1 |
|
|
2 |
/** |
/** |
3 |
* FTrkQLook_EXPERT.cxx |
* FTrkQLook_EXPERT.cxx |
4 |
* |
* |
5 |
* autor: D.Fedele |
* autor: D.Fedele |
6 |
* version v1r06 |
* version v1r27 |
7 |
* Parameters: |
* Parameters: |
8 |
* file - the data file to analyze |
* file - the data file to analyze |
9 |
* fromevent - first event to analyze |
* fromevent - first event to analyze |
23 |
#include <TFile.h> |
#include <TFile.h> |
24 |
#include <TTree.h> |
#include <TTree.h> |
25 |
#include <TStyle.h> |
#include <TStyle.h> |
26 |
|
#include <TAxis.h> |
27 |
|
#include <TH1F.h> |
28 |
|
#include <TROOT.h> |
29 |
|
#include <cstdlib> |
30 |
// |
// |
31 |
#include <physics/tracker/TrackerEvent.h> |
#include <physics/tracker/TrackerEvent.h> |
32 |
#include <PscuHeader.h> |
#include <PscuHeader.h> |
35 |
#include <TrkAlarmEvent.h> |
#include <TrkAlarmEvent.h> |
36 |
#include <tsbt/TsbTRecord.h> |
#include <tsbt/TsbTRecord.h> |
37 |
#include <tsbt/TsbTEvent.h> |
#include <tsbt/TsbTEvent.h> |
38 |
|
#include <tsbb/TsbBRecord.h> |
39 |
|
#include <tsbb/TsbBEvent.h> |
40 |
#include <EventCounter.h> |
#include <EventCounter.h> |
41 |
#include <PacketType.h> |
#include <PacketType.h> |
42 |
// |
// |
44 |
|
|
45 |
void FTrkQLook_EXPERT(TString file,Int_t fromevent,Int_t toevent, TString outdir, TString outfile) |
void FTrkQLook_EXPERT(TString file,Int_t fromevent,Int_t toevent, TString outdir, TString outfile) |
46 |
{ |
{ |
|
printf("\nsono io\n"); |
|
47 |
// |
// |
48 |
// obtain information about the data file and select the output dir |
// obtain information about the data file and select the output dir |
49 |
Int_t dwpos = file.Last('/'); |
Int_t dwpos = file.Last('/'); |
64 |
// inizialise the variables and open the file |
// inizialise the variables and open the file |
65 |
pamela::TsbTEvent *event = 0; |
pamela::TsbTEvent *event = 0; |
66 |
pamela::TsbTRecord *record = 0; |
pamela::TsbTRecord *record = 0; |
67 |
|
pamela::TsbBEvent *Bevent = 0; |
68 |
|
pamela::TsbBRecord *Brecord = 0; |
69 |
pamela::tracker::TrackerEvent *te=0; |
pamela::tracker::TrackerEvent *te=0; |
70 |
pamela::EventHeader *eh=0,*aleh=0,*eH=0,*eT=0; |
pamela::EventHeader *eh=0,*aleh=0,*eH=0,*eT=0,*eB=0; |
71 |
pamela::PscuHeader *ph=0,*pH=0; |
pamela::PscuHeader *ph=0,*pH=0; |
72 |
pamela::TrkAlarmEvent *al=0; |
pamela::TrkAlarmEvent *al=0; |
73 |
pamela::RunHeaderEvent *reh=0; |
pamela::RunHeaderEvent *reh=0; |
85 |
tree->SetBranchAddress("TsbT",&event); |
tree->SetBranchAddress("TsbT",&event); |
86 |
tree->SetBranchAddress("Header",&eT); |
tree->SetBranchAddress("Header",&eT); |
87 |
|
|
88 |
|
TTree *Btree = (TTree*)datafile->Get("TsbB"); |
89 |
|
Btree->SetBranchAddress("TsbB",&Bevent); |
90 |
|
Btree->SetBranchAddress("Header",&eB); |
91 |
|
|
92 |
TTree *altr = (TTree*)datafile->Get("TrkAlarm"); |
TTree *altr = (TTree*)datafile->Get("TrkAlarm"); |
93 |
altr->SetBranchAddress("TrkAlarm",&al); |
altr->SetBranchAddress("TrkAlarm",&al); |
94 |
altr->SetBranchAddress("Header",&aleh); |
altr->SetBranchAddress("Header",&aleh); |
104 |
Long64_t nevent = tr->GetEntries(); |
Long64_t nevent = tr->GetEntries(); |
105 |
Long64_t neventH = otr->GetEntries(); |
Long64_t neventH = otr->GetEntries(); |
106 |
Long64_t tnevent = tree->GetEntries(); |
Long64_t tnevent = tree->GetEntries(); |
107 |
|
Long64_t bnevent = Btree->GetEntries(); |
108 |
Long64_t alnevent = altr->GetEntries(); |
Long64_t alnevent = altr->GetEntries(); |
109 |
Int_t minevent=0; |
Int_t minevent=0; |
110 |
Int_t maxevent=0; |
Int_t maxevent=0; |
112 |
printf("Number of total events: %lld\n",nevent); |
printf("Number of total events: %lld\n",nevent); |
113 |
printf("Number of header events: %lld\n",neventH); |
printf("Number of header events: %lld\n",neventH); |
114 |
printf("Number of TsbT events: %lld\n",tnevent); |
printf("Number of TsbT events: %lld\n",tnevent); |
115 |
|
printf("Number of TsbB events: %lld\n",bnevent); |
116 |
printf("Number of TrkAlarm packet events: %lld\n",alnevent); |
printf("Number of TrkAlarm packet events: %lld\n",alnevent); |
117 |
|
|
118 |
if (nevent<=0){ |
if (nevent<=0){ |
141 |
} else if (toevent > nevent) { |
} else if (toevent > nevent) { |
142 |
maxevent = nevent; |
maxevent = nevent; |
143 |
} else { |
} else { |
144 |
maxevent = toevent+1; |
maxevent = nevent; |
145 |
} |
} |
146 |
nevent=maxevent-minevent ; |
nevent=maxevent-minevent ; |
147 |
} |
} |
148 |
|
|
149 |
// |
// |
150 |
// information about the RunHeader |
// information about the RunHeader |
151 |
ULong64_t HOBT[neventH]; |
ULong_t HOBT[neventH]; |
152 |
Int_t trk_cal_us[neventH]; |
Int_t trk_cal_us[neventH]; |
153 |
|
ULong_t acq_info[neventH]; |
154 |
|
Int_t countnboot=1; |
155 |
for (Int_t vi=0; vi<neventH;vi++){ |
for (Int_t vi=0; vi<neventH;vi++){ |
156 |
HOBT[vi]=0; |
HOBT[vi]=0; |
157 |
trk_cal_us[vi]=0; |
trk_cal_us[vi]=0; |
158 |
|
acq_info[vi]=0; |
159 |
} |
} |
160 |
for (Int_t ev=0; ev<neventH; ev++){ |
for (Int_t ev=0; ev<neventH; ev++){ |
161 |
otr->GetEntry(ev); |
otr->GetEntry(ev); |
162 |
pH = eH->GetPscuHeader(); |
pH = eH->GetPscuHeader(); |
163 |
HOBT[ev]= pH->GetOrbitalTime(); |
HOBT[ev]= pH->GetOrbitalTime(); |
164 |
trk_cal_us[ev]=reh->TRK_CALIB_USED; |
trk_cal_us[ev]=reh->TRK_CALIB_USED; |
165 |
|
acq_info[ev]=reh->ACQ_BUILD_INFO; |
166 |
|
if((HOBT[ev]<HOBT[ev-1]) && ev>0) |
167 |
|
countnboot+=1; |
168 |
} |
} |
169 |
|
countnboot+=(Int_t)(2*nevent/MAXSTORAGE); |
170 |
|
// printf("\ncountnboot=%d\n",countnboot); |
171 |
|
|
172 |
// |
// |
173 |
// other variables definitions |
// other variables definitions |
174 |
stringstream oss1,oss2,oss3,oss4,fromfile,isfile,tit; |
stringstream oss1,oss2,oss3,oss4,fromfile,isfile,tit; |
185 |
} |
} |
186 |
const Int_t tsize=maxsize; |
const Int_t tsize=maxsize; |
187 |
Int_t tempt[tsize][5]; |
Int_t tempt[tsize][5]; |
188 |
Int_t countnboot=1; |
ULong_t xt[tsize]; |
189 |
ULong64_t xt[tsize]; |
|
190 |
|
Int_t cntpgtemp=1,cntpgdat=0,cntpgmag=0; |
191 |
// |
// |
192 |
// information about the temperatures |
// information about the temperatures |
193 |
for (Int_t ev=0; ev<tnevent; ev++){ |
for (Int_t ev=0; ev<tnevent; ev++){ |
197 |
record = (pamela::TsbTRecord*)event->Records->At(j); |
record = (pamela::TsbTRecord*)event->Records->At(j); |
198 |
xt[siztmp]=record->RECORD_OBT; |
xt[siztmp]=record->RECORD_OBT; |
199 |
if((xt[siztmp]<xt[siztmp-1]) && siztmp>0) |
if((xt[siztmp]<xt[siztmp-1]) && siztmp>0) |
200 |
countnboot+=1; |
cntpgtemp+=1; |
201 |
|
|
202 |
for (Int_t z = 0; z < 5; z++){ |
for (Int_t z = 0; z < 5; z++){ |
203 |
tempt[siztmp][z] = record->TEMPERATURES[z+1]; |
tempt[siztmp][z] = record->TEMPERATURES[z+1]; |
205 |
siztmp++; |
siztmp++; |
206 |
} |
} |
207 |
} |
} |
208 |
countnboot+=2*(Int_t)nevent/MAXSTORAGE; |
|
209 |
// printf("\ncountnboot=%d\n",countnboot); |
// |
210 |
|
// information about the entries for the magnetic field |
211 |
|
if(bnevent>0) cntpgmag=1; |
212 |
|
maxsize=0; |
213 |
|
for (Int_t ev=0; ev<bnevent; ev++){ |
214 |
|
Btree->GetEntry(ev); |
215 |
|
tmpSize = Bevent->Records->GetEntries(); |
216 |
|
maxsize+=tmpSize; |
217 |
|
} |
218 |
|
const Int_t bsize=maxsize; |
219 |
|
Int_t magt[bsize][5]; |
220 |
|
ULong_t xb[bsize]; |
221 |
|
siztmp=0; |
222 |
|
// |
223 |
|
// information about the magnetic field |
224 |
|
for (Int_t ev=0; ev<bnevent; ev++){ |
225 |
|
Btree->GetEntry(ev); |
226 |
|
tmpSize = Bevent->Records->GetEntries(); |
227 |
|
for (Int_t j = 0; j < tmpSize; j++){ |
228 |
|
Brecord = (pamela::TsbBRecord*)Bevent->Records->At(j); |
229 |
|
xb[siztmp]=Brecord->RECORD_OBT; |
230 |
|
if((xb[siztmp]<xb[siztmp-1]) && siztmp>0) |
231 |
|
cntpgmag+=1; |
232 |
|
for (Int_t z = 0; z < 5; z++){ |
233 |
|
magt[siztmp][z] = Brecord->B_FIELD[z+1]; |
234 |
|
} |
235 |
|
siztmp++; |
236 |
|
} |
237 |
|
} |
238 |
|
|
239 |
// |
// |
240 |
// open the output text files for the alarms |
// open the output text files for the alarms |
254 |
// write the file for the TrkAlarm packet |
// write the file for the TrkAlarm packet |
255 |
if(alnevent==0) alarm1 <<endl<< "------> NO ALARM!!! <-------"<< endl; |
if(alnevent==0) alarm1 <<endl<< "------> NO ALARM!!! <-------"<< endl; |
256 |
else{ |
else{ |
257 |
Long64_t obt=0; |
ULong_t obt=0; |
258 |
for (Int_t ev=0; ev<alnevent; ev++){ |
for (Int_t ev=0; ev<alnevent; ev++){ |
259 |
altr->GetEntry(ev); |
altr->GetEntry(ev); |
260 |
ph = aleh->GetPscuHeader(); |
ph = aleh->GetPscuHeader(); |
261 |
|
|
262 |
if(ph->GetOrbitalTime()<obt && ev>0) |
if((ULong_t)ph->GetOrbitalTime()<obt && ev>0) |
263 |
alarm1<<endl<<"NEW CPU BOOT"<<endl; |
alarm1<<endl<<"NEW CPU BOOT"<<endl; |
264 |
obt=ph->GetOrbitalTime(); |
obt=ph->GetOrbitalTime(); |
265 |
|
|
266 |
alarm1 << "================================================="<< endl; |
alarm1 << "================================================="<< endl; |
267 |
alarm1 << "PSCU-Pkt N. "<< ph->GetCounter() ; |
alarm1 << "PSCU-Pkt N. "<< ph->GetCounter() ; |
268 |
alarm1 << " - OBT "<< ph->GetOrbitalTime() << " ms"<<endl; |
alarm1 << " - OBT "<< (ULong_t)ph->GetOrbitalTime() << " ms"<<endl; |
269 |
alarm1 << "(ROOT-tree entry "<<ev<<")"<<endl; |
alarm1 << "(ROOT-tree entry "<<ev<<")"<<endl; |
270 |
alarm1 << "================================================="<< endl<<endl; |
alarm1 << "================================================="<< endl<<endl; |
271 |
|
|
272 |
alarm1 << "Alarm variables (range 0-1)"<<endl; |
alarm1 << "Alarm variables (range 0-1)"<<endl; |
273 |
alarm1 << " ALARM[1]= 0x"<< hex << (Int_t)al->ALARM[1]<<endl; |
alarm1 << " ALARM[1]= 0x"<< hex << (Int_t)al->ALARM[0]<<endl; |
274 |
alarm1 << " ALARM[2]= 0x"<< (Int_t)al->ALARM[2]<<endl; |
alarm1 << " ALARM[2]= 0x"<< (Int_t)al->ALARM[1]<<endl; |
275 |
alarm1 << " CmdDuringTrig= 0x"<< (Int_t)al->CmdDuringTrig<<endl; |
alarm1 << " CmdDuringTrig= 0x"<< (Int_t)al->CmdDuringTrig<<endl; |
276 |
alarm1 << " FinalCheck= 0x"<< (Int_t)al->FinalCheck<<endl; |
alarm1 << " FinalCheck= 0x"<< (Int_t)al->FinalCheck<<endl; |
277 |
alarm1 << " FlashData= 0x"<< (Int_t)al->FlashData<<endl; |
alarm1 << " FlashData= 0x"<< (Int_t)al->FlashData<<endl; |
329 |
|
|
330 |
// |
// |
331 |
// Define output canvas, histos and graphs |
// Define output canvas, histos and graphs |
332 |
TCanvas *CompTimeCanv[countnboot],*EventNumCanv[countnboot],*TempCanv[countnboot]; |
TCanvas *CompTimeCanv[countnboot],*EventNumCanv[countnboot],*TempCanv[cntpgtemp],*BfieldCanv[cntpgmag]; |
333 |
TCanvas *IlluminaCanv,*LandauCanv1,*LandauCanv2,*LandauCanv3; |
TCanvas *IlluminaCanv,*LandauCanv1,*LandauCanv2,*LandauCanv3; |
334 |
|
|
335 |
TH1F *landau1[12],*landau2[12],*landau3[12],*illuminazione[12]; |
TH1F *landau1[12],*landau2[12],*landau3[12],*illuminazione[12]; |
336 |
TGraph *comprtime[12][countnboot],*temp[5][countnboot],*eventnumb[countnboot]; |
TGraph *comprtime[12][countnboot],*temp[5][cntpgtemp],*tempw[5][cntpgtemp],*eventnumb[countnboot],*mag[5][cntpgmag]; |
337 |
TPad *pad1[12],*pad2[12],*pad3[12],*pad4[12],*pad5[12],*pad6[5]; |
TPad *pad1[12],*pad2[12],*pad3[12],*pad4[12],*pad5[12],*pad6[5],*pad7[5]; |
338 |
|
|
339 |
for(Int_t n = 0; n<12; n++) { |
for(Int_t n = 0; n<12; n++) { |
340 |
|
|
371 |
|
|
372 |
TLatex *t=new TLatex(); |
TLatex *t=new TLatex(); |
373 |
TLatex *t1=new TLatex(); |
TLatex *t1=new TLatex(); |
374 |
|
|
375 |
|
TLine li,liva1; |
376 |
|
|
377 |
Int_t cntpgtemp=0,cntpgdat=0; |
Int_t minev=minevent,maxev=maxevent,countTEMP=0,countMAG=0; |
378 |
Int_t minev=minevent,maxev=maxevent,countTEMP=0; |
ULong_t countALARMx=0,countALARMy=0,countFC[12],countFL1[12],countFL2[12],countFL3[12],countFL4[12],countFL5[12],countFL6[12]; |
379 |
|
|
380 |
|
for(int i=0; i<12; i++){ |
381 |
|
countFC[i]=0; |
382 |
|
countFL1[i]=0; |
383 |
|
countFL2[i]=0; |
384 |
|
countFL3[i]=0; |
385 |
|
countFL4[i]=0; |
386 |
|
countFL5[i]=0; |
387 |
|
countFL6[i]=0; |
388 |
|
} |
389 |
|
|
390 |
// |
// |
391 |
// Fill temperature graphs |
// Fill temperature graphs |
392 |
for(Int_t ii=0; ii<countnboot;ii++){ |
for(Int_t ii=0; ii<cntpgtemp;ii++){ |
393 |
//**************************************************************************************** |
//**************************************************************************************** |
394 |
//Temperature Output Pages |
//Temperature Output Pages |
395 |
//**************************************************************************************** |
//**************************************************************************************** |
411 |
t1->SetTextSize(0.02); |
t1->SetTextSize(0.02); |
412 |
t1->DrawLatex(78.,98.7,isfile.str().c_str()); |
t1->DrawLatex(78.,98.7,isfile.str().c_str()); |
413 |
isfile.str(""); |
isfile.str(""); |
414 |
|
t1->SetTextSize(0.025); |
415 |
|
t1->SetTextColor(196); |
416 |
|
isfile<<"--> Values at 28.5^{o}C (if presents) correspond"; |
417 |
|
t1->DrawLatex(50.,22.,isfile.str().c_str()); |
418 |
|
isfile.str(""); |
419 |
|
isfile<<" to wrong readings ( > 100^{o}C) of the Tsb"; |
420 |
|
t1->DrawLatex(50.,19.,isfile.str().c_str()); |
421 |
|
isfile.str(""); |
422 |
|
isfile<<"--> Values at 25.5^{o}C (if presents) correspond"; |
423 |
|
t1->DrawLatex(50.,12.,isfile.str().c_str()); |
424 |
|
isfile.str(""); |
425 |
|
isfile<<" to wrong readings ( < 0^{o}C) of the Tsb"; |
426 |
|
t1->DrawLatex(50.,9.,isfile.str().c_str()); |
427 |
|
isfile.str(""); |
428 |
|
|
429 |
Float_t tposy = 0.95; // up y-coord - top pads |
Float_t tposy = 0.95; // up y-coord - top pads |
430 |
Float_t thpad = 0; // pad height |
Float_t thpad = 0; // pad height |
450 |
/* -----------> pad for histograms */ |
/* -----------> pad for histograms */ |
451 |
pad6[i] = new TPad("pad6"," ",tposx1,tposy-thpad,tposx0,tposy,18,0,0); |
pad6[i] = new TPad("pad6"," ",tposx1,tposy-thpad,tposx0,tposy,18,0,0); |
452 |
|
|
453 |
Int_t v=0; |
Int_t v=0,vv=0; |
454 |
Double_t xt_tmp[tsize], tempt_tmp[tsize]; |
Double_t xt_tmp[tsize], tempt_tmp[tsize]; |
455 |
|
Double_t xt_tmpw[tsize], tempt_tmpw[tsize]; |
456 |
for (Int_t ev=countTEMP; ev<tsize; ev++){ |
for (Int_t ev=countTEMP; ev<tsize; ev++){ |
457 |
|
|
458 |
if(ev==tsize-1 && i==4) countTEMP=tsize-1; |
if(ev==tsize-1 && i==4 && ii==cntpgtemp-1) countTEMP=tsize-1; |
459 |
if(xt[ev]<xt[ev-1] && ev>countTEMP){ |
if(xt[ev]<xt[ev-1] && ev>countTEMP){ |
460 |
if(i==4) countTEMP=ev; |
if(i==4) countTEMP=ev; |
461 |
break; |
break; |
462 |
} |
} |
463 |
else{ |
else{ |
464 |
if(tempt[ev][i]!=65535){ |
tempt_tmp[v]=(Double_t)((Int_t)(((3.3*tempt[ev][i]/4096)-0.586)/0.0231)); |
465 |
tempt_tmp[v]=(Double_t)((Int_t)(((3.3*tempt[ev][i]/4096)-0.586)/0.0231)); |
if(tempt_tmp[v]>100) { |
466 |
if(tempt_tmp[v]>0) xt_tmp[v++]=(Double_t)xt[ev]; |
tempt_tmp[v]=28.5; |
467 |
|
tempt_tmpw[vv]=28.5; |
468 |
|
xt_tmpw[vv++]=(Double_t)xt[ev]; |
469 |
} |
} |
470 |
|
else if(tempt_tmp[v]<0){ |
471 |
|
tempt_tmp[v]=25.5; |
472 |
|
tempt_tmpw[vv]=25.5; |
473 |
|
xt_tmpw[vv++]=(Double_t)xt[ev]; |
474 |
|
} |
475 |
|
xt_tmp[v++]=(Double_t)xt[ev]; |
476 |
} |
} |
477 |
} |
} |
478 |
TempCanv[ii]->cd(); |
TempCanv[ii]->cd(); |
482 |
pad6[i]->cd(); |
pad6[i]->cd(); |
483 |
temp[i][ii]= new TGraph(v,xt_tmp,tempt_tmp); |
temp[i][ii]= new TGraph(v,xt_tmp,tempt_tmp); |
484 |
temp[i][ii]->SetTitle(tit.str().c_str()); |
temp[i][ii]->SetTitle(tit.str().c_str()); |
485 |
|
if(v==1) temp[i][ii]->GetXaxis()->SetNdivisions(-501); |
486 |
temp[i][ii]->GetXaxis()->SetLabelSize(0.04); |
temp[i][ii]->GetXaxis()->SetLabelSize(0.04); |
487 |
temp[i][ii]->GetXaxis()->SetTitleSize(0.04); |
temp[i][ii]->GetXaxis()->SetTitleSize(0.04); |
488 |
temp[i][ii]->GetXaxis()->SetTitle("OBT (ms)"); |
temp[i][ii]->GetXaxis()->SetTitle("OBT (ms)"); |
498 |
temp[i][ii]->SetMarkerSize(0.2); |
temp[i][ii]->SetMarkerSize(0.2); |
499 |
temp[i][ii]->Draw("ap"); |
temp[i][ii]->Draw("ap"); |
500 |
tit.str(""); |
tit.str(""); |
501 |
|
if(vv>0){ |
502 |
|
tempw[i][ii]= new TGraph(vv,xt_tmpw,tempt_tmpw); |
503 |
|
tempw[i][ii]->SetMarkerStyle(21); |
504 |
|
tempw[i][ii]->SetMarkerSize(0.2); |
505 |
|
tempw[i][ii]->SetMarkerColor(196); |
506 |
|
tempw[i][ii]->Draw("samep"); |
507 |
|
} |
508 |
TempCanv[ii]->Update(); |
TempCanv[ii]->Update(); |
509 |
|
|
510 |
|
|
511 |
} |
} |
512 |
if(countTEMP==tsize-1){ |
if(countTEMP==tsize-1 && ii==cntpgtemp-1){ |
|
cntpgtemp=ii+1; |
|
513 |
break; |
break; |
514 |
} |
} |
515 |
} |
} |
516 |
|
|
517 |
|
// |
518 |
|
// Fill magnetic field graphs |
519 |
|
for(Int_t ii=0; ii<cntpgmag;ii++){ |
520 |
|
//**************************************************************************************** |
521 |
|
//Magnetic Field Output Pages |
522 |
|
//**************************************************************************************** |
523 |
|
fromfile.str(""); |
524 |
|
fromfile<<"FTrkQLook_EXPERT File: "<<ffile; |
525 |
|
isfile<<"Magnetic Axial Field vs OBT pag"<<ii+1; |
526 |
|
BfieldCanv[ii]=new TCanvas(isfile.str().c_str(),isfile.str().c_str(),900,1200); |
527 |
|
BfieldCanv[ii]->SetFillColor(10); |
528 |
|
BfieldCanv[ii]->Range(0,0,100,100); |
529 |
|
|
530 |
|
t->SetTextFont(32); |
531 |
|
t->SetTextColor(1); |
532 |
|
t->SetTextAlign(12); |
533 |
|
t->SetTextSize(0.02); |
534 |
|
t->DrawLatex(2.,98.7,fromfile.str().c_str()); |
535 |
|
t1->SetTextFont(32); |
536 |
|
t1->SetTextColor(1); |
537 |
|
t1->SetTextAlign(12); |
538 |
|
t1->SetTextSize(0.02); |
539 |
|
t1->DrawLatex(70.,98.7,isfile.str().c_str()); |
540 |
|
isfile.str(""); |
541 |
|
|
542 |
|
li.SetLineStyle(1); |
543 |
|
li.SetLineWidth(1); |
544 |
|
li.SetLineColor(190); |
545 |
|
t1->SetTextColor(190); |
546 |
|
t1->SetTextSize(0.04); |
547 |
|
|
548 |
|
Float_t tposy = 0.95; // up y-coord - top pads |
549 |
|
Float_t thpad = 0; // pad height |
550 |
|
Float_t tposx1=0; // left x-coord - pad column |
551 |
|
Float_t tposx0=0; // x-coord - column division |
552 |
|
Float_t twrel = 0; // relative x size of first sub-column |
553 |
|
Float_t tmarg = 0.004; // margin among pads |
554 |
|
|
555 |
|
thpad = (tposy-tmarg*5)/3; |
556 |
|
twrel = (1-tmarg*4)/2; |
557 |
|
|
558 |
|
for(Int_t i=0; i<5; i++){ |
559 |
|
if ( (i+1)%2==1 ) { |
560 |
|
if(i>1) tposy = tposy-(tmarg*2+thpad); |
561 |
|
tposx1 = tmarg; |
562 |
|
tposx0 = tposx1 + twrel; |
563 |
|
} |
564 |
|
else { |
565 |
|
tposx1 = tposx0 + 2*tmarg; |
566 |
|
tposx0 = tposx1 + twrel; |
567 |
|
} |
568 |
|
|
569 |
|
/* -----------> pad for histograms */ |
570 |
|
pad7[i] = new TPad("pad7"," ",tposx1,tposy-thpad,tposx0,tposy,18,0,0); |
571 |
|
|
572 |
|
Int_t v=0; |
573 |
|
Double_t xb_tmp[bsize], magt_tmp[bsize]; |
574 |
|
for (Int_t ev=countMAG; ev<bsize; ev++){ |
575 |
|
|
576 |
|
if(ev==bsize-1 && i==4 && ii==cntpgmag-1) countMAG=bsize-1; |
577 |
|
if(xb[ev]<xb[ev-1] && ev>countMAG){ |
578 |
|
if(i==4) countMAG=ev; |
579 |
|
break; |
580 |
|
} |
581 |
|
else{ |
582 |
|
magt_tmp[v]=(Double_t)magt[ev][i]; |
583 |
|
xb_tmp[v++]=(Double_t)xb[ev]; |
584 |
|
} |
585 |
|
} |
586 |
|
BfieldCanv[ii]->cd(); |
587 |
|
tit<<"B"<<i+5<<" (magnetic module "<<i+1<<")"; |
588 |
|
pad7[i]->SetFillColor(10); |
589 |
|
pad7[i]->Draw(); |
590 |
|
pad7[i]->cd(); |
591 |
|
mag[i][ii]= new TGraph(v,xb_tmp,magt_tmp); |
592 |
|
mag[i][ii]->SetTitle(tit.str().c_str()); |
593 |
|
if(v==1) mag[i][ii]->GetXaxis()->SetNdivisions(-501); |
594 |
|
mag[i][ii]->GetXaxis()->SetLabelSize(0.04); |
595 |
|
mag[i][ii]->GetXaxis()->SetTitleSize(0.04); |
596 |
|
mag[i][ii]->GetXaxis()->SetTitle("OBT (ms)"); |
597 |
|
mag[i][ii]->GetXaxis()->CenterTitle(); |
598 |
|
mag[i][ii]->GetXaxis()->SetTitleOffset(0.85); |
599 |
|
if(i!=4) mag[i][ii]->GetYaxis()->SetRangeUser(2047,2058); |
600 |
|
else mag[i][ii]->GetYaxis()->SetRangeUser(2059,2067); |
601 |
|
mag[i][ii]->GetYaxis()->SetTitleOffset(1.2); |
602 |
|
mag[i][ii]->GetYaxis()->SetLabelOffset(0.001); |
603 |
|
mag[i][ii]->GetYaxis()->SetLabelSize(0.03); |
604 |
|
mag[i][ii]->GetYaxis()->SetTitleSize(0.04); |
605 |
|
mag[i][ii]->GetYaxis()->SetTitle("Magnetic Field (au)"); |
606 |
|
mag[i][ii]->GetYaxis()->CenterTitle(); |
607 |
|
mag[i][ii]->SetMarkerStyle(21); |
608 |
|
mag[i][ii]->SetMarkerSize(0.4); |
609 |
|
mag[i][ii]->Draw("ap"); |
610 |
|
Double_t min=0.,max=0,xlat=0.; |
611 |
|
min=mag[i][ii]->GetXaxis()->GetXmin(); |
612 |
|
max=mag[i][ii]->GetXaxis()->GetXmax(); |
613 |
|
xlat=min+(max-min)/2; |
614 |
|
stringstream mi,ma; |
615 |
|
mi<<"minimum recorded value"; |
616 |
|
ma<<"maximum recorded value"; |
617 |
|
t->SetTextSize(0.1); |
618 |
|
switch(i){ |
619 |
|
case 0: |
620 |
|
li.DrawLine(min,2054.,max,2054.); |
621 |
|
li.DrawLine(min,2048.,max,2048.); |
622 |
|
t1->DrawLatex(xlat,2054.3,ma.str().c_str()); |
623 |
|
t1->DrawLatex(xlat,2047.7,mi.str().c_str()); |
624 |
|
break; |
625 |
|
|
626 |
|
case 1: |
627 |
|
li.DrawLine(min,2055.,max,2055.); |
628 |
|
li.DrawLine(min,2049.,max,2049.); |
629 |
|
t1->DrawLatex(xlat,2055.3,ma.str().c_str()); |
630 |
|
t1->DrawLatex(xlat,2048.7,mi.str().c_str()); |
631 |
|
break; |
632 |
|
|
633 |
|
case 2: |
634 |
|
li.DrawLine(min,2056.,max,2056.); |
635 |
|
li.DrawLine(min,2050.,max,2050.); |
636 |
|
t1->DrawLatex(xlat,2056.3,ma.str().c_str()); |
637 |
|
t1->DrawLatex(xlat,2049.7,mi.str().c_str()); |
638 |
|
break; |
639 |
|
|
640 |
|
case 3: |
641 |
|
li.DrawLine(min,2057.,max,2057.); |
642 |
|
li.DrawLine(min,2051.,max,2051.); |
643 |
|
t1->DrawLatex(xlat,2057.3,ma.str().c_str()); |
644 |
|
t1->DrawLatex(xlat,2050.7,mi.str().c_str()); |
645 |
|
break; |
646 |
|
|
647 |
|
case 4: |
648 |
|
li.DrawLine(min,2066.,max,2066.); |
649 |
|
li.DrawLine(min,2060.,max,2060.); |
650 |
|
t1->DrawLatex(xlat,2066.2,ma.str().c_str()); |
651 |
|
t1->DrawLatex(xlat,2059.8,mi.str().c_str()); |
652 |
|
break; |
653 |
|
|
654 |
|
} |
655 |
|
BfieldCanv[ii]->Update(); |
656 |
|
tit.str(""); |
657 |
|
} |
658 |
|
if(countMAG==bsize-1 && ii==cntpgmag-1){ |
659 |
|
break; |
660 |
|
} |
661 |
|
} |
662 |
|
|
663 |
|
|
664 |
// |
// |
665 |
// Fill compressiontime and eventnumber graphs and DSP warnings |
// Fill compressiontime and eventnumber graphs and DSP warnings |
742 |
// and fill graphs and histos |
// and fill graphs and histos |
743 |
|
|
744 |
Int_t al=0; |
Int_t al=0; |
745 |
|
ULong_t obtx=0; |
746 |
Double_t x[MAXSTORAGE]; |
Double_t x[MAXSTORAGE]; |
747 |
Float_t yc[MAXSTORAGE][12]; |
Float_t yc[MAXSTORAGE][12]; |
748 |
Double_t eventint[MAXSTORAGE]; |
Double_t eventint[MAXSTORAGE]; |
756 |
|
|
757 |
if(ev==maxevent-1) maxev=maxevent-1; |
if(ev==maxevent-1) maxev=maxevent-1; |
758 |
|
|
759 |
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){ |
760 |
maxev=ev; |
maxev=ev; |
761 |
break; |
break; |
762 |
} |
} |
763 |
else{ |
else{ |
764 |
x[(ev-minev)]= ph->GetOrbitalTime(); |
obtx = ph->GetOrbitalTime(); |
765 |
|
x[(ev-minev)]=(Double_t)obtx; |
766 |
ALARM=0; |
ALARM=0; |
|
|
|
767 |
Int_t dsp=0; |
Int_t dsp=0; |
768 |
for(Int_t i=0; i<12; i++){ |
Int_t noacq=0; |
769 |
if(te->DSPnumber[i]<1 || te->DSPnumber[i]>12) { |
// Int_t acq_dsp[12]; |
770 |
ALARM=1; |
ULong_t acq_info_tmp=0; |
771 |
break; |
if(cod->Get(pctp->RunHeader)>0) acq_info_tmp=acq_info[cod->Get(pctp->RunHeader)-1]; |
772 |
} |
else acq_info_tmp=acq_info[cod->Get(pctp->RunHeader)]; |
773 |
|
for(Int_t io=0;io<12;io++){ |
774 |
|
// acq_dsp[dsp]=(acq_info_tmp>>(12+io))&(~(~0<<1)); |
775 |
|
if(((acq_info_tmp>>(12+io))&(~(~0<<1)))==0) |
776 |
|
noacq+=1; |
777 |
|
WARNING[io]=0; |
778 |
|
} |
779 |
|
|
780 |
dsp=te->DSPnumber[i]-1; |
for(Int_t i=0; i<12; i++){ |
|
yc[(ev-minev)][dsp]= 0.051*te->compressiontime[i]; |
|
781 |
|
|
782 |
// |
if(i<12-noacq){ |
783 |
// Fill Cluster Signal and Lighting of the view histos |
if(te->DSPnumber[i]<1 || te->DSPnumber[i]>12) { |
784 |
for(Int_t j=0;j<3;j++){ |
ALARM=1; |
785 |
if(te->signcluster[i][j]!=0){ |
break; |
786 |
if((te->addrcluster[i][j]>6 && te->addrcluster[i][j]<505) ||(te->addrcluster[i][j]>518 && te->addrcluster[i][j]<1018)){ |
} |
787 |
illuminazione[dsp]->Fill((Float_t)((j*1024.)+te->addrcluster[i][j])); |
|
788 |
|
dsp=te->DSPnumber[i]-1; |
789 |
|
yc[(ev-minev)][dsp]= 0.051*te->compressiontime[i]; |
790 |
|
|
791 |
|
// |
792 |
|
// Fill Cluster Signal and Lighting of the view histos |
793 |
|
for(Int_t j=0;j<3;j++){ |
794 |
|
if(te->signcluster[i][j]!=0){ |
795 |
|
if((te->addrcluster[i][j]>6 && te->addrcluster[i][j]<505) ||(te->addrcluster[i][j]>518 && te->addrcluster[i][j]<1018)){ |
796 |
|
illuminazione[dsp]->Fill((Float_t)((j*1024.)+te->addrcluster[i][j])); |
797 |
|
} |
798 |
} |
} |
799 |
} |
} |
800 |
} |
if(trk_cal_us[cod->Get(pctp->RunHeader)]!=104){ |
801 |
if(trk_cal_us[cod->Get(pctp->RunHeader)]!=104){ |
if(!(dsp%2)){ |
802 |
if(!(dsp%2)){ |
if(te->signcluster[i][0]!=0) landau1[dsp]->Fill((Float_t)(1024.-te->signcluster[i][0])); |
803 |
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])); |
804 |
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])); |
805 |
if(te->signcluster[i][2]!=0) landau3[dsp]->Fill((Float_t)(1024.-te->signcluster[i][2])); |
} |
806 |
} |
else{ |
807 |
else{ |
if(te->signcluster[i][0]!=0) landau1[dsp]->Fill((Float_t)te->signcluster[i][0]); |
808 |
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]); |
809 |
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]); |
810 |
if(te->signcluster[i][2]!=0) landau3[dsp]->Fill((Float_t)te->signcluster[i][2]); |
} |
811 |
} |
} |
|
} |
|
812 |
|
|
813 |
WARNING[i]=0; |
WARNING[i]=0; |
814 |
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){ |
815 |
ALARM = 1; //general alarm |
if(countFC[dsp]==0){ |
816 |
WARNING[i] = 1; // DSP warning |
ALARM = 1; //general alarm |
817 |
}; |
WARNING[i] = 1; // DSP warning |
818 |
|
} |
819 |
if(te->alarm[i]!=0){ // hardware alarm |
countFC[dsp]+=1; |
820 |
ALARM = 1; |
}; |
821 |
}; |
|
822 |
|
if(te->fl1[i]!=0){ |
823 |
|
if(countFL1[dsp]==0){ |
824 |
|
ALARM = 1; //general alarm |
825 |
|
WARNING[i] = 1; // DSP warning |
826 |
|
} |
827 |
|
countFL1[dsp]+=1; |
828 |
|
}; |
829 |
|
|
830 |
|
if(te->fl2[i]!=0){ |
831 |
|
if(countFL2[dsp]==0){ |
832 |
|
ALARM = 1; //general alarm |
833 |
|
WARNING[i] = 1; // DSP warning |
834 |
|
} |
835 |
|
countFL2[dsp]+=1; |
836 |
|
}; |
837 |
|
|
838 |
|
if(te->fl3[i]!=0){ |
839 |
|
if(countFL3[dsp]==0){ |
840 |
|
ALARM = 1; //general alarm |
841 |
|
WARNING[i] = 1; // DSP warning |
842 |
|
} |
843 |
|
countFL3[dsp]+=1; |
844 |
|
}; |
845 |
|
|
846 |
|
if(te->fl4[i]!=0){ |
847 |
|
if(countFL4[dsp]==0){ |
848 |
|
ALARM = 1; //general alarm |
849 |
|
WARNING[i] = 1; // DSP warning |
850 |
|
} |
851 |
|
countFL4[dsp]+=1; |
852 |
|
}; |
853 |
|
|
854 |
|
if(te->fl5[i]!=0){ |
855 |
|
if(countFL5[dsp]==0){ |
856 |
|
ALARM = 1; //general alarm |
857 |
|
WARNING[i] = 1; // DSP warning |
858 |
|
} |
859 |
|
countFL5[dsp]+=1; |
860 |
|
}; |
861 |
|
|
862 |
|
if(te->fl6[i]!=0){ |
863 |
|
if(countFL6[dsp]==0){ |
864 |
|
ALARM = 1; //general alarm |
865 |
|
WARNING[i] = 1; // DSP warning |
866 |
|
} |
867 |
|
countFL6[dsp]+=1; |
868 |
|
}; |
869 |
|
|
870 |
|
if(dsp%2==0 && te->alarm[i]!=0){ // hardware alarm |
871 |
|
if(countALARMy==0) |
872 |
|
ALARM = 1; |
873 |
|
countALARMy+=1; |
874 |
|
}; |
875 |
|
|
876 |
|
if(dsp%2==1 && te->alarm[i]!=0){ // hardware alarm |
877 |
|
if(countALARMx==0) |
878 |
|
ALARM = 1; |
879 |
|
countALARMx+=1; |
880 |
|
}; |
881 |
|
|
882 |
//************************************************************************************** |
//************************************************************************************** |
883 |
// warning for internal number |
// warning for internal number |
884 |
//************************************************************************************** |
//************************************************************************************** |
885 |
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; |
886 |
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; |
887 |
|
} |
888 |
} |
} |
889 |
eventint[(ev-minev)]=te->eventn[0]; |
eventint[(ev-minev)]=te->eventn[0]; |
890 |
|
|
896 |
al=1; |
al=1; |
897 |
alarm <<endl<< "================================================="<< endl; |
alarm <<endl<< "================================================="<< endl; |
898 |
alarm << "PSCU-Pkt N. "<< ph->GetCounter() ; |
alarm << "PSCU-Pkt N. "<< ph->GetCounter() ; |
899 |
alarm << " - OBT "<< ph->GetOrbitalTime() << " ms"<<endl; |
alarm << " - OBT "<< (ULong_t)ph->GetOrbitalTime() << " ms"<<endl; |
900 |
alarm << "Total events "<<nevent<<endl; |
alarm << "Total events "<<nevent<<endl; |
901 |
alarm << "(ROOT-tree entry "<<ev<<" in page "<<ii+1<<" )"<<endl; |
alarm << "(ROOT-tree entry "<<ev<<" in page "<<ii+1<<" )"<<endl; |
902 |
alarm << "================================================="<< endl; |
alarm << "================================================="<< endl; |
937 |
} |
} |
938 |
} |
} |
939 |
if(al==0) alarm << endl<< "Page "<<ii+1<< ": ------> NO ALARM!!! <-------"<<endl; |
if(al==0) alarm << endl<< "Page "<<ii+1<< ": ------> NO ALARM!!! <-------"<<endl; |
940 |
|
if(maxev==maxevent-1) { |
941 |
|
if(countALARMy!=0){ |
942 |
|
if(countALARMy%6!=0) alarm << endl<<endl<< "***** "<<countALARMy/6+1 <<" events with hardware alarm in Y-view *****"<<endl; |
943 |
|
else alarm << endl<<endl<< "***** "<<countALARMy/6 <<" events with hardware alarm in Y-view *****"<<endl; |
944 |
|
} |
945 |
|
if(countALARMx!=0){ |
946 |
|
if(countALARMx%6!=0) alarm << endl<<endl<< "***** "<<countALARMx/6+1 <<" events with hardware alarm in X-view *****"<<endl; |
947 |
|
else alarm << endl<<endl<< "***** "<<countALARMx/6 <<" events with hardware alarm in X-view *****"<<endl; |
948 |
|
} |
949 |
|
for(int p=0; p<12; p++){ |
950 |
|
if(countFC[p]!=0) alarm << endl<<endl<< "***** "<<countFC[p] <<" events with fc!=0 in DSP "<<p+1<<" *****"<<endl; |
951 |
|
if(countFL1[p]!=0) alarm << endl<<endl<< "***** "<<countFL1[p] <<" events with fl1!=0 in DSP "<<p+1<<" *****"<<endl; |
952 |
|
if(countFL2[p]!=0) alarm << endl<<endl<< "***** "<<countFL2[p] <<" events with fl2!=0 in DSP "<<p+1<<" *****"<<endl; |
953 |
|
if(countFL3[p]!=0) alarm << endl<<endl<< "***** "<<countFL3[p] <<" events with fl3!=0 in DSP "<<p+1<<" *****"<<endl; |
954 |
|
if(countFL4[p]!=0) alarm << endl<<endl<< "***** "<<countFL4[p] <<" events with fl4!=0 in DSP "<<p+1<<" *****"<<endl; |
955 |
|
if(countFL5[p]!=0) alarm << endl<<endl<< "***** "<<countFL5[p] <<" events with fl5!=0 in DSP "<<p+1<<" *****"<<endl; |
956 |
|
if(countFL6[p]!=0) alarm << endl<<endl<< "***** "<<countFL6[p] <<" events with fl6!=0 in DSP "<<p+1<<" *****"<<endl; |
957 |
|
} |
958 |
|
} |
959 |
|
|
960 |
// |
// |
961 |
// Draw the graphs |
// Draw the graphs |
977 |
comprtime[i][ii]->GetXaxis()->CenterTitle(); |
comprtime[i][ii]->GetXaxis()->CenterTitle(); |
978 |
comprtime[i][ii]->GetYaxis()->SetTitle("compressiontime (ms)"); |
comprtime[i][ii]->GetYaxis()->SetTitle("compressiontime (ms)"); |
979 |
comprtime[i][ii]->GetYaxis()->CenterTitle(); |
comprtime[i][ii]->GetYaxis()->CenterTitle(); |
980 |
|
if(maxev-minev==1) comprtime[i][ii]->GetXaxis()->SetNdivisions(-501); |
981 |
// comprtime[i][ii]->GetYaxis()->SetRangeUser(0,3); |
// comprtime[i][ii]->GetYaxis()->SetRangeUser(0,3); |
982 |
comprtime[i][ii]->Draw("ap"); |
comprtime[i][ii]->Draw("ap"); |
983 |
oss1.str(""); |
oss1.str(""); |
984 |
CompTimeCanv[ii]->Update(); |
CompTimeCanv[ii]->Update(); |
985 |
} |
} |
986 |
|
|
987 |
|
|
988 |
EventNumCanv[ii]->cd(); |
EventNumCanv[ii]->cd(); |
989 |
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); |
990 |
pt->SetFillColor(10); |
pt->SetFillColor(10); |
1003 |
eventnumb[ii]->GetYaxis()->SetTitleSize(0.03); |
eventnumb[ii]->GetYaxis()->SetTitleSize(0.03); |
1004 |
eventnumb[ii]->GetYaxis()->SetTitle("DSP event-number"); |
eventnumb[ii]->GetYaxis()->SetTitle("DSP event-number"); |
1005 |
eventnumb[ii]->GetYaxis()->CenterTitle(); |
eventnumb[ii]->GetYaxis()->CenterTitle(); |
1006 |
|
if(maxev-minev==1) eventnumb[ii]->GetXaxis()->SetNdivisions(-501); |
1007 |
eventnumb[ii]->GetYaxis()->SetTitleOffset(2.); |
eventnumb[ii]->GetYaxis()->SetTitleOffset(2.); |
1008 |
eventnumb[ii]->SetMarkerStyle(21); |
eventnumb[ii]->SetMarkerStyle(21); |
1009 |
eventnumb[ii]->SetMarkerColor(kBlue); |
eventnumb[ii]->SetMarkerColor(kBlue); |
1010 |
eventnumb[ii]->SetMarkerSize(0.2); |
eventnumb[ii]->SetMarkerSize(0.2); |
1011 |
|
oss1.str(""); |
1012 |
|
oss1<<"number of events in this graph: "<<maxev-minev; |
1013 |
|
t->SetTextColor(kBlue); |
1014 |
|
t->SetTextSize(0.02); |
1015 |
|
double xtex=0,ytex=0; |
1016 |
|
xtex=x[maxev-minev-1]-(x[maxev-minev-1]-x[0])/3; |
1017 |
|
ytex=1000.+eventnumb[ii]->GetYaxis()->GetXmax(); |
1018 |
|
t->DrawLatex(xtex,ytex,oss1.str().c_str()); |
1019 |
|
oss1.str(""); |
1020 |
eventnumb[ii]->Draw("ap"); |
eventnumb[ii]->Draw("ap"); |
1021 |
EventNumCanv[ii]->Update(); |
EventNumCanv[ii]->Update(); |
1022 |
|
|
1028 |
|
|
1029 |
} |
} |
1030 |
|
|
|
|
|
1031 |
alarm.close(); |
alarm.close(); |
1032 |
|
|
1033 |
//**************************************************************************************** |
//**************************************************************************************** |
1115 |
t1->DrawLatex(70.,98.7,isfile.str().c_str()); |
t1->DrawLatex(70.,98.7,isfile.str().c_str()); |
1116 |
isfile.str(""); |
isfile.str(""); |
1117 |
|
|
1118 |
|
isfile<<"Chips with white line at least once showed anomalous behaviour"; |
1119 |
|
t->SetTextColor(17); |
1120 |
|
t->SetTextSize(0.018); |
1121 |
|
t->DrawLatex(.01,.96,isfile.str().c_str()); |
1122 |
|
isfile.str(""); |
1123 |
|
|
1124 |
|
isfile<<"Boxes so colored point out anomalous chips (not necessarily broken)"; |
1125 |
|
t->SetTextColor(107); |
1126 |
|
// t->DrawLatex(7.,95.7,isfile.str().c_str()); |
1127 |
|
isfile.str(""); |
1128 |
|
t->SetTextColor(1); |
1129 |
|
|
1130 |
// |
// |
1131 |
// Draw the histos |
// Draw the histos |
1132 |
for (Int_t i=0; i<12 ; i++){ |
for (Int_t nn=0; nn<12 ; nn++){ |
1133 |
|
|
1134 |
TBox b; |
TBox b; |
|
b.SetFillColor(6); |
|
|
b.SetFillStyle(3945); |
|
1135 |
|
|
1136 |
Float_t maxhist=0; |
Float_t maxhist=0.,va1x=0.,minhist=0.; |
1137 |
LandauCanv1->cd(); |
LandauCanv1->cd(); |
1138 |
pad1[i]->SetFillColor(10); |
pad1[nn]->SetFillColor(10); |
1139 |
pad1[i]->SetFrameFillColor(10); |
pad1[nn]->SetFrameFillColor(10); |
1140 |
pad1[i]->Draw(); |
pad1[nn]->Draw(); |
1141 |
pad1[i]->cd(); |
pad1[nn]->cd(); |
1142 |
landau1[i]->GetXaxis()->SetTitle("max signal"); |
landau1[nn]->GetXaxis()->SetTitle("max signal"); |
1143 |
landau1[i]->GetXaxis()->CenterTitle(); |
landau1[nn]->GetXaxis()->CenterTitle(); |
1144 |
landau1[i]->Draw(""); |
landau1[nn]->Draw(""); |
1145 |
LandauCanv1->Update(); |
LandauCanv1->Update(); |
1146 |
|
|
1147 |
LandauCanv2->cd(); |
LandauCanv2->cd(); |
1148 |
pad4[i]->SetFillColor(10); |
pad4[nn]->SetFillColor(10); |
1149 |
pad4[i]->SetFrameFillColor(10); |
pad4[nn]->SetFrameFillColor(10); |
1150 |
pad4[i]->Draw(); |
pad4[nn]->Draw(); |
1151 |
pad4[i]->cd(); |
pad4[nn]->cd(); |
1152 |
landau2[i]->GetXaxis()->SetTitle("max signal"); |
landau2[nn]->GetXaxis()->SetTitle("max signal"); |
1153 |
landau2[i]->GetXaxis()->CenterTitle(); |
landau2[nn]->GetXaxis()->CenterTitle(); |
1154 |
landau2[i]->Draw(""); |
landau2[nn]->Draw(""); |
1155 |
LandauCanv2->Update(); |
LandauCanv2->Update(); |
1156 |
|
|
1157 |
LandauCanv3->cd(); |
LandauCanv3->cd(); |
1158 |
pad5[i]->SetFillColor(10); |
pad5[nn]->SetFillColor(10); |
1159 |
pad5[i]->SetFrameFillColor(10); |
pad5[nn]->SetFrameFillColor(10); |
1160 |
pad5[i]->Draw(); |
pad5[nn]->Draw(); |
1161 |
pad5[i]->cd(); |
pad5[nn]->cd(); |
1162 |
landau3[i]->GetXaxis()->SetTitle("max signal"); |
landau3[nn]->GetXaxis()->SetTitle("max signal"); |
1163 |
landau3[i]->GetXaxis()->CenterTitle(); |
landau3[nn]->GetXaxis()->CenterTitle(); |
1164 |
landau3[i]->Draw(""); |
landau3[nn]->Draw(""); |
1165 |
LandauCanv3->Update(); |
LandauCanv3->Update(); |
1166 |
|
|
1167 |
|
|
1168 |
|
li.SetLineColor(38); |
1169 |
|
li.SetLineStyle(4); |
1170 |
|
li.SetLineWidth(2); |
1171 |
|
liva1.SetLineColor(42); |
1172 |
|
liva1.SetLineStyle(3); |
1173 |
|
liva1.SetLineWidth(1); |
1174 |
|
|
1175 |
IlluminaCanv->cd(); |
IlluminaCanv->cd(); |
1176 |
pad2[i]->SetFillColor(10); |
pad2[nn]->SetFillColor(10); |
1177 |
pad2[i]->SetFrameFillColor(10); |
pad2[nn]->SetFrameFillColor(10); |
1178 |
pad2[i]->SetLogy(); |
pad2[nn]->SetLogy(); |
1179 |
pad2[i]->Draw(); |
pad2[nn]->Draw(); |
1180 |
pad2[i]->cd(); |
pad2[nn]->cd(); |
1181 |
illuminazione[i]->GetXaxis()->SetTitle("strip with max signal"); |
illuminazione[nn]->GetXaxis()->SetTitle("strip with max signal"); |
1182 |
illuminazione[i]->GetXaxis()->CenterTitle(); |
illuminazione[nn]->GetXaxis()->CenterTitle(); |
1183 |
illuminazione[i]->Draw(""); |
illuminazione[nn]->Draw(""); |
1184 |
if(i==1){ |
maxhist= illuminazione[nn]->GetMaximum(); |
1185 |
maxhist= illuminazione[i]->GetMaximum(); |
minhist=0.; |
1186 |
b.DrawBox(2816.,0.,3060.,maxhist); |
b.SetFillColor(19); |
1187 |
} |
b.SetFillStyle(3954); |
1188 |
else if(i==6){ |
if(nn==0){ |
1189 |
maxhist= illuminazione[i]->GetMaximum(); |
b.DrawBox(0.,minhist,2047.,maxhist); |
1190 |
b.DrawBox(2560.,0.,2816.,maxhist); |
} |
1191 |
b.DrawBox(512.,0.,768.,maxhist); |
else if(nn==1){ |
1192 |
b.DrawBox(1024.,0.,1792.,maxhist); |
b.DrawBox(128.,minhist,256.,maxhist); |
1193 |
} |
b.DrawBox(384.,minhist,512.,maxhist); |
1194 |
else if(i==11){ |
b.DrawBox(896.,minhist,1024.,maxhist); |
1195 |
maxhist= illuminazione[i]->GetMaximum(); |
b.DrawBox(2048.,minhist,2432.,maxhist); |
1196 |
b.DrawBox(768.,0.,1024.,maxhist); |
b.DrawBox(2816.,minhist,2944.,maxhist); |
1197 |
|
b.DrawBox(2944.,minhist,3070.,maxhist); |
1198 |
|
} |
1199 |
|
else if(nn==3){ |
1200 |
|
b.DrawBox(0.,minhist,256.,maxhist); |
1201 |
|
b.DrawBox(2816.,minhist,3070.,maxhist); |
1202 |
} |
} |
1203 |
|
else if(nn==4){ |
1204 |
|
b.DrawBox(256.,minhist,512.,maxhist); |
1205 |
|
b.DrawBox(1792.,minhist,1920.,maxhist); |
1206 |
|
b.DrawBox(2816.,minhist,3070.,maxhist); |
1207 |
|
} |
1208 |
|
else if(nn==5){ |
1209 |
|
b.DrawBox(0.,minhist,256.,maxhist); |
1210 |
|
b.DrawBox(896.,minhist,1024.,maxhist); |
1211 |
|
b.DrawBox(1664.,minhist,1792.,maxhist); |
1212 |
|
} |
1213 |
|
else if(nn==6){ |
1214 |
|
b.DrawBox(512.,minhist,768.,maxhist); |
1215 |
|
b.DrawBox(1024.,minhist,1280.,maxhist); |
1216 |
|
b.DrawBox(1280.,minhist,1792.,maxhist); |
1217 |
|
b.DrawBox(2560.,minhist,2816.,maxhist); |
1218 |
|
} |
1219 |
|
else if(nn==7){ |
1220 |
|
b.DrawBox(0.,minhist,1535.,maxhist); |
1221 |
|
b.DrawBox(2024.,minhist,2280.,maxhist); |
1222 |
|
} |
1223 |
|
else if(nn==8){ |
1224 |
|
b.DrawBox(512.,minhist,768.,maxhist); |
1225 |
|
} |
1226 |
|
else if(nn==9){ |
1227 |
|
b.DrawBox(0.,minhist,128.,maxhist); |
1228 |
|
b.DrawBox(256.,minhist,384.,maxhist); |
1229 |
|
b.DrawBox(512.,minhist,640.,maxhist); |
1230 |
|
b.DrawBox(896.,minhist,1152.,maxhist); |
1231 |
|
b.DrawBox(1280.,minhist,1535.,maxhist); |
1232 |
|
b.DrawBox(1664.,minhist,1920.,maxhist); |
1233 |
|
b.DrawBox(2048.,minhist,2304.,maxhist); |
1234 |
|
} |
1235 |
|
else if(nn==10){ |
1236 |
|
b.DrawBox(0.,minhist,512.,maxhist); |
1237 |
|
b.DrawBox(1024.,minhist,3070.,maxhist); |
1238 |
|
} |
1239 |
|
else if(nn==11){ |
1240 |
|
b.DrawBox(0.,minhist,512.,maxhist); |
1241 |
|
b.DrawBox(768.,minhist,1024.,maxhist); |
1242 |
|
b.DrawBox(1536.,minhist,1664.,maxhist); |
1243 |
|
b.DrawBox(1920.,minhist,2560.,maxhist); |
1244 |
|
b.DrawBox(2816.,minhist,3070.,maxhist); |
1245 |
|
} |
1246 |
|
for(int va=1; va<24; va++){ |
1247 |
|
va1x=128*va; |
1248 |
|
liva1.DrawLine(va1x,minhist,va1x,maxhist); |
1249 |
|
} |
1250 |
|
li.DrawLine(1024.5,minhist,1024.5,maxhist); |
1251 |
|
li.DrawLine(2048.5,minhist,2048.5,maxhist); |
1252 |
IlluminaCanv->Update(); |
IlluminaCanv->Update(); |
1253 |
} |
} |
1254 |
|
|
1263 |
else if(cntpgtemp<=cntpgdat) totpg=cntpgdat; |
else if(cntpgtemp<=cntpgdat) totpg=cntpgdat; |
1264 |
|
|
1265 |
for(Int_t fl=0;fl<totpg;fl++){ |
for(Int_t fl=0;fl<totpg;fl++){ |
1266 |
|
|
1267 |
if(!strcmp(outfile.Data(),"ps")||!strcmp(outfile.Data(),"pdf")){ |
if(!strcmp(outfile.Data(),"ps")||!strcmp(outfile.Data(),"pdf")){ |
1268 |
out1.str(""); |
out1.str(""); |
1269 |
out2.str(""); |
out2.str(""); |
1277 |
CompTimeCanv[fl]->Print(out+out1.str().c_str(),"Portrait"); |
CompTimeCanv[fl]->Print(out+out1.str().c_str(),"Portrait"); |
1278 |
EventNumCanv[fl]->Print(out+out2.str().c_str(),"Portrait"); |
EventNumCanv[fl]->Print(out+out2.str().c_str(),"Portrait"); |
1279 |
TempCanv[fl]->Print(out+out2.str().c_str(),"Portrait"); |
TempCanv[fl]->Print(out+out2.str().c_str(),"Portrait"); |
1280 |
|
BfieldCanv[fl]->Print(out+out2.str().c_str(),"Portrait"); |
1281 |
LandauCanv1->Print(out+out2.str().c_str(),"Portrait"); |
LandauCanv1->Print(out+out2.str().c_str(),"Portrait"); |
1282 |
LandauCanv2->Print(out+out2.str().c_str(),"Portrait"); |
LandauCanv2->Print(out+out2.str().c_str(),"Portrait"); |
1283 |
LandauCanv3->Print(out+out2.str().c_str(),"Portrait"); |
LandauCanv3->Print(out+out2.str().c_str(),"Portrait"); |
1287 |
if(fl==0) CompTimeCanv[fl]->Print(out+out1.str().c_str(),"Portrait"); |
if(fl==0) CompTimeCanv[fl]->Print(out+out1.str().c_str(),"Portrait"); |
1288 |
if(fl>0 && fl<cntpgdat) CompTimeCanv[fl]->Print(out+out2.str().c_str(),"Portrait"); |
if(fl>0 && fl<cntpgdat) CompTimeCanv[fl]->Print(out+out2.str().c_str(),"Portrait"); |
1289 |
if(fl<cntpgdat) EventNumCanv[fl]->Print(out+out2.str().c_str(),"Portrait"); |
if(fl<cntpgdat) EventNumCanv[fl]->Print(out+out2.str().c_str(),"Portrait"); |
1290 |
|
if(fl<cntpgmag) BfieldCanv[fl]->Print(out+out2.str().c_str(),"Portrait"); |
1291 |
if(fl<cntpgtemp) TempCanv[fl]->Print(out+out2.str().c_str(),"Portrait"); |
if(fl<cntpgtemp) TempCanv[fl]->Print(out+out2.str().c_str(),"Portrait"); |
1292 |
if(fl==totpg-1){ |
if(fl==totpg-1){ |
1293 |
LandauCanv1->Print(out+out2.str().c_str(),"Portrait"); |
LandauCanv1->Print(out+out2.str().c_str(),"Portrait"); |
1302 |
out1<<ffile<<"_FTrkQLook_EXPERT-CompTime-pag"<<fl+1<<"."<<outfile.Data(); |
out1<<ffile<<"_FTrkQLook_EXPERT-CompTime-pag"<<fl+1<<"."<<outfile.Data(); |
1303 |
if(fl<cntpgdat) CompTimeCanv[fl]->Print(out+out1.str().c_str()); |
if(fl<cntpgdat) CompTimeCanv[fl]->Print(out+out1.str().c_str()); |
1304 |
out1.str(""); |
out1.str(""); |
1305 |
|
out1<<ffile<<"_FTrkQLook_EXPERT-BField-pag"<<fl+1<<"."<<outfile.Data(); |
1306 |
|
if(fl<cntpgmag) BfieldCanv[fl]->Print(out+out1.str().c_str()); |
1307 |
|
out1.str(""); |
1308 |
out1<<ffile<<"_FTrkQLook_EXPERT-Temp-pag"<<fl+1<<"."<<outfile.Data(); |
out1<<ffile<<"_FTrkQLook_EXPERT-Temp-pag"<<fl+1<<"."<<outfile.Data(); |
1309 |
if(fl<cntpgtemp) TempCanv[fl]->Print(out+out1.str().c_str()); |
if(fl<cntpgtemp) TempCanv[fl]->Print(out+out1.str().c_str()); |
1310 |
out1.str(""); |
out1.str(""); |