1 |
/** |
/** |
2 |
* FTrkQLook_EXPERT |
* FTrkQLook_EXPERT.cxx |
3 |
* |
* |
4 |
* autor: D.Fedele |
* autor: D.Fedele |
5 |
* version 2.0 |
* version v1r04 |
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 |
19 |
#include <TLatex.h> |
#include <TLatex.h> |
20 |
#include <TCanvas.h> |
#include <TCanvas.h> |
21 |
#include <TGraph.h> |
#include <TGraph.h> |
22 |
|
#include <TFile.h> |
23 |
#include <TTree.h> |
#include <TTree.h> |
24 |
#include <TStyle.h> |
#include <TStyle.h> |
25 |
// |
// |
35 |
// |
// |
36 |
#define MAXSTORAGE 50000 |
#define MAXSTORAGE 50000 |
37 |
|
|
|
void stringcopy(TString& s1, const TString& s2, Int_t from=0, Int_t to=0){ |
|
|
if ( to == 0 ){ |
|
|
Int_t t2length = s2.Length(); |
|
|
s1 = ""; |
|
|
to = t2length; |
|
|
}; |
|
|
for (Int_t i = from; i<to; i++){ |
|
|
s1.Append(s2[i],1); |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
38 |
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) |
39 |
{ |
{ |
40 |
// |
// |
41 |
// obtain information about the data file and select the output dir |
// obtain information about the data file and select the output dir |
42 |
const string filepath=file.Data(); |
const string filepath=file.Data(); |
43 |
Int_t dwpos = filepath.rfind("/"); |
Int_t dwpos = file.Last('/'); |
44 |
Int_t dwpos1 = filepath.find(".root"); |
Int_t dwpos1 = file.Last('.'); |
|
TString fpath=(filepath.c_str()); |
|
45 |
TString base,ffile ; |
TString base,ffile ; |
46 |
stringcopy(ffile,fpath,dwpos+1,dwpos1); |
ffile=file(dwpos+1,dwpos1-(dwpos+1)); |
47 |
stringcopy(base,fpath,0,dwpos); |
if(dwpos>0) base=file(0,dwpos); |
|
if(dwpos>0) base+="/"; |
|
48 |
|
|
49 |
TString out; |
TString out; |
50 |
if(outdir.Length()==0){ |
if(outdir.Length()==0){ |
52 |
}else{ |
}else{ |
53 |
out = outdir; |
out = outdir; |
54 |
} |
} |
55 |
|
if(out.Last('/')+1<out.Length()) out+="/"; |
56 |
|
|
57 |
// |
// |
58 |
// inizialise the variables and open the file |
// inizialise the variables and open the file |
68 |
pamela::PacketType *pctp=0; |
pamela::PacketType *pctp=0; |
69 |
|
|
70 |
TFile *datafile = new TFile(file); |
TFile *datafile = new TFile(file); |
71 |
|
if ( !datafile ){ |
72 |
|
printf("No data file, exiting...\n"); |
73 |
|
return; |
74 |
|
} |
75 |
|
|
76 |
TTree *tree = (TTree*)datafile->Get("TsbT"); |
TTree *tree = (TTree*)datafile->Get("TsbT"); |
77 |
tree->SetBranchAddress("TsbT",&event); |
tree->SetBranchAddress("TsbT",&event); |
132 |
nevent=maxevent-minevent ; |
nevent=maxevent-minevent ; |
133 |
} |
} |
134 |
|
|
135 |
Long64_t obt=0; |
// |
136 |
const Int_t sizeH=neventH; |
// information about the RunHeader |
137 |
ULong64_t HOBT[sizeH]; |
ULong64_t HOBT[neventH]; |
138 |
Int_t trk_cal_us[sizeH],countrun=1; |
Int_t trk_cal_us[neventH]; |
139 |
for (Int_t vi=0; vi<sizeH;vi++){ |
for (Int_t vi=0; vi<neventH;vi++){ |
140 |
HOBT[vi]=0; |
HOBT[vi]=0; |
141 |
trk_cal_us[vi]=0; |
trk_cal_us[vi]=0; |
142 |
} |
} |
145 |
pH = eH->GetPscuHeader(); |
pH = eH->GetPscuHeader(); |
146 |
HOBT[ev]= pH->GetOrbitalTime(); |
HOBT[ev]= pH->GetOrbitalTime(); |
147 |
trk_cal_us[ev]=reh->TRK_CALIB_USED; |
trk_cal_us[ev]=reh->TRK_CALIB_USED; |
|
// if((HOBT[ev]<HOBT[ev-1]) && ev>0) |
|
|
// countrun+=1; |
|
|
// printf("\n%lld\t\tcountrun=%d\n",HOBT[ev],countrun); |
|
148 |
} |
} |
149 |
|
|
150 |
// |
// |
163 |
} |
} |
164 |
const Int_t tsize=maxsize; |
const Int_t tsize=maxsize; |
165 |
Int_t tempt[tsize][5],xt[tsize], tempt_tmp[tsize]; |
Int_t tempt[tsize][5],xt[tsize], tempt_tmp[tsize]; |
166 |
|
Int_t countnboot=1; |
167 |
// |
// |
168 |
// information about the temperatures |
// information about the temperatures |
169 |
for (Int_t ev=0; ev<tnevent; ev++){ |
for (Int_t ev=0; ev<tnevent; ev++){ |
171 |
tmpSize = event->Records->GetEntries(); |
tmpSize = event->Records->GetEntries(); |
172 |
for (Int_t j = 0; j < tmpSize; j++){ |
for (Int_t j = 0; j < tmpSize; j++){ |
173 |
record = (pamela::TsbTRecord*)event->Records->At(j); |
record = (pamela::TsbTRecord*)event->Records->At(j); |
174 |
xt[siztmp]=record->RECORD_OBT; //0.051*record->RECORD_OBT; |
xt[siztmp]=record->RECORD_OBT; |
175 |
if((xt[siztmp]<xt[siztmp-1]) && siztmp>0) |
if((xt[siztmp]<xt[siztmp-1]) && siztmp>0) |
176 |
countrun+=1; |
countnboot+=1; |
177 |
|
|
178 |
for (Int_t z = 0; z < 5; z++){ |
for (Int_t z = 0; z < 5; z++){ |
179 |
tempt[siztmp][z] = record->TEMPERATURES[z+1]; |
tempt[siztmp][z] = record->TEMPERATURES[z+1]; |
181 |
siztmp++; |
siztmp++; |
182 |
} |
} |
183 |
} |
} |
184 |
// printf("\ncountrun=%d\n",countrun); |
countnboot+=2*(Int_t)nevent/MAXSTORAGE; |
185 |
countrun+=(Int_t)nevent/30000; |
// printf("\ncountnboot=%d\n",countnboot); |
186 |
|
|
187 |
// |
// |
188 |
// open the output text files for the alarms |
// open the output text files for the alarms |
202 |
// write the file for the TrkAlarm packet |
// write the file for the TrkAlarm packet |
203 |
if(alnevent==0) alarm1 <<endl<< "------> NO ALARM!!! <-------"<< endl; |
if(alnevent==0) alarm1 <<endl<< "------> NO ALARM!!! <-------"<< endl; |
204 |
else{ |
else{ |
205 |
|
Long64_t obt=0; |
206 |
for (Int_t ev=0; ev<alnevent; ev++){ |
for (Int_t ev=0; ev<alnevent; ev++){ |
207 |
altr->GetEntry(ev); |
altr->GetEntry(ev); |
208 |
ph = aleh->GetPscuHeader(); |
ph = aleh->GetPscuHeader(); |
260 |
} |
} |
261 |
} |
} |
262 |
|
|
263 |
|
// |
264 |
|
// Set Style options |
265 |
gStyle->SetLabelSize(0.05,"x"); |
gStyle->SetLabelSize(0.05,"x"); |
266 |
gStyle->SetLabelSize(0.06,"y"); |
gStyle->SetLabelSize(0.06,"y"); |
267 |
gStyle->SetStatFontSize(0.075); |
gStyle->SetStatFontSize(0.075); |
275 |
gStyle->SetTitleSize(0.06,"y"); |
gStyle->SetTitleSize(0.06,"y"); |
276 |
gStyle->SetTitleSize(0.055,"x"); |
gStyle->SetTitleSize(0.055,"x"); |
277 |
|
|
278 |
//************************************************************************************* |
// |
279 |
//book pads and histos |
// Define output canvas, histos and graphs |
280 |
//*************************************************************************************** |
TCanvas *CompTimeCanv[countnboot],*EventNumCanv[countnboot],*TempCanv[countnboot]; |
|
|
|
|
TCanvas *CompTimeCanv[countrun],*EventNumCanv[countrun],*TempCanv[countrun]; |
|
281 |
TCanvas *IlluminaCanv,*LandauCanv1,*LandauCanv2,*LandauCanv3; |
TCanvas *IlluminaCanv,*LandauCanv1,*LandauCanv2,*LandauCanv3; |
282 |
|
|
283 |
TH1F *landau1[12],*landau2[12],*landau3[12],*illuminazione[12]; |
TH1F *landau1[12],*landau2[12],*landau3[12],*illuminazione[12]; |
284 |
|
TGraph *comprtime[12][countnboot],*temp[5][countnboot],*eventnumb[countnboot]; |
285 |
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]; |
286 |
|
|
287 |
for(Int_t n = 0; n<12; n++) { |
for(Int_t n = 0; n<12; n++) { |
308 |
}; |
}; |
309 |
|
|
310 |
|
|
|
|
|
311 |
//*************************************************************************************** |
//*************************************************************************************** |
312 |
// LOOP on each event |
// LOOP on each event |
313 |
//*************************************************************************************** |
//*************************************************************************************** |
322 |
|
|
323 |
Int_t cntpgtemp=0,cntpgdat=0; |
Int_t cntpgtemp=0,cntpgdat=0; |
324 |
Int_t minev=minevent,maxev=maxevent,countTEMP=0; |
Int_t minev=minevent,maxev=maxevent,countTEMP=0; |
|
TGraph *comprtime[12][countrun],*temp[5][countrun],*eventnumb[countrun]; |
|
325 |
|
|
326 |
for(Int_t ii=0; ii<countrun;ii++){ |
// |
327 |
|
// Fill temperature graphs |
328 |
|
for(Int_t ii=0; ii<countnboot;ii++){ |
329 |
//**************************************************************************************** |
//**************************************************************************************** |
330 |
//Output figures --- Fifth sheet: |
//Temperature Output Pages |
331 |
//**************************************************************************************** |
//**************************************************************************************** |
332 |
fromfile.str(""); |
fromfile.str(""); |
333 |
fromfile<<"FTrkQLook_EXPERT File: "<<ffile; |
fromfile<<"FTrkQLook_EXPERT File: "<<ffile; |
419 |
} |
} |
420 |
|
|
421 |
|
|
422 |
for(Int_t ii=0; ii<countrun;ii++){ |
// |
423 |
TPaveText *pt1; |
// Fill compressiontime and eventnumber graphs and DSP warnings |
424 |
TPad *pt,*pt0; //pad for histos |
for(Int_t ii=0; ii<countnboot;ii++){ |
425 |
|
TPad *pt; //pad for histos |
426 |
|
|
|
ofstream warning(out + "warning.txt",ios::out); |
|
|
|
|
427 |
//**************************************************************************************** |
//**************************************************************************************** |
428 |
//Output figures --- First sheet: |
//COMPRESSIONTIME vs. OBT Output Pages |
429 |
//**************************************************************************************** |
//**************************************************************************************** |
430 |
fromfile.str(""); |
fromfile.str(""); |
431 |
fromfile<<"FTrkQLook_EXPERT File: "<<ffile; |
fromfile<<"FTrkQLook_EXPERT File: "<<ffile; |
446 |
isfile.str(""); |
isfile.str(""); |
447 |
|
|
448 |
//**************************************************************************************** |
//**************************************************************************************** |
449 |
//Output figures --- Second sheet: |
//DSP EVENT NUMBER Output Pages |
450 |
//**************************************************************************************** |
//**************************************************************************************** |
451 |
|
|
452 |
isfile<<"WARNINGS on DSP EVENT NUMBER pag"<<ii+1; |
isfile<<"DSP EVENT NUMBER vs. OBT pag"<<ii+1; |
453 |
EventNumCanv[ii]=new TCanvas(isfile.str().c_str(),isfile.str().c_str(),900,1200); |
EventNumCanv[ii]=new TCanvas(isfile.str().c_str(),isfile.str().c_str(),900,1200); |
454 |
EventNumCanv[ii]->SetFillColor(10); |
EventNumCanv[ii]->SetFillColor(10); |
455 |
EventNumCanv[ii]->Range(0,0,100,100); |
EventNumCanv[ii]->Range(0,0,100,100); |
462 |
t1->SetTextColor(1); |
t1->SetTextColor(1); |
463 |
t1->SetTextAlign(12); |
t1->SetTextAlign(12); |
464 |
t1->SetTextSize(0.02); |
t1->SetTextSize(0.02); |
465 |
t1->DrawLatex(65.,98.7,isfile.str().c_str()); |
t1->DrawLatex(62.,98.7,isfile.str().c_str()); |
466 |
isfile.str(""); |
isfile.str(""); |
467 |
|
|
468 |
Float_t posy = 0.95; // up y-coord - top pads |
Float_t posy = 0.95; // up y-coord - top pads |
494 |
pad4[n] = new TPad("pad4"," ",posx1,posy-hpad,posx0,posy,18,0,0); |
pad4[n] = new TPad("pad4"," ",posx1,posy-hpad,posx0,posy,18,0,0); |
495 |
pad5[n] = new TPad("pad5"," ",posx1,posy-hpad,posx0,posy,18,0,0); |
pad5[n] = new TPad("pad5"," ",posx1,posy-hpad,posx0,posy,18,0,0); |
496 |
} |
} |
|
//********************************************************************************** |
|
|
// Fill Graphs and Histos |
|
|
//********************************************************************************** |
|
497 |
|
|
498 |
// |
// |
499 |
// information about the tracker data |
// Obtain information about the tracker data |
500 |
Int_t warning_dspnumber=0; |
// and fill graphs and histos |
501 |
|
|
502 |
|
Int_t al=0; |
503 |
Float_t x[MAXSTORAGE]; |
Float_t x[MAXSTORAGE]; |
504 |
Float_t yc[MAXSTORAGE][12]; |
Float_t yc[MAXSTORAGE][12]; |
505 |
Float_t eventint[MAXSTORAGE]; |
Float_t eventint[MAXSTORAGE]; |
524 |
dsp=te->DSPnumber[i]-1; |
dsp=te->DSPnumber[i]-1; |
525 |
yc[(ev-minev)][dsp]= 0.051*te->compressiontime[i]; |
yc[(ev-minev)][dsp]= 0.051*te->compressiontime[i]; |
526 |
|
|
527 |
|
// |
528 |
|
// Fill Cluster Signal and Lighting of the view histos |
529 |
for(Int_t j=0;j<3;j++){ |
for(Int_t j=0;j<3;j++){ |
530 |
if(te->signcluster[i][j]!=0){ |
if(te->signcluster[i][j]!=0){ |
531 |
if((te->addrcluster[i][j]>6 && te->addrcluster[i][j]<505) ||(te->addrcluster[i][j]>518 && te->addrcluster[i][j]<1018)){ |
if((te->addrcluster[i][j]>6 && te->addrcluster[i][j]<505) ||(te->addrcluster[i][j]>518 && te->addrcluster[i][j]<1018)){ |
535 |
} |
} |
536 |
if(trk_cal_us[cod->Get(pctp->RunHeader)]!=104){ |
if(trk_cal_us[cod->Get(pctp->RunHeader)]!=104){ |
537 |
if(!(dsp%2)){ |
if(!(dsp%2)){ |
538 |
// if((te->addrcluster[i][0]>6 && te->addrcluster[i][0]<505) ||(te->addrcluster[i][0]>518 && te->addrcluster[i][0]<1018)) |
if(te->signcluster[i][0]!=0) landau1[dsp]->Fill((Float_t)(1024.-te->signcluster[i][0])); |
539 |
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])); |
540 |
// if((te->addrcluster[i][1]>6 && te->addrcluster[i][1]<505) ||(te->addrcluster[i][1]>518 && te->addrcluster[i][1]<1018)) |
if(te->signcluster[i][2]!=0) landau3[dsp]->Fill((Float_t)(1024.-te->signcluster[i][2])); |
|
if(te->signcluster[i][1]!=0) landau2[dsp]->Fill((Float_t)(1024.-te->signcluster[i][1])); |
|
|
// if((te->addrcluster[i][2]>6 && te->addrcluster[i][2]<505) ||(te->addrcluster[i][2]>518 && te->addrcluster[i][2]<1018)) |
|
|
if(te->signcluster[i][2]!=0) landau3[dsp]->Fill((Float_t)(1024.-te->signcluster[i][2])); |
|
541 |
} |
} |
542 |
else{ |
else{ |
543 |
// if((te->addrcluster[i][0]>6 && te->addrcluster[i][0]<505) ||(te->addrcluster[i][0]>518 && te->addrcluster[i][0]<1018)) |
if(te->signcluster[i][0]!=0) landau1[dsp]->Fill((Float_t)te->signcluster[i][0]); |
544 |
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]); |
545 |
// if((te->addrcluster[i][1]>6 && te->addrcluster[i][1]<505) ||(te->addrcluster[i][1]>518 && te->addrcluster[i][1]<1018)) |
if(te->signcluster[i][2]!=0) landau3[dsp]->Fill((Float_t)te->signcluster[i][2]); |
|
if(te->signcluster[i][1]!=0) landau2[dsp]->Fill((Float_t)te->signcluster[i][1]); |
|
|
// if((te->addrcluster[i][2]>6 && te->addrcluster[i][2]<505) ||(te->addrcluster[i][2]>518 && te->addrcluster[i][2]<1018)) |
|
|
if(te->signcluster[i][2]!=0) landau3[dsp]->Fill((Float_t)te->signcluster[i][2]); |
|
546 |
} |
} |
547 |
} |
} |
548 |
|
|
549 |
WARNING[i]=0; |
WARNING[i]=0; |
550 |
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){ |
551 |
ALARM = 1; //general alarm |
ALARM = 1; //general alarm |
552 |
|
al=1; |
553 |
WARNING[i] = 1; // DSP warning |
WARNING[i] = 1; // DSP warning |
554 |
}; |
}; |
555 |
|
|
556 |
if(te->alarm[i]!=0){ // hardware alarm |
if(te->alarm[i]!=0){ // hardware alarm |
557 |
ALARM = 1; |
ALARM = 1; |
558 |
|
al=1; |
559 |
}; |
}; |
560 |
|
|
561 |
//************************************************************************************** |
//************************************************************************************** |
562 |
// warning for internal number |
// warning for internal number |
563 |
//************************************************************************************** |
//************************************************************************************** |
564 |
if(i<=10){ |
if(i<=10 && te->eventn[i]!=te->eventn[i+1]) ALARM=1; |
|
if(te->eventn[i]!=te->eventn[i+1]){ |
|
|
warning_dspnumber++; |
|
|
warning<< "==> WARNING!! Check entry "<< ev<<" (DSP "<<dsp<<")" <<endl<< |
|
|
"eventn["<<i<<"]= "<<te->eventn[i]<<"!= eventn["<<i+1<<"]= "<< te->eventn[i+1]<<endl; |
|
|
} |
|
|
else |
|
|
eventint[(ev-minev)]=te->eventn[0]; |
|
|
} |
|
565 |
} |
} |
566 |
|
eventint[(ev-minev)]=te->eventn[0]; |
567 |
if(ev<=maxevent-1){ |
if((ev-minev)>=1 && eventint[(ev-minev)]!=eventint[(ev-minev)-1]+1 && eventint[(ev-minev)]!=1) |
568 |
|
ALARM=1; |
569 |
if((ev-minev)>=1 && eventint[(ev-minev)]!=eventint[(ev-minev)-1]+1 && eventint[(ev-minev)]!=1){ |
|
|
warning_dspnumber++; |
|
|
warning<< "==> WARNING!! Check entry "<< ev<<endl<< |
|
|
" DSP event num.= "<< eventint[(ev-minev)]<< |
|
|
" is different from (previus+1) ="<<eventint[(ev-minev)-1]+1 <<"\n"<<endl; |
|
|
} |
|
|
} |
|
|
|
|
570 |
//******************************************************************************************** |
//******************************************************************************************** |
571 |
// file ALARM |
// file DSP warning |
572 |
//******************************************************************************************** |
//******************************************************************************************** |
573 |
|
|
574 |
if(ALARM==1) { |
if(ALARM==1) { |
575 |
alarm <<endl<< "================================================="<< endl; |
alarm <<endl<< "================================================="<< endl; |
576 |
alarm << "PSCU-Pkt N. "<< ph->GetCounter() ; |
alarm << "PSCU-Pkt N. "<< ph->GetCounter() ; |
577 |
alarm << " - OBT "<< ph->GetOrbitalTime() << " ms"<<endl; |
alarm << " - OBT "<< ph->GetOrbitalTime() << " ms"<<endl; |
578 |
alarm << "(ROOT-tree entry "<<ev<<")"<<endl; |
alarm << "Total events "<<nevent<<endl; |
579 |
|
alarm << "(ROOT-tree entry "<<ev<<" in page "<<ii+1<<" )"<<endl; |
580 |
alarm << "================================================="<< endl; |
alarm << "================================================="<< endl; |
581 |
|
|
582 |
alarm << " DSPn"; |
alarm << " DSPn"; |
583 |
alarm << " Event"; |
alarm << " Counter"; |
584 |
|
alarm << " previous"; |
585 |
alarm << " Words"; |
alarm << " Words"; |
586 |
alarm << " crc"; |
alarm << " crc"; |
587 |
alarm << " FC"; |
alarm << " FC"; |
594 |
|
|
595 |
for(Int_t i=0; i<12 ; i++){ |
for(Int_t i=0; i<12 ; i++){ |
596 |
alarm.width(5); alarm << te->DSPnumber[i]; |
alarm.width(5); alarm << te->DSPnumber[i]; |
597 |
alarm.width(6); alarm << te->eventn[i]; |
alarm.width(8); alarm << te->eventn[i]; |
598 |
|
alarm.width(8); alarm << eventint[(ev-minev)-1]; |
599 |
alarm.width(6); alarm << te->DATAlength[i]; |
alarm.width(6); alarm << te->DATAlength[i]; |
600 |
alarm.width(4); alarm << te->crc[i]; |
alarm.width(4); alarm << te->crc[i]; |
601 |
alarm.width(4); alarm << te->fc[i]; |
alarm.width(4); alarm << te->fc[i]; |
612 |
} |
} |
613 |
} |
} |
614 |
} |
} |
615 |
if(ALARM==0) alarm << endl<< "------> NO ALARM!!! <-------"<<endl; |
if(al==0) alarm << endl<< "Page "<<ii+1<< ": ------> NO ALARM!!! <-------"<<endl; |
|
if(warning_dspnumber==0) warning<<"NONE"<<endl; |
|
616 |
|
|
617 |
|
// |
618 |
|
// Draw the graphs |
619 |
for (Int_t i=0; i<12 ; i++){ |
for (Int_t i=0; i<12 ; i++){ |
620 |
Float_t yyc[maxev-minev]; |
Float_t yyc[maxev-minev]; |
621 |
for (Int_t v=0; v<maxev-minev; v++){ |
for (Int_t v=0; v<maxev-minev; v++){ |
634 |
comprtime[i][ii]->GetXaxis()->CenterTitle(); |
comprtime[i][ii]->GetXaxis()->CenterTitle(); |
635 |
comprtime[i][ii]->GetYaxis()->SetTitle("compressiontime (ms)"); |
comprtime[i][ii]->GetYaxis()->SetTitle("compressiontime (ms)"); |
636 |
comprtime[i][ii]->GetYaxis()->CenterTitle(); |
comprtime[i][ii]->GetYaxis()->CenterTitle(); |
637 |
comprtime[i][ii]->GetYaxis()->SetRangeUser(0,2); |
comprtime[i][ii]->GetYaxis()->SetRangeUser(0,3); |
638 |
comprtime[i][ii]->Draw("ap"); |
comprtime[i][ii]->Draw("ap"); |
639 |
oss1.str(""); |
oss1.str(""); |
640 |
CompTimeCanv[ii]->Update(); |
CompTimeCanv[ii]->Update(); |
641 |
} |
} |
642 |
|
|
643 |
EventNumCanv[ii]->cd(); |
EventNumCanv[ii]->cd(); |
644 |
pt0=new TPad("pt0"," ",0.704,0.004,0.996,0.98); |
pt = new TPad("pt"," ",0.02,0.01,1.,0.98,18,0,0); |
|
pt1 = new TPaveText(0.004,0.004,0.986,0.996); |
|
|
pt = new TPad("pt"," ",0.004,0.004,0.7,0.98,18,0,0); |
|
|
pt1->SetFillColor(10); |
|
|
pt1->ReadFile(out + "warning.txt"); |
|
|
pt1->SetTextAlign(22); |
|
|
pt1->SetTextSize(0.035); |
|
|
pt0->SetFillColor(10); |
|
|
pt0->SetFrameFillColor(10); |
|
|
pt0->Draw(); |
|
|
pt0->cd(); |
|
|
pt1->Draw(); |
|
|
EventNumCanv[ii]->cd(); |
|
645 |
pt->SetFillColor(10); |
pt->SetFillColor(10); |
646 |
pt->SetFrameFillColor(10); |
pt->SetFrameFillColor(10); |
647 |
pt->Draw(); |
pt->Draw(); |
648 |
pt->cd(); |
pt->cd(); |
649 |
eventnumb[ii]=new TGraph(maxev-minev,x,eventint); |
eventnumb[ii]=new TGraph(maxev-minev,x,eventint); |
650 |
eventnumb[ii]->SetTitle(""); |
eventnumb[ii]->SetTitle(""); |
651 |
eventnumb[ii]->GetXaxis()->SetLabelSize(0.04); |
eventnumb[ii]->GetXaxis()->SetLabelSize(0.02); |
652 |
eventnumb[ii]->GetXaxis()->SetTitleSize(0.04); |
eventnumb[ii]->GetXaxis()->SetTitleSize(0.03); |
653 |
eventnumb[ii]->GetXaxis()->SetTitle("OBT (ms)"); |
eventnumb[ii]->GetXaxis()->SetTitle("OBT (ms)"); |
654 |
eventnumb[ii]->GetXaxis()->CenterTitle(); |
eventnumb[ii]->GetXaxis()->CenterTitle(); |
655 |
eventnumb[ii]->GetXaxis()->SetTickLength(0.01); |
eventnumb[ii]->GetXaxis()->SetTickLength(0.01); |
656 |
eventnumb[ii]->GetXaxis()->SetTitleOffset(1.2); |
eventnumb[ii]->GetXaxis()->SetTitleOffset(1.1); |
657 |
eventnumb[ii]->GetYaxis()->SetLabelSize(0.04); |
eventnumb[ii]->GetYaxis()->SetLabelSize(0.02); |
658 |
eventnumb[ii]->GetYaxis()->SetTitleSize(0.04); |
eventnumb[ii]->GetYaxis()->SetTitleSize(0.03); |
659 |
eventnumb[ii]->GetYaxis()->SetTitle("DSP event-number"); |
eventnumb[ii]->GetYaxis()->SetTitle("DSP event-number"); |
660 |
eventnumb[ii]->GetYaxis()->CenterTitle(); |
eventnumb[ii]->GetYaxis()->CenterTitle(); |
661 |
eventnumb[ii]->GetYaxis()->SetTitleOffset(1.5); |
eventnumb[ii]->GetYaxis()->SetTitleOffset(2.); |
662 |
eventnumb[ii]->SetMarkerStyle(21); |
eventnumb[ii]->SetMarkerStyle(21); |
663 |
eventnumb[ii]->SetMarkerColor(kBlue); |
eventnumb[ii]->SetMarkerColor(kBlue); |
664 |
eventnumb[ii]->SetMarkerSize(0.3); |
eventnumb[ii]->SetMarkerSize(0.2); |
665 |
eventnumb[ii]->Draw("ap"); |
eventnumb[ii]->Draw("ap"); |
666 |
EventNumCanv[ii]->Update(); |
EventNumCanv[ii]->Update(); |
667 |
|
|
668 |
|
|
|
warning.close(); |
|
669 |
minev=maxev; |
minev=maxev; |
670 |
if(maxev==maxevent-1) { |
if(maxev==maxevent-1) { |
671 |
cntpgdat=ii+1; |
cntpgdat=ii+1; |
676 |
alarm.close(); |
alarm.close(); |
677 |
|
|
678 |
//**************************************************************************************** |
//**************************************************************************************** |
679 |
//Output figures --- Third sheet: |
//Cluster Signal ladder1 Output Pages |
680 |
//**************************************************************************************** |
//**************************************************************************************** |
681 |
|
|
682 |
fromfile.str(""); |
fromfile.str(""); |
699 |
isfile.str(""); |
isfile.str(""); |
700 |
|
|
701 |
//**************************************************************************************** |
//**************************************************************************************** |
702 |
//Output figures --- Third sheet: |
//Cluster Signal ladder2 Output Pages |
703 |
//**************************************************************************************** |
//**************************************************************************************** |
704 |
|
|
705 |
isfile<<"Cluster Signal ladder2"; |
isfile<<"Cluster Signal ladder2"; |
720 |
isfile.str(""); |
isfile.str(""); |
721 |
|
|
722 |
//**************************************************************************************** |
//**************************************************************************************** |
723 |
//Output figures --- Third sheet: |
//Cluster Signal ladder3 Output Pages |
724 |
//**************************************************************************************** |
//**************************************************************************************** |
725 |
|
|
726 |
isfile<<"Cluster Signal ladder3"; |
isfile<<"Cluster Signal ladder3"; |
741 |
isfile.str(""); |
isfile.str(""); |
742 |
|
|
743 |
//**************************************************************************************** |
//**************************************************************************************** |
744 |
//Output figures --- Fourth sheet: |
//Lighting of the views Output Pages |
745 |
//**************************************************************************************** |
//**************************************************************************************** |
746 |
|
|
747 |
isfile<<"lighting of the views"; |
isfile<<"lighting of the views"; |
760 |
t1->DrawLatex(70.,98.7,isfile.str().c_str()); |
t1->DrawLatex(70.,98.7,isfile.str().c_str()); |
761 |
isfile.str(""); |
isfile.str(""); |
762 |
|
|
763 |
|
// |
764 |
|
// Draw the histos |
765 |
for (Int_t i=0; i<12 ; i++){ |
for (Int_t i=0; i<12 ; i++){ |
766 |
|
|
767 |
TBox b; |
TBox b; |
826 |
} |
} |
827 |
|
|
828 |
printf("... end of packets. \n"); |
printf("... end of packets. \n"); |
829 |
|
|
830 |
//************************************************************************* |
//************************************************************************* |
831 |
// Save output Files |
// Save output Files |
832 |
//************************************************************************* |
//************************************************************************* |
877 |
out1.str(""); |
out1.str(""); |
878 |
out1<<ffile<<"_FTrkQLook_EXPERT-EvNum-pag"<<fl+1<<"."<<outfile.Data(); |
out1<<ffile<<"_FTrkQLook_EXPERT-EvNum-pag"<<fl+1<<"."<<outfile.Data(); |
879 |
if(fl<cntpgdat) EventNumCanv[fl]->Print(out+out1.str().c_str()); |
if(fl<cntpgdat) EventNumCanv[fl]->Print(out+out1.str().c_str()); |
880 |
if(fl==countrun-1){ |
if(fl==totpg-1){ |
881 |
out1.str(""); |
out1.str(""); |
882 |
out1<<ffile<<"_FTrkQLook_EXPERT-LandauL1."<<outfile.Data(); |
out1<<ffile<<"_FTrkQLook_EXPERT-LandauL1."<<outfile.Data(); |
883 |
LandauCanv1->Print(out+out1.str().c_str()); |
LandauCanv1->Print(out+out1.str().c_str()); |
894 |
} |
} |
895 |
} |
} |
896 |
|
|
897 |
|
// |
898 |
|
// Convert ps to pdf if required |
899 |
if(!strcmp(outfile.Data(),"pdf")){ |
if(!strcmp(outfile.Data(),"pdf")){ |
900 |
stringstream com; |
stringstream com; |
901 |
com<<"ps2pdf13 "<<out<<ffile<<"_FTrkQLook_EXPERT.ps "<<out<<ffile<<"_FTrkQLook_EXPERT.pdf"; |
com<<"ps2pdf13 "<<out<<ffile<<"_FTrkQLook_EXPERT.ps "<<out<<ffile<<"_FTrkQLook_EXPERT.pdf"; |
908 |
com.str(""); |
com.str(""); |
909 |
} |
} |
910 |
|
|
|
command.str(""); |
|
|
command<<"rm -f "<<out<<"warning.txt"; |
|
|
system(command.str().c_str()); |
|
|
|
|
911 |
gROOT->Reset(); |
gROOT->Reset(); |
912 |
return; |
return; |
913 |
} |
} |