2 |
* FTrkCalibQLookExpert.cxx |
* FTrkCalibQLookExpert.cxx |
3 |
* |
* |
4 |
* autor: D.Fedele |
* autor: D.Fedele |
5 |
* version v1r14 |
* version v1r28 |
6 |
* Parameters: |
* Parameters: |
7 |
* file - the data file to analyze |
* file - the data file to analyze |
8 |
* step - select =1 in order to analyze one event at time |
* step - select =1 in order to analyze one event at time |
77 |
Int_t nevents=0; |
Int_t nevents=0; |
78 |
Int_t minevent = 0; |
Int_t minevent = 0; |
79 |
Int_t maxevent = 0; |
Int_t maxevent = 0; |
80 |
ULong64_t FOBT[2]; |
ULong_t FOBT[2]; |
81 |
|
|
82 |
FOBT[0]=0; |
FOBT[0]=0; |
83 |
FOBT[1]=0; |
FOBT[1]=0; |
87 |
ctrk.good0[1]=0; |
ctrk.good0[1]=0; |
88 |
for(Int_t i=0;i<12;i++){ |
for(Int_t i=0;i<12;i++){ |
89 |
ctrk.daqmode[i]=0; |
ctrk.daqmode[i]=0; |
90 |
ctrk.dspnum[i]=100; |
ctrk.dspnum[i]=0; |
91 |
ctrk.calibnum[i]=0; |
ctrk.calibnum[i]=0; |
92 |
ctrk.ncalev[i]=0; |
ctrk.ncalev[i]=0; |
93 |
ctrk.calfl[i]=0; |
ctrk.calfl[i]=0; |
188 |
|
|
189 |
Int_t hcevent=hotr->GetEntries(); |
Int_t hcevent=hotr->GetEntries(); |
190 |
Int_t tcevent=totr->GetEntries(); |
Int_t tcevent=totr->GetEntries(); |
191 |
ULong64_t HOBT[hcevent], TOBT[tcevent]; |
ULong_t HOBT[hcevent], TOBT[tcevent]; |
192 |
for (Int_t i = 0; i < hcevent; i++){ |
for (Int_t i = 0; i < hcevent; i++){ |
193 |
hotr->GetEntry(i); |
hotr->GetEntry(i); |
194 |
ph = eh4->GetPscuHeader(); |
ph = eh4->GetPscuHeader(); |
273 |
|
|
274 |
// |
// |
275 |
// other variables definitions |
// other variables definitions |
276 |
|
|
277 |
Int_t risposta=0; |
Int_t risposta=0; |
278 |
stringstream fromfile; |
stringstream fromfile,isfile; |
279 |
|
|
280 |
fromfile<<"FTrkCalibQLook_EXPERT File: "<<ffile<<" -- CalibHeader OBT= "<<HOBT[(cod->Get(pctp->CalibHeader))-1]<<" -- Calib pkt OBT= "<<FOBT[0]<<" -- CalibTrailer OBT= "<<TOBT[(cod->Get(pctp->CalibTrailer))]<<" --"; |
fromfile<<"FTrkCalibQLook_EXPERT File: "<<ffile<<" -- CalibHeader OBT= "<<HOBT[(cod->Get(pctp->CalibHeader))-1]<<" -- Calib pkt OBT= "<<FOBT[0]<<" -- CalibTrailer OBT= "<<TOBT[(cod->Get(pctp->CalibTrailer))]<<" --"; |
281 |
|
|
305 |
Int_t canvasy=900; |
Int_t canvasy=900; |
306 |
TCanvas *c1 = new TCanvas("c1","FTrkCalibQLook_EXPERT_ped",canvasx,canvasy); |
TCanvas *c1 = new TCanvas("c1","FTrkCalibQLook_EXPERT_ped",canvasx,canvasy); |
307 |
c1->SetFillColor(10); |
c1->SetFillColor(10); |
308 |
tzz->DrawLatex(.01,0.98,fromfile.str().c_str()); |
tzz->DrawLatex(.01,.98,fromfile.str().c_str()); |
309 |
tzz->DrawLatex(.90,0.98,"PEDESTAL"); |
tzz->DrawLatex(.90,.98,"PEDESTAL"); |
310 |
|
|
311 |
|
isfile<<"Boxes so colored point out chips broken before the launch and never resumed"; |
312 |
|
tzz->SetTextColor(6); |
313 |
|
tzz->SetTextSize(0.018); |
314 |
|
tzz->DrawLatex(.5,.96,isfile.str().c_str()); |
315 |
|
isfile.str(""); |
316 |
|
|
317 |
|
isfile<<"Boxes so colored point out anomalous chips (not necessarily broken)"; |
318 |
|
tzz->SetTextColor(107); |
319 |
|
tzz->DrawLatex(.05,.96,isfile.str().c_str()); |
320 |
|
isfile.str(""); |
321 |
|
|
322 |
TCanvas *c2 = new TCanvas("c2","FTrkCalibQLook_EXPERT_sig",canvasx,canvasy); |
TCanvas *c2 = new TCanvas("c2","FTrkCalibQLook_EXPERT_sig",canvasx,canvasy); |
323 |
c2->SetFillColor(10); |
c2->SetFillColor(10); |
324 |
tzz->DrawLatex(.01,0.98,fromfile.str().c_str()); |
tzz->SetTextColor(1); |
325 |
tzz->DrawLatex(.90,0.98,"SIGMA"); |
tzz->DrawLatex(.01,.98,fromfile.str().c_str()); |
326 |
|
tzz->DrawLatex(.90,.98,"SIGMA"); |
327 |
|
|
328 |
|
isfile<<"Boxes so colored point out chips broken before the launch and never resumed"; |
329 |
|
tzz->SetTextColor(6); |
330 |
|
tzz->SetTextSize(0.018); |
331 |
|
tzz->DrawLatex(.5,.96,isfile.str().c_str()); |
332 |
|
isfile.str(""); |
333 |
|
|
334 |
|
isfile<<"Boxes so colored point out anomalous chips (not necessarily broken)"; |
335 |
|
tzz->SetTextColor(107); |
336 |
|
tzz->DrawLatex(.05,.96,isfile.str().c_str()); |
337 |
|
isfile.str(""); |
338 |
|
|
339 |
|
|
340 |
TCanvas *sig=new TCanvas("sig","FTrkCalibQLook_EXPERT_histosig",canvasx,canvasy); |
TCanvas *sig=new TCanvas("sig","FTrkCalibQLook_EXPERT_histosig",canvasx,canvasy); |
341 |
sig->SetFillColor(10); |
sig->SetFillColor(10); |
342 |
tzz->DrawLatex(.01,0.98,fromfile.str().c_str()); |
tzz->SetTextColor(1); |
343 |
tzz->DrawLatex(.85,0.97,"Histograms of the sigmas"); |
tzz->DrawLatex(.01,.98,fromfile.str().c_str()); |
344 |
|
tzz->DrawLatex(.85,.97,"Histograms of the sigmas"); |
345 |
|
|
346 |
|
|
347 |
|
|
444 |
for(Int_t n = 0; n<12; n++){ |
for(Int_t n = 0; n<12; n++){ |
445 |
if(ctrk.ncalev[n]==0 && ctrk.calfl[n]==0)calok = 1;//GOOD |
if(ctrk.ncalev[n]==0 && ctrk.calfl[n]==0)calok = 1;//GOOD |
446 |
|
|
447 |
if(ctrk.dspnum[n]>13) |
if(ctrk.dspnum[n]==0) |
448 |
continue; |
continue; |
449 |
|
|
450 |
nn=ctrk.dspnum[n]-1; |
nn=ctrk.dspnum[n]-1; |
532 |
histoaped[nn]->Fill(1025,ctrk.ped2[n]); |
histoaped[nn]->Fill(1025,ctrk.ped2[n]); |
533 |
histoaped[nn]->Fill(2049,ctrk.ped3[n]); |
histoaped[nn]->Fill(2049,ctrk.ped3[n]); |
534 |
/******************************************************/ |
/******************************************************/ |
535 |
|
|
536 |
TLine li; |
TLine li,liva1; |
537 |
li.SetLineColor(38); |
li.SetLineColor(38); |
538 |
li.SetLineStyle(3); |
li.SetLineStyle(4); |
539 |
li.SetLineWidth(2); |
li.SetLineWidth(2); |
540 |
|
liva1.SetLineColor(42); |
541 |
Float_t maxhist=0; |
liva1.SetLineStyle(3); |
542 |
|
liva1.SetLineWidth(1); |
543 |
|
|
544 |
|
Float_t maxhist=0,va1x=0; |
545 |
TBox b; |
TBox b; |
546 |
/* plot PEDESTAL */ |
/* plot PEDESTAL */ |
547 |
c1->cd(); |
c1->cd(); |
562 |
histoaped[nn]->SetLineWidth(1); |
histoaped[nn]->SetLineWidth(1); |
563 |
// if(ctrk.good0[0]==1 && ctrk.good0[1]==1){ |
// if(ctrk.good0[0]==1 && ctrk.good0[1]==1){ |
564 |
histoped[nn]->Draw("b"); |
histoped[nn]->Draw("b"); |
565 |
if(nn==1){ |
maxhist=histoped[nn]->GetMaximum(); |
566 |
maxhist=histoped[nn]->GetMaximum(); |
if(nn==0){ |
567 |
|
b.SetFillColor(107); |
568 |
|
b.SetFillStyle(3945); |
569 |
|
b.DrawBox(256.,2200.,384.,maxhist); |
570 |
|
b.DrawBox(768.,2200.,2047.,maxhist); |
571 |
|
} |
572 |
|
else if(nn==1){ |
573 |
b.SetFillColor(6); |
b.SetFillColor(6); |
574 |
b.SetFillStyle(3945); |
b.SetFillStyle(3945); |
575 |
b.DrawBox(2944.,700.,3060.,maxhist); |
b.DrawBox(2944.,700.,3060.,maxhist); |
576 |
|
|
577 |
b.SetFillColor(107); |
b.SetFillColor(107); |
578 |
b.SetFillStyle(3954); |
b.SetFillStyle(3954); |
579 |
|
b.DrawBox(384.,700.,512.,maxhist); |
580 |
|
b.DrawBox(896.,700.,1024.,maxhist); |
581 |
|
b.DrawBox(2048.,700.,2432.,maxhist); |
582 |
b.DrawBox(2816.,700.,2944.,maxhist); |
b.DrawBox(2816.,700.,2944.,maxhist); |
583 |
b.DrawBox(2048.,700.,2176.,maxhist); |
} |
584 |
|
else if(nn==3){ |
585 |
|
b.SetFillColor(107); |
586 |
|
b.SetFillStyle(3954); |
587 |
|
b.DrawBox(2816.,700.,3070.,maxhist); |
588 |
} |
} |
589 |
else if(nn==4){ |
else if(nn==4){ |
|
maxhist=histoped[nn]->GetMaximum(); |
|
590 |
b.SetFillColor(107); |
b.SetFillColor(107); |
591 |
b.SetFillStyle(3954); |
b.SetFillStyle(3954); |
592 |
b.DrawBox(384.,2200.,512.,maxhist); |
b.DrawBox(256.,2200.,512.,maxhist); |
593 |
|
b.DrawBox(2816.,2200.,3070.,maxhist); |
594 |
|
} |
595 |
|
else if(nn==5){ |
596 |
|
b.SetFillColor(107); |
597 |
|
b.SetFillStyle(3954); |
598 |
|
b.DrawBox(896.,700.,1024.,maxhist); |
599 |
|
// b.DrawBox(1664.,0.,1792.,maxhist); |
600 |
} |
} |
601 |
else if(nn==6){ |
else if(nn==6){ |
|
maxhist=histoped[nn]->GetMaximum(); |
|
|
b.SetFillColor(6); |
|
|
b.SetFillStyle(3945); |
|
|
b.DrawBox(2560.,2200.,2816.,maxhist); |
|
|
b.DrawBox(1024.,2200.,1535.,maxhist); |
|
|
|
|
602 |
b.SetFillColor(107); |
b.SetFillColor(107); |
603 |
b.SetFillStyle(3954); |
b.SetFillStyle(3954); |
604 |
b.DrawBox(512.,2200.,768.,maxhist); |
b.DrawBox(512.,2200.,768.,maxhist); |
605 |
b.DrawBox(1536.,2200.,1792.,maxhist); |
b.DrawBox(1024.,2200.,1280.,maxhist); |
606 |
|
b.DrawBox(1280.,2200.,1792.,maxhist); |
607 |
|
b.DrawBox(2560.,2200.,2816.,maxhist); |
608 |
} |
} |
609 |
else if(nn==7){ |
else if(nn==7){ |
|
maxhist=histoped[nn]->GetMaximum(); |
|
610 |
b.SetFillColor(107); |
b.SetFillColor(107); |
611 |
b.SetFillStyle(3954); |
b.SetFillStyle(3954); |
612 |
b.DrawBox(512.,700.,768.,maxhist); |
b.DrawBox(512.,700.,768.,maxhist); |
613 |
|
b.DrawBox(896.,700.,1535.,maxhist); |
614 |
|
b.DrawBox(2024.,700.,2280.,maxhist); |
615 |
|
} |
616 |
|
else if(nn==8){ |
617 |
|
b.SetFillColor(107); |
618 |
|
b.SetFillStyle(3954); |
619 |
|
b.DrawBox(512.,2200.,768.,maxhist); |
620 |
} |
} |
621 |
else if(nn==9){ |
else if(nn==9){ |
|
maxhist=histoped[nn]->GetMaximum(); |
|
622 |
b.SetFillColor(107); |
b.SetFillColor(107); |
623 |
b.SetFillStyle(3954); |
b.SetFillStyle(3954); |
624 |
|
b.DrawBox(0.,700.,128.,maxhist); |
625 |
b.DrawBox(256.,700.,384.,maxhist); |
b.DrawBox(256.,700.,384.,maxhist); |
626 |
|
b.DrawBox(512.,700.,640.,maxhist); |
627 |
|
b.DrawBox(896.,700.,1024.,maxhist); |
628 |
|
b.DrawBox(1280.,700.,1535.,maxhist); |
629 |
|
b.DrawBox(1664.,700.,1920.,maxhist); |
630 |
|
} |
631 |
|
else if(nn==10){ |
632 |
|
b.SetFillColor(107); |
633 |
|
b.SetFillStyle(3954); |
634 |
|
b.DrawBox(0.,2200.,512.,maxhist); |
635 |
|
b.DrawBox(1024.,2200.,3070.,maxhist); |
636 |
} |
} |
637 |
else if(nn==11){ |
else if(nn==11){ |
|
maxhist=histoped[nn]->GetMaximum(); |
|
638 |
b.SetFillColor(6); |
b.SetFillColor(6); |
639 |
b.SetFillStyle(3945); |
b.SetFillStyle(3945); |
640 |
b.DrawBox(768.,700.,1024.,maxhist); |
b.DrawBox(768.,700.,1024.,maxhist); |
643 |
b.SetFillStyle(3954); |
b.SetFillStyle(3954); |
644 |
b.DrawBox(0.,700.,512.,maxhist); |
b.DrawBox(0.,700.,512.,maxhist); |
645 |
b.DrawBox(1920.,700.,2560.,maxhist); |
b.DrawBox(1920.,700.,2560.,maxhist); |
646 |
|
b.DrawBox(2816.,700.,3070.,maxhist); |
647 |
} |
} |
648 |
// } |
// } |
649 |
// else histoped[nn]->Draw("axis"); |
// else histoped[nn]->Draw("axis"); |
650 |
histoaped[nn]->Draw("same"); |
histoaped[nn]->Draw("same"); |
651 |
if((nn+1)%2==1) { |
if((nn+1)%2==1) { |
652 |
li.DrawLine(1024.5,2200,1024.5,3200); |
for(int va=1; va<24; va++){ |
653 |
li.DrawLine(2048.5,2200,2048.5,3200); |
va1x=128*va; |
654 |
|
liva1.DrawLine(va1x,2200.,va1x,3200.); |
655 |
|
} |
656 |
|
li.DrawLine(1024.5,2200.,1024.5,3200.); |
657 |
|
li.DrawLine(2048.5,2200.,2048.5,3200.); |
658 |
} |
} |
659 |
if((nn+1)%2==0) { |
if((nn+1)%2==0) { |
660 |
|
for(int va=1; va<24; va++){ |
661 |
|
va1x=128*va; |
662 |
|
liva1.DrawLine(va1x,700.,va1x,1700.); |
663 |
|
} |
664 |
li.DrawLine(1024.5,700,1024.5,1700); |
li.DrawLine(1024.5,700,1024.5,1700); |
665 |
li.DrawLine(2048.5,700,2048.5,1700); |
li.DrawLine(2048.5,700,2048.5,1700); |
666 |
} |
} |
688 |
histoasig[nn]->SetLineColor(5); |
histoasig[nn]->SetLineColor(5); |
689 |
histoasig[nn]->SetLineWidth(1); |
histoasig[nn]->SetLineWidth(1); |
690 |
// if(ctrk.good0[0]==1 && ctrk.good0[1]==1){ |
// if(ctrk.good0[0]==1 && ctrk.good0[1]==1){ |
691 |
histosig[nn]->Draw("b"); |
histosig[nn]->Draw("b"); |
692 |
if(nn==1){ |
maxhist=histosig[nn]->GetMaximum(); |
693 |
maxhist=histosig[nn]->GetMaximum(); |
if(nn==0){ |
694 |
|
b.SetFillColor(107); |
695 |
|
b.SetFillStyle(3945); |
696 |
|
b.DrawBox(256.,0.,384.,maxhist); |
697 |
|
b.DrawBox(768.,0.,2047.,maxhist); |
698 |
|
} |
699 |
|
else if(nn==1){ |
700 |
b.SetFillColor(6); |
b.SetFillColor(6); |
701 |
b.SetFillStyle(3945); |
b.SetFillStyle(3945); |
702 |
b.DrawBox(2944.,0.,3060.,maxhist); |
b.DrawBox(2944.,0.,3070.,maxhist); |
703 |
|
|
704 |
b.SetFillColor(107); |
b.SetFillColor(107); |
705 |
b.SetFillStyle(3954); |
b.SetFillStyle(3954); |
706 |
|
b.DrawBox(384.,0.,512.,maxhist); |
707 |
|
b.DrawBox(896.,0.,1024.,maxhist); |
708 |
|
b.DrawBox(2048.,0.,2432.,maxhist); |
709 |
b.DrawBox(2816.,0.,2944.,maxhist); |
b.DrawBox(2816.,0.,2944.,maxhist); |
710 |
b.DrawBox(2048.,0.,2176.,maxhist); |
} |
711 |
|
else if(nn==3){ |
712 |
|
b.SetFillColor(107); |
713 |
|
b.SetFillStyle(3954); |
714 |
|
b.DrawBox(2816.,0.,3070.,maxhist); |
715 |
} |
} |
716 |
else if(nn==4){ |
else if(nn==4){ |
|
maxhist=histosig[nn]->GetMaximum(); |
|
717 |
b.SetFillColor(107); |
b.SetFillColor(107); |
718 |
b.SetFillStyle(3954); |
b.SetFillStyle(3954); |
719 |
b.DrawBox(384.,0.,512.,maxhist); |
b.DrawBox(256.,0.,512.,maxhist); |
720 |
|
b.DrawBox(2816.,0.,3070.,maxhist); |
721 |
|
} |
722 |
|
else if(nn==5){ |
723 |
|
b.SetFillColor(107); |
724 |
|
b.SetFillStyle(3954); |
725 |
|
b.DrawBox(896.,0.,1024.,maxhist); |
726 |
|
// b.DrawBox(1664.,0.,1792.,maxhist); |
727 |
} |
} |
728 |
else if(nn==6){ |
else if(nn==6){ |
|
maxhist=histosig[nn]->GetMaximum(); |
|
|
b.SetFillColor(6); |
|
|
b.SetFillStyle(3945); |
|
|
b.DrawBox(2560.,0.,2816.,maxhist); |
|
|
b.DrawBox(1024.,0.,1535.,maxhist); |
|
|
|
|
729 |
b.SetFillColor(107); |
b.SetFillColor(107); |
730 |
b.SetFillStyle(3954); |
b.SetFillStyle(3954); |
731 |
b.DrawBox(512.,0.,768.,maxhist); |
b.DrawBox(512.,0.,768.,maxhist); |
732 |
b.DrawBox(1536.,0.,1792.,maxhist); |
b.DrawBox(1024.,0.,1280.,maxhist); |
733 |
|
b.DrawBox(1280.,0.,1792.,maxhist); |
734 |
|
b.DrawBox(2560.,0.,2816.,maxhist); |
735 |
} |
} |
736 |
else if(nn==7){ |
else if(nn==7){ |
737 |
maxhist=histosig[nn]->GetMaximum(); |
b.SetFillColor(107); |
738 |
|
b.SetFillStyle(3954); |
739 |
|
b.DrawBox(512.,0.,768.,maxhist); |
740 |
|
b.DrawBox(896.,0.,1535.,maxhist); |
741 |
|
b.DrawBox(2024.,0.,2280.,maxhist); |
742 |
|
} |
743 |
|
else if(nn==8){ |
744 |
b.SetFillColor(107); |
b.SetFillColor(107); |
745 |
b.SetFillStyle(3954); |
b.SetFillStyle(3954); |
746 |
b.DrawBox(512.,0.,768.,maxhist); |
b.DrawBox(512.,0.,768.,maxhist); |
747 |
} |
} |
748 |
else if(nn==9){ |
else if(nn==9){ |
|
maxhist=histosig[nn]->GetMaximum(); |
|
749 |
b.SetFillColor(107); |
b.SetFillColor(107); |
750 |
b.SetFillStyle(3954); |
b.SetFillStyle(3954); |
751 |
|
b.DrawBox(0.,0.,128.,maxhist); |
752 |
b.DrawBox(256.,0.,384.,maxhist); |
b.DrawBox(256.,0.,384.,maxhist); |
753 |
|
b.DrawBox(512.,0.,640.,maxhist); |
754 |
|
b.DrawBox(896.,0.,1024.,maxhist); |
755 |
|
b.DrawBox(1280.,0.,1535.,maxhist); |
756 |
|
b.DrawBox(1664.,0.,1920.,maxhist); |
757 |
|
} |
758 |
|
else if(nn==10){ |
759 |
|
b.SetFillColor(107); |
760 |
|
b.SetFillStyle(3954); |
761 |
|
b.DrawBox(0.,0.,512.,maxhist); |
762 |
|
b.DrawBox(1024.,0.,3070.,maxhist); |
763 |
} |
} |
764 |
else if(nn==11){ |
else if(nn==11){ |
|
maxhist=histosig[nn]->GetMaximum(); |
|
765 |
b.SetFillColor(6); |
b.SetFillColor(6); |
766 |
b.SetFillStyle(3945); |
b.SetFillStyle(3945); |
767 |
b.DrawBox(768.,0.,1024.,maxhist); |
b.DrawBox(768.,0.,1024.,maxhist); |
770 |
b.SetFillStyle(3954); |
b.SetFillStyle(3954); |
771 |
b.DrawBox(0.,0.,512.,maxhist); |
b.DrawBox(0.,0.,512.,maxhist); |
772 |
b.DrawBox(1920.,0.,2560.,maxhist); |
b.DrawBox(1920.,0.,2560.,maxhist); |
773 |
|
b.DrawBox(2816.,0.,3070.,maxhist); |
774 |
} |
} |
775 |
// } |
// } |
776 |
// else histosig[nn]->Draw("axis"); |
// else histosig[nn]->Draw("axis"); |
777 |
histoasig[nn]->Draw("same"); |
histoasig[nn]->Draw("same"); |
778 |
|
for(int va=1; va<24; va++){ |
779 |
|
va1x=128*va; |
780 |
|
liva1.DrawLine(va1x,0.,va1x,max); |
781 |
|
} |
782 |
li.DrawLine(1024.5,0,1024.5,max); |
li.DrawLine(1024.5,0,1024.5,max); |
783 |
li.DrawLine(2048.5,0,2048.5,max); |
li.DrawLine(2048.5,0,2048.5,max); |
784 |
|
c2->Update();//draw pads in canvas |
785 |
|
|
786 |
for(int ii=0;ii<3;ii++){ |
for(int ii=0;ii<3;ii++){ |
787 |
sig->cd(); |
sig->cd(); |