12 gStyle->SetPalette(1);
13 gROOT->SetStyle(
"Plain");
14 gStyle->SetOptStat(00000);
31 system (
"hadd yz.root yz_*.root");
33 c1 =
new TCanvas (
"c1",
"",60,60,800,800);
40 ntuple = (TNtuple*)
f.Get(
"yz");
43 ntuple->SetBranchAddress(
"radius",&radius);
44 ntuple->SetBranchAddress(
"eventID",&eventID);
45 ntuple->SetBranchAddress(
"nbHits",&nofHits);
46 ntuple->SetBranchAddress(
"nbScoredHits",&nbEdep);
47 ntuple->SetBranchAddress(
"y",&y);
48 ntuple->SetBranchAddress(
"z",&z);
49 ntuple->SetBranchAddress(
"Einc",&Einc);
55 TH1F *
hfyw =
new TH1F (
"hfyw",
"hfyw",linB,0,ymax);
69 hfyw->Fill(y,nofHits/nbEdep);
70 if (yLocalMin>y) yLocalMin=
y;
71 if (yLocalMax<y) yLocalMax=
y;
72 population=population+nofHits/
nbEdep;
73 yF_anal = yF_anal + (nofHits/
nbEdep)*y;
74 yD_anal = yD_anal + (nofHits/
nbEdep)*y*y;
77 cout <<
"**** Results ****" << endl;
79 cout <<
"---> yF =" << yF_anal/population <<
" keV/um" << endl;
80 cout <<
"---> yD =" << (yD_anal/
population)/(yF_anal/population) <<
" keV/um" << endl;
82 cout <<
"---> Limits: " << endl;
83 cout <<
" * min value of y = " << yLocalMin <<
" keV/um" << endl;
84 cout <<
" * max value of y = " << yLocalMax <<
" keV/um" << endl;
86 if ( (yLocalMax>ymax) || (yLocalMin<
ymin) )
88 cout <<
"WARNING: please check your histogram limits ! " << endl;
92 hfyw->Scale (1./(population*hfyw->GetBinWidth(1)));
93 hfyw->SetTitle(
"f(y) (um/keV)");
94 hfyw->GetXaxis()->SetTitle(
"y (keV/um)");
95 hfyw->SetFillColor(2);
96 hfyw->SetLineColor(2);
system("rm -rf microbeam.root")