| 2 |
* FTrkScanQlook_EXPERT.cxx |
* FTrkScanQlook_EXPERT.cxx |
| 3 |
* |
* |
| 4 |
* autor: D.Fedele |
* autor: D.Fedele |
| 5 |
* version v2r01 |
* version v2r08 |
| 6 |
* Parameters: |
* Parameters: |
| 7 |
* file - the path to the root file to analyze |
* file - the path to the root file to analyze |
| 8 |
* outdir - total path of output file |
* outdir - total path of output file |
| 202 |
printf(" Number of Header Entries: %d\n",neventH); |
printf(" Number of Header Entries: %d\n",neventH); |
| 203 |
printf(" Number of Calibration: %d\n",cevents); |
printf(" Number of Calibration: %d\n",cevents); |
| 204 |
|
|
| 205 |
Long64_t obt=0; |
ULong_t obt=0,hobt[neventH]; |
| 206 |
Int_t eve,cin=0,cins=0; |
Int_t eve,cin=0,cins=0,br=0,olrun[neventH]; |
| 207 |
TString cal=""; |
TString cal=""; |
| 208 |
|
|
| 209 |
eve=3; |
eve=3; |
| 210 |
for(Int_t i=0;i<neventH;i++){ |
for(Int_t i=0;i<neventH;i++){ |
| 211 |
otr->GetEntry(i); |
otr->GetEntry(i); |
| 212 |
pH = eH->GetPscuHeader(); |
pH = eH->GetPscuHeader(); |
| 213 |
if(reh->TRK_CALIB_USED!=104){ |
hobt[i]= pH->GetOrbitalTime(); |
| 214 |
|
olrun[i]=reh->TRK_CALIB_USED; |
| 215 |
|
if(reh->TRK_CALIB_USED!=104 && br==0){ |
| 216 |
obt = pH->GetOrbitalTime(); |
obt = pH->GetOrbitalTime(); |
| 217 |
cal="Event with online calibration"; |
cal="Event with online calibration"; |
| 218 |
break; |
br=1; |
| 219 |
} |
} |
| 220 |
if(i==neventH-1){ |
if(i==neventH-1 && br==0){ |
| 221 |
cal="***** ONLINE CALIBRATION NOT FOUND IN THIS FILE *****"; |
cal="***** ONLINE CALIBRATION NOT FOUND IN THIS FILE *****"; |
| 222 |
eve=2; |
eve=2; |
| 223 |
} |
} |
| 243 |
|
|
| 244 |
TPad *trkpad[12]; //pad for histos |
TPad *trkpad[12]; //pad for histos |
| 245 |
|
|
| 246 |
stringstream fromfile,title,hid,message; |
stringstream fromfile,isfile,title,hid,message; |
| 247 |
TString figsa="",figsav="",figsava=""; |
TString figsa="",figsav="",figsava=""; |
| 248 |
Int_t canvasx=1200; |
Int_t canvasx=1200; |
| 249 |
Int_t canvasy=900; |
Int_t canvasy=900; |
| 269 |
for(Int_t i=0;i<nevents;i++){ |
for(Int_t i=0;i<nevents;i++){ |
| 270 |
tr->GetEntry(i); |
tr->GetEntry(i); |
| 271 |
ph = eh->GetPscuHeader(); |
ph = eh->GetPscuHeader(); |
|
if(reh->TRK_CALIB_USED==104) continue; |
|
| 272 |
cod = eh->GetCounter(); |
cod = eh->GetCounter(); |
| 273 |
|
if(olrun[cod->Get(pctp->RunHeader)-1]==104) continue; |
| 274 |
if(value%10!=0){ |
if(value%10!=0){ |
| 275 |
if(i==0) cin=cod->Get(pctp->CalibTrk1)+((value%10)-1); |
if(i==0) cin=cod->Get(pctp->CalibTrk1)+((value%10)-1); |
| 276 |
if(cod->Get(pctp->CalibTrk1)==cin+1){ |
if(cod->Get(pctp->CalibTrk1)==cin+1){ |
| 284 |
eve=i+3; |
eve=i+3; |
| 285 |
cin=100; |
cin=100; |
| 286 |
} |
} |
| 287 |
else if(event>=0 && ph->GetOrbitalTime()>obt && obt>0){ |
else if(event>=0 && (ULong_t)ph->GetOrbitalTime()>obt && obt>0){ |
| 288 |
eve=i+3; |
eve=i+3; |
| 289 |
obt=-1; |
obt=0; |
| 290 |
} |
} |
| 291 |
} |
} |
| 292 |
if(i==0) cins=cod->Get(pctp->CalibTrk1); |
if(i==0) cins=cod->Get(pctp->CalibTrk1); |
| 293 |
if(cod->Get(pctp->CalibTrk1)==cins+1){ |
if(cod->Get(pctp->CalibTrk1)>cins){ |
| 294 |
psum=1; |
psum=1; |
| 295 |
cins=cod->Get(pctp->CalibTrk1); |
cins=cod->Get(pctp->CalibTrk1); |
| 296 |
} |
} |
| 303 |
csum[cins-1]->SetFillColor(10); |
csum[cins-1]->SetFillColor(10); |
| 304 |
csum[cins-1]->Range(0,0,1,1); |
csum[cins-1]->Range(0,0,1,1); |
| 305 |
fromfile.str(""); |
fromfile.str(""); |
| 306 |
fromfile<<"FTrkScanQLook_EXPERT File: "<<ffile<<" ----> Sum of "<<totsum<<" events after the "<<cins<<" calibration "; |
fromfile<<"FTrkScanQLook_EXPERT File: "<<ffile<<" ----> Sum of "<<totsum<<" events after the "<<cins<<" calibration at OBT= "<<hobt[(cod->Get(pctp->RunHeader))-1]; |
| 307 |
t->SetTextSize(0.02); |
t->SetTextSize(0.02); |
| 308 |
t->DrawLatex(0.02,0.98,fromfile.str().c_str()); |
t->DrawLatex(0.02,0.98,fromfile.str().c_str()); |
| 309 |
|
|
| 441 |
if(psum==totsum+1){ |
if(psum==totsum+1){ |
| 442 |
if(value%10==0 && value>0) values << (short int)(-cins) << endl << endl; |
if(value%10==0 && value>0) values << (short int)(-cins) << endl << endl; |
| 443 |
psum=0; |
psum=0; |
| 444 |
for(Int_t vi = 0; vi < 12; vi++){ |
for(Int_t vi = 0; vi < 12; vi++){ |
| 445 |
TLine li,liva1; |
if(p[vi]>0){ |
| 446 |
li.SetLineColor(38); |
|
| 447 |
li.SetLineStyle(4); |
TLine li,liva1; |
| 448 |
li.SetLineWidth(2); |
li.SetLineColor(38); |
| 449 |
liva1.SetLineColor(42); |
li.SetLineStyle(4); |
| 450 |
liva1.SetLineStyle(3); |
li.SetLineWidth(2); |
| 451 |
liva1.SetLineWidth(1); |
liva1.SetLineColor(42); |
| 452 |
|
liva1.SetLineStyle(3); |
| 453 |
|
liva1.SetLineWidth(1); |
| 454 |
|
|
| 455 |
Float_t va1x=0; |
Float_t va1x=0; |
| 456 |
csum[cins-1]->cd(); |
csum[cins-1]->cd(); |
| 457 |
trkpad[vi]->Draw(); |
trkpad[vi]->Draw(); |
| 458 |
trkpad[vi]->cd(); |
trkpad[vi]->cd(); |
| 459 |
trkpad[vi]->SetFillColor(10); |
trkpad[vi]->SetFillColor(10); |
| 460 |
|
|
| 461 |
stringstream tit,hid; |
stringstream tit,hid; |
| 462 |
tit.str(""); |
tit.str(""); |
| 463 |
hid.str(""); |
hid.str(""); |
| 464 |
tit<<"DSP "<<vi+1; |
tit<<"DSP "<<vi+1; |
| 465 |
sum[vi][cins-1][0]->SetTitle(tit.str().c_str()); |
sum[vi][cins-1][0]->SetTitle(tit.str().c_str()); |
| 466 |
sum[vi][cins-1][0]->GetXaxis()->SetTitle("channel id"); |
sum[vi][cins-1][0]->GetXaxis()->SetTitle("channel id"); |
| 467 |
sum[vi][cins-1][0]->GetXaxis()->CenterTitle(); |
sum[vi][cins-1][0]->GetXaxis()->CenterTitle(); |
| 468 |
sum[vi][cins-1][0]->GetXaxis()->SetRangeUser(0,3073); |
sum[vi][cins-1][0]->GetXaxis()->SetRangeUser(0,3073); |
| 469 |
sum[vi][cins-1][0]->GetXaxis()->SetTitleSize(0.06); |
sum[vi][cins-1][0]->GetXaxis()->SetTitleSize(0.06); |
| 470 |
sum[vi][cins-1][0]->GetXaxis()->SetTitleOffset(0.8); |
sum[vi][cins-1][0]->GetXaxis()->SetTitleOffset(0.8); |
| 471 |
sum[vi][cins-1][0]->GetYaxis()->SetTitle("ADC value"); |
sum[vi][cins-1][0]->GetYaxis()->SetTitle("ADC value"); |
| 472 |
sum[vi][cins-1][0]->GetYaxis()->SetTitleSize(0.09); |
sum[vi][cins-1][0]->GetYaxis()->SetTitleSize(0.09); |
| 473 |
sum[vi][cins-1][0]->GetYaxis()->SetTitleOffset(0.4); |
sum[vi][cins-1][0]->GetYaxis()->SetTitleOffset(0.4); |
| 474 |
sum[vi][cins-1][0]->GetYaxis()->CenterTitle(); |
sum[vi][cins-1][0]->GetYaxis()->CenterTitle(); |
| 475 |
sum[vi][cins-1][0]->GetYaxis()->SetRangeUser(0,4500); |
sum[vi][cins-1][0]->GetYaxis()->SetRangeUser(0,4500); |
| 476 |
sum[vi][cins-1][0]->SetMarkerStyle(20); |
sum[vi][cins-1][0]->SetMarkerStyle(20); |
| 477 |
sum[vi][cins-1][0]->SetMarkerSize(0.1); |
sum[vi][cins-1][0]->SetMarkerSize(0.1); |
| 478 |
sum[vi][cins-1][0]->SetMarkerColor(4); |
sum[vi][cins-1][0]->SetMarkerColor(4); |
| 479 |
sum[vi][cins-1][0]->Draw("ap"); |
sum[vi][cins-1][0]->Draw("ap"); |
| 480 |
hid<<p[vi]<<" events"; |
hid<<p[vi]<<" events"; |
| 481 |
t->SetTextSize(0.11); |
t->SetTextSize(0.11); |
| 482 |
t->DrawLatex(2400,4250,hid.str().c_str()); |
t->DrawLatex(2400,4250,hid.str().c_str()); |
| 483 |
for(int pi=1; pi<p[vi];pi++){ |
for(int pi=1; pi<p[vi];pi++){ |
| 484 |
sum[vi][cins-1][pi]->SetMarkerStyle(21); |
sum[vi][cins-1][pi]->SetMarkerStyle(21); |
| 485 |
sum[vi][cins-1][pi]->SetMarkerSize(0.1); |
sum[vi][cins-1][pi]->SetMarkerSize(0.1); |
| 486 |
sum[vi][cins-1][pi]->SetMarkerColor(4); |
sum[vi][cins-1][pi]->SetMarkerColor(4); |
| 487 |
sum[vi][cins-1][pi]->Draw("p"); |
sum[vi][cins-1][pi]->Draw("p"); |
| 488 |
} |
} |
| 489 |
for(int va=1; va<24; va++){ |
for(int va=1; va<24; va++){ |
| 490 |
va1x=128*va; |
va1x=128*va; |
| 491 |
liva1.DrawLine(va1x,0.,va1x,4500.); |
liva1.DrawLine(va1x,0.,va1x,4500.); |
| 492 |
|
} |
| 493 |
|
li.DrawLine(1024.5,0.,1024.5,4500.); |
| 494 |
|
li.DrawLine(2048.5,0.,2048.5,4500.); |
| 495 |
|
csum[cins-1]->Update(); |
| 496 |
|
hid.str(""); |
| 497 |
} |
} |
|
li.DrawLine(1024.5,0.,1024.5,4500.); |
|
|
li.DrawLine(2048.5,0.,2048.5,4500.); |
|
|
csum[cins-1]->Update(); |
|
|
hid.str(""); |
|
| 498 |
} |
} |
| 499 |
if(strcmp(outfile.Data(),"ps") && strcmp(outfile.Data(),"pdf")){ |
if(strcmp(outfile.Data(),"ps") && strcmp(outfile.Data(),"pdf")){ |
| 500 |
figsa+="."+outfile; |
figsa+="."+outfile; |
| 501 |
csum[cins-1]->Print(figsa.Data()); |
csum[cins-1]->Print(figsa.Data()); |
| 502 |
} |
} |
| 503 |
} |
if(cod->Get(pctp->CalibTrk1)==cevents) break; |
| 504 |
|
} |
| 505 |
} |
} |
| 506 |
} |
} |
| 507 |
|
|
| 568 |
t->SetTextSize(0.02); |
t->SetTextSize(0.02); |
| 569 |
t->DrawLatex(0.02,0.98,fromfile.str().c_str()); |
t->DrawLatex(0.02,0.98,fromfile.str().c_str()); |
| 570 |
t->DrawLatex(0.60,0.98,cal.Data()); |
t->DrawLatex(0.60,0.98,cal.Data()); |
| 571 |
|
|
| 572 |
|
isfile<<"Boxes so colored point out chips broken before the launch and never resumed"; |
| 573 |
|
t->SetTextColor(6); |
| 574 |
|
t->SetTextSize(0.018); |
| 575 |
|
t->DrawLatex(.05,.96,isfile.str().c_str()); |
| 576 |
|
isfile.str(""); |
| 577 |
|
|
| 578 |
|
isfile<<"Boxes so colored point out anomalous chips (not necessarily broken)"; |
| 579 |
|
t->SetTextColor(107); |
| 580 |
|
t->DrawLatex(.5,.96,isfile.str().c_str()); |
| 581 |
|
isfile.str(""); |
| 582 |
|
t->SetTextColor(1); |
| 583 |
|
|
| 584 |
if(va1!=0){ |
if(va1!=0){ |
| 585 |
figsava=out+ffile+"_FTrkScanQLook_EXPERT_ev"; |
figsava=out+ffile+"_FTrkScanQLook_EXPERT_ev"; |
| 896 |
if(nn==0){ |
if(nn==0){ |
| 897 |
b.SetFillColor(107); |
b.SetFillColor(107); |
| 898 |
b.SetFillStyle(3945); |
b.SetFillStyle(3945); |
| 899 |
|
b.DrawBox(256.,-500.,384.,4500); |
| 900 |
b.DrawBox(768.,-500.,2047.,4500.); |
b.DrawBox(768.,-500.,2047.,4500.); |
| 901 |
} |
} |
| 902 |
else if(nn==1){ |
else if(nn==1){ |
| 907 |
b.SetFillColor(107); |
b.SetFillColor(107); |
| 908 |
b.SetFillStyle(3954); |
b.SetFillStyle(3954); |
| 909 |
b.DrawBox(384.,-500.,512.,4500.); |
b.DrawBox(384.,-500.,512.,4500.); |
| 910 |
|
b.DrawBox(896.,-500.,1024.,4500.); |
| 911 |
|
b.DrawBox(2048.,-500.,2432.,4500.); |
| 912 |
b.DrawBox(2816.,-500.,2944.,4500.); |
b.DrawBox(2816.,-500.,2944.,4500.); |
| 913 |
b.DrawBox(2048.,-500.,2176.,4500.); |
} |
| 914 |
|
else if(nn==3){ |
| 915 |
|
b.SetFillColor(107); |
| 916 |
|
b.SetFillStyle(3954); |
| 917 |
|
b.DrawBox(2816.,-500.,3070.,4500.); |
| 918 |
} |
} |
| 919 |
else if(nn==4){ |
else if(nn==4){ |
| 920 |
b.SetFillColor(107); |
b.SetFillColor(107); |
| 921 |
b.SetFillStyle(3954); |
b.SetFillStyle(3954); |
| 922 |
b.DrawBox(384.,-500.,512.,4500.); |
b.DrawBox(256.,-500.,512.,4500.); |
| 923 |
|
b.DrawBox(2816.,-500.,3070.,4500.); |
| 924 |
|
} |
| 925 |
|
else if(nn==5){ |
| 926 |
|
b.SetFillColor(107); |
| 927 |
|
b.SetFillStyle(3954); |
| 928 |
|
b.DrawBox(896.,-500.,1024.,4500.); |
| 929 |
|
// b.DrawBox(1664.,-500.,1792.,4500.); |
| 930 |
} |
} |
| 931 |
else if(nn==6){ |
else if(nn==6){ |
|
b.SetFillColor(6); |
|
|
b.SetFillStyle(3945); |
|
|
b.DrawBox(2560.,-500.,2816.,4500.); |
|
|
b.DrawBox(1024.,-500.,1280.,4500.); |
|
|
|
|
| 932 |
b.SetFillColor(107); |
b.SetFillColor(107); |
| 933 |
b.SetFillStyle(3954); |
b.SetFillStyle(3954); |
| 934 |
b.DrawBox(512.,-500.,768.,4500.); |
b.DrawBox(512.,-500.,768.,4500.); |
| 935 |
|
b.DrawBox(1024.,-500.,1280.,4500.); |
| 936 |
b.DrawBox(1280.,-500.,1792.,4500.); |
b.DrawBox(1280.,-500.,1792.,4500.); |
| 937 |
|
b.DrawBox(2560.,-500.,2816.,4500.); |
| 938 |
} |
} |
| 939 |
else if(nn==7){ |
else if(nn==7){ |
| 940 |
b.SetFillColor(107); |
b.SetFillColor(107); |
| 941 |
b.SetFillStyle(3954); |
b.SetFillStyle(3954); |
| 942 |
b.DrawBox(512.,-500.,768.,4500.); |
b.DrawBox(512.,-500.,768.,4500.); |
| 943 |
|
b.DrawBox(896.,-500.,1535.,4500.); |
| 944 |
|
b.DrawBox(2024.,-500.,2280.,4500.); |
| 945 |
} |
} |
| 946 |
else if(nn==8){ |
else if(nn==8){ |
| 947 |
b.SetFillColor(107); |
b.SetFillColor(107); |
| 951 |
else if(nn==9){ |
else if(nn==9){ |
| 952 |
b.SetFillColor(107); |
b.SetFillColor(107); |
| 953 |
b.SetFillStyle(3954); |
b.SetFillStyle(3954); |
| 954 |
|
b.DrawBox(0.,-500.,128.,4500.); |
| 955 |
b.DrawBox(256.,-500.,384.,4500.); |
b.DrawBox(256.,-500.,384.,4500.); |
| 956 |
|
b.DrawBox(512.,-500.,640.,4500.); |
| 957 |
|
b.DrawBox(896.,-500.,1024.,4500.); |
| 958 |
b.DrawBox(1280.,-500.,1535.,4500.); |
b.DrawBox(1280.,-500.,1535.,4500.); |
| 959 |
b.DrawBox(1792.,-500.,1920.,4500.); |
b.DrawBox(1664.,-500.,1920.,4500.); |
| 960 |
} |
} |
| 961 |
else if(nn==10){ |
else if(nn==10){ |
| 962 |
b.SetFillColor(107); |
b.SetFillColor(107); |
| 963 |
b.SetFillStyle(3954); |
b.SetFillStyle(3954); |
| 964 |
b.DrawBox(2048.,-500.,3070.,4500.); |
b.DrawBox(0.,-500.,512.,4500.); |
| 965 |
|
b.DrawBox(1024.,-500.,3070.,4500.); |
| 966 |
} |
} |
| 967 |
else if(nn==11){ |
else if(nn==11){ |
| 968 |
b.SetFillColor(6); |
b.SetFillColor(6); |
| 973 |
b.SetFillStyle(3954); |
b.SetFillStyle(3954); |
| 974 |
b.DrawBox(0.,-500.,512.,4500.); |
b.DrawBox(0.,-500.,512.,4500.); |
| 975 |
b.DrawBox(1920.,-500.,2560.,4500.); |
b.DrawBox(1920.,-500.,2560.,4500.); |
| 976 |
|
b.DrawBox(2816.,-500.,3070.,4500.); |
| 977 |
} |
} |
| 978 |
for(int va=1; va<24; va++){ |
for(int va=1; va<24; va++){ |
| 979 |
va1x=128*va; |
va1x=128*va; |