Notes on using the ROOT libraries in standalone C++ programs In the coming problem sheets you will need to write C++ programs that use classes from the ROOT library, and you will also produce plots with the program root. To do this, you need to execute a setup script for the program, which defines the environment variable ROOTSYS. For most accounts, this should already be done for you automatically. To check, type echo $ROOTSYS It should type back something like /usr/local/root/v5.30.01/slc5.gcc4.1-x86_64/root Then everything is OK. If ROOTSYS is not defined, you can add the line source /usr/local/root/v5.30.01/slc5.gcc4.1-x86_64/setup.sh to the file .bash_profile which you have in your home directory (see this by typing ls -la). Or if you don't have a .bash_profile file, on linappserv0 you can do cd cp ~cowan/WWW/stat/comp/.bash_profile ./ Then once you have the file, type source .bash_profile You only have to do this once, as it will now automatically be done every time you log in. This defines some things needed to work with the ROOT libraries. For people not at RHUL, the location of the setup.sh file should be similar. Note that if you're using the csh or tcsh shell (instead of bash), you should use the file setup.csh (not setup.sh). Once you have done the above, download the files from http://www.pp.rhul.ac.uk/~cowan/stat/root/mc/ into a convenient subdirectory and build the program simpleMC by typing gmake. Similar to what we did with .bash_profile, an easy way to copy the files is first to cd to your local work directory on linappserv0, then type cp ~cowan/WWW/stat/root/mc/* ./ More info as well as instructions on how to produce plots with the program root can be found in the file readme.txt in the web area above. More general information about root can be found at root.cern.ch. Glen Cowan 10 November, 2011