Basic Root Info

Reference Material

Installing Root On Your Local Machine

The current version of Root (correct on 25th Feb 2011) is 5.28.00. You can download the source code by doing (from somewhere sensible, e.g. your Applications folder):

svn co http://root.cern.ch/svn/root/tags/v5-28-00a root

cd root

Doing ./configure --help will give you the information about what different configurations you can use. Unless you know what you're doing, just use the standard configuration by doing:

./configure

N.B. If you want to use Roofit (e.g. for limit setting) you will need to use the --enable-roofit option instead (./configure --enable-roofit). Then all you have to do is compile:

make

Now go and make a nice cup of tea while you wait for it to finish.

Starting a Root Session

Every time you log on you'll need to source the Root setup script. This only works if you do it from the directory where Root is installed.

On Your Local Machine

cd <path/to/the/place/where/I/put/root>

. bin/thisroot.sh

cd -

If you're as lazy as me and can't be bother to do all of that whenever you log on, you might want to put this into a little script and then add alias rootSetup='source <path/to/myRootSetupScript.sh'.

On Lxplus

The Root setup script will be automatically sourced if you setup an Athena release. If you don't want to setup Athena then you'll need to setup Root separately by doing the following:

. /afs/cern.ch/sw/lcg/contrib/gcc/4.3/i686-slc5-gcc43-opt/setup.sh

cd /afs/cern.ch/sw/lcg/app/releases/ROOT/5.28.00/i686-slc5-gcc43-opt/root

. bin/thisroot.sh

cd -

To start a Root session all you then have to do is type root from wherever you like.

MakeClass

MakeClass will give you a skeleton piece of code that you can use as a starting point for an ntuple/D3PD analysis. Once you have started a Root session (see above), you need to do:

f = new TFile("<path-to>myNtupleOrD3PD.root");

t = (TTree*)(f->Get(""));

t -> MakeClass();

This will generate the .C and .h files you need.

Plotting

* RatioPlotExample.C: Example code for drawing a ratio runner under your histogram

-- KatharineLeney - 25-Feb-2011

Topic attachments
I Attachment History Action Size Date Who Comment
C source code filec RatioPlotExample.C r1 manage 5.7 K 2013-02-18 - 20:19 KatharineLeney Example code for drawing a ratio runner under your histogram
Edit | Attach | Watch | Print version | History: r2 < r1 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r2 - 2013-02-18 - KatharineLeney
 
    • Cern Search Icon Cern Search
    • TWiki Search Icon TWiki Search
    • Google Search Icon Google Search

    Main All webs login

This site is powered by the TWiki collaboration platform Powered by PerlCopyright & 2008-2021 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
or Ideas, requests, problems regarding TWiki? use Discourse or Send feedback