#include <vector>
Go to the source code of this file.
|
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 () |
|
|
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) |
|
printf |
( |
"%d Simulated points found\n" |
, |
|
|
vec_iX. |
size() |
|
) |
| |
leg SetTextSize |
( |
0. |
035 | ) |
|
TCanvas* c1 = new TCanvas ("c1","c1",200,10,600,400) |
TString doseFileExp = "../../../experimentalData/proton/BraggPeak/62MeVInWater.out" |
TString doseFileSim = "../../../SimulationOutputs/proton/BraggPeak/Dose.out" |
TFile* file = new TFile("Dose.root","RECREATE") |
leg = new TLegend(0.50,0.60,0.20,0.70) |
TNtuple* ntupleExperimental = new TNtuple("ntupleExperimental","Protons, exp. data", "depthExp:EdepExp") |
TNtuple* TNtupleSim = new TNtuple("SimTree","dose from ascii file", "iX:jY:kZ:dose") |