Functions | Variables
tutCAFMacro.C File Reference

Go to the source code of this file.

Functions

gSystem Load ("$SRT_PUBLIC_CONTEXT/lib/Linux2.6-GCC-debug/libStandardRecord_dict.so")
 
tree Draw ("slc.nhit")
 
tree SetBranchAddress ("rec",&rec)
 
 for (int i=0;i< tree->GetEntries();++i)
 
myAwesomeHist Draw ()
 

Variables

TFile * file = new TFile("/nova/data/mc/S13-06-18/genie/nd/nd_r0000001_s01_S13-06-18_v1_genie_1000_fhc_20121129_181943.sim.caf.root", "READ")
 
TTree * tree = file->Get("recTree")
 
TCanvas * can1 = new TCanvas("nameOfCanvas", "Tree::Draw()")
 
caf::StandardRecordrec = 0
 
TH1F * myAwesomeHist = new TH1F("myHist", ";Awesome Variable; Number of Slices", 100, 0, 100)
 
TCanvas * can2 = new TCanvas("name", "Awesome Analysis")
 

Function Documentation

tree Draw ( "slc.nhit"  )
fBaryonPT2pdf Draw ( )
for ( int  i = 0; i< tree->GetEntries(); ++i)

Definition at line 27 of file tutCAFMacro.C.

References MECModelEnuComparisons::i, caf::SRSlice::nhit, demo1::nhit, and caf::StandardRecord::slc.

28  {
29  // Get an entry from the tree, this copies it's information to the rec pointer
30  tree->GetEntry(i);
31  // Get a variable from the tree, this is mostly unnecessary, could just refer to rec->slc.nhit everywhere
32  int nhit = rec->slc.nhit;
33  // Do my awesome analysis
34  float myAwesomeVar = nhit * 5.3;
35 
36  // Add my variable to the histogram
37  myAwesomeHist->Fill(myAwesomeVar);
38  }
nhit
Definition: demo1.py:25
caf::StandardRecord * rec
Definition: tutCAFMacro.C:20
TH1F * myAwesomeHist
Definition: tutCAFMacro.C:24
unsigned int nhit
number of hits
Definition: SRSlice.h:22
TTree * tree
Definition: tutCAFMacro.C:14
SRSlice slc
Slice branch: nhit, extents, time, etc.
gSystem Load ( "$SRT_PUBLIC_CONTEXT/lib/Linux2.6-GCC-debug/libStandardRecord_dict.so"  )
tree SetBranchAddress ( "rec"  ,
rec 
)

Variable Documentation

TCanvas* can1 = new TCanvas("nameOfCanvas", "Tree::Draw()")

Definition at line 16 of file tutCAFMacro.C.

Referenced by diffapdhv(), and plotapdhv().

TCanvas* can2 = new TCanvas("name", "Awesome Analysis")

Definition at line 40 of file tutCAFMacro.C.

Referenced by diffapdhv(), and plotapdhv().

TFile* file = new TFile("/nova/data/mc/S13-06-18/genie/nd/nd_r0000001_s01_S13-06-18_v1_genie_1000_fhc_20121129_181943.sim.caf.root", "READ")

Definition at line 11 of file tutCAFMacro.C.

TH1F* myAwesomeHist = new TH1F("myHist", ";Awesome Variable; Number of Slices", 100, 0, 100)

Definition at line 24 of file tutCAFMacro.C.

TTree* tree = file->Get("recTree")

Definition at line 14 of file tutCAFMacro.C.