2 |
* FTrkCalibQLook_BASIC.cxx |
* FTrkCalibQLook_BASIC.cxx |
3 |
* |
* |
4 |
* autor: D.Fedele |
* autor: D.Fedele |
5 |
* version 2.0 |
* version 3.0 |
6 |
* Parameters: |
* Parameters: |
7 |
* file - the data file to analyze |
* file - the data file to analyze |
8 |
* fromevent - first event to analyze |
* fromevent - first event to analyze |
65 |
// |
// |
66 |
// obtain information about the data file and select the output dir |
// obtain information about the data file and select the output dir |
67 |
const string filepath=file.Data(); |
const string filepath=file.Data(); |
68 |
Int_t dwpos = filepath.rfind("DW_"); |
Int_t dwpos = filepath.rfind("/"); |
69 |
Int_t dwpos1 = filepath.find(".root"); |
Int_t dwpos1 = filepath.rfind(".root"); |
70 |
TString fpath=(filepath.c_str()); |
TString fpath=(filepath.c_str()); |
71 |
TString base,ffile; |
TString base,ffile; |
72 |
stringcopy(base,fpath,0,dwpos); |
stringcopy(base,fpath,0,dwpos); |
73 |
stringcopy(ffile,fpath,dwpos,dwpos1); |
stringcopy(ffile,fpath,dwpos+1,dwpos1); |
74 |
|
if(dwpos>0) base+="/"; |
75 |
|
|
76 |
TString out; |
TString out; |
77 |
if(outdir.Length()==0){ |
if(outdir.Length()==0){ |
213 |
// inizialize the limits for simga and pedestall |
// inizialize the limits for simga and pedestall |
214 |
for(Int_t i=0;i<12;i++){ |
for(Int_t i=0;i<12;i++){ |
215 |
for(Int_t ii=0;ii<12;ii++){ |
for(Int_t ii=0;ii<12;ii++){ |
216 |
siglimsup[i][ii]=20.; |
siglimsup[i][ii]=30.; |
217 |
sigliminf[i][ii]=0.; |
sigliminf[i][ii]=1.5; |
218 |
pedlimsup[i][ii]=3500.; |
if(!(i%2)){ |
219 |
pedliminf[i][ii]=50.; |
pedlimsup[i][ii]=3700.; |
220 |
|
pedliminf[i][ii]=1700.; |
221 |
|
} |
222 |
|
else{ |
223 |
|
pedlimsup[i][ii]=2200.; |
224 |
|
pedliminf[i][ii]=200.; |
225 |
|
} |
226 |
} |
} |
227 |
} |
} |
228 |
|
|
243 |
if(trk2->cal_flag[m]!=0) alarm+=1; |
if(trk2->cal_flag[m]!=0) alarm+=1; |
244 |
} |
} |
245 |
} |
} |
246 |
const Int_t cnum=alarm/30 + 10; |
const Int_t cnum=alarm/30 + 100; |
247 |
Int_t flcanvas=1; |
Int_t flcanvas=1; |
248 |
Float_t spacep=1.5,space[cnum]; |
Float_t spacep=1.5,space[cnum]; |
249 |
TCanvas *c[cnum]; |
TCanvas *c[cnum]; |
|
|
|
250 |
// |
// |
251 |
// create output canvas |
// create output canvas |
252 |
for(Int_t i=0;i<cnum;i++){ |
for(Int_t i=0;i<cnum;i++){ |
257 |
rep<<"FTrkCalibQLook_BASIC_pag"<<i+1; |
rep<<"FTrkCalibQLook_BASIC_pag"<<i+1; |
258 |
c[i]=new TCanvas(tit.str().c_str(),rep.str().c_str(),canvasx,canvasy); |
c[i]=new TCanvas(tit.str().c_str(),rep.str().c_str(),canvasx,canvasy); |
259 |
c[i]->Range(0,0,100,100); |
c[i]->Range(0,0,100,100); |
260 |
|
c[i]->SetFillColor(10); |
261 |
tzz->DrawLatex(1,98.5,fromfile.str().c_str()); |
tzz->DrawLatex(1,98.5,fromfile.str().c_str()); |
262 |
rep.str(""); |
rep.str(""); |
263 |
rep<<"CALIBRATION REPORT pag"<<i+1; |
rep<<"CALIBRATION REPORT pag"<<i+1; |
434 |
if(pedav[nn][ii]>pedlimsup[nn][ii] || pedav[nn][ii]<pedliminf[nn][ii]) flpedav[nn][ii]=1; |
if(pedav[nn][ii]>pedlimsup[nn][ii] || pedav[nn][ii]<pedliminf[nn][ii]) flpedav[nn][ii]=1; |
435 |
if(sigav[nn][ii]>siglimsup[nn][ii] || sigav[nn][ii]<sigliminf[nn][ii]) flsigav[nn][ii]=1; |
if(sigav[nn][ii]>siglimsup[nn][ii] || sigav[nn][ii]<sigliminf[nn][ii]) flsigav[nn][ii]=1; |
436 |
|
|
437 |
if(flpedav[nn][ii]==1){ |
if((nn==1 && ii==11)||(nn==6 && ii==2)||(nn==6 && ii==4)||(nn==6 && ii==5)||(nn==6 && ii==6)||(nn==6 && ii==10)||(nn==11 && ii==3)) |
438 |
ok=1; |
continue; |
439 |
if(space[wc]<=3){ |
else{ |
440 |
wc+=1; |
if(flpedav[nn][ii]==1){ |
441 |
flcanvas+=1; |
ok=1; |
442 |
|
if(space[wc]<=3){ |
443 |
|
wc+=1; |
444 |
|
flcanvas+=1; |
445 |
|
} |
446 |
|
c[wc]->cd(); |
447 |
|
tzz->SetTextFont(40); |
448 |
|
tzz->SetTextSize(0.02); |
449 |
|
tzz->SetTextAlign(13); |
450 |
|
tzz->SetTextColor(50); |
451 |
|
rep<<"********************************************************************************************************************************"; |
452 |
|
tzz->DrawLatex(2,space[wc],rep.str().c_str()); |
453 |
|
rep.str(""); |
454 |
|
space[wc]-=spacep; |
455 |
|
rep<<"WARNING >>> CALIBRATION pkt "<<i+1<<" -->CalibTrk"<<(nn+1)%2+1<<" at OBT: "<<OBT[(nn+1)%2]<<"-->DSP "<<nn+1<<" -VA1 "<<2*ii+1<<"-"<<2*ii+2<<" --> <PED>= "<<pedav[nn][ii]; |
456 |
|
tzz->DrawLatex(2,space[wc],rep.str().c_str()); |
457 |
|
rep.str(""); |
458 |
|
space[wc]-=spacep; |
459 |
} |
} |
460 |
c[wc]->cd(); |
|
461 |
tzz->SetTextFont(40); |
if(flsigav[nn][ii]==1){ |
462 |
tzz->SetTextSize(0.02); |
ok=1; |
463 |
tzz->SetTextAlign(13); |
if(space[wc]<=3){ |
464 |
tzz->SetTextColor(50); |
wc+=1; |
465 |
rep<<"********************************************************************************************************************************"; |
flcanvas+=1; |
466 |
tzz->DrawLatex(2,space[wc],rep.str().c_str()); |
} |
467 |
rep.str(""); |
c[wc]->cd(); |
468 |
space[wc]-=spacep; |
tzz->SetTextFont(40); |
469 |
rep<<"WARNING >>> CALIBRATION pkt "<<i+1<<" -->CalibTrk"<<(nn+1)%2+1<<" at OBT: "<<OBT[(nn+1)%2]<<"-->DSP "<<nn+1<<" -VA1 "<<2*ii+1<<"-"<<2*ii+2<<" --> <PED>= "<<pedav[nn][ii]; |
tzz->SetTextSize(0.02); |
470 |
tzz->DrawLatex(2,space[wc],rep.str().c_str()); |
tzz->SetTextAlign(13); |
471 |
rep.str(""); |
tzz->SetTextColor(50); |
472 |
space[wc]-=spacep; |
rep<<"********************************************************************************************************************************"; |
473 |
} |
tzz->DrawLatex(2,space[wc],rep.str().c_str()); |
474 |
|
rep.str(""); |
475 |
if(flsigav[nn][ii]==1){ |
space[wc]-=spacep; |
476 |
ok=1; |
rep<<"WARNING >>> CALIBRATION pkt "<<i+1<<" -->CalibTrk"<<(nn+1)%2+1<<" at OBT: "<<OBT[(nn+1)%2]<<"-->DSP "<<nn+1<<" -VA1 "<<2*ii+1<<"-"<<2*ii+2<<" --> <SIG>= "<<sigav[nn][ii]; |
477 |
if(space[wc]<=3){ |
tzz->DrawLatex(2,space[wc],rep.str().c_str()); |
478 |
wc+=1; |
rep.str(""); |
479 |
flcanvas+=1; |
space[wc]-=spacep; |
480 |
} |
} |
|
c[wc]->cd(); |
|
|
tzz->SetTextFont(40); |
|
|
tzz->SetTextSize(0.02); |
|
|
tzz->SetTextAlign(13); |
|
|
tzz->SetTextColor(50); |
|
|
rep<<"********************************************************************************************************************************"; |
|
|
tzz->DrawLatex(2,space[wc],rep.str().c_str()); |
|
|
rep.str(""); |
|
|
space[wc]-=spacep; |
|
|
rep<<"WARNING >>> CALIBRATION pkt "<<i+1<<" -->CalibTrk"<<(nn+1)%2+1<<" at OBT: "<<OBT[(nn+1)%2]<<"-->DSP "<<nn+1<<" -VA1 "<<2*ii+1<<"-"<<2*ii+2<<" --> <SIG>= "<<sigav[nn][ii]; |
|
|
tzz->DrawLatex(2,space[wc],rep.str().c_str()); |
|
|
rep.str(""); |
|
|
space[wc]-=spacep; |
|
481 |
} |
} |
482 |
} |
} |
483 |
} |
} |
484 |
} |
} |
485 |
|
if(ok==0 && ctrk.good0[0]==1 && ctrk.good0[1]==1){ |
|
if(ok==0 && ctrk.good0[0]==1 && ctrk.good0[1]==1){ |
|
486 |
if(space[wc]<=10){ |
if(space[wc]<=10){ |
487 |
wc+=1; |
wc+=1; |
488 |
flcanvas+=1; |
flcanvas+=1; |