Geant4_10
Functions | Variables
comparison_ascii.C File Reference
#include <vector>
Include dependency graph for comparison_ascii.C:

Go to the source code of this file.

Functions

cout<< "Reading file \" "
<< doseFileExp
<< "\" ... ";Long64_t nlines=ntupleExperimental-> 
ReadFile (doseFileExp,"depthExp:EdepExp")
 
 if (nlines<=0)
 
 printf ("%d Experimental points found\n", nlines)
 
ntupleExperimental SetBranchAddress ("EdepExp",&EdepExp)
 
ntupleExperimental SetBranchAddress ("depthExp",&depthExp)
 
ntupleExperimental GetEntry (0)
 
 for (Int_t l=0;l< nentries;l++)
 
ntupleExperimental Reset ()
 
ntupleExperimental Fill (depthExp, EdepExp)
 
in open (doseFileSim)
 
 if (!in.is_open())
 
TNtupleSim Fill (f1, f2, f3, f4)
 
 while (in.good())
 
in close ()
 
TNtupleSim SetBranchAddress ("dose",&dose)
 
TNtupleSim SetBranchAddress ("iX",&iX)
 
vec_iX clear ()
 
 printf ("%d Simulated points found\n", vec_iX.size())
 
TNtupleSim Fill (iX, 0, 0, dose)
 
TNtupleSim SetMarkerStyle (26)
 
TNtupleSim SetMarkerSize (0.8)
 
ntupleExperimental SetMarkerStyle (4)
 
ntupleExperimental SetMarkerColor (2)
 
ntupleExperimental Draw ("EdepExp:depthExp")
 
TNtupleSim Draw ("dose:iX","","same")
 
leg SetTextSize (0.035)
 
leg SetFillColor (0)
 
leg AddEntry (ntupleExperimental,"Experiment","P")
 
leg AddEntry (TNtupleSim,"Simulation","P")
 
leg Draw ()
 

Variables

ifstream in
 
TFile * file = new TFile("Dose.root","RECREATE")
 
TNtuple * ntupleExperimental = new TNtuple("ntupleExperimental","Protons, exp. data", "depthExp:EdepExp")
 
vector< Float_t > vec_dose
 
vector< Float_t > vec_iX
 
TString doseFileExp = "../../../experimentalData/proton/BraggPeak/62MeVInWater.out"
 
Float_t depthExp
 
Float_t EdepExp = vec_dose[l]/normFactor
 
Int_t nentries = (Int_t)ntupleExperimental -> GetEntries()
 
Float_t normFactor = EdepExp
 
TString doseFileSim = "../../../SimulationOutputs/proton/BraggPeak/Dose.out"
 
TNtuple * TNtupleSim = new TNtuple("SimTree","dose from ascii file", "iX:jY:kZ:dose")
 
Char_t n [5]
 
Float_t f1
 
Float_t f2
 
Float_t f3
 
Float_t f4
 
 nlines = 0
 
 do
 
Float_t iX
 
Float_t dose = vec_dose[l]/norm
 
Float_t sumDose = 0.
 
Float_t norm = 0.
 
Int_t oldX = iX
 
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 ( TNtupleSim  ,
"Simulation"  ,
"P"   
)
vec_dose clear ( )

Here is the caller graph for this function:

in close ( )

Here is the caller graph for this function:

ntupleExperimental Draw ( "EdepExp:depthExp"  )
TNtupleSim Draw ( "dose:iX"  ,
""  ,
"same"   
)
leg Draw ( )
ntupleExperimental Fill ( depthExp  ,
EdepExp   
)

Here is the caller graph for this function:

TNtupleSim Fill ( f1  ,
f2  ,
f3  ,
f4   
)
TNtupleSim Fill ( iX  ,
,
,
dose   
)
for ( )

Definition at line 32 of file comparison_ascii.C.

Here is the call graph for this function:

TNtupleSim GetEntry ( )

Here is the caller graph for this function:

if ( nlines<=  0)

Definition at line 19 of file comparison_ascii.C.

Here is the caller graph for this function:

