2 |
* FTrkQLook_EXPERT.cxx |
* FTrkQLook_EXPERT.cxx |
3 |
* |
* |
4 |
* autor: D.Fedele |
* autor: D.Fedele |
5 |
* version v1r10 |
* version v1r26 |
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 |
136 |
} else if (toevent > nevent) { |
} else if (toevent > nevent) { |
137 |
maxevent = nevent; |
maxevent = nevent; |
138 |
} else { |
} else { |
139 |
maxevent = toevent+1; |
maxevent = nevent; |
140 |
} |
} |
141 |
nevent=maxevent-minevent ; |
nevent=maxevent-minevent ; |
142 |
} |
} |
143 |
|
|
144 |
// |
// |
145 |
// information about the RunHeader |
// information about the RunHeader |
146 |
ULong64_t HOBT[neventH]; |
ULong_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; |
180 |
} |
} |
181 |
const Int_t tsize=maxsize; |
const Int_t tsize=maxsize; |
182 |
Int_t tempt[tsize][5]; |
Int_t tempt[tsize][5]; |
183 |
ULong64_t xt[tsize]; |
ULong_t xt[tsize]; |
184 |
|
|
185 |
Int_t cntpgtemp=1,cntpgdat=0,cntpgmag=0; |
Int_t cntpgtemp=1,cntpgdat=0,cntpgmag=0; |
186 |
// |
// |
212 |
} |
} |
213 |
const Int_t bsize=maxsize; |
const Int_t bsize=maxsize; |
214 |
Int_t magt[bsize][5]; |
Int_t magt[bsize][5]; |
215 |
ULong64_t xb[bsize]; |
ULong_t xb[bsize]; |
216 |
siztmp=0; |
siztmp=0; |
217 |
// |
// |
218 |
// information about the magnetic field |
// information about the magnetic field |
249 |
// write the file for the TrkAlarm packet |
// write the file for the TrkAlarm packet |
250 |
if(alnevent==0) alarm1 <<endl<< "------> NO ALARM!!! <-------"<< endl; |
if(alnevent==0) alarm1 <<endl<< "------> NO ALARM!!! <-------"<< endl; |
251 |
else{ |
else{ |
252 |
Long64_t obt=0; |
ULong_t obt=0; |
253 |
for (Int_t ev=0; ev<alnevent; ev++){ |
for (Int_t ev=0; ev<alnevent; ev++){ |
254 |
altr->GetEntry(ev); |
altr->GetEntry(ev); |
255 |
ph = aleh->GetPscuHeader(); |
ph = aleh->GetPscuHeader(); |
256 |
|
|
257 |
if(ph->GetOrbitalTime()<obt && ev>0) |
if((ULong_t)ph->GetOrbitalTime()<obt && ev>0) |
258 |
alarm1<<endl<<"NEW CPU BOOT"<<endl; |
alarm1<<endl<<"NEW CPU BOOT"<<endl; |
259 |
obt=ph->GetOrbitalTime(); |
obt=ph->GetOrbitalTime(); |
260 |
|
|
261 |
alarm1 << "================================================="<< endl; |
alarm1 << "================================================="<< endl; |
262 |
alarm1 << "PSCU-Pkt N. "<< ph->GetCounter() ; |
alarm1 << "PSCU-Pkt N. "<< ph->GetCounter() ; |
263 |
alarm1 << " - OBT "<< ph->GetOrbitalTime() << " ms"<<endl; |
alarm1 << " - OBT "<< (ULong_t)ph->GetOrbitalTime() << " ms"<<endl; |
264 |
alarm1 << "(ROOT-tree entry "<<ev<<")"<<endl; |
alarm1 << "(ROOT-tree entry "<<ev<<")"<<endl; |
265 |
alarm1 << "================================================="<< endl<<endl; |
alarm1 << "================================================="<< endl<<endl; |
266 |
|
|
267 |
alarm1 << "Alarm variables (range 0-1)"<<endl; |
alarm1 << "Alarm variables (range 0-1)"<<endl; |
268 |
alarm1 << " ALARM[1]= 0x"<< hex << (Int_t)al->ALARM[1]<<endl; |
alarm1 << " ALARM[1]= 0x"<< hex << (Int_t)al->ALARM[0]<<endl; |
269 |
alarm1 << " ALARM[2]= 0x"<< (Int_t)al->ALARM[2]<<endl; |
alarm1 << " ALARM[2]= 0x"<< (Int_t)al->ALARM[1]<<endl; |
270 |
alarm1 << " CmdDuringTrig= 0x"<< (Int_t)al->CmdDuringTrig<<endl; |
alarm1 << " CmdDuringTrig= 0x"<< (Int_t)al->CmdDuringTrig<<endl; |
271 |
alarm1 << " FinalCheck= 0x"<< (Int_t)al->FinalCheck<<endl; |
alarm1 << " FinalCheck= 0x"<< (Int_t)al->FinalCheck<<endl; |
272 |
alarm1 << " FlashData= 0x"<< (Int_t)al->FlashData<<endl; |
alarm1 << " FlashData= 0x"<< (Int_t)al->FlashData<<endl; |
366 |
|
|
367 |
TLatex *t=new TLatex(); |
TLatex *t=new TLatex(); |
368 |
TLatex *t1=new TLatex(); |
TLatex *t1=new TLatex(); |
|
|
|
369 |
|
|
370 |
|
TLine li,liva1; |
371 |
|
|
372 |
Int_t minev=minevent,maxev=maxevent,countTEMP=0,countMAG=0; |
Int_t minev=minevent,maxev=maxevent,countTEMP=0,countMAG=0; |
373 |
|
ULong_t countALARMx=0,countALARMy=0,countFC[12],countFL1[12],countFL2[12],countFL3[12],countFL4[12],countFL5[12],countFL6[12]; |
374 |
|
|
375 |
|
for(int i=0; i<12; i++){ |
376 |
|
countFC[i]=0; |
377 |
|
countFL1[i]=0; |
378 |
|
countFL2[i]=0; |
379 |
|
countFL3[i]=0; |
380 |
|
countFL4[i]=0; |
381 |
|
countFL5[i]=0; |
382 |
|
countFL6[i]=0; |
383 |
|
} |
384 |
|
|
385 |
// |
// |
386 |
// Fill temperature graphs |
// Fill temperature graphs |
456 |
break; |
break; |
457 |
} |
} |
458 |
else{ |
else{ |
459 |
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)); |
460 |
if(tempt_tmp[v]>100) { |
if(tempt_tmp[v]>100) { |
461 |
tempt_tmp[v]=28.5; |
tempt_tmp[v]=28.5; |
462 |
tempt_tmpw[vv]=28.5; |
tempt_tmpw[vv]=28.5; |
463 |
xt_tmpw[vv++]=(Double_t)xt[ev]; |
xt_tmpw[vv++]=(Double_t)xt[ev]; |
464 |
} |
} |
465 |
else if(tempt_tmp[v]<0){ |
else if(tempt_tmp[v]<0){ |
466 |
tempt_tmp[v]=25.5; |
tempt_tmp[v]=25.5; |
467 |
tempt_tmpw[vv]=25.5; |
tempt_tmpw[vv]=25.5; |
468 |
xt_tmpw[vv++]=(Double_t)xt[ev]; |
xt_tmpw[vv++]=(Double_t)xt[ev]; |
469 |
} |
} |
470 |
xt_tmp[v++]=(Double_t)xt[ev]; |
xt_tmp[v++]=(Double_t)xt[ev]; |
471 |
} |
} |
472 |
} |
} |
473 |
TempCanv[ii]->cd(); |
TempCanv[ii]->cd(); |
477 |
pad6[i]->cd(); |
pad6[i]->cd(); |
478 |
temp[i][ii]= new TGraph(v,xt_tmp,tempt_tmp); |
temp[i][ii]= new TGraph(v,xt_tmp,tempt_tmp); |
479 |
temp[i][ii]->SetTitle(tit.str().c_str()); |
temp[i][ii]->SetTitle(tit.str().c_str()); |
480 |
|
if(v==1) temp[i][ii]->GetXaxis()->SetNdivisions(-501); |
481 |
temp[i][ii]->GetXaxis()->SetLabelSize(0.04); |
temp[i][ii]->GetXaxis()->SetLabelSize(0.04); |
482 |
temp[i][ii]->GetXaxis()->SetTitleSize(0.04); |
temp[i][ii]->GetXaxis()->SetTitleSize(0.04); |
483 |
temp[i][ii]->GetXaxis()->SetTitle("OBT (ms)"); |
temp[i][ii]->GetXaxis()->SetTitle("OBT (ms)"); |
534 |
t1->DrawLatex(70.,98.7,isfile.str().c_str()); |
t1->DrawLatex(70.,98.7,isfile.str().c_str()); |
535 |
isfile.str(""); |
isfile.str(""); |
536 |
|
|
|
TLine li; |
|
537 |
li.SetLineStyle(1); |
li.SetLineStyle(1); |
538 |
li.SetLineWidth(1); |
li.SetLineWidth(1); |
539 |
li.SetLineColor(190); |
li.SetLineColor(190); |
585 |
pad7[i]->cd(); |
pad7[i]->cd(); |
586 |
mag[i][ii]= new TGraph(v,xb_tmp,magt_tmp); |
mag[i][ii]= new TGraph(v,xb_tmp,magt_tmp); |
587 |
mag[i][ii]->SetTitle(tit.str().c_str()); |
mag[i][ii]->SetTitle(tit.str().c_str()); |
588 |
mag[i][ii]->GetXaxis()->SetNdivisions(502,kTRUE); |
if(v==1) mag[i][ii]->GetXaxis()->SetNdivisions(-501); |
589 |
mag[i][ii]->GetXaxis()->SetLabelSize(0.04); |
mag[i][ii]->GetXaxis()->SetLabelSize(0.04); |
590 |
mag[i][ii]->GetXaxis()->SetTitleSize(0.04); |
mag[i][ii]->GetXaxis()->SetTitleSize(0.04); |
591 |
mag[i][ii]->GetXaxis()->SetTitle("OBT (ms)"); |
mag[i][ii]->GetXaxis()->SetTitle("OBT (ms)"); |
592 |
mag[i][ii]->GetXaxis()->CenterTitle(); |
mag[i][ii]->GetXaxis()->CenterTitle(); |
593 |
mag[i][ii]->GetXaxis()->SetTitleOffset(0.85); |
mag[i][ii]->GetXaxis()->SetTitleOffset(0.85); |
594 |
if(i!=4) mag[i][ii]->GetYaxis()->SetRangeUser(2047,2058); |
if(i!=4) mag[i][ii]->GetYaxis()->SetRangeUser(2047,2058); |
595 |
else mag[i][ii]->GetYaxis()->SetRangeUser(2060,2066); |
else mag[i][ii]->GetYaxis()->SetRangeUser(2059,2067); |
596 |
mag[i][ii]->GetYaxis()->SetTitleOffset(1.2); |
mag[i][ii]->GetYaxis()->SetTitleOffset(1.2); |
597 |
mag[i][ii]->GetYaxis()->SetLabelOffset(0.001); |
mag[i][ii]->GetYaxis()->SetLabelOffset(0.001); |
598 |
mag[i][ii]->GetYaxis()->SetLabelSize(0.03); |
mag[i][ii]->GetYaxis()->SetLabelSize(0.03); |
611 |
ma<<"maximum recorded value"; |
ma<<"maximum recorded value"; |
612 |
t->SetTextSize(0.1); |
t->SetTextSize(0.1); |
613 |
switch(i){ |
switch(i){ |
614 |
case 0: |
case 0: |
615 |
li.DrawLine(min,2054.,max,2054.); |
li.DrawLine(min,2054.,max,2054.); |
616 |
li.DrawLine(min,2048.,max,2048.); |
li.DrawLine(min,2048.,max,2048.); |
617 |
t1->DrawLatex(xlat,2054.3,ma.str().c_str()); |
t1->DrawLatex(xlat,2054.3,ma.str().c_str()); |
618 |
t1->DrawLatex(xlat,2047.7,mi.str().c_str()); |
t1->DrawLatex(xlat,2047.7,mi.str().c_str()); |
619 |
break; |
break; |
620 |
|
|
621 |
case 1: |
case 1: |
622 |
li.DrawLine(min,2055.,max,2055.); |
li.DrawLine(min,2055.,max,2055.); |
623 |
li.DrawLine(min,2050.,max,2050.); |
li.DrawLine(min,2050.,max,2050.); |
624 |
t1->DrawLatex(xlat,2055.3,ma.str().c_str()); |
t1->DrawLatex(xlat,2055.3,ma.str().c_str()); |
625 |
t1->DrawLatex(xlat,2049.7,mi.str().c_str()); |
t1->DrawLatex(xlat,2049.7,mi.str().c_str()); |
626 |
break; |
break; |
627 |
|
|
628 |
case 2: |
case 2: |
629 |
li.DrawLine(min,2056.,max,2056.); |
li.DrawLine(min,2056.,max,2056.); |
630 |
li.DrawLine(min,2051.,max,2051.); |
li.DrawLine(min,2051.,max,2051.); |
631 |
t1->DrawLatex(xlat,2056.3,ma.str().c_str()); |
t1->DrawLatex(xlat,2056.3,ma.str().c_str()); |
632 |
t1->DrawLatex(xlat,2050.7,mi.str().c_str()); |
t1->DrawLatex(xlat,2050.7,mi.str().c_str()); |
633 |
break; |
break; |
634 |
|
|
635 |
case 3: |
case 3: |
636 |
li.DrawLine(min,2057.,max,2057.); |
li.DrawLine(min,2057.,max,2057.); |
637 |
li.DrawLine(min,2052.,max,2052.); |
li.DrawLine(min,2052.,max,2052.); |
638 |
t1->DrawLatex(xlat,2057.3,ma.str().c_str()); |
t1->DrawLatex(xlat,2057.3,ma.str().c_str()); |
639 |
t1->DrawLatex(xlat,2051.7,mi.str().c_str()); |
t1->DrawLatex(xlat,2051.7,mi.str().c_str()); |
640 |
break; |
break; |
641 |
|
|
642 |
case 4: |
case 4: |
643 |
li.DrawLine(min,2065.,max,2065.); |
li.DrawLine(min,2066.,max,2066.); |
644 |
li.DrawLine(min,2061.,max,2061.); |
li.DrawLine(min,2060.,max,2060.); |
645 |
t1->DrawLatex(xlat,2065.15,ma.str().c_str()); |
t1->DrawLatex(xlat,2066.15,ma.str().c_str()); |
646 |
t1->DrawLatex(xlat,2060.85,mi.str().c_str()); |
t1->DrawLatex(xlat,2059.85,mi.str().c_str()); |
647 |
break; |
break; |
648 |
|
|
649 |
} |
} |
650 |
BfieldCanv[ii]->Update(); |
BfieldCanv[ii]->Update(); |
737 |
// and fill graphs and histos |
// and fill graphs and histos |
738 |
|
|
739 |
Int_t al=0; |
Int_t al=0; |
740 |
|
ULong_t obtx=0; |
741 |
Double_t x[MAXSTORAGE]; |
Double_t x[MAXSTORAGE]; |
742 |
Float_t yc[MAXSTORAGE][12]; |
Float_t yc[MAXSTORAGE][12]; |
743 |
Double_t eventint[MAXSTORAGE]; |
Double_t eventint[MAXSTORAGE]; |
751 |
|
|
752 |
if(ev==maxevent-1) maxev=maxevent-1; |
if(ev==maxevent-1) maxev=maxevent-1; |
753 |
|
|
754 |
if((ph->GetOrbitalTime()<x[ev-minev-1] && ev-minev!=0) || ev-minev==MAXSTORAGE){ |
if(((ULong_t)ph->GetOrbitalTime()<x[ev-minev-1] && ev-minev!=0) || ev-minev==MAXSTORAGE){ |
755 |
maxev=ev; |
maxev=ev; |
756 |
break; |
break; |
757 |
} |
} |
758 |
else{ |
else{ |
759 |
x[(ev-minev)]= ph->GetOrbitalTime(); |
obtx = ph->GetOrbitalTime(); |
760 |
|
x[(ev-minev)]=(Double_t)obtx; |
761 |
ALARM=0; |
ALARM=0; |
|
|
|
762 |
Int_t dsp=0; |
Int_t dsp=0; |
763 |
for(Int_t i=0; i<12; i++){ |
Int_t noacq=0; |
764 |
if(te->DSPnumber[i]<1 || te->DSPnumber[i]>12) { |
Int_t acq_dsp[12]; |
765 |
ALARM=1; |
ULong_t acq_info_tmp=0; |
766 |
break; |
if(cod->Get(pctp->RunHeader)>0) acq_info_tmp=acq_info[cod->Get(pctp->RunHeader)-1]; |
767 |
} |
else acq_info_tmp=acq_info[cod->Get(pctp->RunHeader)]; |
768 |
|
for(Int_t io=0;io<12;io++){ |
769 |
|
acq_dsp[dsp]=(acq_info_tmp>>(12+io))&(~(~0<<1)); |
770 |
|
if(((acq_info_tmp>>(12+io))&(~(~0<<1)))==0) |
771 |
|
noacq+=1; |
772 |
|
WARNING[io]=0; |
773 |
|
} |
774 |
|
|
775 |
dsp=te->DSPnumber[i]-1; |
for(Int_t i=0; i<12; i++){ |
|
yc[(ev-minev)][dsp]= 0.051*te->compressiontime[i]; |
|
776 |
|
|
777 |
// |
if(i<12-noacq){ |
778 |
// Fill Cluster Signal and Lighting of the view histos |
if(te->DSPnumber[i]<1 || te->DSPnumber[i]>12) { |
779 |
for(Int_t j=0;j<3;j++){ |
ALARM=1; |
780 |
if(te->signcluster[i][j]!=0){ |
break; |
781 |
if((te->addrcluster[i][j]>6 && te->addrcluster[i][j]<505) ||(te->addrcluster[i][j]>518 && te->addrcluster[i][j]<1018)){ |
} |
782 |
illuminazione[dsp]->Fill((Float_t)((j*1024.)+te->addrcluster[i][j])); |
|
783 |
|
dsp=te->DSPnumber[i]-1; |
784 |
|
yc[(ev-minev)][dsp]= 0.051*te->compressiontime[i]; |
785 |
|
|
786 |
|
// |
787 |
|
// Fill Cluster Signal and Lighting of the view histos |
788 |
|
for(Int_t j=0;j<3;j++){ |
789 |
|
if(te->signcluster[i][j]!=0){ |
790 |
|
if((te->addrcluster[i][j]>6 && te->addrcluster[i][j]<505) ||(te->addrcluster[i][j]>518 && te->addrcluster[i][j]<1018)){ |
791 |
|
illuminazione[dsp]->Fill((Float_t)((j*1024.)+te->addrcluster[i][j])); |
792 |
|
} |
793 |
} |
} |
794 |
} |
} |
795 |
} |
if(trk_cal_us[cod->Get(pctp->RunHeader)]!=104){ |
796 |
if(trk_cal_us[cod->Get(pctp->RunHeader)]!=104){ |
if(!(dsp%2)){ |
797 |
if(!(dsp%2)){ |
if(te->signcluster[i][0]!=0) landau1[dsp]->Fill((Float_t)(1024.-te->signcluster[i][0])); |
798 |
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])); |
799 |
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])); |
800 |
if(te->signcluster[i][2]!=0) landau3[dsp]->Fill((Float_t)(1024.-te->signcluster[i][2])); |
} |
801 |
} |
else{ |
802 |
else{ |
if(te->signcluster[i][0]!=0) landau1[dsp]->Fill((Float_t)te->signcluster[i][0]); |
803 |
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]); |
804 |
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]); |
805 |
if(te->signcluster[i][2]!=0) landau3[dsp]->Fill((Float_t)te->signcluster[i][2]); |
} |
806 |
} |
} |
|
} |
|
807 |
|
|
808 |
WARNING[i]=0; |
WARNING[i]=0; |
809 |
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){ |
810 |
ALARM = 1; //general alarm |
if(countFC[dsp]==0){ |
811 |
WARNING[i] = 1; // DSP warning |
ALARM = 1; //general alarm |
812 |
}; |
WARNING[i] = 1; // DSP warning |
813 |
|
} |
814 |
if(te->alarm[i]!=0){ // hardware alarm |
countFC[dsp]+=1; |
815 |
ALARM = 1; |
}; |
816 |
}; |
|
817 |
|
if(te->fl1[i]!=0){ |
818 |
|
if(countFL1[dsp]==0){ |
819 |
|
ALARM = 1; //general alarm |
820 |
|
WARNING[i] = 1; // DSP warning |
821 |
|
} |
822 |
|
countFL1[dsp]+=1; |
823 |
|
}; |
824 |
|
|
825 |
|
if(te->fl2[i]!=0){ |
826 |
|
if(countFL2[dsp]==0){ |
827 |
|
ALARM = 1; //general alarm |
828 |
|
WARNING[i] = 1; // DSP warning |
829 |
|
} |
830 |
|
countFL2[dsp]+=1; |
831 |
|
}; |
832 |
|
|
833 |
|
if(te->fl3[i]!=0){ |
834 |
|
if(countFL3[dsp]==0){ |
835 |
|
ALARM = 1; //general alarm |
836 |
|
WARNING[i] = 1; // DSP warning |
837 |
|
} |
838 |
|
countFL3[dsp]+=1; |
839 |
|
}; |
840 |
|
|
841 |
|
if(te->fl4[i]!=0){ |
842 |
|
if(countFL4[dsp]==0){ |
843 |
|
ALARM = 1; //general alarm |
844 |
|
WARNING[i] = 1; // DSP warning |
845 |
|
} |
846 |
|
countFL4[dsp]+=1; |
847 |
|
}; |
848 |
|
|
849 |
|
if(te->fl5[i]!=0){ |
850 |
|
if(countFL5[dsp]==0){ |
851 |
|
ALARM = 1; //general alarm |
852 |
|
WARNING[i] = 1; // DSP warning |
853 |
|
} |
854 |
|
countFL5[dsp]+=1; |
855 |
|
}; |
856 |
|
|
857 |
|
if(te->fl6[i]!=0){ |
858 |
|
if(countFL6[dsp]==0){ |
859 |
|
ALARM = 1; //general alarm |
860 |
|
WARNING[i] = 1; // DSP warning |
861 |
|
} |
862 |
|
countFL6[dsp]+=1; |
863 |
|
}; |
864 |
|
|
865 |
|
if(dsp%2==0 && te->alarm[i]!=0){ // hardware alarm |
866 |
|
if(countALARMy==0) |
867 |
|
ALARM = 1; |
868 |
|
countALARMy+=1; |
869 |
|
}; |
870 |
|
|
871 |
|
if(dsp%2==1 && te->alarm[i]!=0){ // hardware alarm |
872 |
|
if(countALARMx==0) |
873 |
|
ALARM = 1; |
874 |
|
countALARMx+=1; |
875 |
|
}; |
876 |
|
|
877 |
//************************************************************************************** |
//************************************************************************************** |
878 |
// warning for internal number |
// warning for internal number |
879 |
//************************************************************************************** |
//************************************************************************************** |
880 |
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; |
881 |
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; |
882 |
|
} |
883 |
} |
} |
884 |
eventint[(ev-minev)]=te->eventn[0]; |
eventint[(ev-minev)]=te->eventn[0]; |
885 |
|
|
891 |
al=1; |
al=1; |
892 |
alarm <<endl<< "================================================="<< endl; |
alarm <<endl<< "================================================="<< endl; |
893 |
alarm << "PSCU-Pkt N. "<< ph->GetCounter() ; |
alarm << "PSCU-Pkt N. "<< ph->GetCounter() ; |
894 |
alarm << " - OBT "<< ph->GetOrbitalTime() << " ms"<<endl; |
alarm << " - OBT "<< (ULong_t)ph->GetOrbitalTime() << " ms"<<endl; |
895 |
alarm << "Total events "<<nevent<<endl; |
alarm << "Total events "<<nevent<<endl; |
896 |
alarm << "(ROOT-tree entry "<<ev<<" in page "<<ii+1<<" )"<<endl; |
alarm << "(ROOT-tree entry "<<ev<<" in page "<<ii+1<<" )"<<endl; |
897 |
alarm << "================================================="<< endl; |
alarm << "================================================="<< endl; |
932 |
} |
} |
933 |
} |
} |
934 |
if(al==0) alarm << endl<< "Page "<<ii+1<< ": ------> NO ALARM!!! <-------"<<endl; |
if(al==0) alarm << endl<< "Page "<<ii+1<< ": ------> NO ALARM!!! <-------"<<endl; |
935 |
|
if(maxev==maxevent-1) { |
936 |
|
if(countALARMy!=0){ |
937 |
|
if(countALARMy%6!=0) alarm << endl<<endl<< "***** "<<countALARMy/6+1 <<" events with hardware alarm in Y-view *****"<<endl; |
938 |
|
else alarm << endl<<endl<< "***** "<<countALARMy/6 <<" events with hardware alarm in Y-view *****"<<endl; |
939 |
|
} |
940 |
|
if(countALARMx!=0){ |
941 |
|
if(countALARMx%6!=0) alarm << endl<<endl<< "***** "<<countALARMx/6+1 <<" events with hardware alarm in X-view *****"<<endl; |
942 |
|
else alarm << endl<<endl<< "***** "<<countALARMx/6 <<" events with hardware alarm in X-view *****"<<endl; |
943 |
|
} |
944 |
|
for(int p=0; p<12; p++){ |
945 |
|
if(countFC[p]!=0) alarm << endl<<endl<< "***** "<<countFC[p] <<" events with fc!=0 in DSP "<<p+1<<" *****"<<endl; |
946 |
|
if(countFL1[p]!=0) alarm << endl<<endl<< "***** "<<countFL1[p] <<" events with fl1!=0 in DSP "<<p+1<<" *****"<<endl; |
947 |
|
if(countFL2[p]!=0) alarm << endl<<endl<< "***** "<<countFL2[p] <<" events with fl2!=0 in DSP "<<p+1<<" *****"<<endl; |
948 |
|
if(countFL3[p]!=0) alarm << endl<<endl<< "***** "<<countFL3[p] <<" events with fl3!=0 in DSP "<<p+1<<" *****"<<endl; |
949 |
|
if(countFL4[p]!=0) alarm << endl<<endl<< "***** "<<countFL4[p] <<" events with fl4!=0 in DSP "<<p+1<<" *****"<<endl; |
950 |
|
if(countFL5[p]!=0) alarm << endl<<endl<< "***** "<<countFL5[p] <<" events with fl5!=0 in DSP "<<p+1<<" *****"<<endl; |
951 |
|
if(countFL6[p]!=0) alarm << endl<<endl<< "***** "<<countFL6[p] <<" events with fl6!=0 in DSP "<<p+1<<" *****"<<endl; |
952 |
|
} |
953 |
|
} |
954 |
|
|
955 |
// |
// |
956 |
// Draw the graphs |
// Draw the graphs |
972 |
comprtime[i][ii]->GetXaxis()->CenterTitle(); |
comprtime[i][ii]->GetXaxis()->CenterTitle(); |
973 |
comprtime[i][ii]->GetYaxis()->SetTitle("compressiontime (ms)"); |
comprtime[i][ii]->GetYaxis()->SetTitle("compressiontime (ms)"); |
974 |
comprtime[i][ii]->GetYaxis()->CenterTitle(); |
comprtime[i][ii]->GetYaxis()->CenterTitle(); |
975 |
|
if(maxev-minev==1) comprtime[i][ii]->GetXaxis()->SetNdivisions(-501); |
976 |
// comprtime[i][ii]->GetYaxis()->SetRangeUser(0,3); |
// comprtime[i][ii]->GetYaxis()->SetRangeUser(0,3); |
977 |
comprtime[i][ii]->Draw("ap"); |
comprtime[i][ii]->Draw("ap"); |
978 |
oss1.str(""); |
oss1.str(""); |
979 |
CompTimeCanv[ii]->Update(); |
CompTimeCanv[ii]->Update(); |
980 |
} |
} |
981 |
|
|
982 |
|
|
983 |
EventNumCanv[ii]->cd(); |
EventNumCanv[ii]->cd(); |
984 |
pt = new TPad("pt"," ",0.02,0.01,1.,0.98,18,0,0); |
pt = new TPad("pt"," ",0.02,0.01,1.,0.98,18,0,0); |
985 |
pt->SetFillColor(10); |
pt->SetFillColor(10); |
998 |
eventnumb[ii]->GetYaxis()->SetTitleSize(0.03); |
eventnumb[ii]->GetYaxis()->SetTitleSize(0.03); |
999 |
eventnumb[ii]->GetYaxis()->SetTitle("DSP event-number"); |
eventnumb[ii]->GetYaxis()->SetTitle("DSP event-number"); |
1000 |
eventnumb[ii]->GetYaxis()->CenterTitle(); |
eventnumb[ii]->GetYaxis()->CenterTitle(); |
1001 |
|
if(maxev-minev==1) eventnumb[ii]->GetXaxis()->SetNdivisions(-501); |
1002 |
eventnumb[ii]->GetYaxis()->SetTitleOffset(2.); |
eventnumb[ii]->GetYaxis()->SetTitleOffset(2.); |
1003 |
eventnumb[ii]->SetMarkerStyle(21); |
eventnumb[ii]->SetMarkerStyle(21); |
1004 |
eventnumb[ii]->SetMarkerColor(kBlue); |
eventnumb[ii]->SetMarkerColor(kBlue); |
1005 |
eventnumb[ii]->SetMarkerSize(0.2); |
eventnumb[ii]->SetMarkerSize(0.2); |
1006 |
|
oss1.str(""); |
1007 |
|
oss1<<"number of events in this graph: "<<maxev-minev; |
1008 |
|
t->SetTextColor(kBlue); |
1009 |
|
t->SetTextSize(0.02); |
1010 |
|
double xtex=0,ytex=0; |
1011 |
|
xtex=x[maxev-minev-1]-(x[maxev-minev-1]-x[0])/3; |
1012 |
|
ytex=1000.+eventnumb[ii]->GetYaxis()->GetXmax(); |
1013 |
|
t->DrawLatex(xtex,ytex,oss1.str().c_str()); |
1014 |
|
oss1.str(""); |
1015 |
eventnumb[ii]->Draw("ap"); |
eventnumb[ii]->Draw("ap"); |
1016 |
EventNumCanv[ii]->Update(); |
EventNumCanv[ii]->Update(); |
1017 |
|
|
1023 |
|
|
1024 |
} |
} |
1025 |
|
|
|
|
|
1026 |
alarm.close(); |
alarm.close(); |
1027 |
|
|
1028 |
//**************************************************************************************** |
//**************************************************************************************** |
1116 |
|
|
1117 |
TBox b; |
TBox b; |
1118 |
|
|
1119 |
Float_t maxhist=0; |
Float_t maxhist=0,va1x=0; |
1120 |
LandauCanv1->cd(); |
LandauCanv1->cd(); |
1121 |
pad1[i]->SetFillColor(10); |
pad1[i]->SetFillColor(10); |
1122 |
pad1[i]->SetFrameFillColor(10); |
pad1[i]->SetFrameFillColor(10); |
1147 |
landau3[i]->Draw(""); |
landau3[i]->Draw(""); |
1148 |
LandauCanv3->Update(); |
LandauCanv3->Update(); |
1149 |
|
|
1150 |
|
|
1151 |
|
li.SetLineColor(38); |
1152 |
|
li.SetLineStyle(4); |
1153 |
|
li.SetLineWidth(2); |
1154 |
|
liva1.SetLineColor(42); |
1155 |
|
liva1.SetLineStyle(3); |
1156 |
|
liva1.SetLineWidth(1); |
1157 |
|
|
1158 |
IlluminaCanv->cd(); |
IlluminaCanv->cd(); |
1159 |
pad2[i]->SetFillColor(10); |
pad2[i]->SetFillColor(10); |
1160 |
pad2[i]->SetFrameFillColor(10); |
pad2[i]->SetFrameFillColor(10); |
1164 |
illuminazione[i]->GetXaxis()->SetTitle("strip with max signal"); |
illuminazione[i]->GetXaxis()->SetTitle("strip with max signal"); |
1165 |
illuminazione[i]->GetXaxis()->CenterTitle(); |
illuminazione[i]->GetXaxis()->CenterTitle(); |
1166 |
illuminazione[i]->Draw(""); |
illuminazione[i]->Draw(""); |
1167 |
if(i==1){ |
maxhist= illuminazione[i]->GetMaximum(); |
1168 |
maxhist= illuminazione[i]->GetMaximum(); |
if(i==0){ |
1169 |
|
b.SetFillColor(107); |
1170 |
|
b.SetFillStyle(3954); |
1171 |
|
b.DrawBox(256.,0.,384.,maxhist); |
1172 |
|
b.DrawBox(768.,0.,2047.,maxhist); |
1173 |
|
} |
1174 |
|
else if(i==1){ |
1175 |
b.SetFillColor(6); |
b.SetFillColor(6); |
1176 |
b.SetFillStyle(3945); |
b.SetFillStyle(3945); |
1177 |
b.DrawBox(2944.,0.,3060.,maxhist); |
b.DrawBox(2944.,0.,3070.,maxhist); |
1178 |
|
|
1179 |
b.SetFillColor(107); |
b.SetFillColor(107); |
1180 |
b.SetFillStyle(3954); |
b.SetFillStyle(3954); |
1181 |
|
b.DrawBox(384.,0.,512.,maxhist); |
1182 |
|
b.DrawBox(2048.,0.,2432.,maxhist); |
1183 |
b.DrawBox(2816.,0.,2944.,maxhist); |
b.DrawBox(2816.,0.,2944.,maxhist); |
1184 |
b.DrawBox(2048.,0.,2176.,maxhist); |
} |
1185 |
|
else if(i==3){ |
1186 |
|
b.SetFillColor(107); |
1187 |
|
b.SetFillStyle(3954); |
1188 |
|
b.DrawBox(2816.,0.,3070.,maxhist); |
1189 |
} |
} |
1190 |
else if(i==4){ |
else if(i==4){ |
|
maxhist=illuminazione[i]->GetMaximum(); |
|
1191 |
b.SetFillColor(107); |
b.SetFillColor(107); |
1192 |
b.SetFillStyle(3954); |
b.SetFillStyle(3954); |
1193 |
b.DrawBox(384.,0.,512.,maxhist); |
b.DrawBox(256.,0.,512.,maxhist); |
1194 |
|
b.DrawBox(2816.,0.,3070.,maxhist); |
1195 |
|
} |
1196 |
|
else if(i==5){ |
1197 |
|
b.SetFillColor(107); |
1198 |
|
b.SetFillStyle(3954); |
1199 |
|
b.DrawBox(896.,0.,1024.,maxhist); |
1200 |
} |
} |
1201 |
else if(i==6){ |
else if(i==6){ |
1202 |
maxhist= illuminazione[i]->GetMaximum(); |
b.SetFillColor(107); |
1203 |
b.SetFillColor(6); |
b.SetFillStyle(3954); |
1204 |
b.SetFillStyle(3945); |
b.DrawBox(512.,0.,768.,maxhist); |
1205 |
|
b.DrawBox(1024.,0.,1280.,maxhist); |
1206 |
|
b.DrawBox(1280.,0.,1792.,maxhist); |
1207 |
b.DrawBox(2560.,0.,2816.,maxhist); |
b.DrawBox(2560.,0.,2816.,maxhist); |
1208 |
b.DrawBox(1024.,0.,1792.,maxhist); |
} |
1209 |
|
else if(i==7){ |
1210 |
b.SetFillColor(107); |
b.SetFillColor(107); |
1211 |
b.SetFillStyle(3954); |
b.SetFillStyle(3954); |
1212 |
b.DrawBox(512.,0.,768.,maxhist); |
b.DrawBox(512.,0.,768.,maxhist); |
1213 |
|
b.DrawBox(896.,0.,1535.,maxhist); |
1214 |
|
b.DrawBox(2024.,0.,2280.,maxhist); |
1215 |
} |
} |
1216 |
else if(i==7){ |
else if(i==8){ |
|
maxhist= illuminazione[i]->GetMaximum(); |
|
1217 |
b.SetFillColor(107); |
b.SetFillColor(107); |
1218 |
b.SetFillStyle(3954); |
b.SetFillStyle(3954); |
1219 |
b.DrawBox(512.,0.,768.,maxhist); |
b.DrawBox(512.,0.,768.,maxhist); |
1220 |
} |
} |
1221 |
|
else if(i==9){ |
1222 |
|
b.SetFillColor(107); |
1223 |
|
b.SetFillStyle(3954); |
1224 |
|
b.DrawBox(0.,0.,128.,maxhist); |
1225 |
|
b.DrawBox(256.,0.,384.,maxhist); |
1226 |
|
b.DrawBox(512.,0.,640.,maxhist); |
1227 |
|
b.DrawBox(896.,0.,1024.,maxhist); |
1228 |
|
b.DrawBox(1280.,0.,1535.,maxhist); |
1229 |
|
b.DrawBox(1792.,0.,1920.,maxhist); |
1230 |
|
} |
1231 |
|
else if(i==10){ |
1232 |
|
b.SetFillColor(107); |
1233 |
|
b.SetFillStyle(3954); |
1234 |
|
b.DrawBox(0.,0.,256.,maxhist); |
1235 |
|
b.DrawBox(1024.,0.,1152.,maxhist); |
1236 |
|
b.DrawBox(1768.,0.,3070.,maxhist); |
1237 |
|
} |
1238 |
else if(i==11){ |
else if(i==11){ |
|
maxhist= illuminazione[i]->GetMaximum(); |
|
1239 |
b.SetFillColor(6); |
b.SetFillColor(6); |
1240 |
b.SetFillStyle(3945); |
b.SetFillStyle(3945); |
1241 |
b.DrawBox(768.,0.,1024.,maxhist); |
b.DrawBox(768.,0.,1024.,maxhist); |
1243 |
b.SetFillColor(107); |
b.SetFillColor(107); |
1244 |
b.SetFillStyle(3954); |
b.SetFillStyle(3954); |
1245 |
b.DrawBox(0.,0.,512.,maxhist); |
b.DrawBox(0.,0.,512.,maxhist); |
1246 |
b.DrawBox(1920.,0.,2048.,maxhist); |
b.DrawBox(1920.,0.,2560.,maxhist); |
1247 |
|
b.DrawBox(2816.,0.,3070.,maxhist); |
1248 |
} |
} |
1249 |
|
for(int va=1; va<24; va++){ |
1250 |
|
va1x=128*va; |
1251 |
|
liva1.DrawLine(va1x,0.,va1x,maxhist); |
1252 |
|
} |
1253 |
|
li.DrawLine(1024.5,0,1024.5,maxhist); |
1254 |
|
li.DrawLine(2048.5,0,2048.5,maxhist); |
1255 |
IlluminaCanv->Update(); |
IlluminaCanv->Update(); |
1256 |
} |
} |
1257 |
|
|
1266 |
else if(cntpgtemp<=cntpgdat) totpg=cntpgdat; |
else if(cntpgtemp<=cntpgdat) totpg=cntpgdat; |
1267 |
|
|
1268 |
for(Int_t fl=0;fl<totpg;fl++){ |
for(Int_t fl=0;fl<totpg;fl++){ |
1269 |
|
|
1270 |
if(!strcmp(outfile.Data(),"ps")||!strcmp(outfile.Data(),"pdf")){ |
if(!strcmp(outfile.Data(),"ps")||!strcmp(outfile.Data(),"pdf")){ |
1271 |
out1.str(""); |
out1.str(""); |
1272 |
out2.str(""); |
out2.str(""); |