LArSoft  v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
comparison.C File Reference
#include "Riostream.h"

Go to the source code of this file.

Functions

experimentalTree SetBranchAddress ("EdepExp",&EdepExp)
 
experimentalTree SetBranchAddress ("depthExp",&depthExp)
 
 for (Int_t i=0;i< nentries;i++)
 
simulatedPeak Scale (1/simulationNormalisationFactor)
 
ntupleExperimental SetMarkerStyle (4)
 
simulatedPeak SetMarkerSize (2)
 
ntupleExperimental Draw ("EdepExp:depthExp")
 
simulatedPeak Draw ("same")
 
leg SetTextSize (0.035)
 
leg SetFillColor (0)
 
leg AddEntry (ntupleExperimental,"Experiment","P")
 
leg AddEntry (simulatedPeak,"Simulation")
 
leg Draw ()
 

Variables

ifstream in
 
TFile * experimentalFile = new TFile("../../../experimentalData/proton/BraggPeak/62MeVInWater.root","READ")
 
TTree * experimentalTree = (TTree*)experimentalFile -> Get("Experimental62MeVInWater")
 
Float_t depthExp
 
Float_t EdepExp
 
TNtuple * ntupleExperimental = new TNtuple("ntupleExperimental","Protons, exp. data", "depthExp:EdepExp")
 
Int_t nentries = (Int_t)experimentalTree -> GetEntries()
 
TFile * simulationFile = new TFile("../../../SimulationOutputs/proton/BraggPeak/protonBraggPeak.root","READ")
 
TH1D * simulatedPeak = (TH1D*) simulationFile -> Get("braggPeak")
 
Float_t simulationNormalisationFactor = simulatedPeak -> GetBinContent(1)
 
TCanvas * c1 = new TCanvas ("c1","c1",200,10,600,400)
 
 leg = new TLegend(0.50,0.60,0.20,0.70)
 

Function Documentation

leg AddEntry ( ntupleExperimental  ,
"Experiment"  ,
"P"   
)
leg AddEntry ( simulatedPeak  ,
"Simulation"   
)
ntupleExperimental Draw ( "EdepExp:depthExp"  )
h20 Draw ( "same"  )
leg Draw ( )
for ( )

Definition at line 30 of file comparison.C.

References EdepExp, Fill(), GetEntry(), and normFactor.

31  {
33  Float_t normFactor = EdepExp;
35  ntupleExperimental -> Fill(depthExp, EdepExp/normFactor);
36 
37  }
TNtupleSim Fill(f1, f2, f3, f4)
Float_t normFactor
Float_t depthExp
Definition: comparison.C:22
Float_t EdepExp
Definition: comparison.C:22
TTree * experimentalTree
Definition: comparison.C:20
TNtuple * ntupleExperimental
Definition: comparison.C:28
ntupleExperimental GetEntry(0)
simulatedPeak Scale ( 1/  simulationNormalisationFactor)
experimentalTree SetBranchAddress ( "EdepExp"  ,
EdepExp 
)
experimentalTree SetBranchAddress ( "depthExp"  ,
depthExp 
)
leg SetFillColor ( )
simulatedPeak SetMarkerSize ( )
ntupleExperimental SetMarkerStyle ( )
leg SetTextSize ( 0.  035)

Variable Documentation

TCanvas* c1 = new TCanvas ("c1","c1",200,10,600,400)

Definition at line 51 of file comparison.C.

Float_t depthExp

Definition at line 22 of file comparison.C.

Float_t EdepExp

Definition at line 22 of file comparison.C.

Referenced by for().

TFile* experimentalFile = new TFile("../../../experimentalData/proton/BraggPeak/62MeVInWater.root","READ")

Definition at line 17 of file comparison.C.

TTree* experimentalTree = (TTree*)experimentalFile -> Get("Experimental62MeVInWater")

Definition at line 20 of file comparison.C.

leg = new TLegend(0.50,0.60,0.20,0.70)

Definition at line 61 of file comparison.C.

Int_t nentries = (Int_t)experimentalTree -> GetEntries()
TNtuple* ntupleExperimental = new TNtuple("ntupleExperimental","Protons, exp. data", "depthExp:EdepExp")

Definition at line 28 of file comparison.C.

TH1D* simulatedPeak = (TH1D*) simulationFile -> Get("braggPeak")

Definition at line 45 of file comparison.C.

TFile* simulationFile = new TFile("../../../SimulationOutputs/proton/BraggPeak/protonBraggPeak.root","READ")

Definition at line 42 of file comparison.C.

Float_t simulationNormalisationFactor = simulatedPeak -> GetBinContent(1)

Definition at line 47 of file comparison.C.