First steps using Root

There is probably a file called outfile.root in your workdir after running tagmix.cc.  The root file has a large number of histograms and several TTrees (ntuples) inside it.  The first step to examining the contents is starting a root session from your workdir.

> bbrroot  -l             // the -l option bypasses some graphics which are displayed on startup

To quit a root session, type

>.q

To load a file into memory, and some other useful commands

>TFile f("output.root")                 // This loads output.root into an object called f, you can use any name instead of f

>f.ls()                                                 // This lists all the contents in f

>goodB->Draw()                            // Put the name of any histogram plus the Draw() funtion and it will be displayed

>dataTree->Scan()                        // Shows the entire contents of the root-tuple, including values of variables

>dataTree->Print()                        // Prints the names of the variables in the root-tuple

>dataTree->Scan("dt:cat", "tag_cat ==1")  // Show only the values of these variables with a cut on tag_cat applied

>dataTree->Draw("dmass")        // Makes a histogram of dmass from dataTree contents

Hints:
    1)  Tab continue works in root!

To run a macro:

> .x  (macro name)        //  See ~cleclerc/srt/8.8.0c-physics-1/workdir for macro examples.  Also RooFitTools/examples.



 

For more:

1)  Intro stuff - http://www.slac.stanford.edu/BFROOT/www/doc/tutorials/19Jun2000_Root_Tutorial/ROOT_Tutorial.html

2)  More advanced - http://root.cern.ch/root/Tutorials.html

3)  Official web page with everything you could want - http://root.cern.ch/root/