2 void saveSignalCharAPV(Char_t* signalFile=
"signalShapes.root")
16 cout <<
"So many APV plots... please be patient." << endl;
18 sprintf(buffer,
"Canvas_mean&max_maxTb_APVbin");
19 TCanvas c2(buffer,buffer,10,10,1600,800);
22 sprintf(buffer,
"Canvas_mean&max_firsthigh_APVbin");
23 TCanvas c7(buffer,buffer,10,10,1600,800);
27 Double_t meanmaxTblayerP[n] = {0};
28 Double_t meanmaxTblayerR[n] = {0};
29 Double_t meanmaxTblayerRerr[n] = {0};
30 Double_t meanmaxTblayerPerr[n] = {0};
31 Double_t maxmaxTblayerP[n] = {0};
32 Double_t maxmaxTblayerR[n] = {0};
33 Double_t meanmaxfhlayerP[n] = {0};
34 Double_t meanmaxfhlayerR[n] = {0};
35 Double_t meanmaxfhlayerRerr[n] = {0};
36 Double_t meanmaxfhlayerPerr[n] = {0};
37 Double_t maxmaxfhlayerP[n] = {0};
38 Double_t maxmaxfhlayerR[n] = {0};
39 Double_t nbinAPV[n] = {0};
40 Double_t nbinAPVerr[n] = {0};
42 for(Int_t ibin=0;ibin<n;ibin++)
44 nbinAPV[ibin]=(Double_t*)ibin;
47 for(
int iD=1;iD<7;iD++)
49 for(
int iL=0;iL<2;iL++)
52 sprintf(layerName,
"P");
54 sprintf(layerName,
"R");
56 sprintf(buffer,
"Canvas0_Disc_%id_QuadAandB_Layer%s",iD,layerName);
57 TCanvas c0(buffer,buffer,10,10,3000,2000);
60 sprintf(buffer,
"Canvas3_Disc_%id_QuadAandB_Layer%s",iD,layerName);
61 TCanvas c3(buffer,buffer,10,10,3000,2000);
64 sprintf(buffer,
"Canvas5_Disc_%id_QuadAandB_Layer%s",iD,layerName);
65 TCanvas c5(buffer,buffer,10,10,3000,2000);
68 sprintf(buffer,
"Canvas8_Disc_%id_QuadAandB_Layer%s",iD,layerName);
69 TCanvas c8(buffer,buffer,10,10,3000,2000);
72 for(
int binAPVi=0;binAPVi<20;binAPVi++)
76 if((binAPVi>= 0) && (binAPVi<= 9)){
78 sprintf(quadName,
"A");}
79 if((binAPVi>=10) && (binAPVi<=19)){
81 sprintf(quadName,
"B");}
82 if((iD-1==0) || ((iD-1)%2==1)){
83 if((binAPVi>= 0) && (binAPVi<= 4)) truAPV = binAPVi;
84 if((binAPVi>= 5) && (binAPVi<= 9)) truAPV = binAPVi+12;
85 if((binAPVi>=10) && (binAPVi<=14)) truAPV = binAPVi+2;
86 if((binAPVi>=15) && (binAPVi<=19)) truAPV = binAPVi-10;
89 if((binAPVi>= 0) && (binAPVi<= 4)) truAPV = binAPVi+12;
90 if((binAPVi>= 5) && (binAPVi<= 9)) truAPV = binAPVi;
91 if((binAPVi>=10) && (binAPVi<=14)) truAPV = binAPVi-10;
92 if((binAPVi>=15) && (binAPVi<=19)) truAPV = binAPVi+2;
100 if(truAPV>= 0 && truAPV<= 9) grp = 0;
101 if(truAPV>=12 && truAPV<=21) grp = 1;
106 if(truAPV > 10) rdo = 1;
107 if(truAPV < 10) rdo = 2;
110 if(truAPV > 10) rdo = 2;
111 if(truAPV < 10) rdo = 1;
117 if(truAPV>=5 && truAPV<=9) rdo = 2;
121 if(truAPV>=12 && truAPV<=16) {
131 if(truAPV>=5 && truAPV<=9){
142 if(truAPV>=12 && truAPV<=16) rdo = 1;
147 if(truAPV>=5 && truAPV<=9) rdo = 2;
152 sprintf(buffer,
"APVnumFSigCloseCluster%s_disc%d_quad%d_apvBIN%d",layerName,iD,iQ,binAPVi);
153 TH1D* h=(TH1D*)f.Get(buffer);
154 sprintf(buffer,
"APVnumFSigCloseCluster%sd%dq%s_rdo%darm%dgrp%dapv%d",layerName,iD,quadName,rdo,arm,grp,truAPV);
164 sprintf(buffer,
"APVmaxTbCloseCluster%s_disc%d_quad%d_apvBIN%d",layerName,iD,iQ,binAPVi);
167 TH1D* h=(TH1D*)f.Get(buffer);
168 sprintf(buffer,
"APVmaxTbCloseCluster%sd%dq%s_rdo%darm%dgrp%dapv%d",layerName,iD,quadName,rdo,arm,grp,truAPV);
171 Double_t meanval = h->GetMean(1);
172 Double_t meanvalerr = h->GetRMS(1);
173 Double_t maxbinnum = h->GetMaximumBin();
176 meanmaxTblayerP[(iD-1)*40+binAPVi] = meanval;
177 meanmaxTblayerPerr[(iD-1)*40+binAPVi] = meanvalerr;
178 maxmaxTblayerP[(iD-1)*40+binAPVi] = maxbinnum-1;
181 meanmaxTblayerR[(iD-1)*40+binAPVi] = meanval;
182 meanmaxTblayerRerr[(iD-1)*40+binAPVi] = meanvalerr;
183 maxmaxTblayerR[(iD-1)*40+binAPVi] = maxbinnum-1;
191 sprintf(buffer,
"APVmaxAdcCloseCluster%s_disc%d_quad%d_apvBIN%d",layerName,iD,iQ,binAPVi);
192 TH1D* h=(TH1D*)f.Get(buffer);
193 sprintf(buffer,
"APVmaxAdcCloseCluster%sd%dq%s_rdo%darm%dgrp%dapv%d",layerName,iD,quadName,rdo,arm,grp,truAPV);
203 sprintf(buffer,
"APVnumFirstHighCloseCluster%s_disc%d_quad%d_apvBIN%d",layerName,iD,iQ,binAPVi);
204 TH1D* h=(TH1D*)f.Get(buffer);
205 sprintf(buffer,
"maxFirstHighCloseCluster%sd%dq%s_rdo%darm%dgrp%dapv%d",layerName,iD,quadName,rdo,arm,grp,truAPV);
208 Double_t meanval = h->GetMean(1);
209 Double_t meanvalerr = h->GetRMS(1);
210 Double_t maxbinnum = h->GetMaximumBin();
212 meanmaxfhlayerP[(iD-1)*40+binAPVi] = meanval;
213 meanmaxfhlayerPerr[(iD-1)*40+binAPVi] = meanvalerr;
214 maxmaxfhlayerP[(iD-1)*40+binAPVi] = maxbinnum-1;
217 meanmaxfhlayerR[(iD-1)*40+binAPVi] = meanval;
218 meanmaxfhlayerRerr[(iD-1)*40+binAPVi] = meanvalerr;
219 maxmaxfhlayerR[(iD-1)*40+binAPVi] = maxbinnum-1;
229 sprintf(buffer,
"APVnumFSigCloseInfoForDisk%d_QuadAandB_layer%s.png",iD,layerName);
232 sprintf(buffer,
"APVmaxTbCloseInfoForDisk%d_QuadAandB_layer%s.png",iD,layerName);
235 sprintf(buffer,
"APVmaxAdcCloseInfoForDisk%d_QuadAandB_layer%s.png",iD,layerName);
238 sprintf(buffer,
"APVmaxFirstHighCloseInfoForDisk%d_QuadAandB_layer%s.png",iD,layerName);
243 sprintf(buffer,
"Canvas1_Disc_%id_QuadCandD_Layer%s",iD,layerName);
244 TCanvas c1(buffer,buffer,10,10,3000,2000);
247 sprintf(buffer,
"Canvas4_Disc_%id_QuadCandD_Layer%s",iD,layerName);
248 TCanvas c4(buffer,buffer,10,10,3000,2000);
251 sprintf(buffer,
"Canvas6_Disc_%id_QuadCandD_Layer%s",iD,layerName);
252 TCanvas c6(buffer,buffer,10,10,3000,2000);
255 sprintf(buffer,
"Canvas9_Disc_%id_QuadCandD_Layer%s",iD,layerName);
256 TCanvas c9(buffer,buffer,10,10,3000,2000);
260 for(
int binAPVi=20;binAPVi<40;binAPVi++)
264 if((binAPVi>=20) && (binAPVi<=29)){
266 sprintf(quadName,
"C");}
267 if((binAPVi>=30) && (binAPVi<=39)){
269 sprintf(quadName,
"D");}
270 if((iD>1) && (iQ>1))
continue;
271 if((iD-1==0) || ((iD-1)%2==1)){
272 if((binAPVi>=20) && (binAPVi<=24)) truAPV = binAPVi-20;
273 if((binAPVi>=25) && (binAPVi<=29)) truAPV = binAPVi-8;
274 if((binAPVi>=30) && (binAPVi<=34)) truAPV = binAPVi-18;
275 if((binAPVi>=35) && (binAPVi<=39)) truAPV = binAPVi-30;
278 if((binAPVi>=20) && (binAPVi<=24)) truAPV = binAPVi-8;
279 if((binAPVi>=25) && (binAPVi<=29)) truAPV = binAPVi-20;
280 if((binAPVi>=30) && (binAPVi<=34)) truAPV = binAPVi-26;
281 if((binAPVi>=35) && (binAPVi<=39)) truAPV = binAPVi-18;
286 if(truAPV>= 0 && truAPV<= 9) grp = 0;
287 if(truAPV>=12 && truAPV<=21) grp = 1;
292 if(truAPV > 10) rdo = 1;
293 if(truAPV < 10) rdo = 2;
296 if(truAPV > 10) rdo = 2;
297 if(truAPV < 10) rdo = 1;
303 if(truAPV>=5 && truAPV<=9) rdo = 2;
307 if(truAPV>=12 && truAPV<=16) {
317 if(truAPV>=5 && truAPV<=9){
328 if(truAPV>=12 && truAPV<=16) rdo = 1;
333 if(truAPV>=5 && truAPV<=9) rdo = 2;
338 sprintf(buffer,
"APVnumFSigCloseCluster%s_disc%d_quad%d_apvBIN%d",layerName,iD,iQ,binAPVi);
340 TH1D* h=(TH1D*)f.Get(buffer);
341 sprintf(buffer,
"APVnumFSigCloseCluster%s_d%dq%s_rdo%darm%dgrp%dapv%d",layerName,iD,quadName,rdo,arm,grp,truAPV);
351 sprintf(buffer,
"APVmaxTbCloseCluster%s_disc%d_quad%d_apvBIN%d",layerName,iD,iQ,binAPVi);
353 TH1D* h=(TH1D*)f.Get(buffer);
354 sprintf(buffer,
"APVmaxTbCloseCluster%sd%dq%s_rdo%darm%dgrp%dapv%d",layerName,iD,quadName,rdo,arm,grp,truAPV);
357 Double_t meanval = h->GetMean(1);
358 Double_t meanvalerr = h->GetRMS(1);
360 meanmaxTblayerP[(iD-1)*40+binAPVi] = meanval;
361 meanmaxTblayerPerr[(iD-1)*40+binAPVi] = meanvalerr;
364 meanmaxTblayerR[(iD-1)*40+binAPVi] = meanval;
365 meanmaxTblayerRerr[(iD-1)*40+binAPVi] = meanvalerr;
374 sprintf(buffer,
"APVmaxAdcCloseCluster%s_disc%d_quad%d_apvBIN%d",layerName,iD,iQ,binAPVi);
376 TH1D* h=(TH1D*)f.Get(buffer);
377 sprintf(buffer,
"APVmaxAdcCloseCluster%sd%dq%s_rdo%darm%dgrp%dapv%d",layerName,iD,quadName,rdo,arm,grp,truAPV);
387 sprintf(buffer,
"APVnumFirstHighCloseCluster%s_disc%d_quad%d_apvBIN%d",layerName,iD,iQ,binAPVi);
389 TH1D* h=(TH1D*)f.Get(buffer);
390 sprintf(buffer,
"maxFirstHighCloseCluster%sd%dq%s_rdo%darm%dgrp%dapv%d",layerName,iD,quadName,rdo,arm,grp,truAPV);
393 Double_t meanval = h->GetMean(1);
394 Double_t meanvalerr = h->GetRMS(1);
396 meanmaxfhlayerP[(iD-1)*40+binAPVi] = meanval;
397 meanmaxfhlayerPerr[(iD-1)*40+binAPVi] = meanvalerr;
400 meanmaxfhlayerR[(iD-1)*40+binAPVi] = meanval;
401 meanmaxfhlayerRerr[(iD-1)*40+binAPVi] = meanvalerr;
412 sprintf(buffer,
"APVnumFSigCloseInfoForDisk%d_QuadCandD_layer%s.png",iD,layerName);
415 sprintf(buffer,
"APVmaxTbCloseInfoForDisk%d_QuadCandD_layer%s.png",iD,layerName);
418 sprintf(buffer,
"APVmaxAdcCloseInfoForDisk%d_QuadCandD_layer%s.png",iD,layerName);
421 sprintf(buffer,
"APVmaxFirstHighCloseInfoForDisk%d_QuadCandD_layer%s.png",iD,layerName);
427 TGraphErrors *gr1 =
new TGraphErrors(n,nbinAPV,meanmaxTblayerP,nbinAPVerr,meanmaxTblayerPerr);
428 gr1->SetTitle(
"Layer P mean maxTb per APV");
431 gr1->SetMarkerColor(1);
432 gr1->SetMarkerSize(.4);
433 gr1->SetMarkerStyle(21);
436 TGraphErrors *gr2 =
new TGraphErrors(n,nbinAPV,meanmaxTblayerR,nbinAPVerr,meanmaxTblayerRerr);
437 gr2->SetTitle(
"Layer R mean maxTb per APV");
440 gr2->SetMarkerColor(1);
441 gr2->SetMarkerSize(.4);
442 gr2->SetMarkerStyle(21);
445 TGraph *gr3 =
new TGraph(n,nbinAPV,maxmaxTblayerP);
446 gr3->SetTitle(
"Layer P max maxTb per APV");
449 gr3->SetMarkerColor(1);
450 gr3->SetMarkerSize(.4);
451 gr3->SetMarkerStyle(21);
454 TGraph *gr4 =
new TGraph(n,nbinAPV,maxmaxTblayerR);
455 gr4->SetTitle(
"Layer R max maxTb per APV");
458 gr4->SetMarkerColor(1);
459 gr4->SetMarkerSize(.4);
460 gr4->SetMarkerStyle(21);
463 c2.SaveAs(
"APVmeanmaxTb.png");
466 TGraphErrors *gr5 =
new TGraphErrors(n,nbinAPV,meanmaxfhlayerP,nbinAPVerr,meanmaxfhlayerPerr);
467 gr5->SetTitle(
"Layer P mean maxFirstHigh per APV");
470 gr5->SetMarkerColor(1);
471 gr5->SetMarkerSize(.4);
472 gr5->SetMarkerStyle(21);
475 TGraphErrors *gr6 =
new TGraphErrors(n,nbinAPV,meanmaxfhlayerR,nbinAPVerr,meanmaxfhlayerRerr);
476 gr6->SetTitle(
"Layer R mean maxFirstHigh per APV");
479 gr6->SetMarkerColor(1);
480 gr6->SetMarkerSize(.4);
481 gr6->SetMarkerStyle(21);
484 TGraph *gr7 =
new TGraph(n,nbinAPV,maxmaxfhlayerP);
485 gr7->SetTitle(
"Layer P max maxFirstHigh per APV");
488 gr7->SetMarkerColor(1);
489 gr7->SetMarkerSize(.4);
490 gr7->SetMarkerStyle(21);
493 TGraph *gr8 =
new TGraph(n,nbinAPV,maxmaxfhlayerR);
494 gr8->SetTitle(
"Layer R max maxFirstHigh per APV");
497 gr8->SetMarkerColor(1);
498 gr8->SetMarkerSize(.4);
499 gr8->SetMarkerStyle(21);
502 c7.SaveAs(
"APVmeanmaxFirstHigh.png");