13 #include <dighistograms.h>
26 #include <TClonesArray.h>
45 DIGHistograms::DIGHistograms(Int_t myNumberOfConfigurations)
47 fNumberOfConfigs = myNumberOfConfigurations;
51 DIGHistograms::~DIGHistograms() {
60 fNumberOfConfigs = adighisto.GetNumberOfConfigurations();
65 void DIGHistograms::Clear(
const Option_t *)
72 void DIGHistograms::PrintInfo() {
73 std::cout<<
"---------DIGHistograms properties------------- "<<endl;
79 void DIGHistograms::SetNumberOfConfigurations(Int_t myNumberOfConfigurations){
80 fNumberOfConfigs=myNumberOfConfigurations;
84 void DIGHistograms::BookHistograms(Int_t myNumberOfConfigurations){
86 SetNumberOfConfigurations(myNumberOfConfigurations);
88 Ar_h1_multiplicity_with_threshold_01 =
new TObjArray(fNumberOfConfigs);
89 Ar_h1_multiplicity_with_threshold_02 =
new TObjArray(fNumberOfConfigs);
90 Ar_h1_multiplicity_with_threshold_03 =
new TObjArray(fNumberOfConfigs);
91 Ar_h1_multiplicity_with_threshold_04 =
new TObjArray(fNumberOfConfigs);
92 Ar_h1_multiplicity_with_threshold_05 =
new TObjArray(fNumberOfConfigs);
93 Ar_h1_multiplicity_with_threshold_06 =
new TObjArray(fNumberOfConfigs);
94 Ar_h1_multiplicity_with_threshold_07 =
new TObjArray(fNumberOfConfigs);
95 Ar_h1_multiplicity_with_threshold_08 =
new TObjArray(fNumberOfConfigs);
96 Ar_h1_multiplicity_with_threshold_09 =
new TObjArray(fNumberOfConfigs);
97 Ar_h1_multiplicity_with_threshold_10 =
new TObjArray(fNumberOfConfigs);
99 Ar_h1_multiplicity_with_threshold_15 =
new TObjArray(fNumberOfConfigs);
100 Ar_h1_multiplicity_with_threshold_20 =
new TObjArray(fNumberOfConfigs);
101 Ar_h1_multiplicity_with_threshold_25 =
new TObjArray(fNumberOfConfigs);
102 Ar_h1_multiplicity_with_threshold_30 =
new TObjArray(fNumberOfConfigs);
103 Ar_h1_multiplicity_with_threshold_40 =
new TObjArray(fNumberOfConfigs);
109 Ar_h1_Cluster_SeedDigitalCharge =
new TObjArray(fNumberOfConfigs);
110 Ar_h1_Cluster_TotalDigitalCharge =
new TObjArray(fNumberOfConfigs);
111 Ar_h1_Cluster_9x9DigitalCharge =
new TObjArray(fNumberOfConfigs);
112 Ar_h1_Cluster_1stCrownDigitalCharge =
new TObjArray(fNumberOfConfigs);
113 Ar_h1_Cluster_2ndCrownDigitalCharge =
new TObjArray(fNumberOfConfigs);
114 Ar_h1_Cluster_4NeighboursDigitalCharge =
new TObjArray(fNumberOfConfigs);
115 Ar_h1_Cluster_SeedOverTotalDigitalCharge =
new TObjArray(fNumberOfConfigs);
116 Ar_h1_Cluster_1stCrownOverTotalDigitalCharge =
new TObjArray(fNumberOfConfigs);
117 Ar_h1_Cluster_2ndCrownOverTotalDigitalCharge =
new TObjArray(fNumberOfConfigs);
118 Ar_h1_Cluster_4NeighboursOverTotalDigitalCharge =
new TObjArray(fNumberOfConfigs);
120 Ar_h1_test =
new TObjArray(fNumberOfConfigs);
123 Ar_h1_Particle_TotalAnalogCharge =
new TObjArray(fNumberOfConfigs);
124 Ar_h1_Particle_TotalDigitalCharge =
new TObjArray(fNumberOfConfigs);
125 Ar_h1_Particle_Energy_deposited =
new TObjArray(fNumberOfConfigs);
126 Ar_h2_Particle_EnergyDeposited_vs_TotalAnalogCharge =
new TObjArray(fNumberOfConfigs);
127 Ar_h2_Particle_TotalDigitalCharge_vs_TotalAnalogCharge =
new TObjArray(fNumberOfConfigs);
130 Ar_h1_Resolution_ResidualX_CoG_true =
new TObjArray(fNumberOfConfigs);
131 Ar_h1_Resolution_ResidualY_CoG_true =
new TObjArray(fNumberOfConfigs);
132 Ar_h1_Resolution_Residualdist_CoG_true =
new TObjArray(fNumberOfConfigs);
133 Ar_h2_Resolution_TruePosition =
new TObjArray(fNumberOfConfigs);
134 Ar_h2_Resolution_TruePosition_modulo =
new TObjArray(fNumberOfConfigs);
135 Ar_h2_Resolution_CoG =
new TObjArray(fNumberOfConfigs);
136 Ar_h2_Resolution_CoG_modulo =
new TObjArray(fNumberOfConfigs);
139 Ar_Pr_Charge_Q_over_Qtot_vs_distance =
new TObjArray(fNumberOfConfigs);
140 Ar_h2_Charge_Q_over_Qtot_vs_distance =
new TObjArray(fNumberOfConfigs);
142 Ar_h1_ADC_LSB =
new TObjArray(fNumberOfConfigs);
143 Ar_h1_Efficiency_ideal =
new TObjArray(fNumberOfConfigs);
148 TProfile *prtemp = 0;
153 Int_t Nbin_mult = 27;
155 for (Int_t i = 0; i < fNumberOfConfigs ; i++){
158 sprintf(titre,
"multiplicity_with_threshold_01_conf%d",i);
159 h1temp=
new TH1F(titre,titre,Nbin_mult,0,Nbin_mult);
160 Ar_h1_multiplicity_with_threshold_01->Add(h1temp);
161 sprintf(titre,
"multiplicity_with_threshold_02_conf%d",i);
162 h1temp=
new TH1F(titre,titre,Nbin_mult,0,Nbin_mult);
163 Ar_h1_multiplicity_with_threshold_02->Add(h1temp);
164 sprintf(titre,
"multiplicity_with_threshold_03_conf%d",i);
165 h1temp=
new TH1F(titre,titre,Nbin_mult,0,Nbin_mult);
166 Ar_h1_multiplicity_with_threshold_03->Add(h1temp);
167 sprintf(titre,
"multiplicity_with_threshold_04_conf%d",i);
168 h1temp=
new TH1F(titre,titre,Nbin_mult,0,Nbin_mult);
169 Ar_h1_multiplicity_with_threshold_04->Add(h1temp);
170 sprintf(titre,
"multiplicity_with_threshold_05_conf%d",i);
171 h1temp=
new TH1F(titre,titre,Nbin_mult,0,Nbin_mult);
172 Ar_h1_multiplicity_with_threshold_05->Add(h1temp);
173 sprintf(titre,
"multiplicity_with_threshold_06_conf%d",i);
174 h1temp=
new TH1F(titre,titre,Nbin_mult,0,Nbin_mult);
175 Ar_h1_multiplicity_with_threshold_06->Add(h1temp);
176 sprintf(titre,
"multiplicity_with_threshold_07_conf%d",i);
177 h1temp=
new TH1F(titre,titre,Nbin_mult,0,Nbin_mult);
178 Ar_h1_multiplicity_with_threshold_07->Add(h1temp);
179 sprintf(titre,
"multiplicity_with_threshold_08_conf%d",i);
180 h1temp=
new TH1F(titre,titre,Nbin_mult,0,Nbin_mult);
181 Ar_h1_multiplicity_with_threshold_08->Add(h1temp);
182 sprintf(titre,
"multiplicity_with_threshold_09_conf%d",i);
183 h1temp=
new TH1F(titre,titre,Nbin_mult,0,Nbin_mult);
184 Ar_h1_multiplicity_with_threshold_09->Add(h1temp);
185 sprintf(titre,
"multiplicity_with_threshold_10_conf%d",i);
186 h1temp=
new TH1F(titre,titre,Nbin_mult,0,Nbin_mult);
187 Ar_h1_multiplicity_with_threshold_10->Add(h1temp);
189 sprintf(titre,
"multiplicity_with_threshold_15_conf%d",i);
190 h1temp=
new TH1F(titre,titre,Nbin_mult,0,Nbin_mult);
191 Ar_h1_multiplicity_with_threshold_15->Add(h1temp);
192 sprintf(titre,
"multiplicity_with_threshold_20_conf%d",i);
193 h1temp=
new TH1F(titre,titre,Nbin_mult,0,Nbin_mult);
194 Ar_h1_multiplicity_with_threshold_20->Add(h1temp);
195 sprintf(titre,
"multiplicity_with_threshold_25_conf%d",i);
196 h1temp=
new TH1F(titre,titre,Nbin_mult,0,Nbin_mult);
197 Ar_h1_multiplicity_with_threshold_25->Add(h1temp);
198 sprintf(titre,
"multiplicity_with_threshold_30_conf%d",i);
199 h1temp=
new TH1F(titre,titre,Nbin_mult,0,Nbin_mult);
200 Ar_h1_multiplicity_with_threshold_30->Add(h1temp);
201 sprintf(titre,
"multiplicity_with_threshold_40_conf%d",i);
202 h1temp=
new TH1F(titre,titre,Nbin_mult,0,Nbin_mult);
203 Ar_h1_multiplicity_with_threshold_40->Add(h1temp);
208 sprintf(titre,
"Cluster_SeedDigitalCharge_conf%d",i);
209 h1temp=
new TH1F(titre,titre,1000,0,2000);
210 Ar_h1_Cluster_SeedDigitalCharge->Add(h1temp);
211 sprintf(titre,
"Cluster_TotalDigitalCharge_conf%d",i);
212 h1temp=
new TH1F(titre,titre,1000,0,2000);
213 Ar_h1_Cluster_TotalDigitalCharge->Add(h1temp);
214 sprintf(titre,
"Ar_h1_Cluster_9x9DigitalCharge_conf%d",i);
215 h1temp=
new TH1F(titre,titre,1000,0,2000);
216 Ar_h1_Cluster_9x9DigitalCharge->Add(h1temp);
217 sprintf(titre,
"Ar_h1_Cluster_1stCrownDigitalCharge_conf%d",i);
218 h1temp=
new TH1F(titre,titre,1000,0,2000);
219 Ar_h1_Cluster_1stCrownDigitalCharge->Add(h1temp);
220 sprintf(titre,
" Ar_h1_Cluster_2ndCrownDigitalCharge_conf%d",i);
221 h1temp=
new TH1F(titre,titre,1000,0,2000);
222 Ar_h1_Cluster_2ndCrownDigitalCharge->Add(h1temp);
223 sprintf(titre,
"Ar_h1_Cluster_4NeighboursDigitalCharge_conf%d",i);
224 h1temp=
new TH1F(titre,titre,1000,0,2000);
225 Ar_h1_Cluster_4NeighboursDigitalCharge->Add(h1temp);
226 sprintf(titre,
" Ar_h1_Cluster_SeedOverTotalDigitalCharge_conf%d",i);
227 h1temp=
new TH1F(titre,titre,110,0.0,1.1);
228 Ar_h1_Cluster_SeedOverTotalDigitalCharge->Add(h1temp);
229 sprintf(titre,
"Ar_h1_Cluster_1stCrownOverTotalDigitalCharge_conf%d",i);
230 h1temp=
new TH1F(titre,titre,110,0.0,1.1);
231 Ar_h1_Cluster_1stCrownOverTotalDigitalCharge->Add(h1temp);
232 sprintf(titre,
" Ar_h1_Cluster_2ndCrownOverTotalDigitalCharge_conf%d",i);
233 h1temp=
new TH1F(titre,titre,110,0.0,1.1);
234 Ar_h1_Cluster_2ndCrownOverTotalDigitalCharge->Add(h1temp);
235 sprintf(titre,
"Ar_h1_Cluster_4NeighboursOverTotalDigitalCharge_conf%d",i);
236 h1temp=
new TH1F(titre,titre,110,0.0,1.1);
237 Ar_h1_Cluster_4NeighboursOverTotalDigitalCharge->Add(h1temp);
238 sprintf(titre,
"Ar_h1_test%d",i);
239 h1temp=
new TH1F(titre,titre,1000,0,2000);
240 Ar_h1_test->Add(h1temp);
242 sprintf(titre,
"Ar_Pr_Charge_Q_over_Qtot_vs_distance%d",i);
243 prtemp=
new TProfile(titre,titre,100,0,200,0.0,1.1);
244 Ar_Pr_Charge_Q_over_Qtot_vs_distance->Add(prtemp);
245 sprintf(titre,
"Ar_h2_Charge_Q_over_Qtot_vs_distance%d",i);
246 h2temp=
new TH2F(titre,titre,400,0,200,110,0.0,1.1);
247 Ar_h2_Charge_Q_over_Qtot_vs_distance->Add(h2temp);
251 sprintf(titre,
"Particle_TotalAnalogCharge_conf%d",i);
252 h1temp=
new TH1F(titre,titre,600,0,6000);
253 Ar_h1_Particle_TotalAnalogCharge->Add(h1temp);
254 sprintf(titre,
"Particle_TotalDigitalCharge_conf%d",i);
255 h1temp=
new TH1F(titre,titre,1000,0,2000);
256 Ar_h1_Particle_TotalDigitalCharge->Add(h1temp);
257 sprintf(titre,
"Particle_Energy_deposited_conf%d",i);
258 h1temp=
new TH1F(titre,titre,600,0,6000);
259 Ar_h1_Particle_Energy_deposited->Add(h1temp);
261 sprintf(titre,
"Particle_EnergyDeposited_vs_TotalAnalogCharge_conf%d",i);
262 h2temp=
new TH2F(titre,titre,150,0,3000,150,0,3000);
263 Ar_h2_Particle_EnergyDeposited_vs_TotalAnalogCharge->Add(h2temp);
264 sprintf(titre,
"Particle_TotalDigitalCharge_vs_TotalAnalogCharge_conf%d",i);
265 h2temp=
new TH2F(titre,titre,300,0,3000,500,0,1000);
266 Ar_h2_Particle_TotalDigitalCharge_vs_TotalAnalogCharge->Add(h2temp);
269 sprintf(titre,
"Ar_h1_Resolution_ResidualX_CoG_true_conf%d",i);
270 h1temp=
new TH1F(titre,titre,400,-40,40);
271 Ar_h1_Resolution_ResidualX_CoG_true->Add(h1temp);
272 sprintf(titre,
"Ar_h1_Resolution_ResidualY_CoG_true_conf%d",i);
273 h1temp=
new TH1F(titre,titre,400,-40,40);
274 Ar_h1_Resolution_ResidualY_CoG_true->Add(h1temp);
275 sprintf(titre,
"Ar_h1_Resolution_Residualdist_CoG_true_conf%d",i);
276 h1temp=
new TH1F(titre,titre,400,0,80);
277 Ar_h1_Resolution_Residualdist_CoG_true->Add(h1temp);
278 sprintf(titre,
"Ar_h2_Resolution_TruePosition_conf%d",i);
279 h2temp=
new TH2F(titre,titre,400,0,2000,400,0,2000);
280 Ar_h2_Resolution_TruePosition->Add(h2temp);
281 sprintf(titre,
"Ar_h2_Resolution_TruePosition_modulo_conf%d",i);
282 h2temp=
new TH2F(titre,titre,200,0,200,200,0,200);
283 Ar_h2_Resolution_TruePosition_modulo->Add(h2temp);
284 sprintf(titre,
"Ar_h2_Resolution_CoG_conf%d",i);
285 h2temp=
new TH2F(titre,titre,400,0,2000,400,0,2000);
286 Ar_h2_Resolution_CoG->Add(h2temp);
287 sprintf(titre,
"Ar_h2_Resolution_CoG_modulo_conf%d",i);
288 h2temp=
new TH2F(titre,titre,200,0,200,200,0,200);
289 Ar_h2_Resolution_CoG_modulo->Add(h2temp);
292 sprintf(titre,
"Ar_h1_ADC_LSB_conf%d",i);
293 h1temp=
new TH1F(titre,titre,200,0,20);
294 Ar_h1_ADC_LSB->Add(h1temp);
297 sprintf(titre,
"Ar_h1_Efficiency_ideal_conf%d",i);
298 h1temp=
new TH1F(titre,titre,10001,0,1.0001);
299 Ar_h1_Efficiency_ideal->Add(h1temp);
305 sprintf(titre,
"NumberOfEventsPerConfiguration");
306 h1_NumberOfEventsPerConfiguration=
new TH1F(titre,titre,100,0,100000);
307 sprintf(titre,
"NumberOfConfigurations");
308 h1_NumberOfConfigurations=
new TH1F(titre,titre,10000,0,10000);;
319 void DIGHistograms::PlotHistograms(Int_t myNumberOfConfigurations){
320 cout<<
" number of configurations "<<myNumberOfConfigurations<<endl;
325 TH1F* DIGHistograms::AutoZoom(TH1F* H,Option_t* aType, Int_t EntryMin)
327 Int_t shift = (Int_t)(H->GetNbinsX()/50.);
333 int max = H->GetNbinsX();
337 if (opt.Contains(
"all")) opt = TString(
"min,max");
338 if (opt.Contains(
"sym")) opt = TString(
"min,sym");
340 if (opt.Contains(
"min"))
342 for (New_min=min; New_min<=max;New_min++)
343 {Stat_t c = H->GetBinContent(New_min);
if (c>EntryMin)
break;}
346 else if (opt.Contains(
"max"))
348 for (New_max=max;New_max>=min;New_max--)
349 {Stat_t c = H->GetBinContent(New_max);
if (c>EntryMin)
break;}
352 else if (opt.Contains(
"calib"))
355 for (New_max=max;New_max>=min;New_max--)
356 {Stat_t c = H->GetBinContent(New_max);
if (c>EntryMin)
break;}
358 Stat_t EntryMax=H->GetEntries()-H->GetEntries()/100;
360 for (New_min=min; New_min<=max;New_min++)
361 {t+=H->GetBinContent(New_min);
if (t>EntryMax)
break;}
364 if (opt.Contains(
"sym"))New_max = H->FindBin(-1*H->GetXaxis()->GetBinCenter(New_min));
366 H->GetXaxis()->SetRange(New_min - shift , New_max + shift);
373 TH2F* DIGHistograms::AutoZoom(TH2F* H,Option_t* aType, Int_t EntryMin)
376 Int_t shiftX = (Int_t)(H->GetNbinsX()/30.);
377 Int_t shiftY = (Int_t)(H->GetNbinsY()/30.);
383 int maxX = H->GetNbinsX();
388 int maxY = H->GetNbinsY();
392 if (opt.Contains(
"all")) opt = TString(
"minx,maxx,miny,maxy");
394 if (opt.Contains(
"maxx"))
396 for (New_maxX = maxX;New_maxX >=minX; New_maxX--)
398 for (
int i_y = maxY; i_y >= minY;i_y--)
399 { c = H->GetBinContent(New_maxX,i_y);
if (c>EntryMin)
break;}
400 if (c>EntryMin)
break;
404 if (opt.Contains(
"maxy"))
407 for (New_maxY = maxY;New_maxY >=minY;New_maxY--)
409 for (
int i_x=maxX; i_x>=minX;i_x--)
410 { c = H->GetBinContent(i_x, New_maxY );
if (c>EntryMin)
break;}
411 if (c>EntryMin)
break;
416 if (opt.Contains(
"minx"))
419 for (New_minX = minX;New_minX <=maxX; New_minX++)
421 for (
int i_y = minY; i_y <= maxY;i_y++)
422 { c = H->GetBinContent(New_minX,i_y);
if (c>EntryMin)
break;}
423 if (c>EntryMin)
break;
429 if (opt.Contains(
"miny"))
431 for (New_minY = minY;New_minY <=maxY;New_minY++)
433 for (
int i_x=minX; i_x<=maxX;i_x++)
434 { c = H->GetBinContent(i_x, New_minY );
if (c>EntryMin)
break;}
435 if (c>EntryMin)
break;
440 H->GetXaxis()->SetRange(New_minX - shiftX , New_maxX + shiftX);
441 H->GetYaxis()->SetRange(New_minY - shiftY , New_maxY + shiftY);