ROOT and PyROOT tips and tricks

The following snippet of code will add $ROOTSYS/lib to the path which python searches to load in modules. This enables one to use root in python scripts (PyROOT) without having to define the $PYTHONPATH environment variable.

This is how to make root go into batch mode from within a script
or a root macro...

How to silence root, suppress root warnings, suppress root errors, in otherwords, how to tell root to just shut up already.

 


How to compile a ROOT code using ACLiC which depends on shared libraries:

 

ROOT:

$ # Create one or more Cint macros which load in the shared libraries your code requires
$ # then execute ROOT using the following signature:
$ root.exe LoadLib1.C LoadLib2.C ... LoadLibN.C code.c++

 
Some fun with python's first-class nature:

Fun with python introspection: