You are here

Loading a macro or a class

Loading a macro or a class

A functionality similar to '.L' on the ROOT shell is available in PROOF (since v5.15.04) via


TProof::Load(const char *macro, Bool_t notOnClient = kFALSE)

The first argument contains the path to the file implementing the macro. This file may have any extension. If existing, a file with the same name and extension .h or .hh is also uploaded to the system. The second argument can be used to avoid a local enabling of the macro.

As an example, we show how to enable the Event class using this technology:

root [0] TProof *p = TProof::Open("alicecaf.cern.ch:41093")
Starting master: opening connection ...            
Starting master: OK                                                 
Opening connections to workers: OK (13 workers)                     
Setting up worker servers: OK (13 workers)                          
PROOF set to parallel mode (13 workers)                             
(class TProof*)0x22dab40                                                                                                        
root [1] p->Load("test/Event.cxx+")
08:41:41 30591 Mst-0 | Info in <:handlecache>: loading macro Event.cxx+ ...
08:41:41 30591 Mst-0 | Info in <:aclic>: creating shared library <...> ./Event_cxx.so                                                                                  
08:41:41 31872 Wrk-0.8 | Info in <:handlecache>: loading macro Event.cxx+ ...
08:41:41 31872 Wrk-0.8 | Info in <:aclic>: creating shared library <...> ./Event_cxx.so
08:41:41  1799 Wrk-0.0 | Info in <:handlecache>: loading macro Event.cxx+ ...
08:41:41  1799 Wrk-0.0 | Info in <:aclic>: creating shared library <...> ./Event_cxx.so
08:41:41 24025 Wrk-0.9 | Info in <:handlecache>: loading macro Event.cxx+ ...
08:41:41 24025 Wrk-0.9 | Info in <:aclic>: creating shared library <...> ./Event_cxx.so
08:41:41 20838 Wrk-0.11 | Info in <:handlecache>: loading macro Event.cxx+ ...
08:41:41 20838 Wrk-0.11 | Info in <:aclic>: creating shared library <...> ./Event_cxx.so
08:41:41 12673 Wrk-0.1 | Info in <:handlecache>: loading macro Event.cxx+ ...
08:41:41 12673 Wrk-0.1 | Info in <:aclic>: creating shared library <...> ./Event_cxx.so
08:41:41 17015 Wrk-0.5 | Info in <:handlecache>: loading macro Event.cxx+ ...
08:41:41 17015 Wrk-0.5 | Info in <:aclic>: creating shared library <...> ./Event_cxx.so
08:41:41 32426 Wrk-0.4 | Info in <:handlecache>: loading macro Event.cxx+ ...
08:41:41 32426 Wrk-0.4 | Info in <:aclic>: creating shared library <...> ./Event_cxx.so
08:41:41   966 Wrk-0.3 | Info in <:handlecache>: loading macro Event.cxx+ ...
08:41:41   966 Wrk-0.3 | Info in <:aclic>: creating shared library <...> ./Event_cxx.so
08:41:41 29938 Wrk-0.7 | Info in <:handlecache>: loading macro Event.cxx+ ...
08:41:41 29938 Wrk-0.7 | Info in <:aclic>: creating shared library <...> ./Event_cxx.so
08:41:41 30450 Wrk-0.12 | Info in <:handlecache>: loading macro Event.cxx+ ...
08:41:41 30450 Wrk-0.12 | Info in <:aclic>: creating shared library <...> ./Event_cxx.so
08:41:41 21695 Wrk-0.2 | Info in <:handlecache>: loading macro Event.cxx+ ...
08:41:41 21695 Wrk-0.2 | Info in <:aclic>: creating shared library <...> ./Event_cxx.so
08:41:41 11688 Wrk-0.10 | Info in <:handlecache>: loading macro Event.cxx+ ...
08:41:41 11688 Wrk-0.10 | Info in <:aclic>: creating shared library <...> ./Event_cxx.so
08:41:41  9690 Wrk-0.6 | Info in <:handlecache>: loading macro Event.cxx+ ...
08:41:41  9690 Wrk-0.6 | Info in <:aclic>: creating shared library <...> ./Event_cxx.so
(Int_t)0
root [2]