-
initialization: there are 3 .rootrc files processed on load (in given order)
if found:
$ROOTSYS/.rootrc
$HOME/.rootrc
./.rootrc.
The last found resource setting is used. See $ROOTSYS/tutorials/.rootrc
for a list of all the resources supported by ROOT.
-
to execute shell/batch command `ls' from ROOT prompt:
root [0] gSystem->Exec("ls")
root [1] system("ls")
or just
root [2] .! ls
-
to switch ON cint tracing option (helps a lot in debugging):
root [0] .T
-
to redirect output of print command to a file:
root [0] tpy->Pylist(12); > tpy.log
-
to switch ON/OFF printing of a CPU time usage by each command:
root [0] gROOT->Time("on/off")
-
to load a file (CINT script or shared library), for example, liblinalg.so :
root [0] gSystem->Load("liblinalg.so")
root [1] G__loadfile("liblinalg.so")
root [2] .L liblinalg.so
- first 2 commands work also from within the script/compiled code
- TSystem::Load first tries to unload the file in case it has been loaded
before
-
naming issue: in addition to LinkDef.h and
linkdef.h one could also use
names like cot_LinkDef.h
-
when used in split mode TClonesArray can't have "holes" in it
-
to get run-time information about the running code:
gClassTable.Print() // shows all known classes
gObjectTable.Print() // shows all TObject derived active objects
TStorage::PrintStatistics() // shows all allocated and freed heap space
-
pragmas needed to declare a nested class for CINT :
#ifdef __CINT__
#pragma link off all globals;
#pragma link off all classes;
#pragma link off all functions;
#pragma link C++ nestedclasses;
#pragma link C++ nestedtypedefs;
#pragma link C++ class mine::MyClass;
#pragma link C++ class mine;
#endif
- more on pragmas/namespaces from Masa
CINT understands namespaces, the following pragmas can be used:
#pragma link C++ namespace MDL;
#pragma link C++ namespace MDL::WAB;
For your information Cint handles namespace as a kind of struct which
has only static member. So '#pragma link C++ class' and
'#pragma link C++ namespace' are analogious.
accessing protected members: the following pragma statement turns it on:
#pragma link C++ class+protected [classname];
Only non-constructor,non-destructor members can be accessed as protected.
This feature will be included in cint5.14.41.
- to check if a symbol has been loaded :
void* G__findsym(const char* symname);
This API searchs all loaded shared libraries. The operation is almost
platform independent, except for following matters.
1) Win32 and AIX: You need to explicitly export the symbols if you want to
get handle by G__findsym.
2) Some platform adds '_' in front of the function name
3) If you want a C++ symbol name you need to know name mangling rule of the
C++ compiler you use. If you don't like to do so, you need to declare the
function 'extern "C"'.
- how to use script compiler
- how to create/append a simple ntuple
- how to avoid clashes between the histogram names
- how to display
a rotated 1D histogram
- how to put greek symbols
on the axis
- how to detect an error in TFile
- how to merge several ROOT trees from several files into one and to write the resulting tree out