2 |
* FTrkQLook_EXPERT.cxx |
* FTrkQLook_EXPERT.cxx |
3 |
* |
* |
4 |
* autor: D.Fedele |
* autor: D.Fedele |
5 |
* version v1r12 |
* version v1r15 |
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 |
145 |
// information about the RunHeader |
// information about the RunHeader |
146 |
ULong64_t HOBT[neventH]; |
ULong64_t HOBT[neventH]; |
147 |
Int_t trk_cal_us[neventH]; |
Int_t trk_cal_us[neventH]; |
148 |
|
ULong_t acq_info[neventH]; |
149 |
Int_t countnboot=1; |
Int_t countnboot=1; |
150 |
for (Int_t vi=0; vi<neventH;vi++){ |
for (Int_t vi=0; vi<neventH;vi++){ |
151 |
HOBT[vi]=0; |
HOBT[vi]=0; |
152 |
trk_cal_us[vi]=0; |
trk_cal_us[vi]=0; |
153 |
|
acq_info[vi]=0; |
154 |
} |
} |
155 |
for (Int_t ev=0; ev<neventH; ev++){ |
for (Int_t ev=0; ev<neventH; ev++){ |
156 |
otr->GetEntry(ev); |
otr->GetEntry(ev); |
157 |
pH = eH->GetPscuHeader(); |
pH = eH->GetPscuHeader(); |
158 |
HOBT[ev]= pH->GetOrbitalTime(); |
HOBT[ev]= pH->GetOrbitalTime(); |
159 |
trk_cal_us[ev]=reh->TRK_CALIB_USED; |
trk_cal_us[ev]=reh->TRK_CALIB_USED; |
160 |
|
acq_info[ev]=reh->ACQ_BUILD_INFO; |
161 |
if((HOBT[ev]<HOBT[ev-1]) && ev>0) |
if((HOBT[ev]<HOBT[ev-1]) && ev>0) |
162 |
countnboot+=1; |
countnboot+=1; |
163 |
} |
} |
164 |
countnboot+=(Int_t)(2*nevent/MAXSTORAGE); |
countnboot+=(Int_t)(2*nevent/MAXSTORAGE); |
165 |
// printf("\ncountnboot=%d\n",countnboot); |
// printf("\ncountnboot=%d\n",countnboot); |
166 |
|
|
|
|
|
167 |
// |
// |
168 |
// other variables definitions |
// other variables definitions |
169 |
stringstream oss1,oss2,oss3,oss4,fromfile,isfile,tit; |
stringstream oss1,oss2,oss3,oss4,fromfile,isfile,tit; |
369 |
|
|
370 |
|
|
371 |
Int_t minev=minevent,maxev=maxevent,countTEMP=0,countMAG=0; |
Int_t minev=minevent,maxev=maxevent,countTEMP=0,countMAG=0; |
372 |
|
ULong_t countALARMx=0,countALARMy=0; |
373 |
|
|
374 |
// |
// |
375 |
// Fill temperature graphs |
// Fill temperature graphs |
445 |
break; |
break; |
446 |
} |
} |
447 |
else{ |
else{ |
448 |
tempt_tmp[v]=(Double_t)((Int_t)(((3.3*tempt[ev][i]/4096)-0.586)/0.0231)); |
tempt_tmp[v]=(Double_t)((Int_t)(((3.3*tempt[ev][i]/4096)-0.586)/0.0231)); |
449 |
if(tempt_tmp[v]>100) { |
if(tempt_tmp[v]>100) { |
450 |
tempt_tmp[v]=28.5; |
tempt_tmp[v]=28.5; |
451 |
tempt_tmpw[vv]=28.5; |
tempt_tmpw[vv]=28.5; |
452 |
xt_tmpw[vv++]=(Double_t)xt[ev]; |
xt_tmpw[vv++]=(Double_t)xt[ev]; |
453 |
} |
} |
454 |
else if(tempt_tmp[v]<0){ |
else if(tempt_tmp[v]<0){ |
455 |
tempt_tmp[v]=25.5; |
tempt_tmp[v]=25.5; |
456 |
tempt_tmpw[vv]=25.5; |
tempt_tmpw[vv]=25.5; |
457 |
xt_tmpw[vv++]=(Double_t)xt[ev]; |
xt_tmpw[vv++]=(Double_t)xt[ev]; |
458 |
} |
} |
459 |
xt_tmp[v++]=(Double_t)xt[ev]; |
xt_tmp[v++]=(Double_t)xt[ev]; |
460 |
} |
} |
461 |
} |
} |
462 |
TempCanv[ii]->cd(); |
TempCanv[ii]->cd(); |
466 |
pad6[i]->cd(); |
pad6[i]->cd(); |
467 |
temp[i][ii]= new TGraph(v,xt_tmp,tempt_tmp); |
temp[i][ii]= new TGraph(v,xt_tmp,tempt_tmp); |
468 |
temp[i][ii]->SetTitle(tit.str().c_str()); |
temp[i][ii]->SetTitle(tit.str().c_str()); |
469 |
if(v==1) temp[i][ii]->GetXaxis()->SetNdivisions(502,kTRUE); |
if(v==1) temp[i][ii]->GetXaxis()->SetNdivisions(-501); |
470 |
temp[i][ii]->GetXaxis()->SetLabelSize(0.04); |
temp[i][ii]->GetXaxis()->SetLabelSize(0.04); |
471 |
temp[i][ii]->GetXaxis()->SetTitleSize(0.04); |
temp[i][ii]->GetXaxis()->SetTitleSize(0.04); |
472 |
temp[i][ii]->GetXaxis()->SetTitle("OBT (ms)"); |
temp[i][ii]->GetXaxis()->SetTitle("OBT (ms)"); |
575 |
pad7[i]->cd(); |
pad7[i]->cd(); |
576 |
mag[i][ii]= new TGraph(v,xb_tmp,magt_tmp); |
mag[i][ii]= new TGraph(v,xb_tmp,magt_tmp); |
577 |
mag[i][ii]->SetTitle(tit.str().c_str()); |
mag[i][ii]->SetTitle(tit.str().c_str()); |
578 |
mag[i][ii]->GetXaxis()->SetNdivisions(502,kTRUE); |
if(v==1) mag[i][ii]->GetXaxis()->SetNdivisions(-501); |
579 |
mag[i][ii]->GetXaxis()->SetLabelSize(0.04); |
mag[i][ii]->GetXaxis()->SetLabelSize(0.04); |
580 |
mag[i][ii]->GetXaxis()->SetTitleSize(0.04); |
mag[i][ii]->GetXaxis()->SetTitleSize(0.04); |
581 |
mag[i][ii]->GetXaxis()->SetTitle("OBT (ms)"); |
mag[i][ii]->GetXaxis()->SetTitle("OBT (ms)"); |
582 |
mag[i][ii]->GetXaxis()->CenterTitle(); |
mag[i][ii]->GetXaxis()->CenterTitle(); |
583 |
mag[i][ii]->GetXaxis()->SetTitleOffset(0.85); |
mag[i][ii]->GetXaxis()->SetTitleOffset(0.85); |
584 |
if(i!=4) mag[i][ii]->GetYaxis()->SetRangeUser(2047,2058); |
if(i!=4) mag[i][ii]->GetYaxis()->SetRangeUser(2047,2058); |
585 |
else mag[i][ii]->GetYaxis()->SetRangeUser(2060,2067); |
else mag[i][ii]->GetYaxis()->SetRangeUser(2059,2067); |
586 |
mag[i][ii]->GetYaxis()->SetTitleOffset(1.2); |
mag[i][ii]->GetYaxis()->SetTitleOffset(1.2); |
587 |
mag[i][ii]->GetYaxis()->SetLabelOffset(0.001); |
mag[i][ii]->GetYaxis()->SetLabelOffset(0.001); |
588 |
mag[i][ii]->GetYaxis()->SetLabelSize(0.03); |
mag[i][ii]->GetYaxis()->SetLabelSize(0.03); |
601 |
ma<<"maximum recorded value"; |
ma<<"maximum recorded value"; |
602 |
t->SetTextSize(0.1); |
t->SetTextSize(0.1); |
603 |
switch(i){ |
switch(i){ |
604 |
case 0: |
case 0: |
605 |
li.DrawLine(min,2054.,max,2054.); |
li.DrawLine(min,2054.,max,2054.); |
606 |
li.DrawLine(min,2048.,max,2048.); |
li.DrawLine(min,2048.,max,2048.); |
607 |
t1->DrawLatex(xlat,2054.3,ma.str().c_str()); |
t1->DrawLatex(xlat,2054.3,ma.str().c_str()); |
608 |
t1->DrawLatex(xlat,2047.7,mi.str().c_str()); |
t1->DrawLatex(xlat,2047.7,mi.str().c_str()); |
609 |
break; |
break; |
610 |
|
|
611 |
case 1: |
case 1: |
612 |
li.DrawLine(min,2055.,max,2055.); |
li.DrawLine(min,2055.,max,2055.); |
613 |
li.DrawLine(min,2050.,max,2050.); |
li.DrawLine(min,2050.,max,2050.); |
614 |
t1->DrawLatex(xlat,2055.3,ma.str().c_str()); |
t1->DrawLatex(xlat,2055.3,ma.str().c_str()); |
615 |
t1->DrawLatex(xlat,2049.7,mi.str().c_str()); |
t1->DrawLatex(xlat,2049.7,mi.str().c_str()); |
616 |
break; |
break; |
617 |
|
|
618 |
case 2: |
case 2: |
619 |
li.DrawLine(min,2056.,max,2056.); |
li.DrawLine(min,2056.,max,2056.); |
620 |
li.DrawLine(min,2051.,max,2051.); |
li.DrawLine(min,2051.,max,2051.); |
621 |
t1->DrawLatex(xlat,2056.3,ma.str().c_str()); |
t1->DrawLatex(xlat,2056.3,ma.str().c_str()); |
622 |
t1->DrawLatex(xlat,2050.7,mi.str().c_str()); |
t1->DrawLatex(xlat,2050.7,mi.str().c_str()); |
623 |
break; |
break; |
624 |
|
|
625 |
case 3: |
case 3: |
626 |
li.DrawLine(min,2057.,max,2057.); |
li.DrawLine(min,2057.,max,2057.); |
627 |
li.DrawLine(min,2052.,max,2052.); |
li.DrawLine(min,2052.,max,2052.); |
628 |
t1->DrawLatex(xlat,2057.3,ma.str().c_str()); |
t1->DrawLatex(xlat,2057.3,ma.str().c_str()); |
629 |
t1->DrawLatex(xlat,2051.7,mi.str().c_str()); |
t1->DrawLatex(xlat,2051.7,mi.str().c_str()); |
630 |
break; |
break; |
631 |
|
|
632 |
case 4: |
case 4: |
633 |
li.DrawLine(min,2066.,max,2066.); |
li.DrawLine(min,2066.,max,2066.); |
634 |
li.DrawLine(min,2061.,max,2061.); |
li.DrawLine(min,2060.,max,2060.); |
635 |
t1->DrawLatex(xlat,2066.15,ma.str().c_str()); |
t1->DrawLatex(xlat,2066.15,ma.str().c_str()); |
636 |
t1->DrawLatex(xlat,2060.85,mi.str().c_str()); |
t1->DrawLatex(xlat,2059.85,mi.str().c_str()); |
637 |
break; |
break; |
638 |
|
|
639 |
} |
} |
640 |
BfieldCanv[ii]->Update(); |
BfieldCanv[ii]->Update(); |
747 |
else{ |
else{ |
748 |
x[(ev-minev)]= ph->GetOrbitalTime(); |
x[(ev-minev)]= ph->GetOrbitalTime(); |
749 |
ALARM=0; |
ALARM=0; |
|
|
|
750 |
Int_t dsp=0; |
Int_t dsp=0; |
751 |
for(Int_t i=0; i<12; i++){ |
Int_t noacq=0; |
752 |
if(te->DSPnumber[i]<1 || te->DSPnumber[i]>12) { |
Int_t acq_dsp[12]; |
753 |
ALARM=1; |
ULong_t acq_info_tmp=0; |
754 |
break; |
if(cod->Get(pctp->RunHeader)>0) acq_info_tmp=acq_info[cod->Get(pctp->RunHeader)-1]; |
755 |
} |
else acq_info_tmp=acq_info[cod->Get(pctp->RunHeader)]; |
756 |
|
for(Int_t io=0;io<12;io++){ |
757 |
|
acq_dsp[dsp]=(acq_info_tmp>>(12+io))&(~(~0<<1)); |
758 |
|
if(((acq_info_tmp>>(12+io))&(~(~0<<1)))==0) |
759 |
|
noacq+=1; |
760 |
|
WARNING[io]=0; |
761 |
|
} |
762 |
|
|
763 |
dsp=te->DSPnumber[i]-1; |
for(Int_t i=0; i<12; i++){ |
|
yc[(ev-minev)][dsp]= 0.051*te->compressiontime[i]; |
|
764 |
|
|
765 |
// |
if(i<12-noacq){ |
766 |
// Fill Cluster Signal and Lighting of the view histos |
if(te->DSPnumber[i]<1 || te->DSPnumber[i]>12) { |
767 |
for(Int_t j=0;j<3;j++){ |
ALARM=1; |
768 |
if(te->signcluster[i][j]!=0){ |
break; |
769 |
if((te->addrcluster[i][j]>6 && te->addrcluster[i][j]<505) ||(te->addrcluster[i][j]>518 && te->addrcluster[i][j]<1018)){ |
} |
770 |
illuminazione[dsp]->Fill((Float_t)((j*1024.)+te->addrcluster[i][j])); |
|
771 |
|
dsp=te->DSPnumber[i]-1; |
772 |
|
yc[(ev-minev)][dsp]= 0.051*te->compressiontime[i]; |
773 |
|
|
774 |
|
// |
775 |
|
// Fill Cluster Signal and Lighting of the view histos |
776 |
|
for(Int_t j=0;j<3;j++){ |
777 |
|
if(te->signcluster[i][j]!=0){ |
778 |
|
if((te->addrcluster[i][j]>6 && te->addrcluster[i][j]<505) ||(te->addrcluster[i][j]>518 && te->addrcluster[i][j]<1018)){ |
779 |
|
illuminazione[dsp]->Fill((Float_t)((j*1024.)+te->addrcluster[i][j])); |
780 |
|
} |
781 |
} |
} |
782 |
} |
} |
783 |
} |
if(trk_cal_us[cod->Get(pctp->RunHeader)]!=104){ |
784 |
if(trk_cal_us[cod->Get(pctp->RunHeader)]!=104){ |
if(!(dsp%2)){ |
785 |
if(!(dsp%2)){ |
if(te->signcluster[i][0]!=0) landau1[dsp]->Fill((Float_t)(1024.-te->signcluster[i][0])); |
786 |
if(te->signcluster[i][0]!=0) landau1[dsp]->Fill((Float_t)(1024.-te->signcluster[i][0])); |
if(te->signcluster[i][1]!=0) landau2[dsp]->Fill((Float_t)(1024.-te->signcluster[i][1])); |
787 |
if(te->signcluster[i][1]!=0) landau2[dsp]->Fill((Float_t)(1024.-te->signcluster[i][1])); |
if(te->signcluster[i][2]!=0) landau3[dsp]->Fill((Float_t)(1024.-te->signcluster[i][2])); |
788 |
if(te->signcluster[i][2]!=0) landau3[dsp]->Fill((Float_t)(1024.-te->signcluster[i][2])); |
} |
789 |
} |
else{ |
790 |
else{ |
if(te->signcluster[i][0]!=0) landau1[dsp]->Fill((Float_t)te->signcluster[i][0]); |
791 |
if(te->signcluster[i][0]!=0) landau1[dsp]->Fill((Float_t)te->signcluster[i][0]); |
if(te->signcluster[i][1]!=0) landau2[dsp]->Fill((Float_t)te->signcluster[i][1]); |
792 |
if(te->signcluster[i][1]!=0) landau2[dsp]->Fill((Float_t)te->signcluster[i][1]); |
if(te->signcluster[i][2]!=0) landau3[dsp]->Fill((Float_t)te->signcluster[i][2]); |
793 |
if(te->signcluster[i][2]!=0) landau3[dsp]->Fill((Float_t)te->signcluster[i][2]); |
} |
794 |
} |
} |
|
} |
|
795 |
|
|
796 |
WARNING[i]=0; |
WARNING[i]=0; |
797 |
if(te->fc[i]!=0 || te->fl1[i]!=0 || te->fl2[i]!=0 || te->fl3[i]!=0 || te->fl4[i]!=0 || te->fl5[i]!=0 || te->fl6[i]!=0){ |
if(te->fc[i]!=0 || te->fl1[i]!=0 || te->fl2[i]!=0 || te->fl3[i]!=0 || te->fl4[i]!=0 || te->fl5[i]!=0 || te->fl6[i]!=0){ |
798 |
ALARM = 1; //general alarm |
ALARM = 1; //general alarm |
799 |
WARNING[i] = 1; // DSP warning |
WARNING[i] = 1; // DSP warning |
800 |
}; |
}; |
801 |
|
|
802 |
if(te->alarm[i]!=0){ // hardware alarm |
if(dsp%2==0 && te->alarm[i]!=0){ // hardware alarm |
803 |
ALARM = 1; |
if(countALARMy==0) |
804 |
}; |
ALARM = 1; |
805 |
|
countALARMy+=1; |
806 |
|
}; |
807 |
|
|
808 |
|
if(dsp%2==1 && te->alarm[i]!=0){ // hardware alarm |
809 |
|
if(countALARMx==0) |
810 |
|
ALARM = 1; |
811 |
|
countALARMx+=1; |
812 |
|
}; |
813 |
|
|
814 |
//************************************************************************************** |
//************************************************************************************** |
815 |
// warning for internal number |
// warning for internal number |
816 |
//************************************************************************************** |
//************************************************************************************** |
817 |
if(i<=10 && te->eventn[i]!=te->eventn[i+1]) ALARM=1; |
if(ev==minev && i<=10 && te->eventn[i]!=te->eventn[i+1]) ALARM=1; |
818 |
if((ev-minev)>=1 && eventn[i]+1!=te->eventn[i] && te->eventn[i]!=1) ALARM=1; |
if((ev-minev)>=1 && eventn[i]+1!=te->eventn[i] && te->eventn[i]!=1) ALARM=1; |
819 |
|
} |
820 |
} |
} |
821 |
eventint[(ev-minev)]=te->eventn[0]; |
eventint[(ev-minev)]=te->eventn[0]; |
822 |
|
|
869 |
} |
} |
870 |
} |
} |
871 |
if(al==0) alarm << endl<< "Page "<<ii+1<< ": ------> NO ALARM!!! <-------"<<endl; |
if(al==0) alarm << endl<< "Page "<<ii+1<< ": ------> NO ALARM!!! <-------"<<endl; |
872 |
|
if(maxev==maxevent-1) { |
873 |
|
if(countALARMy!=0){ |
874 |
|
if(countALARMy%6!=0) alarm << endl<<endl<< "***** "<<countALARMy/6+1 <<" events with hardware alarm in Y-view *****"<<endl; |
875 |
|
else alarm << endl<<endl<< "***** "<<countALARMy/6 <<" events with hardware alarm in Y-view *****"<<endl; |
876 |
|
} |
877 |
|
if(countALARMx!=0){ |
878 |
|
if(countALARMx%6!=0) alarm << endl<<endl<< "***** "<<countALARMx/6+1 <<" events with hardware alarm in X-view *****"<<endl; |
879 |
|
else alarm << endl<<endl<< "***** "<<countALARMx/6 <<" events with hardware alarm in X-view *****"<<endl; |
880 |
|
} |
881 |
|
} |
882 |
|
|
883 |
// |
// |
884 |
// Draw the graphs |
// Draw the graphs |
1082 |
illuminazione[i]->GetXaxis()->SetTitle("strip with max signal"); |
illuminazione[i]->GetXaxis()->SetTitle("strip with max signal"); |
1083 |
illuminazione[i]->GetXaxis()->CenterTitle(); |
illuminazione[i]->GetXaxis()->CenterTitle(); |
1084 |
illuminazione[i]->Draw(""); |
illuminazione[i]->Draw(""); |
1085 |
if(i==1){ |
if(i==0){ |
1086 |
|
maxhist= illuminazione[i]->GetMaximum(); |
1087 |
|
b.SetFillColor(107); |
1088 |
|
b.SetFillStyle(3954); |
1089 |
|
b.DrawBox(768.,0.,2047.,maxhist); |
1090 |
|
} |
1091 |
|
else if(i==1){ |
1092 |
maxhist= illuminazione[i]->GetMaximum(); |
maxhist= illuminazione[i]->GetMaximum(); |
1093 |
b.SetFillColor(6); |
b.SetFillColor(6); |
1094 |
b.SetFillStyle(3945); |
b.SetFillStyle(3945); |
1123 |
b.SetFillStyle(3954); |
b.SetFillStyle(3954); |
1124 |
b.DrawBox(512.,0.,768.,maxhist); |
b.DrawBox(512.,0.,768.,maxhist); |
1125 |
} |
} |
1126 |
|
else if(i==9){ |
1127 |
|
maxhist=illuminazione[i]->GetMaximum(); |
1128 |
|
b.SetFillColor(107); |
1129 |
|
b.SetFillStyle(3954); |
1130 |
|
b.DrawBox(256.,0.,384.,maxhist); |
1131 |
|
} |
1132 |
else if(i==11){ |
else if(i==11){ |
1133 |
maxhist= illuminazione[i]->GetMaximum(); |
maxhist= illuminazione[i]->GetMaximum(); |
1134 |
b.SetFillColor(6); |
b.SetFillColor(6); |
1138 |
b.SetFillColor(107); |
b.SetFillColor(107); |
1139 |
b.SetFillStyle(3954); |
b.SetFillStyle(3954); |
1140 |
b.DrawBox(0.,0.,512.,maxhist); |
b.DrawBox(0.,0.,512.,maxhist); |
1141 |
b.DrawBox(1920.,0.,2048.,maxhist); |
b.DrawBox(1920.,0.,2560.,maxhist); |
|
b.DrawBox(2176.,0.,2304.,maxhist); |
|
1142 |
} |
} |
1143 |
IlluminaCanv->Update(); |
IlluminaCanv->Update(); |
1144 |
} |
} |