if ( !in.  is_open())

Definition at line 54 of file comparison_ascii.C.

in open ( doseFileSim  )

Here is the caller graph for this function:

printf ( "%d Experimental points found\n ,
nlines   
)

Here is the caller graph for this function:

printf ( "%d Simulated points found\n ,
vec_iX.  size() 
)
cout<< "Reading file \" " << doseFileExp << "\" ... "; Long64_t nlines = ntupleExperimental -> ReadFile ( doseFileExp  ,
"depthExp:EdepExp"   
)
TNtupleSim Reset ( )

Here is the caller graph for this function:

ntupleExperimental SetBranchAddress ( "EdepExp"  ,
EdepExp 
)
ntupleExperimental SetBranchAddress ( "depthExp"  ,
depthExp 
)
TNtupleSim SetBranchAddress ( "dose"  ,
dose 
)
TNtupleSim SetBranchAddress ( "iX"  ,
iX 
)
leg SetFillColor ( )
ntupleExperimental SetMarkerColor ( )
ntupleExperimental SetMarkerSize ( 0.  8)
TNtupleSim SetMarkerStyle ( 26  )
ntupleExperimental SetMarkerStyle ( )
leg SetTextSize ( 0.  035)
while ( in.  good())

Here is the caller graph for this function:

Variable Documentation

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

Definition at line 113 of file comparison_ascii.C.

Float_t depthExp

Definition at line 23 of file comparison_ascii.C.

do
Initial value:
{
in >> f1 >> f2 >> f3 >> f4
ifstream in
Definition: comparison.C:7
Float_t f4
Float_t f1
Float_t f2
Float_t f3

Definition at line 61 of file comparison_ascii.C.

dose = vec_dose[l]/norm

Definition at line 71 of file comparison_ascii.C.

TString doseFileExp = "../../../experimentalData/proton/BraggPeak/62MeVInWater.out"

Definition at line 15 of file comparison_ascii.C.

TString doseFileSim = "../../../SimulationOutputs/proton/BraggPeak/Dose.out"

Definition at line 50 of file comparison_ascii.C.

EdepExp = vec_dose[l]/normFactor

Definition at line 23 of file comparison_ascii.C.

Float_t f1

Definition at line 56 of file comparison_ascii.C.

Float_t f2

Definition at line 56 of file comparison_ascii.C.

Float_t f3

Definition at line 56 of file comparison_ascii.C.

Float_t f4

Definition at line 56 of file comparison_ascii.C.

TFile* file = new TFile("Dose.root","RECREATE")

Definition at line 5 of file comparison_ascii.C.

ifstream in
Initial value:
{
gROOT->Reset()

Definition at line 1 of file comparison_ascii.C.

Float_t iX

Definition at line 71 of file comparison_ascii.C.

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

Definition at line 131 of file comparison_ascii.C.

cout<< "Reading file \" " << doseFileSim << "\" ... "; in > n n n n

Definition at line 55 of file comparison_ascii.C.

nentries = (Int_t)ntupleExperimental -> GetEntries()

Definition at line 29 of file comparison_ascii.C.

nlines = 0

Definition at line 57 of file comparison_ascii.C.

norm = 0.

Definition at line 71 of file comparison_ascii.C.

Float_t normFactor = EdepExp

Definition at line 31 of file comparison_ascii.C.

TNtuple* ntupleExperimental = new TNtuple("ntupleExperimental","Protons, exp. data", "depthExp:EdepExp")

Definition at line 11 of file comparison_ascii.C.

Int_t oldX = iX

Definition at line 79 of file comparison_ascii.C.

Float_t sumDose = 0.

Definition at line 71 of file comparison_ascii.C.

TNtuple* TNtupleSim = new TNtuple("SimTree","dose from ascii file", "iX:jY:kZ:dose")

Definition at line 51 of file comparison_ascii.C.

vector<Float_t> vec_dose

Definition at line 13 of file comparison_ascii.C.

vector<Float_t> vec_iX

Definition at line 13 of file comparison_ascii.C.