2 |
* FTrkQLook_EXPERT.cxx |
* FTrkQLook_EXPERT.cxx |
3 |
* |
* |
4 |
* autor: D.Fedele |
* autor: D.Fedele |
5 |
* version v1r04 |
* version v1r08 |
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 |
30 |
#include <TrkAlarmEvent.h> |
#include <TrkAlarmEvent.h> |
31 |
#include <tsbt/TsbTRecord.h> |
#include <tsbt/TsbTRecord.h> |
32 |
#include <tsbt/TsbTEvent.h> |
#include <tsbt/TsbTEvent.h> |
33 |
|
#include <tsbb/TsbBRecord.h> |
34 |
|
#include <tsbb/TsbBEvent.h> |
35 |
#include <EventCounter.h> |
#include <EventCounter.h> |
36 |
#include <PacketType.h> |
#include <PacketType.h> |
37 |
// |
// |
41 |
{ |
{ |
42 |
// |
// |
43 |
// obtain information about the data file and select the output dir |
// obtain information about the data file and select the output dir |
|
const string filepath=file.Data(); |
|
44 |
Int_t dwpos = file.Last('/'); |
Int_t dwpos = file.Last('/'); |
45 |
Int_t dwpos1 = file.Last('.'); |
Int_t dwpos1 = file.Last('.'); |
46 |
TString base,ffile ; |
TString base,ffile ; |
59 |
// inizialise the variables and open the file |
// inizialise the variables and open the file |
60 |
pamela::TsbTEvent *event = 0; |
pamela::TsbTEvent *event = 0; |
61 |
pamela::TsbTRecord *record = 0; |
pamela::TsbTRecord *record = 0; |
62 |
|
pamela::TsbBEvent *Bevent = 0; |
63 |
|
pamela::TsbBRecord *Brecord = 0; |
64 |
pamela::tracker::TrackerEvent *te=0; |
pamela::tracker::TrackerEvent *te=0; |
65 |
pamela::EventHeader *eh=0,*aleh=0,*eH=0,*eT=0; |
pamela::EventHeader *eh=0,*aleh=0,*eH=0,*eT=0,*eB=0; |
66 |
pamela::PscuHeader *ph=0,*pH=0; |
pamela::PscuHeader *ph=0,*pH=0; |
67 |
pamela::TrkAlarmEvent *al=0; |
pamela::TrkAlarmEvent *al=0; |
68 |
pamela::RunHeaderEvent *reh=0; |
pamela::RunHeaderEvent *reh=0; |
80 |
tree->SetBranchAddress("TsbT",&event); |
tree->SetBranchAddress("TsbT",&event); |
81 |
tree->SetBranchAddress("Header",&eT); |
tree->SetBranchAddress("Header",&eT); |
82 |
|
|
83 |
|
TTree *Btree = (TTree*)datafile->Get("TsbB"); |
84 |
|
Btree->SetBranchAddress("TsbB",&Bevent); |
85 |
|
Btree->SetBranchAddress("Header",&eB); |
86 |
|
|
87 |
TTree *altr = (TTree*)datafile->Get("TrkAlarm"); |
TTree *altr = (TTree*)datafile->Get("TrkAlarm"); |
88 |
altr->SetBranchAddress("TrkAlarm",&al); |
altr->SetBranchAddress("TrkAlarm",&al); |
89 |
altr->SetBranchAddress("Header",&aleh); |
altr->SetBranchAddress("Header",&aleh); |
99 |
Long64_t nevent = tr->GetEntries(); |
Long64_t nevent = tr->GetEntries(); |
100 |
Long64_t neventH = otr->GetEntries(); |
Long64_t neventH = otr->GetEntries(); |
101 |
Long64_t tnevent = tree->GetEntries(); |
Long64_t tnevent = tree->GetEntries(); |
102 |
|
Long64_t bnevent = Btree->GetEntries(); |
103 |
Long64_t alnevent = altr->GetEntries(); |
Long64_t alnevent = altr->GetEntries(); |
104 |
Int_t minevent=0; |
Int_t minevent=0; |
105 |
Int_t maxevent=0; |
Int_t maxevent=0; |
107 |
printf("Number of total events: %lld\n",nevent); |
printf("Number of total events: %lld\n",nevent); |
108 |
printf("Number of header events: %lld\n",neventH); |
printf("Number of header events: %lld\n",neventH); |
109 |
printf("Number of TsbT events: %lld\n",tnevent); |
printf("Number of TsbT events: %lld\n",tnevent); |
110 |
|
printf("Number of TsbB events: %lld\n",bnevent); |
111 |
printf("Number of TrkAlarm packet events: %lld\n",alnevent); |
printf("Number of TrkAlarm packet events: %lld\n",alnevent); |
112 |
|
|
113 |
if (nevent<=0){ |
if (nevent<=0){ |
171 |
maxsize+=tmpSize; |
maxsize+=tmpSize; |
172 |
} |
} |
173 |
const Int_t tsize=maxsize; |
const Int_t tsize=maxsize; |
174 |
Int_t tempt[tsize][5],xt[tsize], tempt_tmp[tsize]; |
Int_t tempt[tsize][5]; |
175 |
|
ULong64_t xt[tsize]; |
176 |
|
|
177 |
Int_t countnboot=1; |
Int_t countnboot=1; |
178 |
|
Int_t cntpgtemp=0,cntpgdat=0,cntpgmag=0; |
179 |
// |
// |
180 |
// information about the temperatures |
// information about the temperatures |
181 |
for (Int_t ev=0; ev<tnevent; ev++){ |
for (Int_t ev=0; ev<tnevent; ev++){ |
193 |
siztmp++; |
siztmp++; |
194 |
} |
} |
195 |
} |
} |
196 |
countnboot+=2*(Int_t)nevent/MAXSTORAGE; |
cntpgtemp=countnboot; |
197 |
|
countnboot+=2+(Int_t)nevent/MAXSTORAGE; |
198 |
// printf("\ncountnboot=%d\n",countnboot); |
// printf("\ncountnboot=%d\n",countnboot); |
199 |
|
|
200 |
|
// |
201 |
|
// information about the entries for the magnetic field |
202 |
|
if(bnevent>0) cntpgmag=1; |
203 |
|
maxsize=0; |
204 |
|
for (Int_t ev=0; ev<bnevent; ev++){ |
205 |
|
Btree->GetEntry(ev); |
206 |
|
tmpSize = Bevent->Records->GetEntries(); |
207 |
|
maxsize+=tmpSize; |
208 |
|
} |
209 |
|
const Int_t bsize=maxsize; |
210 |
|
Int_t magt[bsize][5]; |
211 |
|
ULong64_t xb[bsize]; |
212 |
|
siztmp=0; |
213 |
|
// |
214 |
|
// information about the magnetic field |
215 |
|
for (Int_t ev=0; ev<bnevent; ev++){ |
216 |
|
Btree->GetEntry(ev); |
217 |
|
tmpSize = Bevent->Records->GetEntries(); |
218 |
|
for (Int_t j = 0; j < tmpSize; j++){ |
219 |
|
Brecord = (pamela::TsbBRecord*)Bevent->Records->At(j); |
220 |
|
xb[siztmp]=Brecord->RECORD_OBT; |
221 |
|
if((xb[siztmp]<xb[siztmp-1]) && siztmp>0) |
222 |
|
cntpgmag+=1; |
223 |
|
for (Int_t z = 0; z < 5; z++){ |
224 |
|
magt[siztmp][z] = Brecord->B_FIELD[z+1]; |
225 |
|
} |
226 |
|
siztmp++; |
227 |
|
} |
228 |
|
} |
229 |
|
|
230 |
// |
// |
231 |
// open the output text files for the alarms |
// open the output text files for the alarms |
320 |
|
|
321 |
// |
// |
322 |
// Define output canvas, histos and graphs |
// Define output canvas, histos and graphs |
323 |
TCanvas *CompTimeCanv[countnboot],*EventNumCanv[countnboot],*TempCanv[countnboot]; |
TCanvas *CompTimeCanv[countnboot],*EventNumCanv[countnboot],*TempCanv[cntpgtemp],*BfieldCanv[cntpgmag]; |
324 |
TCanvas *IlluminaCanv,*LandauCanv1,*LandauCanv2,*LandauCanv3; |
TCanvas *IlluminaCanv,*LandauCanv1,*LandauCanv2,*LandauCanv3; |
325 |
|
|
326 |
TH1F *landau1[12],*landau2[12],*landau3[12],*illuminazione[12]; |
TH1F *landau1[12],*landau2[12],*landau3[12],*illuminazione[12]; |
327 |
TGraph *comprtime[12][countnboot],*temp[5][countnboot],*eventnumb[countnboot]; |
TGraph *comprtime[12][countnboot],*temp[5][cntpgtemp],*tempw[5][cntpgtemp],*eventnumb[countnboot],*mag[5][cntpgmag]; |
328 |
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]; |
329 |
|
|
330 |
for(Int_t n = 0; n<12; n++) { |
for(Int_t n = 0; n<12; n++) { |
331 |
|
|
363 |
TLatex *t=new TLatex(); |
TLatex *t=new TLatex(); |
364 |
TLatex *t1=new TLatex(); |
TLatex *t1=new TLatex(); |
365 |
|
|
366 |
Int_t cntpgtemp=0,cntpgdat=0; |
|
367 |
Int_t minev=minevent,maxev=maxevent,countTEMP=0; |
Int_t minev=minevent,maxev=maxevent,countTEMP=0,countMAG=0; |
368 |
|
|
369 |
// |
// |
370 |
// Fill temperature graphs |
// Fill temperature graphs |
371 |
for(Int_t ii=0; ii<countnboot;ii++){ |
for(Int_t ii=0; ii<cntpgtemp;ii++){ |
372 |
//**************************************************************************************** |
//**************************************************************************************** |
373 |
//Temperature Output Pages |
//Temperature Output Pages |
374 |
//**************************************************************************************** |
//**************************************************************************************** |
390 |
t1->SetTextSize(0.02); |
t1->SetTextSize(0.02); |
391 |
t1->DrawLatex(78.,98.7,isfile.str().c_str()); |
t1->DrawLatex(78.,98.7,isfile.str().c_str()); |
392 |
isfile.str(""); |
isfile.str(""); |
393 |
|
t1->SetTextSize(0.025); |
394 |
|
t1->SetTextColor(196); |
395 |
|
isfile<<"--> Values at 28.5^{o}C (if presents) correspond"; |
396 |
|
t1->DrawLatex(50.,22.,isfile.str().c_str()); |
397 |
|
isfile.str(""); |
398 |
|
isfile<<" to wrong readings ( > 100^{o}C) of the Tsb"; |
399 |
|
t1->DrawLatex(50.,19.,isfile.str().c_str()); |
400 |
|
isfile.str(""); |
401 |
|
isfile<<"--> Values at 25.5^{o}C (if presents) correspond"; |
402 |
|
t1->DrawLatex(50.,12.,isfile.str().c_str()); |
403 |
|
isfile.str(""); |
404 |
|
isfile<<" to wrong readings ( < 0^{o}C) of the Tsb"; |
405 |
|
t1->DrawLatex(50.,9.,isfile.str().c_str()); |
406 |
|
isfile.str(""); |
407 |
|
|
408 |
Float_t tposy = 0.95; // up y-coord - top pads |
Float_t tposy = 0.95; // up y-coord - top pads |
409 |
Float_t thpad = 0; // pad height |
Float_t thpad = 0; // pad height |
429 |
/* -----------> pad for histograms */ |
/* -----------> pad for histograms */ |
430 |
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); |
431 |
|
|
432 |
Int_t v=0,xt_tmp[tsize]; |
Int_t v=0,vv=0; |
433 |
|
Double_t xt_tmp[tsize], tempt_tmp[tsize]; |
434 |
|
Double_t xt_tmpw[tsize], tempt_tmpw[tsize]; |
435 |
for (Int_t ev=countTEMP; ev<tsize; ev++){ |
for (Int_t ev=countTEMP; ev<tsize; ev++){ |
436 |
|
|
437 |
if(ev==tsize-1 && i==4) countTEMP=tsize-1; |
if(ev==tsize-1 && i==4) countTEMP=tsize-1; |
440 |
break; |
break; |
441 |
} |
} |
442 |
else{ |
else{ |
443 |
if(tempt[ev][i]!=65535){ |
tempt_tmp[v]=(Double_t)((Int_t)(((3.3*tempt[ev][i]/4096)-0.586)/0.0231)); |
444 |
tempt_tmp[v]=(Int_t)(((3.3*tempt[ev][i]/4096)-0.586)/0.0231); |
if(tempt_tmp[v]>100) { |
445 |
if(tempt_tmp[v]>0) xt_tmp[v++]=xt[ev]; |
tempt_tmp[v]=28.5; |
446 |
} |
tempt_tmpw[vv]=28.5; |
447 |
|
xt_tmpw[vv++]=(Double_t)xt[ev]; |
448 |
|
} |
449 |
|
else if(tempt_tmp[v]<0){ |
450 |
|
tempt_tmp[v]=25.5; |
451 |
|
tempt_tmpw[vv]=25.5; |
452 |
|
xt_tmpw[vv++]=(Double_t)xt[ev]; |
453 |
|
} |
454 |
|
xt_tmp[v++]=(Double_t)xt[ev]; |
455 |
} |
} |
456 |
} |
} |
457 |
TempCanv[ii]->cd(); |
TempCanv[ii]->cd(); |
476 |
temp[i][ii]->SetMarkerSize(0.2); |
temp[i][ii]->SetMarkerSize(0.2); |
477 |
temp[i][ii]->Draw("ap"); |
temp[i][ii]->Draw("ap"); |
478 |
tit.str(""); |
tit.str(""); |
479 |
|
if(vv>0){ |
480 |
|
tempw[i][ii]= new TGraph(vv,xt_tmpw,tempt_tmpw); |
481 |
|
tempw[i][ii]->SetMarkerStyle(21); |
482 |
|
tempw[i][ii]->SetMarkerSize(0.2); |
483 |
|
tempw[i][ii]->SetMarkerColor(196); |
484 |
|
tempw[i][ii]->Draw("samep"); |
485 |
|
} |
486 |
TempCanv[ii]->Update(); |
TempCanv[ii]->Update(); |
487 |
|
|
488 |
|
|
489 |
} |
} |
490 |
if(countTEMP==tsize-1){ |
if(countTEMP==tsize-1){ |
|
cntpgtemp=ii+1; |
|
491 |
break; |
break; |
492 |
} |
} |
493 |
} |
} |
494 |
|
|
495 |
|
// |
496 |
|
// Fill magnetic field graphs |
497 |
|
for(Int_t ii=0; ii<cntpgmag;ii++){ |
498 |
|
//**************************************************************************************** |
499 |
|
//Magnetic Field Output Pages |
500 |
|
//**************************************************************************************** |
501 |
|
fromfile.str(""); |
502 |
|
fromfile<<"FTrkQLook_EXPERT File: "<<ffile; |
503 |
|
isfile<<"Magnetic Axial Field vs OBT pag"<<ii+1; |
504 |
|
BfieldCanv[ii]=new TCanvas(isfile.str().c_str(),isfile.str().c_str(),900,1200); |
505 |
|
BfieldCanv[ii]->SetFillColor(10); |
506 |
|
BfieldCanv[ii]->Range(0,0,100,100); |
507 |
|
|
508 |
|
t->SetTextFont(32); |
509 |
|
t->SetTextColor(1); |
510 |
|
t->SetTextAlign(12); |
511 |
|
t->SetTextSize(0.02); |
512 |
|
t->DrawLatex(2.,98.7,fromfile.str().c_str()); |
513 |
|
t1->SetTextFont(32); |
514 |
|
t1->SetTextColor(1); |
515 |
|
t1->SetTextAlign(12); |
516 |
|
t1->SetTextSize(0.02); |
517 |
|
t1->DrawLatex(70.,98.7,isfile.str().c_str()); |
518 |
|
isfile.str(""); |
519 |
|
|
520 |
|
TLine li; |
521 |
|
li.SetLineStyle(1); |
522 |
|
li.SetLineWidth(1); |
523 |
|
li.SetLineColor(190); |
524 |
|
t1->SetTextColor(190); |
525 |
|
t1->SetTextSize(0.04); |
526 |
|
|
527 |
|
Float_t tposy = 0.95; // up y-coord - top pads |
528 |
|
Float_t thpad = 0; // pad height |
529 |
|
Float_t tposx1=0; // left x-coord - pad column |
530 |
|
Float_t tposx0=0; // x-coord - column division |
531 |
|
Float_t twrel = 0; // relative x size of first sub-column |
532 |
|
Float_t tmarg = 0.004; // margin among pads |
533 |
|
|
534 |
|
thpad = (tposy-tmarg*5)/3; |
535 |
|
twrel = (1-tmarg*4)/2; |
536 |
|
|
537 |
|
for(Int_t i=0; i<5; i++){ |
538 |
|
if ( (i+1)%2==1 ) { |
539 |
|
if(i>1) tposy = tposy-(tmarg*2+thpad); |
540 |
|
tposx1 = tmarg; |
541 |
|
tposx0 = tposx1 + twrel; |
542 |
|
} |
543 |
|
else { |
544 |
|
tposx1 = tposx0 + 2*tmarg; |
545 |
|
tposx0 = tposx1 + twrel; |
546 |
|
} |
547 |
|
|
548 |
|
/* -----------> pad for histograms */ |
549 |
|
pad7[i] = new TPad("pad7"," ",tposx1,tposy-thpad,tposx0,tposy,18,0,0); |
550 |
|
|
551 |
|
Int_t v=0; |
552 |
|
Double_t xb_tmp[bsize], magt_tmp[bsize]; |
553 |
|
for (Int_t ev=countMAG; ev<bsize; ev++){ |
554 |
|
|
555 |
|
if(ev==bsize-1 && i==4) countMAG=bsize-1; |
556 |
|
if(xb[ev]<xb[ev-1] && ev>countMAG){ |
557 |
|
if(i==4) countMAG=ev; |
558 |
|
break; |
559 |
|
} |
560 |
|
else{ |
561 |
|
magt_tmp[v]=(Double_t)magt[ev][i]; |
562 |
|
xb_tmp[v++]=(Double_t)xb[ev]; |
563 |
|
} |
564 |
|
} |
565 |
|
BfieldCanv[ii]->cd(); |
566 |
|
tit<<"B"<<i+5<<" (magnetic module "<<i+1<<")"; |
567 |
|
pad7[i]->SetFillColor(10); |
568 |
|
pad7[i]->Draw(); |
569 |
|
pad7[i]->cd(); |
570 |
|
mag[i][ii]= new TGraph(v,xb_tmp,magt_tmp); |
571 |
|
mag[i][ii]->SetTitle(tit.str().c_str()); |
572 |
|
mag[i][ii]->GetXaxis()->SetNdivisions(502,kTRUE); |
573 |
|
mag[i][ii]->GetXaxis()->SetLabelSize(0.04); |
574 |
|
mag[i][ii]->GetXaxis()->SetTitleSize(0.04); |
575 |
|
mag[i][ii]->GetXaxis()->SetTitle("OBT (ms)"); |
576 |
|
mag[i][ii]->GetXaxis()->CenterTitle(); |
577 |
|
mag[i][ii]->GetXaxis()->SetTitleOffset(0.85); |
578 |
|
if(i!=4) mag[i][ii]->GetYaxis()->SetRangeUser(2047,2058); |
579 |
|
else mag[i][ii]->GetYaxis()->SetRangeUser(2061,2066); |
580 |
|
mag[i][ii]->GetYaxis()->SetTitleOffset(1.2); |
581 |
|
mag[i][ii]->GetYaxis()->SetLabelOffset(0.001); |
582 |
|
mag[i][ii]->GetYaxis()->SetLabelSize(0.03); |
583 |
|
mag[i][ii]->GetYaxis()->SetTitleSize(0.04); |
584 |
|
mag[i][ii]->GetYaxis()->SetTitle("Magnetic Field (au)"); |
585 |
|
mag[i][ii]->GetYaxis()->CenterTitle(); |
586 |
|
mag[i][ii]->SetMarkerStyle(21); |
587 |
|
mag[i][ii]->SetMarkerSize(0.4); |
588 |
|
mag[i][ii]->Draw("ap"); |
589 |
|
Double_t min=0.,max=0,xlat=0.; |
590 |
|
min=mag[i][ii]->GetXaxis()->GetXmin(); |
591 |
|
max=mag[i][ii]->GetXaxis()->GetXmax(); |
592 |
|
xlat=min+(max-min)/2; |
593 |
|
stringstream mi,ma; |
594 |
|
mi<<"minimum recorded value"; |
595 |
|
ma<<"maximum recorded value"; |
596 |
|
t->SetTextSize(0.1); |
597 |
|
switch(i){ |
598 |
|
case 0: |
599 |
|
li.DrawLine(min,2054.,max,2054.); |
600 |
|
li.DrawLine(min,2048.,max,2048.); |
601 |
|
t1->DrawLatex(xlat,2054.3,ma.str().c_str()); |
602 |
|
t1->DrawLatex(xlat,2047.7,mi.str().c_str()); |
603 |
|
break; |
604 |
|
|
605 |
|
case 1: |
606 |
|
li.DrawLine(min,2055.,max,2055.); |
607 |
|
li.DrawLine(min,2051.,max,2051.); |
608 |
|
t1->DrawLatex(xlat,2055.3,ma.str().c_str()); |
609 |
|
t1->DrawLatex(xlat,2050.7,mi.str().c_str()); |
610 |
|
break; |
611 |
|
|
612 |
|
case 2: |
613 |
|
li.DrawLine(min,2056.,max,2056.); |
614 |
|
li.DrawLine(min,2052.,max,2052.); |
615 |
|
t1->DrawLatex(xlat,2056.3,ma.str().c_str()); |
616 |
|
t1->DrawLatex(xlat,2051.7,mi.str().c_str()); |
617 |
|
break; |
618 |
|
|
619 |
|
case 3: |
620 |
|
li.DrawLine(min,2057.,max,2057.); |
621 |
|
li.DrawLine(min,2053.,max,2053.); |
622 |
|
t1->DrawLatex(xlat,2057.3,ma.str().c_str()); |
623 |
|
t1->DrawLatex(xlat,2052.7,mi.str().c_str()); |
624 |
|
break; |
625 |
|
|
626 |
|
case 4: |
627 |
|
li.DrawLine(min,2065.,max,2065.); |
628 |
|
li.DrawLine(min,2062.,max,2062.); |
629 |
|
t1->DrawLatex(xlat,2065.15,ma.str().c_str()); |
630 |
|
t1->DrawLatex(xlat,2061.85,mi.str().c_str()); |
631 |
|
break; |
632 |
|
|
633 |
|
} |
634 |
|
BfieldCanv[ii]->Update(); |
635 |
|
tit.str(""); |
636 |
|
} |
637 |
|
if(countMAG==bsize-1){ |
638 |
|
break; |
639 |
|
} |
640 |
|
} |
641 |
|
|
642 |
|
|
643 |
// |
// |
644 |
// Fill compressiontime and eventnumber graphs and DSP warnings |
// Fill compressiontime and eventnumber graphs and DSP warnings |
721 |
// and fill graphs and histos |
// and fill graphs and histos |
722 |
|
|
723 |
Int_t al=0; |
Int_t al=0; |
724 |
Float_t x[MAXSTORAGE]; |
Double_t x[MAXSTORAGE]; |
725 |
Float_t yc[MAXSTORAGE][12]; |
Float_t yc[MAXSTORAGE][12]; |
726 |
Float_t eventint[MAXSTORAGE]; |
Double_t eventint[MAXSTORAGE]; |
727 |
|
Int_t eventn[12]; |
728 |
|
|
729 |
for (Int_t ev=minev; ev<maxevent; ev++){ |
for (Int_t ev=minev; ev<maxevent; ev++){ |
730 |
tr->GetEntry(ev); |
tr->GetEntry(ev); |
731 |
ph = eh->GetPscuHeader(); |
ph = eh->GetPscuHeader(); |
732 |
cod = eh->GetCounter(); |
cod = eh->GetCounter(); |
733 |
|
|
734 |
|
|
735 |
if(ev==maxevent-1) maxev=maxevent-1; |
if(ev==maxevent-1) maxev=maxevent-1; |
736 |
|
|
737 |
if((ph->GetOrbitalTime()<x[ev-minev-1] && ev-minev!=0) || ev-minev==MAXSTORAGE){ |
if((ph->GetOrbitalTime()<x[ev-minev-1] && ev-minev!=0) || ev-minev==MAXSTORAGE){ |
744 |
|
|
745 |
Int_t dsp=0; |
Int_t dsp=0; |
746 |
for(Int_t i=0; i<12; i++){ |
for(Int_t i=0; i<12; i++){ |
747 |
|
if(te->DSPnumber[i]<1 || te->DSPnumber[i]>12) { |
748 |
|
ALARM=1; |
749 |
|
break; |
750 |
|
} |
751 |
|
|
752 |
dsp=te->DSPnumber[i]-1; |
dsp=te->DSPnumber[i]-1; |
753 |
yc[(ev-minev)][dsp]= 0.051*te->compressiontime[i]; |
yc[(ev-minev)][dsp]= 0.051*te->compressiontime[i]; |
754 |
|
|
755 |
// |
// |
756 |
// Fill Cluster Signal and Lighting of the view histos |
// Fill Cluster Signal and Lighting of the view histos |
757 |
for(Int_t j=0;j<3;j++){ |
for(Int_t j=0;j<3;j++){ |
777 |
WARNING[i]=0; |
WARNING[i]=0; |
778 |
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){ |
779 |
ALARM = 1; //general alarm |
ALARM = 1; //general alarm |
|
al=1; |
|
780 |
WARNING[i] = 1; // DSP warning |
WARNING[i] = 1; // DSP warning |
781 |
}; |
}; |
782 |
|
|
783 |
if(te->alarm[i]!=0){ // hardware alarm |
if(te->alarm[i]!=0){ // hardware alarm |
784 |
ALARM = 1; |
ALARM = 1; |
|
al=1; |
|
785 |
}; |
}; |
786 |
|
|
787 |
//************************************************************************************** |
//************************************************************************************** |
788 |
// warning for internal number |
// warning for internal number |
789 |
//************************************************************************************** |
//************************************************************************************** |
790 |
if(i<=10 && te->eventn[i]!=te->eventn[i+1]) ALARM=1; |
if(i<=10 && te->eventn[i]!=te->eventn[i+1]) ALARM=1; |
791 |
|
if((ev-minev)>=1 && eventn[i]+1!=te->eventn[i] && te->eventn[i]!=1) ALARM=1; |
792 |
} |
} |
793 |
eventint[(ev-minev)]=te->eventn[0]; |
eventint[(ev-minev)]=te->eventn[0]; |
794 |
if((ev-minev)>=1 && eventint[(ev-minev)]!=eventint[(ev-minev)-1]+1 && eventint[(ev-minev)]!=1) |
|
|
ALARM=1; |
|
|
|
|
795 |
//******************************************************************************************** |
//******************************************************************************************** |
796 |
// file DSP warning |
// file DSP warning |
797 |
//******************************************************************************************** |
//******************************************************************************************** |
798 |
|
|
799 |
if(ALARM==1) { |
if(ALARM==1) { |
800 |
|
al=1; |
801 |
alarm <<endl<< "================================================="<< endl; |
alarm <<endl<< "================================================="<< endl; |
802 |
alarm << "PSCU-Pkt N. "<< ph->GetCounter() ; |
alarm << "PSCU-Pkt N. "<< ph->GetCounter() ; |
803 |
alarm << " - OBT "<< ph->GetOrbitalTime() << " ms"<<endl; |
alarm << " - OBT "<< ph->GetOrbitalTime() << " ms"<<endl; |
821 |
for(Int_t i=0; i<12 ; i++){ |
for(Int_t i=0; i<12 ; i++){ |
822 |
alarm.width(5); alarm << te->DSPnumber[i]; |
alarm.width(5); alarm << te->DSPnumber[i]; |
823 |
alarm.width(8); alarm << te->eventn[i]; |
alarm.width(8); alarm << te->eventn[i]; |
824 |
alarm.width(8); alarm << eventint[(ev-minev)-1]; |
alarm.width(8); alarm << eventn[i]; |
825 |
alarm.width(6); alarm << te->DATAlength[i]; |
alarm.width(6); alarm << te->DATAlength[i]; |
826 |
alarm.width(4); alarm << te->crc[i]; |
alarm.width(4); alarm << te->crc[i]; |
827 |
alarm.width(4); alarm << te->fc[i]; |
alarm.width(4); alarm << te->fc[i]; |
836 |
alarm << endl; |
alarm << endl; |
837 |
} |
} |
838 |
} |
} |
839 |
|
for(Int_t i=0; i<12 ; i++) |
840 |
|
eventn[i]=te->eventn[i]; |
841 |
} |
} |
842 |
} |
} |
843 |
if(al==0) alarm << endl<< "Page "<<ii+1<< ": ------> NO ALARM!!! <-------"<<endl; |
if(al==0) alarm << endl<< "Page "<<ii+1<< ": ------> NO ALARM!!! <-------"<<endl; |
845 |
// |
// |
846 |
// Draw the graphs |
// Draw the graphs |
847 |
for (Int_t i=0; i<12 ; i++){ |
for (Int_t i=0; i<12 ; i++){ |
848 |
Float_t yyc[maxev-minev]; |
Double_t yyc[maxev-minev]; |
849 |
for (Int_t v=0; v<maxev-minev; v++){ |
for (Int_t v=0; v<maxev-minev; v++){ |
850 |
yyc[v]=yc[v][i]; |
yyc[v]=yc[v][i]; |
851 |
} |
} |
862 |
comprtime[i][ii]->GetXaxis()->CenterTitle(); |
comprtime[i][ii]->GetXaxis()->CenterTitle(); |
863 |
comprtime[i][ii]->GetYaxis()->SetTitle("compressiontime (ms)"); |
comprtime[i][ii]->GetYaxis()->SetTitle("compressiontime (ms)"); |
864 |
comprtime[i][ii]->GetYaxis()->CenterTitle(); |
comprtime[i][ii]->GetYaxis()->CenterTitle(); |
865 |
comprtime[i][ii]->GetYaxis()->SetRangeUser(0,3); |
// comprtime[i][ii]->GetYaxis()->SetRangeUser(0,3); |
866 |
comprtime[i][ii]->Draw("ap"); |
comprtime[i][ii]->Draw("ap"); |
867 |
oss1.str(""); |
oss1.str(""); |
868 |
CompTimeCanv[ii]->Update(); |
CompTimeCanv[ii]->Update(); |
893 |
eventnumb[ii]->Draw("ap"); |
eventnumb[ii]->Draw("ap"); |
894 |
EventNumCanv[ii]->Update(); |
EventNumCanv[ii]->Update(); |
895 |
|
|
|
|
|
896 |
minev=maxev; |
minev=maxev; |
897 |
if(maxev==maxevent-1) { |
if(maxev==maxevent-1) { |
898 |
cntpgdat=ii+1; |
cntpgdat=ii+1; |
899 |
break; |
break; |
900 |
} |
} |
901 |
|
|
902 |
} |
} |
903 |
|
|
904 |
|
|
905 |
alarm.close(); |
alarm.close(); |
906 |
|
|
907 |
//**************************************************************************************** |
//**************************************************************************************** |
994 |
for (Int_t i=0; i<12 ; i++){ |
for (Int_t i=0; i<12 ; i++){ |
995 |
|
|
996 |
TBox b; |
TBox b; |
|
b.SetFillColor(6); |
|
|
b.SetFillStyle(3945); |
|
997 |
|
|
998 |
Float_t maxhist=0; |
Float_t maxhist=0; |
999 |
LandauCanv1->cd(); |
LandauCanv1->cd(); |
1037 |
illuminazione[i]->Draw(""); |
illuminazione[i]->Draw(""); |
1038 |
if(i==1){ |
if(i==1){ |
1039 |
maxhist= illuminazione[i]->GetMaximum(); |
maxhist= illuminazione[i]->GetMaximum(); |
1040 |
b.DrawBox(2816.,0.,3060.,maxhist); |
b.SetFillColor(6); |
1041 |
|
b.SetFillStyle(3945); |
1042 |
|
b.DrawBox(2944.,0.,3060.,maxhist); |
1043 |
|
|
1044 |
|
b.SetFillColor(107); |
1045 |
|
b.SetFillStyle(3954); |
1046 |
|
b.DrawBox(2816.,0.,2944.,maxhist); |
1047 |
|
b.DrawBox(2048.,0.,2176.,maxhist); |
1048 |
} |
} |
1049 |
else if(i==6){ |
else if(i==6){ |
1050 |
maxhist= illuminazione[i]->GetMaximum(); |
maxhist= illuminazione[i]->GetMaximum(); |
1051 |
|
b.SetFillColor(6); |
1052 |
|
b.SetFillStyle(3945); |
1053 |
b.DrawBox(2560.,0.,2816.,maxhist); |
b.DrawBox(2560.,0.,2816.,maxhist); |
|
b.DrawBox(512.,0.,768.,maxhist); |
|
1054 |
b.DrawBox(1024.,0.,1792.,maxhist); |
b.DrawBox(1024.,0.,1792.,maxhist); |
1055 |
|
|
1056 |
|
b.SetFillColor(107); |
1057 |
|
b.SetFillStyle(3954); |
1058 |
|
b.DrawBox(512.,0.,768.,maxhist); |
1059 |
|
} |
1060 |
|
else if(i==7){ |
1061 |
|
maxhist= illuminazione[i]->GetMaximum(); |
1062 |
|
b.SetFillColor(107); |
1063 |
|
b.SetFillStyle(3954); |
1064 |
|
b.DrawBox(512.,0.,768.,maxhist); |
1065 |
} |
} |
1066 |
else if(i==11){ |
else if(i==11){ |
1067 |
maxhist= illuminazione[i]->GetMaximum(); |
maxhist= illuminazione[i]->GetMaximum(); |
1068 |
|
b.SetFillColor(6); |
1069 |
|
b.SetFillStyle(3945); |
1070 |
b.DrawBox(768.,0.,1024.,maxhist); |
b.DrawBox(768.,0.,1024.,maxhist); |
1071 |
|
|
1072 |
|
b.SetFillColor(107); |
1073 |
|
b.SetFillStyle(3954); |
1074 |
|
b.DrawBox(0.,0.,512.,maxhist); |
1075 |
|
b.DrawBox(1920.,0.,2048.,maxhist); |
1076 |
} |
} |
1077 |
IlluminaCanv->Update(); |
IlluminaCanv->Update(); |
1078 |
} |
} |
1101 |
CompTimeCanv[fl]->Print(out+out1.str().c_str(),"Portrait"); |
CompTimeCanv[fl]->Print(out+out1.str().c_str(),"Portrait"); |
1102 |
EventNumCanv[fl]->Print(out+out2.str().c_str(),"Portrait"); |
EventNumCanv[fl]->Print(out+out2.str().c_str(),"Portrait"); |
1103 |
TempCanv[fl]->Print(out+out2.str().c_str(),"Portrait"); |
TempCanv[fl]->Print(out+out2.str().c_str(),"Portrait"); |
1104 |
|
BfieldCanv[fl]->Print(out+out2.str().c_str(),"Portrait"); |
1105 |
LandauCanv1->Print(out+out2.str().c_str(),"Portrait"); |
LandauCanv1->Print(out+out2.str().c_str(),"Portrait"); |
1106 |
LandauCanv2->Print(out+out2.str().c_str(),"Portrait"); |
LandauCanv2->Print(out+out2.str().c_str(),"Portrait"); |
1107 |
LandauCanv3->Print(out+out2.str().c_str(),"Portrait"); |
LandauCanv3->Print(out+out2.str().c_str(),"Portrait"); |
1111 |
if(fl==0) CompTimeCanv[fl]->Print(out+out1.str().c_str(),"Portrait"); |
if(fl==0) CompTimeCanv[fl]->Print(out+out1.str().c_str(),"Portrait"); |
1112 |
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"); |
1113 |
if(fl<cntpgdat) EventNumCanv[fl]->Print(out+out2.str().c_str(),"Portrait"); |
if(fl<cntpgdat) EventNumCanv[fl]->Print(out+out2.str().c_str(),"Portrait"); |
1114 |
|
if(fl<cntpgmag) BfieldCanv[fl]->Print(out+out2.str().c_str(),"Portrait"); |
1115 |
if(fl<cntpgtemp) TempCanv[fl]->Print(out+out2.str().c_str(),"Portrait"); |
if(fl<cntpgtemp) TempCanv[fl]->Print(out+out2.str().c_str(),"Portrait"); |
1116 |
if(fl==totpg-1){ |
if(fl==totpg-1){ |
1117 |
LandauCanv1->Print(out+out2.str().c_str(),"Portrait"); |
LandauCanv1->Print(out+out2.str().c_str(),"Portrait"); |
1126 |
out1<<ffile<<"_FTrkQLook_EXPERT-CompTime-pag"<<fl+1<<"."<<outfile.Data(); |
out1<<ffile<<"_FTrkQLook_EXPERT-CompTime-pag"<<fl+1<<"."<<outfile.Data(); |
1127 |
if(fl<cntpgdat) CompTimeCanv[fl]->Print(out+out1.str().c_str()); |
if(fl<cntpgdat) CompTimeCanv[fl]->Print(out+out1.str().c_str()); |
1128 |
out1.str(""); |
out1.str(""); |
1129 |
|
out1<<ffile<<"_FTrkQLook_EXPERT-BField-pag"<<fl+1<<"."<<outfile.Data(); |
1130 |
|
if(fl<cntpgmag) BfieldCanv[fl]->Print(out+out1.str().c_str()); |
1131 |
|
out1.str(""); |
1132 |
out1<<ffile<<"_FTrkQLook_EXPERT-Temp-pag"<<fl+1<<"."<<outfile.Data(); |
out1<<ffile<<"_FTrkQLook_EXPERT-Temp-pag"<<fl+1<<"."<<outfile.Data(); |
1133 |
if(fl<cntpgtemp) TempCanv[fl]->Print(out+out1.str().c_str()); |
if(fl<cntpgtemp) TempCanv[fl]->Print(out+out1.str().c_str()); |
1134 |
out1.str(""); |
out1.str(""); |