1 |
/** |
/** |
2 |
* FTrkQLook_EXPERT |
* FTrkQLook_EXPERT.cxx |
3 |
* |
* |
4 |
* autor: D.Fedele |
* autor: D.Fedele |
5 |
* version 2.0 |
* 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 |
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 |
// |
// |
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 |
// |
// |
38 |
#define MAXSTORAGE 50000 |
#define MAXSTORAGE 50000 |
39 |
|
|
|
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); |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
40 |
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) |
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 |
44 |
const string filepath=file.Data(); |
Int_t dwpos = file.Last('/'); |
45 |
Int_t dwpos = filepath.rfind("/"); |
Int_t dwpos1 = file.Last('.'); |
|
Int_t dwpos1 = filepath.find(".root"); |
|
|
TString fpath=(filepath.c_str()); |
|
46 |
TString base,ffile ; |
TString base,ffile ; |
47 |
stringcopy(ffile,fpath,dwpos+1,dwpos1); |
ffile=file(dwpos+1,dwpos1-(dwpos+1)); |
48 |
stringcopy(base,fpath,0,dwpos); |
if(dwpos>0) base=file(0,dwpos); |
|
if(dwpos>0) base+="/"; |
|
49 |
|
|
50 |
TString out; |
TString out; |
51 |
if(outdir.Length()==0){ |
if(outdir.Length()==0){ |
53 |
}else{ |
}else{ |
54 |
out = outdir; |
out = outdir; |
55 |
} |
} |
56 |
|
if(out.Last('/')+1<out.Length()) out+="/"; |
57 |
|
|
58 |
// |
// |
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; |
71 |
pamela::PacketType *pctp=0; |
pamela::PacketType *pctp=0; |
72 |
|
|
73 |
TFile *datafile = new TFile(file); |
TFile *datafile = new TFile(file); |
74 |
|
if ( !datafile ){ |
75 |
|
printf("No data file, exiting...\n"); |
76 |
|
return; |
77 |
|
} |
78 |
|
|
79 |
TTree *tree = (TTree*)datafile->Get("TsbT"); |
TTree *tree = (TTree*)datafile->Get("TsbT"); |
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){ |
141 |
nevent=maxevent-minevent ; |
nevent=maxevent-minevent ; |
142 |
} |
} |
143 |
|
|
144 |
Long64_t obt=0; |
// |
145 |
const Int_t sizeH=neventH; |
// information about the RunHeader |
146 |
ULong64_t HOBT[sizeH]; |
ULong64_t HOBT[neventH]; |
147 |
Int_t trk_cal_us[sizeH],countrun=1; |
Int_t trk_cal_us[neventH]; |
148 |
for (Int_t vi=0; vi<sizeH;vi++){ |
Int_t countnboot=1; |
149 |
|
for (Int_t vi=0; vi<neventH;vi++){ |
150 |
HOBT[vi]=0; |
HOBT[vi]=0; |
151 |
trk_cal_us[vi]=0; |
trk_cal_us[vi]=0; |
152 |
} |
} |
155 |
pH = eH->GetPscuHeader(); |
pH = eH->GetPscuHeader(); |
156 |
HOBT[ev]= pH->GetOrbitalTime(); |
HOBT[ev]= pH->GetOrbitalTime(); |
157 |
trk_cal_us[ev]=reh->TRK_CALIB_USED; |
trk_cal_us[ev]=reh->TRK_CALIB_USED; |
158 |
// if((HOBT[ev]<HOBT[ev-1]) && ev>0) |
if((HOBT[ev]<HOBT[ev-1]) && ev>0) |
159 |
// countrun+=1; |
countnboot+=1; |
|
// printf("\n%lld\t\tcountrun=%d\n",HOBT[ev],countrun); |
|
160 |
} |
} |
161 |
|
countnboot+=2*(Int_t)nevent/MAXSTORAGE; |
162 |
|
// printf("\ncountnboot=%d\n",countnboot); |
163 |
|
|
164 |
|
|
165 |
// |
// |
166 |
// other variables definitions |
// other variables definitions |
177 |
maxsize+=tmpSize; |
maxsize+=tmpSize; |
178 |
} |
} |
179 |
const Int_t tsize=maxsize; |
const Int_t tsize=maxsize; |
180 |
Int_t tempt[tsize][5],xt[tsize], tempt_tmp[tsize]; |
Int_t tempt[tsize][5]; |
181 |
|
ULong64_t xt[tsize]; |
182 |
|
|
183 |
|
Int_t cntpgtemp=1,cntpgdat=0,cntpgmag=0; |
184 |
// |
// |
185 |
// information about the temperatures |
// information about the temperatures |
186 |
for (Int_t ev=0; ev<tnevent; ev++){ |
for (Int_t ev=0; ev<tnevent; ev++){ |
188 |
tmpSize = event->Records->GetEntries(); |
tmpSize = event->Records->GetEntries(); |
189 |
for (Int_t j = 0; j < tmpSize; j++){ |
for (Int_t j = 0; j < tmpSize; j++){ |
190 |
record = (pamela::TsbTRecord*)event->Records->At(j); |
record = (pamela::TsbTRecord*)event->Records->At(j); |
191 |
xt[siztmp]=record->RECORD_OBT; //0.051*record->RECORD_OBT; |
xt[siztmp]=record->RECORD_OBT; |
192 |
if((xt[siztmp]<xt[siztmp-1]) && siztmp>0) |
if((xt[siztmp]<xt[siztmp-1]) && siztmp>0) |
193 |
countrun+=1; |
cntpgtemp+=1; |
194 |
|
|
195 |
for (Int_t z = 0; z < 5; z++){ |
for (Int_t z = 0; z < 5; z++){ |
196 |
tempt[siztmp][z] = record->TEMPERATURES[z+1]; |
tempt[siztmp][z] = record->TEMPERATURES[z+1]; |
198 |
siztmp++; |
siztmp++; |
199 |
} |
} |
200 |
} |
} |
201 |
// printf("\ncountrun=%d\n",countrun); |
|
202 |
countrun+=(Int_t)nevent/30000; |
// |
203 |
|
// information about the entries for the magnetic field |
204 |
|
if(bnevent>0) cntpgmag=1; |
205 |
|
maxsize=0; |
206 |
|
for (Int_t ev=0; ev<bnevent; ev++){ |
207 |
|
Btree->GetEntry(ev); |
208 |
|
tmpSize = Bevent->Records->GetEntries(); |
209 |
|
maxsize+=tmpSize; |
210 |
|
} |
211 |
|
const Int_t bsize=maxsize; |
212 |
|
Int_t magt[bsize][5]; |
213 |
|
ULong64_t xb[bsize]; |
214 |
|
siztmp=0; |
215 |
|
// |
216 |
|
// information about the magnetic field |
217 |
|
for (Int_t ev=0; ev<bnevent; ev++){ |
218 |
|
Btree->GetEntry(ev); |
219 |
|
tmpSize = Bevent->Records->GetEntries(); |
220 |
|
for (Int_t j = 0; j < tmpSize; j++){ |
221 |
|
Brecord = (pamela::TsbBRecord*)Bevent->Records->At(j); |
222 |
|
xb[siztmp]=Brecord->RECORD_OBT; |
223 |
|
if((xb[siztmp]<xb[siztmp-1]) && siztmp>0) |
224 |
|
cntpgmag+=1; |
225 |
|
for (Int_t z = 0; z < 5; z++){ |
226 |
|
magt[siztmp][z] = Brecord->B_FIELD[z+1]; |
227 |
|
} |
228 |
|
siztmp++; |
229 |
|
} |
230 |
|
} |
231 |
|
|
232 |
// |
// |
233 |
// open the output text files for the alarms |
// open the output text files for the alarms |
247 |
// write the file for the TrkAlarm packet |
// write the file for the TrkAlarm packet |
248 |
if(alnevent==0) alarm1 <<endl<< "------> NO ALARM!!! <-------"<< endl; |
if(alnevent==0) alarm1 <<endl<< "------> NO ALARM!!! <-------"<< endl; |
249 |
else{ |
else{ |
250 |
|
Long64_t obt=0; |
251 |
for (Int_t ev=0; ev<alnevent; ev++){ |
for (Int_t ev=0; ev<alnevent; ev++){ |
252 |
altr->GetEntry(ev); |
altr->GetEntry(ev); |
253 |
ph = aleh->GetPscuHeader(); |
ph = aleh->GetPscuHeader(); |
305 |
} |
} |
306 |
} |
} |
307 |
|
|
308 |
|
// |
309 |
|
// Set Style options |
310 |
gStyle->SetLabelSize(0.05,"x"); |
gStyle->SetLabelSize(0.05,"x"); |
311 |
gStyle->SetLabelSize(0.06,"y"); |
gStyle->SetLabelSize(0.06,"y"); |
312 |
gStyle->SetStatFontSize(0.075); |
gStyle->SetStatFontSize(0.075); |
320 |
gStyle->SetTitleSize(0.06,"y"); |
gStyle->SetTitleSize(0.06,"y"); |
321 |
gStyle->SetTitleSize(0.055,"x"); |
gStyle->SetTitleSize(0.055,"x"); |
322 |
|
|
323 |
//************************************************************************************* |
// |
324 |
//book pads and histos |
// Define output canvas, histos and graphs |
325 |
//*************************************************************************************** |
TCanvas *CompTimeCanv[countnboot],*EventNumCanv[countnboot],*TempCanv[cntpgtemp],*BfieldCanv[cntpgmag]; |
|
|
|
|
TCanvas *CompTimeCanv[countrun],*EventNumCanv[countrun],*TempCanv[countrun]; |
|
326 |
TCanvas *IlluminaCanv,*LandauCanv1,*LandauCanv2,*LandauCanv3; |
TCanvas *IlluminaCanv,*LandauCanv1,*LandauCanv2,*LandauCanv3; |
327 |
|
|
328 |
TH1F *landau1[12],*landau2[12],*landau3[12],*illuminazione[12]; |
TH1F *landau1[12],*landau2[12],*landau3[12],*illuminazione[12]; |
329 |
TPad *pad1[12],*pad2[12],*pad3[12],*pad4[12],*pad5[12],*pad6[5]; |
TGraph *comprtime[12][countnboot],*temp[5][cntpgtemp],*tempw[5][cntpgtemp],*eventnumb[countnboot],*mag[5][cntpgmag]; |
330 |
|
TPad *pad1[12],*pad2[12],*pad3[12],*pad4[12],*pad5[12],*pad6[5],*pad7[5]; |
331 |
|
|
332 |
for(Int_t n = 0; n<12; n++) { |
for(Int_t n = 0; n<12; n++) { |
333 |
|
|
353 |
}; |
}; |
354 |
|
|
355 |
|
|
|
|
|
356 |
//*************************************************************************************** |
//*************************************************************************************** |
357 |
// LOOP on each event |
// LOOP on each event |
358 |
//*************************************************************************************** |
//*************************************************************************************** |
365 |
TLatex *t=new TLatex(); |
TLatex *t=new TLatex(); |
366 |
TLatex *t1=new TLatex(); |
TLatex *t1=new TLatex(); |
367 |
|
|
368 |
Int_t cntpgtemp=0,cntpgdat=0; |
|
369 |
Int_t minev=minevent,maxev=maxevent,countTEMP=0; |
Int_t minev=minevent,maxev=maxevent,countTEMP=0,countMAG=0; |
|
TGraph *comprtime[12][countrun],*temp[5][countrun],*eventnumb[countrun]; |
|
370 |
|
|
371 |
for(Int_t ii=0; ii<countrun;ii++){ |
// |
372 |
|
// Fill temperature graphs |
373 |
|
for(Int_t ii=0; ii<cntpgtemp;ii++){ |
374 |
//**************************************************************************************** |
//**************************************************************************************** |
375 |
//Output figures --- Fifth sheet: |
//Temperature Output Pages |
376 |
//**************************************************************************************** |
//**************************************************************************************** |
377 |
fromfile.str(""); |
fromfile.str(""); |
378 |
fromfile<<"FTrkQLook_EXPERT File: "<<ffile; |
fromfile<<"FTrkQLook_EXPERT File: "<<ffile; |
392 |
t1->SetTextSize(0.02); |
t1->SetTextSize(0.02); |
393 |
t1->DrawLatex(78.,98.7,isfile.str().c_str()); |
t1->DrawLatex(78.,98.7,isfile.str().c_str()); |
394 |
isfile.str(""); |
isfile.str(""); |
395 |
|
t1->SetTextSize(0.025); |
396 |
|
t1->SetTextColor(196); |
397 |
|
isfile<<"--> Values at 28.5^{o}C (if presents) correspond"; |
398 |
|
t1->DrawLatex(50.,22.,isfile.str().c_str()); |
399 |
|
isfile.str(""); |
400 |
|
isfile<<" to wrong readings ( > 100^{o}C) of the Tsb"; |
401 |
|
t1->DrawLatex(50.,19.,isfile.str().c_str()); |
402 |
|
isfile.str(""); |
403 |
|
isfile<<"--> Values at 25.5^{o}C (if presents) correspond"; |
404 |
|
t1->DrawLatex(50.,12.,isfile.str().c_str()); |
405 |
|
isfile.str(""); |
406 |
|
isfile<<" to wrong readings ( < 0^{o}C) of the Tsb"; |
407 |
|
t1->DrawLatex(50.,9.,isfile.str().c_str()); |
408 |
|
isfile.str(""); |
409 |
|
|
410 |
Float_t tposy = 0.95; // up y-coord - top pads |
Float_t tposy = 0.95; // up y-coord - top pads |
411 |
Float_t thpad = 0; // pad height |
Float_t thpad = 0; // pad height |
431 |
/* -----------> pad for histograms */ |
/* -----------> pad for histograms */ |
432 |
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); |
433 |
|
|
434 |
Int_t v=0,xt_tmp[tsize]; |
Int_t v=0,vv=0; |
435 |
|
Double_t xt_tmp[tsize], tempt_tmp[tsize]; |
436 |
|
Double_t xt_tmpw[tsize], tempt_tmpw[tsize]; |
437 |
for (Int_t ev=countTEMP; ev<tsize; ev++){ |
for (Int_t ev=countTEMP; ev<tsize; ev++){ |
438 |
|
|
439 |
if(ev==tsize-1 && i==4) countTEMP=tsize-1; |
if(ev==tsize-1 && i==4) countTEMP=tsize-1; |
442 |
break; |
break; |
443 |
} |
} |
444 |
else{ |
else{ |
445 |
if(tempt[ev][i]!=65535){ |
tempt_tmp[v]=(Double_t)((Int_t)(((3.3*tempt[ev][i]/4096)-0.586)/0.0231)); |
446 |
tempt_tmp[v]=(Int_t)(((3.3*tempt[ev][i]/4096)-0.586)/0.0231); |
if(tempt_tmp[v]>100) { |
447 |
if(tempt_tmp[v]>0) xt_tmp[v++]=xt[ev]; |
tempt_tmp[v]=28.5; |
448 |
} |
tempt_tmpw[vv]=28.5; |
449 |
|
xt_tmpw[vv++]=(Double_t)xt[ev]; |
450 |
|
} |
451 |
|
else if(tempt_tmp[v]<0){ |
452 |
|
tempt_tmp[v]=25.5; |
453 |
|
tempt_tmpw[vv]=25.5; |
454 |
|
xt_tmpw[vv++]=(Double_t)xt[ev]; |
455 |
|
} |
456 |
|
xt_tmp[v++]=(Double_t)xt[ev]; |
457 |
} |
} |
458 |
} |
} |
459 |
TempCanv[ii]->cd(); |
TempCanv[ii]->cd(); |
478 |
temp[i][ii]->SetMarkerSize(0.2); |
temp[i][ii]->SetMarkerSize(0.2); |
479 |
temp[i][ii]->Draw("ap"); |
temp[i][ii]->Draw("ap"); |
480 |
tit.str(""); |
tit.str(""); |
481 |
|
if(vv>0){ |
482 |
|
tempw[i][ii]= new TGraph(vv,xt_tmpw,tempt_tmpw); |
483 |
|
tempw[i][ii]->SetMarkerStyle(21); |
484 |
|
tempw[i][ii]->SetMarkerSize(0.2); |
485 |
|
tempw[i][ii]->SetMarkerColor(196); |
486 |
|
tempw[i][ii]->Draw("samep"); |
487 |
|
} |
488 |
TempCanv[ii]->Update(); |
TempCanv[ii]->Update(); |
489 |
|
|
490 |
|
|
491 |
} |
} |
492 |
if(countTEMP==tsize-1){ |
if(countTEMP==tsize-1){ |
|
cntpgtemp=ii+1; |
|
493 |
break; |
break; |
494 |
} |
} |
495 |
} |
} |
496 |
|
|
497 |
|
// |
498 |
|
// Fill magnetic field graphs |
499 |
|
for(Int_t ii=0; ii<cntpgmag;ii++){ |
500 |
|
//**************************************************************************************** |
501 |
|
//Magnetic Field Output Pages |
502 |
|
//**************************************************************************************** |
503 |
|
fromfile.str(""); |
504 |
|
fromfile<<"FTrkQLook_EXPERT File: "<<ffile; |
505 |
|
isfile<<"Magnetic Axial Field vs OBT pag"<<ii+1; |
506 |
|
BfieldCanv[ii]=new TCanvas(isfile.str().c_str(),isfile.str().c_str(),900,1200); |
507 |
|
BfieldCanv[ii]->SetFillColor(10); |
508 |
|
BfieldCanv[ii]->Range(0,0,100,100); |
509 |
|
|
510 |
|
t->SetTextFont(32); |
511 |
|
t->SetTextColor(1); |
512 |
|
t->SetTextAlign(12); |
513 |
|
t->SetTextSize(0.02); |
514 |
|
t->DrawLatex(2.,98.7,fromfile.str().c_str()); |
515 |
|
t1->SetTextFont(32); |
516 |
|
t1->SetTextColor(1); |
517 |
|
t1->SetTextAlign(12); |
518 |
|
t1->SetTextSize(0.02); |
519 |
|
t1->DrawLatex(70.,98.7,isfile.str().c_str()); |
520 |
|
isfile.str(""); |
521 |
|
|
522 |
|
TLine li; |
523 |
|
li.SetLineStyle(1); |
524 |
|
li.SetLineWidth(1); |
525 |
|
li.SetLineColor(190); |
526 |
|
t1->SetTextColor(190); |
527 |
|
t1->SetTextSize(0.04); |
528 |
|
|
529 |
|
Float_t tposy = 0.95; // up y-coord - top pads |
530 |
|
Float_t thpad = 0; // pad height |
531 |
|
Float_t tposx1=0; // left x-coord - pad column |
532 |
|
Float_t tposx0=0; // x-coord - column division |
533 |
|
Float_t twrel = 0; // relative x size of first sub-column |
534 |
|
Float_t tmarg = 0.004; // margin among pads |
535 |
|
|
536 |
|
thpad = (tposy-tmarg*5)/3; |
537 |
|
twrel = (1-tmarg*4)/2; |
538 |
|
|
539 |
|
for(Int_t i=0; i<5; i++){ |
540 |
|
if ( (i+1)%2==1 ) { |
541 |
|
if(i>1) tposy = tposy-(tmarg*2+thpad); |
542 |
|
tposx1 = tmarg; |
543 |
|
tposx0 = tposx1 + twrel; |
544 |
|
} |
545 |
|
else { |
546 |
|
tposx1 = tposx0 + 2*tmarg; |
547 |
|
tposx0 = tposx1 + twrel; |
548 |
|
} |
549 |
|
|
550 |
|
/* -----------> pad for histograms */ |
551 |
|
pad7[i] = new TPad("pad7"," ",tposx1,tposy-thpad,tposx0,tposy,18,0,0); |
552 |
|
|
553 |
|
Int_t v=0; |
554 |
|
Double_t xb_tmp[bsize], magt_tmp[bsize]; |
555 |
|
for (Int_t ev=countMAG; ev<bsize; ev++){ |
556 |
|
|
557 |
|
if(ev==bsize-1 && i==4) countMAG=bsize-1; |
558 |
|
if(xb[ev]<xb[ev-1] && ev>countMAG){ |
559 |
|
if(i==4) countMAG=ev; |
560 |
|
break; |
561 |
|
} |
562 |
|
else{ |
563 |
|
magt_tmp[v]=(Double_t)magt[ev][i]; |
564 |
|
xb_tmp[v++]=(Double_t)xb[ev]; |
565 |
|
} |
566 |
|
} |
567 |
|
BfieldCanv[ii]->cd(); |
568 |
|
tit<<"B"<<i+5<<" (magnetic module "<<i+1<<")"; |
569 |
|
pad7[i]->SetFillColor(10); |
570 |
|
pad7[i]->Draw(); |
571 |
|
pad7[i]->cd(); |
572 |
|
mag[i][ii]= new TGraph(v,xb_tmp,magt_tmp); |
573 |
|
mag[i][ii]->SetTitle(tit.str().c_str()); |
574 |
|
mag[i][ii]->GetXaxis()->SetNdivisions(502,kTRUE); |
575 |
|
mag[i][ii]->GetXaxis()->SetLabelSize(0.04); |
576 |
|
mag[i][ii]->GetXaxis()->SetTitleSize(0.04); |
577 |
|
mag[i][ii]->GetXaxis()->SetTitle("OBT (ms)"); |
578 |
|
mag[i][ii]->GetXaxis()->CenterTitle(); |
579 |
|
mag[i][ii]->GetXaxis()->SetTitleOffset(0.85); |
580 |
|
if(i!=4) mag[i][ii]->GetYaxis()->SetRangeUser(2047,2058); |
581 |
|
else mag[i][ii]->GetYaxis()->SetRangeUser(2061,2066); |
582 |
|
mag[i][ii]->GetYaxis()->SetTitleOffset(1.2); |
583 |
|
mag[i][ii]->GetYaxis()->SetLabelOffset(0.001); |
584 |
|
mag[i][ii]->GetYaxis()->SetLabelSize(0.03); |
585 |
|
mag[i][ii]->GetYaxis()->SetTitleSize(0.04); |
586 |
|
mag[i][ii]->GetYaxis()->SetTitle("Magnetic Field (au)"); |
587 |
|
mag[i][ii]->GetYaxis()->CenterTitle(); |
588 |
|
mag[i][ii]->SetMarkerStyle(21); |
589 |
|
mag[i][ii]->SetMarkerSize(0.4); |
590 |
|
mag[i][ii]->Draw("ap"); |
591 |
|
Double_t min=0.,max=0,xlat=0.; |
592 |
|
min=mag[i][ii]->GetXaxis()->GetXmin(); |
593 |
|
max=mag[i][ii]->GetXaxis()->GetXmax(); |
594 |
|
xlat=min+(max-min)/2; |
595 |
|
stringstream mi,ma; |
596 |
|
mi<<"minimum recorded value"; |
597 |
|
ma<<"maximum recorded value"; |
598 |
|
t->SetTextSize(0.1); |
599 |
|
switch(i){ |
600 |
|
case 0: |
601 |
|
li.DrawLine(min,2054.,max,2054.); |
602 |
|
li.DrawLine(min,2048.,max,2048.); |
603 |
|
t1->DrawLatex(xlat,2054.3,ma.str().c_str()); |
604 |
|
t1->DrawLatex(xlat,2047.7,mi.str().c_str()); |
605 |
|
break; |
606 |
|
|
607 |
|
case 1: |
608 |
|
li.DrawLine(min,2055.,max,2055.); |
609 |
|
li.DrawLine(min,2051.,max,2051.); |
610 |
|
t1->DrawLatex(xlat,2055.3,ma.str().c_str()); |
611 |
|
t1->DrawLatex(xlat,2050.7,mi.str().c_str()); |
612 |
|
break; |
613 |
|
|
614 |
|
case 2: |
615 |
|
li.DrawLine(min,2056.,max,2056.); |
616 |
|
li.DrawLine(min,2052.,max,2052.); |
617 |
|
t1->DrawLatex(xlat,2056.3,ma.str().c_str()); |
618 |
|
t1->DrawLatex(xlat,2051.7,mi.str().c_str()); |
619 |
|
break; |
620 |
|
|
621 |
|
case 3: |
622 |
|
li.DrawLine(min,2057.,max,2057.); |
623 |
|
li.DrawLine(min,2053.,max,2053.); |
624 |
|
t1->DrawLatex(xlat,2057.3,ma.str().c_str()); |
625 |
|
t1->DrawLatex(xlat,2052.7,mi.str().c_str()); |
626 |
|
break; |
627 |
|
|
628 |
|
case 4: |
629 |
|
li.DrawLine(min,2065.,max,2065.); |
630 |
|
li.DrawLine(min,2062.,max,2062.); |
631 |
|
t1->DrawLatex(xlat,2065.15,ma.str().c_str()); |
632 |
|
t1->DrawLatex(xlat,2061.85,mi.str().c_str()); |
633 |
|
break; |
634 |
|
|
635 |
for(Int_t ii=0; ii<countrun;ii++){ |
} |
636 |
TPaveText *pt1; |
BfieldCanv[ii]->Update(); |
637 |
TPad *pt,*pt0; //pad for histos |
tit.str(""); |
638 |
|
} |
639 |
|
if(countMAG==bsize-1){ |
640 |
|
break; |
641 |
|
} |
642 |
|
} |
643 |
|
|
|
ofstream warning(out + "warning.txt",ios::out); |
|
644 |
|
|
645 |
|
// |
646 |
|
// Fill compressiontime and eventnumber graphs and DSP warnings |
647 |
|
for(Int_t ii=0; ii<countnboot;ii++){ |
648 |
|
TPad *pt; //pad for histos |
649 |
|
|
650 |
//**************************************************************************************** |
//**************************************************************************************** |
651 |
//Output figures --- First sheet: |
//COMPRESSIONTIME vs. OBT Output Pages |
652 |
//**************************************************************************************** |
//**************************************************************************************** |
653 |
fromfile.str(""); |
fromfile.str(""); |
654 |
fromfile<<"FTrkQLook_EXPERT File: "<<ffile; |
fromfile<<"FTrkQLook_EXPERT File: "<<ffile; |
669 |
isfile.str(""); |
isfile.str(""); |
670 |
|
|
671 |
//**************************************************************************************** |
//**************************************************************************************** |
672 |
//Output figures --- Second sheet: |
//DSP EVENT NUMBER Output Pages |
673 |
//**************************************************************************************** |
//**************************************************************************************** |
674 |
|
|
675 |
isfile<<"WARNINGS on DSP EVENT NUMBER pag"<<ii+1; |
isfile<<"DSP EVENT NUMBER vs. OBT pag"<<ii+1; |
676 |
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); |
677 |
EventNumCanv[ii]->SetFillColor(10); |
EventNumCanv[ii]->SetFillColor(10); |
678 |
EventNumCanv[ii]->Range(0,0,100,100); |
EventNumCanv[ii]->Range(0,0,100,100); |
685 |
t1->SetTextColor(1); |
t1->SetTextColor(1); |
686 |
t1->SetTextAlign(12); |
t1->SetTextAlign(12); |
687 |
t1->SetTextSize(0.02); |
t1->SetTextSize(0.02); |
688 |
t1->DrawLatex(65.,98.7,isfile.str().c_str()); |
t1->DrawLatex(62.,98.7,isfile.str().c_str()); |
689 |
isfile.str(""); |
isfile.str(""); |
690 |
|
|
691 |
Float_t posy = 0.95; // up y-coord - top pads |
Float_t posy = 0.95; // up y-coord - top pads |
717 |
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); |
718 |
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); |
719 |
} |
} |
|
//********************************************************************************** |
|
|
// Fill Graphs and Histos |
|
|
//********************************************************************************** |
|
720 |
|
|
721 |
// |
// |
722 |
// information about the tracker data |
// Obtain information about the tracker data |
723 |
Int_t warning_dspnumber=0; |
// and fill graphs and histos |
724 |
Float_t x[MAXSTORAGE]; |
|
725 |
|
Int_t al=0; |
726 |
|
Double_t x[MAXSTORAGE]; |
727 |
Float_t yc[MAXSTORAGE][12]; |
Float_t yc[MAXSTORAGE][12]; |
728 |
Float_t eventint[MAXSTORAGE]; |
Double_t eventint[MAXSTORAGE]; |
729 |
|
Int_t eventn[12]; |
730 |
|
|
731 |
for (Int_t ev=minev; ev<maxevent; ev++){ |
for (Int_t ev=minev; ev<maxevent; ev++){ |
732 |
tr->GetEntry(ev); |
tr->GetEntry(ev); |
733 |
ph = eh->GetPscuHeader(); |
ph = eh->GetPscuHeader(); |
734 |
cod = eh->GetCounter(); |
cod = eh->GetCounter(); |
735 |
|
|
736 |
|
|
737 |
if(ev==maxevent-1) maxev=maxevent-1; |
if(ev==maxevent-1) maxev=maxevent-1; |
738 |
|
|
739 |
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){ |
746 |
|
|
747 |
Int_t dsp=0; |
Int_t dsp=0; |
748 |
for(Int_t i=0; i<12; i++){ |
for(Int_t i=0; i<12; i++){ |
749 |
|
if(te->DSPnumber[i]<1 || te->DSPnumber[i]>12) { |
750 |
|
ALARM=1; |
751 |
|
break; |
752 |
|
} |
753 |
|
|
754 |
dsp=te->DSPnumber[i]-1; |
dsp=te->DSPnumber[i]-1; |
755 |
yc[(ev-minev)][dsp]= 0.051*te->compressiontime[i]; |
yc[(ev-minev)][dsp]= 0.051*te->compressiontime[i]; |
756 |
|
|
757 |
|
// |
758 |
|
// Fill Cluster Signal and Lighting of the view histos |
759 |
for(Int_t j=0;j<3;j++){ |
for(Int_t j=0;j<3;j++){ |
760 |
if(te->signcluster[i][j]!=0){ |
if(te->signcluster[i][j]!=0){ |
761 |
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)){ |
765 |
} |
} |
766 |
if(trk_cal_us[cod->Get(pctp->RunHeader)]!=104){ |
if(trk_cal_us[cod->Get(pctp->RunHeader)]!=104){ |
767 |
if(!(dsp%2)){ |
if(!(dsp%2)){ |
768 |
// 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])); |
769 |
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])); |
770 |
// 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])); |
|
771 |
} |
} |
772 |
else{ |
else{ |
773 |
// 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]); |
774 |
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]); |
775 |
// 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]); |
|
776 |
} |
} |
777 |
} |
} |
778 |
|
|
789 |
//************************************************************************************** |
//************************************************************************************** |
790 |
// warning for internal number |
// warning for internal number |
791 |
//************************************************************************************** |
//************************************************************************************** |
792 |
if(i<=10){ |
if(i<=10 && te->eventn[i]!=te->eventn[i+1]) ALARM=1; |
793 |
if(te->eventn[i]!=te->eventn[i+1]){ |
if((ev-minev)>=1 && eventn[i]+1!=te->eventn[i] && te->eventn[i]!=1) ALARM=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]; |
|
|
} |
|
794 |
} |
} |
795 |
|
eventint[(ev-minev)]=te->eventn[0]; |
796 |
|
|
|
if(ev<=maxevent-1){ |
|
|
|
|
|
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; |
|
|
} |
|
|
} |
|
|
|
|
797 |
//******************************************************************************************** |
//******************************************************************************************** |
798 |
// file ALARM |
// file DSP warning |
799 |
//******************************************************************************************** |
//******************************************************************************************** |
800 |
|
|
801 |
if(ALARM==1) { |
if(ALARM==1) { |
802 |
|
al=1; |
803 |
alarm <<endl<< "================================================="<< endl; |
alarm <<endl<< "================================================="<< endl; |
804 |
alarm << "PSCU-Pkt N. "<< ph->GetCounter() ; |
alarm << "PSCU-Pkt N. "<< ph->GetCounter() ; |
805 |
alarm << " - OBT "<< ph->GetOrbitalTime() << " ms"<<endl; |
alarm << " - OBT "<< ph->GetOrbitalTime() << " ms"<<endl; |
806 |
alarm << "(ROOT-tree entry "<<ev<<")"<<endl; |
alarm << "Total events "<<nevent<<endl; |
807 |
|
alarm << "(ROOT-tree entry "<<ev<<" in page "<<ii+1<<" )"<<endl; |
808 |
alarm << "================================================="<< endl; |
alarm << "================================================="<< endl; |
809 |
|
|
810 |
alarm << " DSPn"; |
alarm << " DSPn"; |
811 |
alarm << " Event"; |
alarm << " Counter"; |
812 |
|
alarm << " previous"; |
813 |
alarm << " Words"; |
alarm << " Words"; |
814 |
alarm << " crc"; |
alarm << " crc"; |
815 |
alarm << " FC"; |
alarm << " FC"; |
822 |
|
|
823 |
for(Int_t i=0; i<12 ; i++){ |
for(Int_t i=0; i<12 ; i++){ |
824 |
alarm.width(5); alarm << te->DSPnumber[i]; |
alarm.width(5); alarm << te->DSPnumber[i]; |
825 |
alarm.width(6); alarm << te->eventn[i]; |
alarm.width(8); alarm << te->eventn[i]; |
826 |
|
alarm.width(8); alarm << eventn[i]; |
827 |
alarm.width(6); alarm << te->DATAlength[i]; |
alarm.width(6); alarm << te->DATAlength[i]; |
828 |
alarm.width(4); alarm << te->crc[i]; |
alarm.width(4); alarm << te->crc[i]; |
829 |
alarm.width(4); alarm << te->fc[i]; |
alarm.width(4); alarm << te->fc[i]; |
838 |
alarm << endl; |
alarm << endl; |
839 |
} |
} |
840 |
} |
} |
841 |
|
for(Int_t i=0; i<12 ; i++) |
842 |
|
eventn[i]=te->eventn[i]; |
843 |
} |
} |
844 |
} |
} |
845 |
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; |
|
846 |
|
|
847 |
|
// |
848 |
|
// Draw the graphs |
849 |
for (Int_t i=0; i<12 ; i++){ |
for (Int_t i=0; i<12 ; i++){ |
850 |
Float_t yyc[maxev-minev]; |
Double_t yyc[maxev-minev]; |
851 |
for (Int_t v=0; v<maxev-minev; v++){ |
for (Int_t v=0; v<maxev-minev; v++){ |
852 |
yyc[v]=yc[v][i]; |
yyc[v]=yc[v][i]; |
853 |
} |
} |
864 |
comprtime[i][ii]->GetXaxis()->CenterTitle(); |
comprtime[i][ii]->GetXaxis()->CenterTitle(); |
865 |
comprtime[i][ii]->GetYaxis()->SetTitle("compressiontime (ms)"); |
comprtime[i][ii]->GetYaxis()->SetTitle("compressiontime (ms)"); |
866 |
comprtime[i][ii]->GetYaxis()->CenterTitle(); |
comprtime[i][ii]->GetYaxis()->CenterTitle(); |
867 |
comprtime[i][ii]->GetYaxis()->SetRangeUser(0,2); |
// comprtime[i][ii]->GetYaxis()->SetRangeUser(0,3); |
868 |
comprtime[i][ii]->Draw("ap"); |
comprtime[i][ii]->Draw("ap"); |
869 |
oss1.str(""); |
oss1.str(""); |
870 |
CompTimeCanv[ii]->Update(); |
CompTimeCanv[ii]->Update(); |
871 |
} |
} |
872 |
|
|
873 |
EventNumCanv[ii]->cd(); |
EventNumCanv[ii]->cd(); |
874 |
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(); |
|
875 |
pt->SetFillColor(10); |
pt->SetFillColor(10); |
876 |
pt->SetFrameFillColor(10); |
pt->SetFrameFillColor(10); |
877 |
pt->Draw(); |
pt->Draw(); |
878 |
pt->cd(); |
pt->cd(); |
879 |
eventnumb[ii]=new TGraph(maxev-minev,x,eventint); |
eventnumb[ii]=new TGraph(maxev-minev,x,eventint); |
880 |
eventnumb[ii]->SetTitle(""); |
eventnumb[ii]->SetTitle(""); |
881 |
eventnumb[ii]->GetXaxis()->SetLabelSize(0.04); |
eventnumb[ii]->GetXaxis()->SetLabelSize(0.02); |
882 |
eventnumb[ii]->GetXaxis()->SetTitleSize(0.04); |
eventnumb[ii]->GetXaxis()->SetTitleSize(0.03); |
883 |
eventnumb[ii]->GetXaxis()->SetTitle("OBT (ms)"); |
eventnumb[ii]->GetXaxis()->SetTitle("OBT (ms)"); |
884 |
eventnumb[ii]->GetXaxis()->CenterTitle(); |
eventnumb[ii]->GetXaxis()->CenterTitle(); |
885 |
eventnumb[ii]->GetXaxis()->SetTickLength(0.01); |
eventnumb[ii]->GetXaxis()->SetTickLength(0.01); |
886 |
eventnumb[ii]->GetXaxis()->SetTitleOffset(1.2); |
eventnumb[ii]->GetXaxis()->SetTitleOffset(1.1); |
887 |
eventnumb[ii]->GetYaxis()->SetLabelSize(0.04); |
eventnumb[ii]->GetYaxis()->SetLabelSize(0.02); |
888 |
eventnumb[ii]->GetYaxis()->SetTitleSize(0.04); |
eventnumb[ii]->GetYaxis()->SetTitleSize(0.03); |
889 |
eventnumb[ii]->GetYaxis()->SetTitle("DSP event-number"); |
eventnumb[ii]->GetYaxis()->SetTitle("DSP event-number"); |
890 |
eventnumb[ii]->GetYaxis()->CenterTitle(); |
eventnumb[ii]->GetYaxis()->CenterTitle(); |
891 |
eventnumb[ii]->GetYaxis()->SetTitleOffset(1.5); |
eventnumb[ii]->GetYaxis()->SetTitleOffset(2.); |
892 |
eventnumb[ii]->SetMarkerStyle(21); |
eventnumb[ii]->SetMarkerStyle(21); |
893 |
eventnumb[ii]->SetMarkerColor(kBlue); |
eventnumb[ii]->SetMarkerColor(kBlue); |
894 |
eventnumb[ii]->SetMarkerSize(0.3); |
eventnumb[ii]->SetMarkerSize(0.2); |
895 |
eventnumb[ii]->Draw("ap"); |
eventnumb[ii]->Draw("ap"); |
896 |
EventNumCanv[ii]->Update(); |
EventNumCanv[ii]->Update(); |
897 |
|
|
|
|
|
|
warning.close(); |
|
898 |
minev=maxev; |
minev=maxev; |
899 |
if(maxev==maxevent-1) { |
if(maxev==maxevent-1) { |
900 |
cntpgdat=ii+1; |
cntpgdat=ii+1; |
901 |
break; |
break; |
902 |
} |
} |
903 |
|
|
904 |
} |
} |
905 |
|
|
906 |
|
|
907 |
alarm.close(); |
alarm.close(); |
908 |
|
|
909 |
//**************************************************************************************** |
//**************************************************************************************** |
910 |
//Output figures --- Third sheet: |
//Cluster Signal ladder1 Output Pages |
911 |
//**************************************************************************************** |
//**************************************************************************************** |
912 |
|
|
913 |
fromfile.str(""); |
fromfile.str(""); |
930 |
isfile.str(""); |
isfile.str(""); |
931 |
|
|
932 |
//**************************************************************************************** |
//**************************************************************************************** |
933 |
//Output figures --- Third sheet: |
//Cluster Signal ladder2 Output Pages |
934 |
//**************************************************************************************** |
//**************************************************************************************** |
935 |
|
|
936 |
isfile<<"Cluster Signal ladder2"; |
isfile<<"Cluster Signal ladder2"; |
951 |
isfile.str(""); |
isfile.str(""); |
952 |
|
|
953 |
//**************************************************************************************** |
//**************************************************************************************** |
954 |
//Output figures --- Third sheet: |
//Cluster Signal ladder3 Output Pages |
955 |
//**************************************************************************************** |
//**************************************************************************************** |
956 |
|
|
957 |
isfile<<"Cluster Signal ladder3"; |
isfile<<"Cluster Signal ladder3"; |
972 |
isfile.str(""); |
isfile.str(""); |
973 |
|
|
974 |
//**************************************************************************************** |
//**************************************************************************************** |
975 |
//Output figures --- Fourth sheet: |
//Lighting of the views Output Pages |
976 |
//**************************************************************************************** |
//**************************************************************************************** |
977 |
|
|
978 |
isfile<<"lighting of the views"; |
isfile<<"lighting of the views"; |
991 |
t1->DrawLatex(70.,98.7,isfile.str().c_str()); |
t1->DrawLatex(70.,98.7,isfile.str().c_str()); |
992 |
isfile.str(""); |
isfile.str(""); |
993 |
|
|
994 |
|
// |
995 |
|
// Draw the histos |
996 |
for (Int_t i=0; i<12 ; i++){ |
for (Int_t i=0; i<12 ; i++){ |
997 |
|
|
998 |
TBox b; |
TBox b; |
|
b.SetFillColor(6); |
|
|
b.SetFillStyle(3945); |
|
999 |
|
|
1000 |
Float_t maxhist=0; |
Float_t maxhist=0; |
1001 |
LandauCanv1->cd(); |
LandauCanv1->cd(); |
1039 |
illuminazione[i]->Draw(""); |
illuminazione[i]->Draw(""); |
1040 |
if(i==1){ |
if(i==1){ |
1041 |
maxhist= illuminazione[i]->GetMaximum(); |
maxhist= illuminazione[i]->GetMaximum(); |
1042 |
b.DrawBox(2816.,0.,3060.,maxhist); |
b.SetFillColor(6); |
1043 |
|
b.SetFillStyle(3945); |
1044 |
|
b.DrawBox(2944.,0.,3060.,maxhist); |
1045 |
|
|
1046 |
|
b.SetFillColor(107); |
1047 |
|
b.SetFillStyle(3954); |
1048 |
|
b.DrawBox(2816.,0.,2944.,maxhist); |
1049 |
|
b.DrawBox(2048.,0.,2176.,maxhist); |
1050 |
} |
} |
1051 |
else if(i==6){ |
else if(i==6){ |
1052 |
maxhist= illuminazione[i]->GetMaximum(); |
maxhist= illuminazione[i]->GetMaximum(); |
1053 |
|
b.SetFillColor(6); |
1054 |
|
b.SetFillStyle(3945); |
1055 |
b.DrawBox(2560.,0.,2816.,maxhist); |
b.DrawBox(2560.,0.,2816.,maxhist); |
|
b.DrawBox(512.,0.,768.,maxhist); |
|
1056 |
b.DrawBox(1024.,0.,1792.,maxhist); |
b.DrawBox(1024.,0.,1792.,maxhist); |
1057 |
|
|
1058 |
|
b.SetFillColor(107); |
1059 |
|
b.SetFillStyle(3954); |
1060 |
|
b.DrawBox(512.,0.,768.,maxhist); |
1061 |
|
} |
1062 |
|
else if(i==7){ |
1063 |
|
maxhist= illuminazione[i]->GetMaximum(); |
1064 |
|
b.SetFillColor(107); |
1065 |
|
b.SetFillStyle(3954); |
1066 |
|
b.DrawBox(512.,0.,768.,maxhist); |
1067 |
} |
} |
1068 |
else if(i==11){ |
else if(i==11){ |
1069 |
maxhist= illuminazione[i]->GetMaximum(); |
maxhist= illuminazione[i]->GetMaximum(); |
1070 |
|
b.SetFillColor(6); |
1071 |
|
b.SetFillStyle(3945); |
1072 |
b.DrawBox(768.,0.,1024.,maxhist); |
b.DrawBox(768.,0.,1024.,maxhist); |
1073 |
|
|
1074 |
|
b.SetFillColor(107); |
1075 |
|
b.SetFillStyle(3954); |
1076 |
|
b.DrawBox(0.,0.,512.,maxhist); |
1077 |
|
b.DrawBox(1920.,0.,2048.,maxhist); |
1078 |
} |
} |
1079 |
IlluminaCanv->Update(); |
IlluminaCanv->Update(); |
1080 |
} |
} |
1081 |
|
|
1082 |
printf("... end of packets. \n"); |
printf("... end of packets. \n"); |
1083 |
|
|
1084 |
//************************************************************************* |
//************************************************************************* |
1085 |
// Save output Files |
// Save output Files |
1086 |
//************************************************************************* |
//************************************************************************* |
1103 |
CompTimeCanv[fl]->Print(out+out1.str().c_str(),"Portrait"); |
CompTimeCanv[fl]->Print(out+out1.str().c_str(),"Portrait"); |
1104 |
EventNumCanv[fl]->Print(out+out2.str().c_str(),"Portrait"); |
EventNumCanv[fl]->Print(out+out2.str().c_str(),"Portrait"); |
1105 |
TempCanv[fl]->Print(out+out2.str().c_str(),"Portrait"); |
TempCanv[fl]->Print(out+out2.str().c_str(),"Portrait"); |
1106 |
|
BfieldCanv[fl]->Print(out+out2.str().c_str(),"Portrait"); |
1107 |
LandauCanv1->Print(out+out2.str().c_str(),"Portrait"); |
LandauCanv1->Print(out+out2.str().c_str(),"Portrait"); |
1108 |
LandauCanv2->Print(out+out2.str().c_str(),"Portrait"); |
LandauCanv2->Print(out+out2.str().c_str(),"Portrait"); |
1109 |
LandauCanv3->Print(out+out2.str().c_str(),"Portrait"); |
LandauCanv3->Print(out+out2.str().c_str(),"Portrait"); |
1113 |
if(fl==0) CompTimeCanv[fl]->Print(out+out1.str().c_str(),"Portrait"); |
if(fl==0) CompTimeCanv[fl]->Print(out+out1.str().c_str(),"Portrait"); |
1114 |
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"); |
1115 |
if(fl<cntpgdat) EventNumCanv[fl]->Print(out+out2.str().c_str(),"Portrait"); |
if(fl<cntpgdat) EventNumCanv[fl]->Print(out+out2.str().c_str(),"Portrait"); |
1116 |
|
if(fl<cntpgmag) BfieldCanv[fl]->Print(out+out2.str().c_str(),"Portrait"); |
1117 |
if(fl<cntpgtemp) TempCanv[fl]->Print(out+out2.str().c_str(),"Portrait"); |
if(fl<cntpgtemp) TempCanv[fl]->Print(out+out2.str().c_str(),"Portrait"); |
1118 |
if(fl==totpg-1){ |
if(fl==totpg-1){ |
1119 |
LandauCanv1->Print(out+out2.str().c_str(),"Portrait"); |
LandauCanv1->Print(out+out2.str().c_str(),"Portrait"); |
1128 |
out1<<ffile<<"_FTrkQLook_EXPERT-CompTime-pag"<<fl+1<<"."<<outfile.Data(); |
out1<<ffile<<"_FTrkQLook_EXPERT-CompTime-pag"<<fl+1<<"."<<outfile.Data(); |
1129 |
if(fl<cntpgdat) CompTimeCanv[fl]->Print(out+out1.str().c_str()); |
if(fl<cntpgdat) CompTimeCanv[fl]->Print(out+out1.str().c_str()); |
1130 |
out1.str(""); |
out1.str(""); |
1131 |
|
out1<<ffile<<"_FTrkQLook_EXPERT-BField-pag"<<fl+1<<"."<<outfile.Data(); |
1132 |
|
if(fl<cntpgmag) BfieldCanv[fl]->Print(out+out1.str().c_str()); |
1133 |
|
out1.str(""); |
1134 |
out1<<ffile<<"_FTrkQLook_EXPERT-Temp-pag"<<fl+1<<"."<<outfile.Data(); |
out1<<ffile<<"_FTrkQLook_EXPERT-Temp-pag"<<fl+1<<"."<<outfile.Data(); |
1135 |
if(fl<cntpgtemp) TempCanv[fl]->Print(out+out1.str().c_str()); |
if(fl<cntpgtemp) TempCanv[fl]->Print(out+out1.str().c_str()); |
1136 |
out1.str(""); |
out1.str(""); |
1137 |
out1<<ffile<<"_FTrkQLook_EXPERT-EvNum-pag"<<fl+1<<"."<<outfile.Data(); |
out1<<ffile<<"_FTrkQLook_EXPERT-EvNum-pag"<<fl+1<<"."<<outfile.Data(); |
1138 |
if(fl<cntpgdat) EventNumCanv[fl]->Print(out+out1.str().c_str()); |
if(fl<cntpgdat) EventNumCanv[fl]->Print(out+out1.str().c_str()); |
1139 |
if(fl==countrun-1){ |
if(fl==totpg-1){ |
1140 |
out1.str(""); |
out1.str(""); |
1141 |
out1<<ffile<<"_FTrkQLook_EXPERT-LandauL1."<<outfile.Data(); |
out1<<ffile<<"_FTrkQLook_EXPERT-LandauL1."<<outfile.Data(); |
1142 |
LandauCanv1->Print(out+out1.str().c_str()); |
LandauCanv1->Print(out+out1.str().c_str()); |
1153 |
} |
} |
1154 |
} |
} |
1155 |
|
|
1156 |
|
// |
1157 |
|
// Convert ps to pdf if required |
1158 |
if(!strcmp(outfile.Data(),"pdf")){ |
if(!strcmp(outfile.Data(),"pdf")){ |
1159 |
stringstream com; |
stringstream com; |
1160 |
com<<"ps2pdf13 "<<out<<ffile<<"_FTrkQLook_EXPERT.ps "<<out<<ffile<<"_FTrkQLook_EXPERT.pdf"; |
com<<"ps2pdf13 "<<out<<ffile<<"_FTrkQLook_EXPERT.ps "<<out<<ffile<<"_FTrkQLook_EXPERT.pdf"; |
1167 |
com.str(""); |
com.str(""); |
1168 |
} |
} |
1169 |
|
|
|
command.str(""); |
|
|
command<<"rm -f "<<out<<"warning.txt"; |
|
|
system(command.str().c_str()); |
|
|
|
|
1170 |
gROOT->Reset(); |
gROOT->Reset(); |
1171 |
return; |
return; |
1172 |
} |
} |