14 gStyle->SetPalette(1);
15 gROOT->SetStyle(
"Plain");
16 gStyle->SetOptStat(00000);
30 FILE *
fp = fopen(
"yz.root",
"r");
33 cout <<
"*** Notice: the output file yz.root exists ***"<< endl;
36 cout <<
"*** Notice: the output file yz.root does not exist ***"<< endl;
37 cout <<
"*** it will be created from merged ROOT files ***"<< endl;
39 system (
"hadd yz.root yz_*.root");}
42 c1 =
new TCanvas (
"c1",
"",60,60,800,600);
66 ntuple = (TNtuple*)f->Get(
"yz");
73 ntuple->Draw(
"y>>hfy",
"",
"");
75 hfy->Scale (1./(hfy->GetEntries()*hfy->GetBinWidth(1)));
76 hfy->SetTitle(
"f(y) (um/keV)");
77 hfy->GetXaxis()->SetTitle(
"y (keV/um)");
85 for (Int_t j=0;j<hfy->GetNbinsX(); j++)
86 norm=norm+hfy->GetBinContent(j)*hfy->GetBinWidth(1);
89 cout <<
"**** I - Results from lin-lin histograms ****" << endl;
91 cout <<
"---> sum of f(y)dy =" << norm << endl;
96 TH1F *hyfy = (TH1F*)hfy->Clone(
"hyfy");
98 for (Int_t i=0;i<hyfy->GetNbinsX(); i++)
99 hyfy->SetBinContent(i,hyfy->GetBinCenter(i)*hyfy->GetBinContent(i));
101 hyfy->SetLineColor(2);
102 hyfy->SetFillColor(2);
103 hyfy->SetTitle(
"y*f(y)");
104 hyfy->GetXaxis()->SetTitle(
"y (keV/um)");
113 for (Int_t j=0;j<hyfy->GetNbinsX(); j++)
114 yF=yF+hyfy->GetBinContent(j)*hyfy->GetBinWidth(1);
116 cout <<
"---> yF=" << yF <<
" keV/um" << endl;
121 TH1F *hdy = (TH1F*)hyfy->Clone(
"hdy");
125 hdy->SetLineColor(4);
126 hdy->SetFillColor(4);
127 hdy->SetTitle(
"d(y) (um/keV)");
128 hdy->GetXaxis()->SetTitle(
"y (keV/um)");
135 for (Int_t j=0;j<hdy->GetNbinsX(); j++)
136 normD=normD+hdy->GetBinContent(j)*hdy->GetBinWidth(1);
138 cout <<
"---> sum of d(y)dy =" << normD << endl;
143 TH1F *hydy = (TH1F*)hdy->Clone(
"hydy");
145 for (Int_t k=0;k<hydy->GetNbinsX(); k++)
146 hydy->SetBinContent(k,hydy->GetBinCenter(k)*hdy->GetBinContent(k));
148 hydy->SetLineColor(3);
149 hydy->SetFillColor(3);
150 hydy->SetTitle(
"y*d(y)");
151 hydy->GetXaxis()->SetTitle(
"y (keV/um)");
158 for (Int_t l=0;l<hydy->GetNbinsX(); l++)
159 yD=yD+hydy->GetBinContent(l)*hydy->GetBinWidth(1);
161 cout <<
"---> yD=" << yD <<
" keV/um" << endl;
174 cout <<
"**** II - Results from log-lin histograms ****" << endl;
176 cout <<
" You have selected "<< B <<
" bins per decade, from 10^" << min <<
" (a.u.) to 10^"<< max <<
" (a.u.) "<< endl;
180 Int_t bins=B*(max-
min);
182 TH1F *hlogyfy =
new TH1F(
"1",
"1",bins,min,max);
183 TAxis *axis = hlogyfy->GetXaxis();
185 TH1F *hlogy2fy =
new TH1F(
"2",
"2",bins,min,max);
186 TAxis *axis2 = hlogy2fy->GetXaxis();
188 TH1F *hlogydy =
new TH1F(
"3",
"3",bins,min,max);
189 TAxis *axis3 = hlogydy->GetXaxis();
191 TH1F *hlogy3fy =
new TH1F(
"4",
"4",bins,min,max);
192 TAxis *axis4 = hlogy3fy->GetXaxis();
195 Axis_t from = axis->GetXmin();
196 Axis_t to = axis->GetXmax();
197 Axis_t width = (to - from) / bins;
200 Axis_t *
new_bins =
new Axis_t[bins + 1];
201 for (
int i = 0; i <= bins; i++)
203 new_bins[i] = TMath::Power(10, from + i * width);
206 axis->Set(bins, new_bins);
207 axis2->Set(bins, new_bins);
208 axis3->Set(bins, new_bins);
209 axis4->Set(bins, new_bins);
237 ntuple->SetBranchAddress(
"radius",&radius);
238 ntuple->SetBranchAddress(
"y",&y);
239 ntuple->SetBranchAddress(
"z",&z);
253 hlogyfy->Scale(1./( hlogyfy->GetEntries() ));
254 hlogy2fy->Scale(1./( hlogy2fy->GetEntries() ));
255 hlogydy->Scale(1./( hlogydy->GetEntries() ));
256 hlogy3fy->Scale(1./( hlogy3fy->GetEntries() ));
263 for (Int_t i=0;i<hlogyfy->GetNbinsX(); i++)
265 hlogyfy->SetBinContent(i,
267 hlogyfy->GetBinCenter(i)
268 *hlogyfy->GetBinContent(i)
269 /(TMath::Power(10, from + (i+1) * width)-TMath::Power(10, from + i * width))
273 hlogyfy->SetLineColor(2);
274 hlogyfy->SetFillColor(2);
275 hlogyfy->SetTitle(
"y*f(y)");
276 hlogyfy->GetXaxis()->SetTitle(
"y (keV/um)");
283 for (Int_t j=0;j<hlogyfy->GetNbinsX(); j++)
284 normLogfy=normLogfy+(log(10)/
B)*hlogyfy->GetBinContent(j);
286 cout <<
"---> sum of Log f(y)dy =" << normLogfy << endl;
291 for (Int_t i=0;i<hlogy2fy->GetNbinsX(); i++)
293 hlogy2fy->SetBinContent(i,
295 hlogy2fy->GetBinCenter(i)
296 *hlogy2fy->GetBinCenter(i)
297 *hlogy2fy->GetBinContent(i)
298 /(TMath::Power(10, from + (i+1) * width)-TMath::Power(10, from + i * width))
304 for (Int_t j=0;j<hlogy2fy->GetNbinsX(); j++)
305 logyF=logyF+(log(10)/
B)*hlogy2fy->GetBinContent(j);
307 cout <<
"---> yF =" << logyF <<
" keV/um" << endl;
315 for (Int_t i=0;i<hlogydy->GetNbinsX(); i++)
317 hlogydy->SetBinContent(i,
319 hlogydy->GetBinCenter(i)
320 *hlogydy->GetBinCenter(i)
321 *hlogydy->GetBinContent(i)
322 /(TMath::Power(10, from + (i+1) * width)-TMath::Power(10, from + i * width))
327 hlogydy->SetLineColor(3);
328 hlogydy->SetFillColor(3);
329 hlogydy->SetTitle(
"y*d(y)");
330 hlogydy->GetXaxis()->SetTitle(
"y (keV/um)");
336 Double_t normLogdy=0;
338 for (Int_t j=0;j<hlogydy->GetNbinsX(); j++)
339 normLogdy=normLogdy+(log(10)/
B)*hlogydy->GetBinContent(j);
341 cout <<
"---> sum of Log d(y)dy =" << normLogdy << endl;
346 for (Int_t i=0;i<hlogy3fy->GetNbinsX(); i++)
348 hlogy3fy->SetBinContent(i,
350 hlogy3fy->GetBinCenter(i)
351 *hlogy3fy->GetBinCenter(i)
352 *hlogy3fy->GetBinCenter(i)
353 *hlogy3fy->GetBinContent(i)
354 /(TMath::Power(10, from + (i+1) * width)-TMath::Power(10, from + i * width))
361 for (Int_t j=0;j<hlogy3fy->GetNbinsX(); j++)
362 logyD=logyD+(log(10)/
B)*hlogy3fy->GetBinContent(j);
364 cout <<
"---> yD =" << logyD <<
" keV/um" << endl;
system("rm -rf microbeam.root")
TFile f("microbeam.root")
std::vector< evd::details::RawDigitInfo_t >::const_iterator end(RawDigitCacheDataClass const &cache)