1 |
/** |
/** |
2 |
* FTrkQLook_EXPERT |
* FTrkQLook_EXPERT.cxx |
3 |
* |
* |
4 |
* autor: D.Fedele |
* autor: D.Fedele |
5 |
* version 2.0 |
* version v1r06 |
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 <EventCounter.h> |
34 |
|
#include <PacketType.h> |
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(); |
Int_t dwpos = file.Last('/'); |
43 |
Int_t dwpos = filepath.rfind("/"); |
Int_t dwpos1 = file.Last('.'); |
|
Int_t dwpos1 = filepath.find(".root"); |
|
|
TString fpath=(filepath.c_str()); |
|
44 |
TString base,ffile ; |
TString base,ffile ; |
45 |
stringcopy(ffile,fpath,dwpos+1,dwpos1); |
ffile=file(dwpos+1,dwpos1-(dwpos+1)); |
46 |
stringcopy(base,fpath,0,dwpos); |
if(dwpos>0) base=file(0,dwpos); |
|
if(dwpos>0) base+="/"; |
|
47 |
|
|
48 |
TString out; |
TString out; |
49 |
if(outdir.Length()==0){ |
if(outdir.Length()==0){ |
51 |
}else{ |
}else{ |
52 |
out = outdir; |
out = outdir; |
53 |
} |
} |
54 |
|
if(out.Last('/')+1<out.Length()) out+="/"; |
55 |
|
|
56 |
// |
// |
57 |
// inizialise the variables and open the file |
// inizialise the variables and open the file |
62 |
pamela::PscuHeader *ph=0,*pH=0; |
pamela::PscuHeader *ph=0,*pH=0; |
63 |
pamela::TrkAlarmEvent *al=0; |
pamela::TrkAlarmEvent *al=0; |
64 |
pamela::RunHeaderEvent *reh=0; |
pamela::RunHeaderEvent *reh=0; |
65 |
|
pamela::EventCounter *cod=0; |
66 |
|
|
67 |
|
pamela::PacketType *pctp=0; |
68 |
|
|
69 |
TFile *datafile = new TFile(file); |
TFile *datafile = new TFile(file); |
70 |
|
if ( !datafile ){ |
71 |
|
printf("No data file, exiting...\n"); |
72 |
|
return; |
73 |
|
} |
74 |
|
|
75 |
TTree *tree = (TTree*)datafile->Get("TsbT"); |
TTree *tree = (TTree*)datafile->Get("TsbT"); |
76 |
tree->SetBranchAddress("TsbT",&event); |
tree->SetBranchAddress("TsbT",&event); |
131 |
nevent=maxevent-minevent ; |
nevent=maxevent-minevent ; |
132 |
} |
} |
133 |
|
|
134 |
Long64_t obt=0; |
// |
135 |
const Int_t sizeH=neventH; |
// information about the RunHeader |
136 |
ULong64_t HOBT[sizeH]; |
ULong64_t HOBT[neventH]; |
137 |
Int_t trk_cal_us[sizeH],countrun=1; |
Int_t trk_cal_us[neventH]; |
138 |
for (Int_t vi=0; vi<sizeH;vi++){ |
for (Int_t vi=0; vi<neventH;vi++){ |
139 |
HOBT[vi]=0; |
HOBT[vi]=0; |
140 |
trk_cal_us[vi]=0; |
trk_cal_us[vi]=0; |
141 |
} |
} |
144 |
pH = eH->GetPscuHeader(); |
pH = eH->GetPscuHeader(); |
145 |
HOBT[ev]= pH->GetOrbitalTime(); |
HOBT[ev]= pH->GetOrbitalTime(); |
146 |
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); |
|
147 |
} |
} |
|
countrun+=(Int_t)nevent/30000; |
|
|
// printf("\ncountrun=%d\n",countrun); |
|
148 |
|
|
149 |
// |
// |
150 |
// other variables definitions |
// other variables definitions |
162 |
} |
} |
163 |
const Int_t tsize=maxsize; |
const Int_t tsize=maxsize; |
164 |
Int_t tempt[tsize][5],xt[tsize], tempt_tmp[tsize]; |
Int_t tempt[tsize][5],xt[tsize], tempt_tmp[tsize]; |
165 |
|
Int_t countnboot=1; |
166 |
// |
// |
167 |
// information about the temperatures |
// information about the temperatures |
168 |
for (Int_t ev=0; ev<tnevent; ev++){ |
for (Int_t ev=0; ev<tnevent; ev++){ |
170 |
tmpSize = event->Records->GetEntries(); |
tmpSize = event->Records->GetEntries(); |
171 |
for (Int_t j = 0; j < tmpSize; j++){ |
for (Int_t j = 0; j < tmpSize; j++){ |
172 |
record = (pamela::TsbTRecord*)event->Records->At(j); |
record = (pamela::TsbTRecord*)event->Records->At(j); |
173 |
xt[siztmp]=record->RECORD_OBT; //0.051*record->RECORD_OBT; |
xt[siztmp]=record->RECORD_OBT; |
174 |
|
if((xt[siztmp]<xt[siztmp-1]) && siztmp>0) |
175 |
|
countnboot+=1; |
176 |
|
|
177 |
for (Int_t z = 0; z < 5; z++){ |
for (Int_t z = 0; z < 5; z++){ |
178 |
tempt[siztmp][z] = record->TEMPERATURES[z+1]; |
tempt[siztmp][z] = record->TEMPERATURES[z+1]; |
179 |
} |
} |
180 |
siztmp++; |
siztmp++; |
181 |
} |
} |
182 |
} |
} |
183 |
|
countnboot+=2*(Int_t)nevent/MAXSTORAGE; |
184 |
|
// printf("\ncountnboot=%d\n",countnboot); |
185 |
|
|
186 |
// |
// |
187 |
// open the output text files for the alarms |
// open the output text files for the alarms |
201 |
// write the file for the TrkAlarm packet |
// write the file for the TrkAlarm packet |
202 |
if(alnevent==0) alarm1 <<endl<< "------> NO ALARM!!! <-------"<< endl; |
if(alnevent==0) alarm1 <<endl<< "------> NO ALARM!!! <-------"<< endl; |
203 |
else{ |
else{ |
204 |
|
Long64_t obt=0; |
205 |
for (Int_t ev=0; ev<alnevent; ev++){ |
for (Int_t ev=0; ev<alnevent; ev++){ |
206 |
altr->GetEntry(ev); |
altr->GetEntry(ev); |
207 |
ph = aleh->GetPscuHeader(); |
ph = aleh->GetPscuHeader(); |
259 |
} |
} |
260 |
} |
} |
261 |
|
|
262 |
|
// |
263 |
|
// Set Style options |
264 |
gStyle->SetLabelSize(0.05,"x"); |
gStyle->SetLabelSize(0.05,"x"); |
265 |
gStyle->SetLabelSize(0.06,"y"); |
gStyle->SetLabelSize(0.06,"y"); |
266 |
gStyle->SetStatFontSize(0.075); |
gStyle->SetStatFontSize(0.075); |
274 |
gStyle->SetTitleSize(0.06,"y"); |
gStyle->SetTitleSize(0.06,"y"); |
275 |
gStyle->SetTitleSize(0.055,"x"); |
gStyle->SetTitleSize(0.055,"x"); |
276 |
|
|
277 |
|
// |
278 |
|
// Define output canvas, histos and graphs |
279 |
|
TCanvas *CompTimeCanv[countnboot],*EventNumCanv[countnboot],*TempCanv[countnboot]; |
280 |
|
TCanvas *IlluminaCanv,*LandauCanv1,*LandauCanv2,*LandauCanv3; |
281 |
|
|
282 |
|
TH1F *landau1[12],*landau2[12],*landau3[12],*illuminazione[12]; |
283 |
|
TGraph *comprtime[12][countnboot],*temp[5][countnboot],*eventnumb[countnboot]; |
284 |
|
TPad *pad1[12],*pad2[12],*pad3[12],*pad4[12],*pad5[12],*pad6[5]; |
285 |
|
|
286 |
|
for(Int_t n = 0; n<12; n++) { |
287 |
|
|
288 |
|
/* -----------> HISTOGRAMS */ |
289 |
|
|
290 |
|
tit<<"DSP "<<n+1; |
291 |
|
oss1<<"DSP "<<n+1; |
292 |
|
oss2<<"DSPh "<<n+1; |
293 |
|
oss3<<"DSP h "<<n+1; |
294 |
|
oss4<<"DSP h"<<n+1; |
295 |
|
|
296 |
|
landau1[n]= new TH1F(oss1.str().c_str(),tit.str().c_str(),401,-0.5,1200.5); |
297 |
|
landau2[n]= new TH1F(oss2.str().c_str(),tit.str().c_str(),401,-0.5,1200.5); |
298 |
|
landau3[n]= new TH1F(oss3.str().c_str(),tit.str().c_str(),401,-0.5,1200.5); |
299 |
|
|
300 |
|
illuminazione[n]= new TH1F(oss4.str().c_str(),tit.str().c_str(),3073,-0.5,3072.5); |
301 |
|
|
302 |
|
tit.str(""); |
303 |
|
oss1.str(""); |
304 |
|
oss2.str(""); |
305 |
|
oss3.str(""); |
306 |
|
oss4.str(""); |
307 |
|
}; |
308 |
|
|
309 |
|
|
310 |
//*************************************************************************************** |
//*************************************************************************************** |
311 |
// LOOP on each event |
// LOOP on each event |
315 |
printf("\n Scan of events from %i to %i ... \n",minevent,maxevent-1); |
printf("\n Scan of events from %i to %i ... \n",minevent,maxevent-1); |
316 |
else |
else |
317 |
printf("\n Scan of events from %i to %i ... \n",minevent+1,maxevent); |
printf("\n Scan of events from %i to %i ... \n",minevent+1,maxevent); |
|
|
|
|
|
|
|
Int_t minev=minevent,maxev=maxevent,countTEMP=0,countHOBT=0; |
|
|
TCanvas *CompTimeCanv[countrun],*EventNumCanv[countrun],*LandauCanv1[countrun],*LandauCanv2[countrun],*LandauCanv3[countrun]; |
|
|
TCanvas *IlluminaCanv[countrun],*TempCanv[countrun]; |
|
|
TGraph *comprtime[12][countrun],*temp[5][countrun],*eventnumb[countrun]; |
|
|
TH1F *landau1[12][countrun],*landau2[12][countrun],*landau3[12][countrun],*illuminazione[12][countrun]; |
|
|
|
|
|
|
|
|
for(Int_t ii=0; ii<countrun;ii++){ |
|
|
TPaveText *pt1; |
|
|
TPad *pt,*pt0; |
|
|
TPad *pad1[12],*pad2[12],*pad3[12],*pad4[12],*pad5[12],*pad6[5]; //pad for histos |
|
318 |
|
|
319 |
ofstream warning(out + "warning.txt",ios::out); |
TLatex *t=new TLatex(); |
320 |
|
TLatex *t1=new TLatex(); |
321 |
|
|
322 |
|
Int_t cntpgtemp=0,cntpgdat=0; |
323 |
|
Int_t minev=minevent,maxev=maxevent,countTEMP=0; |
324 |
|
|
325 |
|
// |
326 |
|
// Fill temperature graphs |
327 |
|
for(Int_t ii=0; ii<countnboot;ii++){ |
328 |
//**************************************************************************************** |
//**************************************************************************************** |
329 |
//Output figures --- First sheet: |
//Temperature Output Pages |
330 |
//**************************************************************************************** |
//**************************************************************************************** |
331 |
fromfile.str(""); |
fromfile.str(""); |
332 |
fromfile<<"FTrkQLook_EXPERT File: "<<ffile; |
fromfile<<"FTrkQLook_EXPERT File: "<<ffile; |
333 |
isfile<<"COMPRESSIONTIME vs. OBT pag"<<ii+1; |
isfile<<"Temperatures vs OBT pag"<<ii+1; |
334 |
CompTimeCanv[ii]=new TCanvas(isfile.str().c_str(),isfile.str().c_str(),900,1200); |
TempCanv[ii]=new TCanvas(isfile.str().c_str(),isfile.str().c_str(),900,1200); |
335 |
CompTimeCanv[ii]->SetFillColor(10); |
TempCanv[ii]->SetFillColor(10); |
336 |
CompTimeCanv[ii]->Range(0,0,100,100); |
TempCanv[ii]->Range(0,0,100,100); |
|
TLatex *t=new TLatex(); |
|
|
t->SetTextFont(32); |
|
|
t->SetTextColor(1); |
|
|
t->SetTextAlign(12); |
|
|
t->SetTextSize(0.02); |
|
|
t->DrawLatex(2.,98.7,fromfile.str().c_str()); |
|
|
TLatex *t1=new TLatex(); |
|
|
t1->SetTextFont(32); |
|
|
t1->SetTextColor(1); |
|
|
t1->SetTextAlign(12); |
|
|
t1->SetTextSize(0.02); |
|
|
t1->DrawLatex(62.,98.7,isfile.str().c_str()); |
|
|
isfile.str(""); |
|
|
|
|
|
//**************************************************************************************** |
|
|
//Output figures --- Second sheet: |
|
|
//**************************************************************************************** |
|
|
|
|
|
isfile<<"WARNINGS on DSP EVENT NUMBER pag"<<ii+1; |
|
|
EventNumCanv[ii]=new TCanvas(isfile.str().c_str(),isfile.str().c_str(),900,1200); |
|
|
EventNumCanv[ii]->SetFillColor(10); |
|
|
EventNumCanv[ii]->Range(0,0,100,100); |
|
|
t->SetTextFont(32); |
|
|
t->SetTextColor(1); |
|
|
t->SetTextAlign(12); |
|
|
t->SetTextSize(0.02); |
|
|
t->DrawLatex(2.,98.7,fromfile.str().c_str()); |
|
|
t1->SetTextFont(32); |
|
|
t1->SetTextColor(1); |
|
|
t1->SetTextAlign(12); |
|
|
t1->SetTextSize(0.02); |
|
|
t1->DrawLatex(65.,98.7,isfile.str().c_str()); |
|
|
isfile.str(""); |
|
|
|
|
|
//**************************************************************************************** |
|
|
//Output figures --- Third sheet: |
|
|
//**************************************************************************************** |
|
|
|
|
|
isfile<<"Cluster Signal ladder1 pag"<<ii+1; |
|
|
LandauCanv1[ii]=new TCanvas(isfile.str().c_str(),isfile.str().c_str(),900,1200); |
|
|
LandauCanv1[ii]->SetFillColor(10); |
|
|
LandauCanv1[ii]->Range(0,0,100,100); |
|
337 |
|
|
338 |
t->SetTextFont(32); |
t->SetTextFont(32); |
339 |
t->SetTextColor(1); |
t->SetTextColor(1); |
344 |
t1->SetTextColor(1); |
t1->SetTextColor(1); |
345 |
t1->SetTextAlign(12); |
t1->SetTextAlign(12); |
346 |
t1->SetTextSize(0.02); |
t1->SetTextSize(0.02); |
347 |
t1->DrawLatex(65.,98.7,isfile.str().c_str()); |
t1->DrawLatex(78.,98.7,isfile.str().c_str()); |
348 |
isfile.str(""); |
isfile.str(""); |
349 |
|
|
350 |
//**************************************************************************************** |
Float_t tposy = 0.95; // up y-coord - top pads |
351 |
//Output figures --- Third sheet: |
Float_t thpad = 0; // pad height |
352 |
//**************************************************************************************** |
Float_t tposx1=0; // left x-coord - pad column |
353 |
|
Float_t tposx0=0; // x-coord - column division |
354 |
isfile<<"Cluster Signal ladder2 pag"<<ii+1; |
Float_t twrel = 0; // relative x size of first sub-column |
355 |
LandauCanv2[ii]=new TCanvas(isfile.str().c_str(),isfile.str().c_str(),900,1200); |
Float_t tmarg = 0.004; // margin among pads |
356 |
LandauCanv2[ii]->SetFillColor(10); |
|
357 |
LandauCanv2[ii]->Range(0,0,100,100); |
thpad = (tposy-tmarg*5)/3; |
358 |
|
twrel = (1-tmarg*4)/2; |
359 |
t->SetTextFont(32); |
|
360 |
t->SetTextColor(1); |
for(Int_t i=0; i<5; i++){ |
361 |
t->SetTextAlign(12); |
if ( (i+1)%2==1 ) { |
362 |
t->SetTextSize(0.02); |
if(i>1) tposy = tposy-(tmarg*2+thpad); |
363 |
t->DrawLatex(2.,98.7,fromfile.str().c_str()); |
tposx1 = tmarg; |
364 |
t1->SetTextFont(32); |
tposx0 = tposx1 + twrel; |
365 |
t1->SetTextColor(1); |
} |
366 |
t1->SetTextAlign(12); |
else { |
367 |
t1->SetTextSize(0.02); |
tposx1 = tposx0 + 2*tmarg; |
368 |
t1->DrawLatex(65.,98.7,isfile.str().c_str()); |
tposx0 = tposx1 + twrel; |
369 |
isfile.str(""); |
} |
370 |
|
|
371 |
|
/* -----------> pad for histograms */ |
372 |
|
pad6[i] = new TPad("pad6"," ",tposx1,tposy-thpad,tposx0,tposy,18,0,0); |
373 |
|
|
374 |
//**************************************************************************************** |
Int_t v=0,xt_tmp[tsize]; |
375 |
//Output figures --- Third sheet: |
for (Int_t ev=countTEMP; ev<tsize; ev++){ |
376 |
//**************************************************************************************** |
|
377 |
|
if(ev==tsize-1 && i==4) countTEMP=tsize-1; |
378 |
|
if(xt[ev]<xt[ev-1] && ev>countTEMP){ |
379 |
|
if(i==4) countTEMP=ev; |
380 |
|
break; |
381 |
|
} |
382 |
|
else{ |
383 |
|
if(tempt[ev][i]!=65535){ |
384 |
|
tempt_tmp[v]=(Int_t)(((3.3*tempt[ev][i]/4096)-0.586)/0.0231); |
385 |
|
if(tempt_tmp[v]>0) xt_tmp[v++]=xt[ev]; |
386 |
|
} |
387 |
|
} |
388 |
|
} |
389 |
|
TempCanv[ii]->cd(); |
390 |
|
tit<<"T"<<i+5<<" (magnetic module "<<i+1<<")"; |
391 |
|
pad6[i]->SetFillColor(10); |
392 |
|
pad6[i]->Draw(); |
393 |
|
pad6[i]->cd(); |
394 |
|
temp[i][ii]= new TGraph(v,xt_tmp,tempt_tmp); |
395 |
|
temp[i][ii]->SetTitle(tit.str().c_str()); |
396 |
|
temp[i][ii]->GetXaxis()->SetLabelSize(0.04); |
397 |
|
temp[i][ii]->GetXaxis()->SetTitleSize(0.04); |
398 |
|
temp[i][ii]->GetXaxis()->SetTitle("OBT (ms)"); |
399 |
|
temp[i][ii]->GetXaxis()->CenterTitle(); |
400 |
|
temp[i][ii]->GetXaxis()->SetTitleOffset(0.85); |
401 |
|
temp[i][ii]->GetYaxis()->SetTitleOffset(1.2); |
402 |
|
temp[i][ii]->GetYaxis()->SetLabelOffset(0.001); |
403 |
|
temp[i][ii]->GetYaxis()->SetLabelSize(0.04); |
404 |
|
temp[i][ii]->GetYaxis()->SetTitleSize(0.04); |
405 |
|
temp[i][ii]->GetYaxis()->SetTitle("Temperatures ( ^{o}C)"); |
406 |
|
temp[i][ii]->GetYaxis()->CenterTitle(); |
407 |
|
temp[i][ii]->SetMarkerStyle(21); |
408 |
|
temp[i][ii]->SetMarkerSize(0.2); |
409 |
|
temp[i][ii]->Draw("ap"); |
410 |
|
tit.str(""); |
411 |
|
TempCanv[ii]->Update(); |
412 |
|
|
413 |
|
} |
414 |
|
if(countTEMP==tsize-1){ |
415 |
|
cntpgtemp=ii+1; |
416 |
|
break; |
417 |
|
} |
418 |
|
} |
419 |
|
|
|
isfile<<"Cluster Signal ladder3 pag"<<ii+1; |
|
|
LandauCanv3[ii]=new TCanvas(isfile.str().c_str(),isfile.str().c_str(),900,1200); |
|
|
LandauCanv3[ii]->SetFillColor(10); |
|
|
LandauCanv3[ii]->Range(0,0,100,100); |
|
420 |
|
|
421 |
t->SetTextFont(32); |
// |
422 |
t->SetTextColor(1); |
// Fill compressiontime and eventnumber graphs and DSP warnings |
423 |
t->SetTextAlign(12); |
for(Int_t ii=0; ii<countnboot;ii++){ |
424 |
t->SetTextSize(0.02); |
TPad *pt; //pad for histos |
|
t->DrawLatex(2.,98.7,fromfile.str().c_str()); |
|
|
t1->SetTextFont(32); |
|
|
t1->SetTextColor(1); |
|
|
t1->SetTextAlign(12); |
|
|
t1->SetTextSize(0.02); |
|
|
t1->DrawLatex(65.,98.7,isfile.str().c_str()); |
|
|
isfile.str(""); |
|
425 |
|
|
426 |
//**************************************************************************************** |
//**************************************************************************************** |
427 |
//Output figures --- Fourth sheet: |
//COMPRESSIONTIME vs. OBT Output Pages |
428 |
//**************************************************************************************** |
//**************************************************************************************** |
429 |
|
fromfile.str(""); |
430 |
isfile<<"lighting of the views pag"<<ii+1; |
fromfile<<"FTrkQLook_EXPERT File: "<<ffile; |
431 |
IlluminaCanv[ii]=new TCanvas(isfile.str().c_str(),isfile.str().c_str(),900,1200); |
isfile<<"COMPRESSIONTIME vs. OBT pag"<<ii+1; |
432 |
IlluminaCanv[ii]->SetFillColor(10); |
CompTimeCanv[ii]=new TCanvas(isfile.str().c_str(),isfile.str().c_str(),900,1200); |
433 |
IlluminaCanv[ii]->Range(0,0,100,100); |
CompTimeCanv[ii]->SetFillColor(10); |
434 |
|
CompTimeCanv[ii]->Range(0,0,100,100); |
435 |
t->SetTextFont(32); |
t->SetTextFont(32); |
436 |
t->SetTextColor(1); |
t->SetTextColor(1); |
437 |
t->SetTextAlign(12); |
t->SetTextAlign(12); |
441 |
t1->SetTextColor(1); |
t1->SetTextColor(1); |
442 |
t1->SetTextAlign(12); |
t1->SetTextAlign(12); |
443 |
t1->SetTextSize(0.02); |
t1->SetTextSize(0.02); |
444 |
t1->DrawLatex(70.,98.7,isfile.str().c_str()); |
t1->DrawLatex(62.,98.7,isfile.str().c_str()); |
445 |
isfile.str(""); |
isfile.str(""); |
446 |
|
|
447 |
//**************************************************************************************** |
//**************************************************************************************** |
448 |
//Output figures --- Fifth sheet: |
//DSP EVENT NUMBER Output Pages |
449 |
//**************************************************************************************** |
//**************************************************************************************** |
|
|
|
|
isfile<<"Temperatures vs OBT pag"<<ii+1; |
|
|
TempCanv[ii]=new TCanvas(isfile.str().c_str(),isfile.str().c_str(),900,1200); |
|
|
TempCanv[ii]->SetFillColor(10); |
|
|
TempCanv[ii]->Range(0,0,100,100); |
|
450 |
|
|
451 |
|
isfile<<"DSP EVENT NUMBER vs. OBT pag"<<ii+1; |
452 |
|
EventNumCanv[ii]=new TCanvas(isfile.str().c_str(),isfile.str().c_str(),900,1200); |
453 |
|
EventNumCanv[ii]->SetFillColor(10); |
454 |
|
EventNumCanv[ii]->Range(0,0,100,100); |
455 |
t->SetTextFont(32); |
t->SetTextFont(32); |
456 |
t->SetTextColor(1); |
t->SetTextColor(1); |
457 |
t->SetTextAlign(12); |
t->SetTextAlign(12); |
461 |
t1->SetTextColor(1); |
t1->SetTextColor(1); |
462 |
t1->SetTextAlign(12); |
t1->SetTextAlign(12); |
463 |
t1->SetTextSize(0.02); |
t1->SetTextSize(0.02); |
464 |
t1->DrawLatex(78.,98.7,isfile.str().c_str()); |
t1->DrawLatex(62.,98.7,isfile.str().c_str()); |
465 |
isfile.str(""); |
isfile.str(""); |
466 |
|
|
|
//************************************************************************************* |
|
|
//book pads and histos |
|
|
//*************************************************************************************** |
|
467 |
Float_t posy = 0.95; // up y-coord - top pads |
Float_t posy = 0.95; // up y-coord - top pads |
468 |
Float_t hpad = 0; // pad height |
Float_t hpad = 0; // pad height |
469 |
Float_t posx1=0; // left x-coord - pad column |
Float_t posx1=0; // left x-coord - pad column |
470 |
Float_t posx0=0; // x-coord - column division |
Float_t posx0=0; // x-coord - column division |
471 |
Float_t wrel = 0; // relative x size of first sub-column |
Float_t wrel = 0; // relative x size of first sub-column |
472 |
Float_t marg = 0.004; // margin among pads |
Float_t marg = 0.004; // margin among pads |
473 |
Float_t tposy = 0.95; // up y-coord - top pads |
|
|
Float_t thpad = 0; // pad height |
|
|
Float_t tposx1=0; // left x-coord - pad column |
|
|
Float_t tposx0=0; // x-coord - column division |
|
|
Float_t twrel = 0; // relative x size of first sub-column |
|
|
Float_t tmarg = 0.004; // margin among pads |
|
|
|
|
474 |
hpad = (posy-marg*11)/6; |
hpad = (posy-marg*11)/6; |
475 |
wrel = (1-marg*4)/2; |
wrel = (1-marg*4)/2; |
476 |
thpad = (tposy-tmarg*5)/3; |
|
|
twrel = (1-tmarg*4)/2; |
|
|
|
|
477 |
for(Int_t n = 0; n<12; n++) { |
for(Int_t n = 0; n<12; n++) { |
478 |
|
|
479 |
if ( (n+1)%2==1 ) { |
if ( (n+1)%2==1 ) { |
480 |
if(n>1) posy = posy-(marg*2+hpad); |
if(n>1) posy = posy-(marg*2+hpad); |
481 |
posx1 = marg; |
posx1 = marg; |
484 |
else { |
else { |
485 |
posx1 = posx0 + 2*marg; |
posx1 = posx0 + 2*marg; |
486 |
posx0 = posx1 + wrel; |
posx0 = posx1 + wrel; |
487 |
} |
} |
488 |
|
|
|
if ( (n+1)%2==1 ) { |
|
|
if(n>1) tposy = tposy-(tmarg*2+thpad); |
|
|
tposx1 = tmarg; |
|
|
tposx0 = tposx1 + twrel; |
|
|
} |
|
|
else { |
|
|
tposx1 = tposx0 + 2*tmarg; |
|
|
tposx0 = tposx1 + twrel; |
|
|
} |
|
|
|
|
|
|
|
489 |
/* -----------> pad for histograms */ |
/* -----------> pad for histograms */ |
490 |
pad1[n] = new TPad("pad1"," ",posx1,posy-hpad,posx0,posy,18,0,0); |
pad1[n] = new TPad("pad1"," ",posx1,posy-hpad,posx0,posy,18,0,0); |
491 |
pad2[n] = new TPad("pad2"," ",posx1,posy-hpad,posx0,posy,18,0,0); |
pad2[n] = new TPad("pad2"," ",posx1,posy-hpad,posx0,posy,18,0,0); |
492 |
pad3[n] = new TPad("pad3"," ",posx1,posy-hpad,posx0,posy,18,0,0); |
pad3[n] = new TPad("pad3"," ",posx1,posy-hpad,posx0,posy,18,0,0); |
493 |
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); |
494 |
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); |
495 |
if(n<5) pad6[n] = new TPad("pad6"," ",tposx1,tposy-thpad,tposx0,tposy,18,0,0); |
} |
|
|
|
|
|
|
|
/* -----------> HISTOGRAMS */ |
|
|
|
|
|
tit<<"DSP "<<n+1; |
|
|
oss1<<"DSP "<<n*100+ii; |
|
|
oss2<<"DSPh "<<n*100+ii; |
|
|
oss3<<"DSP h "<<n*100+ii; |
|
|
oss4<<"DSP h"<<n*100+ii; |
|
|
|
|
|
landau1[n][ii]= new TH1F(oss1.str().c_str(),tit.str().c_str(),401,-0.5,1200.5); |
|
|
landau2[n][ii]= new TH1F(oss2.str().c_str(),tit.str().c_str(),401,-0.5,1200.5); |
|
|
landau3[n][ii]= new TH1F(oss3.str().c_str(),tit.str().c_str(),401,-0.5,1200.5); |
|
|
|
|
|
illuminazione[n][ii]= new TH1F(oss4.str().c_str(),tit.str().c_str(),3073,-0.5,3072.5); |
|
|
|
|
|
tit.str(""); |
|
|
oss1.str(""); |
|
|
oss2.str(""); |
|
|
oss3.str(""); |
|
|
oss4.str(""); |
|
|
}; |
|
|
|
|
|
|
|
|
// printf("\nprova0\n"); |
|
|
|
|
|
|
|
|
//********************************************************************************** |
|
|
// Fill Graphs and Histos |
|
|
//********************************************************************************** |
|
496 |
|
|
497 |
// |
// |
498 |
// information about the tracker data |
// Obtain information about the tracker data |
499 |
Int_t warning_dspnumber=0; |
// and fill graphs and histos |
500 |
|
|
501 |
|
Int_t al=0; |
502 |
Float_t x[MAXSTORAGE]; |
Float_t x[MAXSTORAGE]; |
503 |
Float_t yc[MAXSTORAGE][12]; |
Float_t yc[MAXSTORAGE][12]; |
504 |
Float_t eventint[MAXSTORAGE]; |
Float_t eventint[MAXSTORAGE]; |
505 |
|
Int_t eventn[12]; |
506 |
|
|
507 |
for (Int_t ev=minev; ev<maxevent; ev++){ |
for (Int_t ev=minev; ev<maxevent; ev++){ |
508 |
tr->GetEntry(ev); |
tr->GetEntry(ev); |
509 |
ph = eh->GetPscuHeader(); |
ph = eh->GetPscuHeader(); |
510 |
|
cod = eh->GetCounter(); |
511 |
|
|
512 |
|
|
513 |
if(ev==maxevent-1) maxev=maxevent-1; |
if(ev==maxevent-1) maxev=maxevent-1; |
514 |
|
|
522 |
|
|
523 |
Int_t dsp=0; |
Int_t dsp=0; |
524 |
for(Int_t i=0; i<12; i++){ |
for(Int_t i=0; i<12; i++){ |
525 |
|
if(te->DSPnumber[i]<1 || te->DSPnumber[i]>12) { |
526 |
|
ALARM=1; |
527 |
|
break; |
528 |
|
} |
529 |
|
|
530 |
dsp=te->DSPnumber[i]-1; |
dsp=te->DSPnumber[i]-1; |
531 |
yc[(ev-minev)][dsp]= 0.051*te->compressiontime[i]; |
yc[(ev-minev)][dsp]= 0.051*te->compressiontime[i]; |
532 |
|
|
533 |
|
// |
534 |
|
// Fill Cluster Signal and Lighting of the view histos |
535 |
for(Int_t j=0;j<3;j++){ |
for(Int_t j=0;j<3;j++){ |
536 |
if(te->signcluster[i][j]!=0){ |
if(te->signcluster[i][j]!=0){ |
537 |
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)){ |
538 |
// if((dsp==1 && te->addrcluster[i][2]>767 && te->addrcluster[i][2]<1024) || (dsp==6 && te->addrcluster[i][0]>511 && te->addrcluster[i][0]<769) ||(dsp==6 && te->addrcluster[i][1]>0 && te->addrcluster[i][1]<769) ||(dsp==6 && te->addrcluster[i][2]>511 && te->addrcluster[i][2]<769) ||(dsp==11 && te->addrcluster[i][0]>767 && te->addrcluster[i][0]<1024)); |
illuminazione[dsp]->Fill((Float_t)((j*1024.)+te->addrcluster[i][j])); |
|
// else |
|
|
illuminazione[dsp][ii]->Fill((Float_t)((j*1024.)+te->addrcluster[i][j])); |
|
539 |
} |
} |
540 |
} |
} |
541 |
} |
} |
542 |
if(x[ev-minev]>HOBT[countHOBT+1]) |
if(trk_cal_us[cod->Get(pctp->RunHeader)]!=104){ |
|
countHOBT+=1; |
|
|
if(trk_cal_us[countHOBT]!=104){ |
|
543 |
if(!(dsp%2)){ |
if(!(dsp%2)){ |
544 |
if(te->signcluster[i][0]!=0) landau1[dsp][ii]->Fill((Float_t)(1024.-te->signcluster[i][0])); |
if(te->signcluster[i][0]!=0) landau1[dsp]->Fill((Float_t)(1024.-te->signcluster[i][0])); |
545 |
if(te->signcluster[i][1]!=0) landau2[dsp][ii]->Fill((Float_t)(1024.-te->signcluster[i][1])); |
if(te->signcluster[i][1]!=0) landau2[dsp]->Fill((Float_t)(1024.-te->signcluster[i][1])); |
546 |
if(te->signcluster[i][2]!=0) landau3[dsp][ii]->Fill((Float_t)(1024.-te->signcluster[i][2])); |
if(te->signcluster[i][2]!=0) landau3[dsp]->Fill((Float_t)(1024.-te->signcluster[i][2])); |
547 |
} |
} |
548 |
else{ |
else{ |
549 |
if(te->signcluster[i][0]!=0) landau1[dsp][ii]->Fill((Float_t)te->signcluster[i][0]); |
if(te->signcluster[i][0]!=0) landau1[dsp]->Fill((Float_t)te->signcluster[i][0]); |
550 |
if(te->signcluster[i][1]!=0) landau2[dsp][ii]->Fill((Float_t)te->signcluster[i][1]); |
if(te->signcluster[i][1]!=0) landau2[dsp]->Fill((Float_t)te->signcluster[i][1]); |
551 |
if(te->signcluster[i][2]!=0) landau3[dsp][ii]->Fill((Float_t)te->signcluster[i][2]); |
if(te->signcluster[i][2]!=0) landau3[dsp]->Fill((Float_t)te->signcluster[i][2]); |
552 |
} |
} |
553 |
} |
} |
554 |
|
|
555 |
WARNING[i]=0; |
WARNING[i]=0; |
556 |
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){ |
557 |
ALARM = 1; //general alarm |
ALARM = 1; //general alarm |
565 |
//************************************************************************************** |
//************************************************************************************** |
566 |
// warning for internal number |
// warning for internal number |
567 |
//************************************************************************************** |
//************************************************************************************** |
568 |
if(i<=10){ |
if(i<=10 && te->eventn[i]!=te->eventn[i+1]) ALARM=1; |
569 |
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]; |
|
|
} |
|
570 |
} |
} |
571 |
|
eventint[(ev-minev)]=te->eventn[0]; |
572 |
|
|
|
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; |
|
|
} |
|
|
} |
|
|
|
|
573 |
//******************************************************************************************** |
//******************************************************************************************** |
574 |
// file ALARM |
// file DSP warning |
575 |
//******************************************************************************************** |
//******************************************************************************************** |
576 |
|
|
577 |
if(ALARM==1) { |
if(ALARM==1) { |
578 |
|
al=1; |
579 |
alarm <<endl<< "================================================="<< endl; |
alarm <<endl<< "================================================="<< endl; |
580 |
alarm << "PSCU-Pkt N. "<< ph->GetCounter() ; |
alarm << "PSCU-Pkt N. "<< ph->GetCounter() ; |
581 |
alarm << " - OBT "<< ph->GetOrbitalTime() << " ms"<<endl; |
alarm << " - OBT "<< ph->GetOrbitalTime() << " ms"<<endl; |
582 |
alarm << "(ROOT-tree entry "<<ev<<")"<<endl; |
alarm << "Total events "<<nevent<<endl; |
583 |
|
alarm << "(ROOT-tree entry "<<ev<<" in page "<<ii+1<<" )"<<endl; |
584 |
alarm << "================================================="<< endl; |
alarm << "================================================="<< endl; |
585 |
|
|
586 |
alarm << " DSPn"; |
alarm << " DSPn"; |
587 |
alarm << " Event"; |
alarm << " Counter"; |
588 |
|
alarm << " previous"; |
589 |
alarm << " Words"; |
alarm << " Words"; |
590 |
alarm << " crc"; |
alarm << " crc"; |
591 |
alarm << " FC"; |
alarm << " FC"; |
598 |
|
|
599 |
for(Int_t i=0; i<12 ; i++){ |
for(Int_t i=0; i<12 ; i++){ |
600 |
alarm.width(5); alarm << te->DSPnumber[i]; |
alarm.width(5); alarm << te->DSPnumber[i]; |
601 |
alarm.width(6); alarm << te->eventn[i]; |
alarm.width(8); alarm << te->eventn[i]; |
602 |
|
alarm.width(8); alarm << eventn[i]; |
603 |
alarm.width(6); alarm << te->DATAlength[i]; |
alarm.width(6); alarm << te->DATAlength[i]; |
604 |
alarm.width(4); alarm << te->crc[i]; |
alarm.width(4); alarm << te->crc[i]; |
605 |
alarm.width(4); alarm << te->fc[i]; |
alarm.width(4); alarm << te->fc[i]; |
614 |
alarm << endl; |
alarm << endl; |
615 |
} |
} |
616 |
} |
} |
617 |
|
for(Int_t i=0; i<12 ; i++) |
618 |
|
eventn[i]=te->eventn[i]; |
619 |
} |
} |
620 |
} |
} |
621 |
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; |
|
|
|
|
|
|
|
|
Float_t maxhist=0; |
|
|
TBox b; |
|
|
b.SetFillColor(6); |
|
|
b.SetFillStyle(3945); |
|
622 |
|
|
623 |
|
// |
624 |
|
// Draw the graphs |
625 |
for (Int_t i=0; i<12 ; i++){ |
for (Int_t i=0; i<12 ; i++){ |
626 |
Float_t yyc[maxev-minev]; |
Float_t yyc[maxev-minev]; |
627 |
for (Int_t v=0; v<maxev-minev; v++){ |
for (Int_t v=0; v<maxev-minev; v++){ |
628 |
yyc[v]=yc[v][i]; |
yyc[v]=yc[v][i]; |
629 |
} |
} |
|
|
|
|
LandauCanv1[ii]->cd(); |
|
|
pad1[i]->SetFillColor(10); |
|
|
pad1[i]->SetFrameFillColor(10); |
|
|
pad1[i]->Draw(); |
|
|
pad1[i]->cd(); |
|
|
landau1[i][ii]->GetXaxis()->SetTitle("max signal"); |
|
|
landau1[i][ii]->GetXaxis()->CenterTitle(); |
|
|
landau1[i][ii]->Draw(""); |
|
|
LandauCanv1[ii]->Update(); |
|
|
|
|
|
LandauCanv2[ii]->cd(); |
|
|
pad4[i]->SetFillColor(10); |
|
|
pad4[i]->SetFrameFillColor(10); |
|
|
pad4[i]->Draw(); |
|
|
pad4[i]->cd(); |
|
|
landau2[i][ii]->GetXaxis()->SetTitle("max signal"); |
|
|
landau2[i][ii]->GetXaxis()->CenterTitle(); |
|
|
landau2[i][ii]->Draw(""); |
|
|
LandauCanv2[ii]->Update(); |
|
|
|
|
|
LandauCanv3[ii]->cd(); |
|
|
pad5[i]->SetFillColor(10); |
|
|
pad5[i]->SetFrameFillColor(10); |
|
|
pad5[i]->Draw(); |
|
|
pad5[i]->cd(); |
|
|
landau3[i][ii]->GetXaxis()->SetTitle("max signal"); |
|
|
landau3[i][ii]->GetXaxis()->CenterTitle(); |
|
|
landau3[i][ii]->Draw(""); |
|
|
LandauCanv3[ii]->Update(); |
|
|
|
|
|
IlluminaCanv[ii]->cd(); |
|
|
pad2[i]->SetFillColor(10); |
|
|
pad2[i]->SetFrameFillColor(10); |
|
|
pad2[i]->SetLogy(); |
|
|
pad2[i]->Draw(); |
|
|
pad2[i]->cd(); |
|
|
illuminazione[i][ii]->GetXaxis()->SetTitle("strip with max signal"); |
|
|
illuminazione[i][ii]->GetXaxis()->CenterTitle(); |
|
|
illuminazione[i][ii]->Draw(""); |
|
|
if(i==1){ |
|
|
maxhist= illuminazione[i][ii]->GetMaximum(); |
|
|
b.DrawBox(2816.,0.,3060.,maxhist); |
|
|
} |
|
|
else if(i==6){ |
|
|
maxhist= illuminazione[i][ii]->GetMaximum(); |
|
|
b.DrawBox(2560.,0.,2816.,maxhist); |
|
|
b.DrawBox(512.,0.,768.,maxhist); |
|
|
b.DrawBox(1024.,0.,1792.,maxhist); |
|
|
} |
|
|
else if(i==11){ |
|
|
maxhist= illuminazione[i][ii]->GetMaximum(); |
|
|
b.DrawBox(768.,0.,1024.,maxhist); |
|
|
} |
|
|
IlluminaCanv[ii]->Update(); |
|
|
|
|
630 |
|
|
631 |
CompTimeCanv[ii]->cd(); |
CompTimeCanv[ii]->cd(); |
632 |
pad3[i]->SetFillColor(10); |
pad3[i]->SetFillColor(10); |
640 |
comprtime[i][ii]->GetXaxis()->CenterTitle(); |
comprtime[i][ii]->GetXaxis()->CenterTitle(); |
641 |
comprtime[i][ii]->GetYaxis()->SetTitle("compressiontime (ms)"); |
comprtime[i][ii]->GetYaxis()->SetTitle("compressiontime (ms)"); |
642 |
comprtime[i][ii]->GetYaxis()->CenterTitle(); |
comprtime[i][ii]->GetYaxis()->CenterTitle(); |
643 |
comprtime[i][ii]->GetYaxis()->SetRangeUser(0,2); |
comprtime[i][ii]->GetYaxis()->SetRangeUser(0,3); |
644 |
comprtime[i][ii]->Draw("ap"); |
comprtime[i][ii]->Draw("ap"); |
645 |
oss1.str(""); |
oss1.str(""); |
646 |
CompTimeCanv[ii]->Update(); |
CompTimeCanv[ii]->Update(); |
647 |
}; |
} |
648 |
|
|
649 |
EventNumCanv[ii]->cd(); |
EventNumCanv[ii]->cd(); |
650 |
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(); |
|
651 |
pt->SetFillColor(10); |
pt->SetFillColor(10); |
652 |
pt->SetFrameFillColor(10); |
pt->SetFrameFillColor(10); |
653 |
pt->Draw(); |
pt->Draw(); |
654 |
pt->cd(); |
pt->cd(); |
655 |
eventnumb[ii]=new TGraph(maxev-minev,x,eventint); |
eventnumb[ii]=new TGraph(maxev-minev,x,eventint); |
656 |
eventnumb[ii]->SetTitle(""); |
eventnumb[ii]->SetTitle(""); |
657 |
eventnumb[ii]->GetXaxis()->SetLabelSize(0.04); |
eventnumb[ii]->GetXaxis()->SetLabelSize(0.02); |
658 |
eventnumb[ii]->GetXaxis()->SetTitleSize(0.04); |
eventnumb[ii]->GetXaxis()->SetTitleSize(0.03); |
659 |
eventnumb[ii]->GetXaxis()->SetTitle("OBT (ms)"); |
eventnumb[ii]->GetXaxis()->SetTitle("OBT (ms)"); |
660 |
eventnumb[ii]->GetXaxis()->CenterTitle(); |
eventnumb[ii]->GetXaxis()->CenterTitle(); |
661 |
eventnumb[ii]->GetXaxis()->SetTickLength(0.01); |
eventnumb[ii]->GetXaxis()->SetTickLength(0.01); |
662 |
eventnumb[ii]->GetXaxis()->SetTitleOffset(1.2); |
eventnumb[ii]->GetXaxis()->SetTitleOffset(1.1); |
663 |
eventnumb[ii]->GetYaxis()->SetLabelSize(0.04); |
eventnumb[ii]->GetYaxis()->SetLabelSize(0.02); |
664 |
eventnumb[ii]->GetYaxis()->SetTitleSize(0.04); |
eventnumb[ii]->GetYaxis()->SetTitleSize(0.03); |
665 |
eventnumb[ii]->GetYaxis()->SetTitle("DSP event-number"); |
eventnumb[ii]->GetYaxis()->SetTitle("DSP event-number"); |
666 |
eventnumb[ii]->GetYaxis()->CenterTitle(); |
eventnumb[ii]->GetYaxis()->CenterTitle(); |
667 |
eventnumb[ii]->GetYaxis()->SetTitleOffset(1.5); |
eventnumb[ii]->GetYaxis()->SetTitleOffset(2.); |
668 |
eventnumb[ii]->SetMarkerStyle(21); |
eventnumb[ii]->SetMarkerStyle(21); |
669 |
eventnumb[ii]->SetMarkerColor(kBlue); |
eventnumb[ii]->SetMarkerColor(kBlue); |
670 |
eventnumb[ii]->SetMarkerSize(0.3); |
eventnumb[ii]->SetMarkerSize(0.2); |
671 |
eventnumb[ii]->Draw("ap"); |
eventnumb[ii]->Draw("ap"); |
672 |
EventNumCanv[ii]->Update(); |
EventNumCanv[ii]->Update(); |
|
|
|
|
obt=0; |
|
|
for(Int_t i=0; i<5; i++){ |
|
|
Int_t v=0; |
|
|
for (Int_t ev=countTEMP; ev<tsize; ev++){ |
|
|
tree->GetEntry(ev); |
|
|
ph=eT->GetPscuHeader(); |
|
|
|
|
|
if(ph->GetOrbitalTime()<obt && ev>countTEMP){ |
|
|
countTEMP=ev; |
|
|
break; |
|
|
} |
|
|
else{ |
|
|
obt=ph->GetOrbitalTime(); |
|
|
tempt_tmp[v++]=(Int_t)(((3.3*tempt[ev][i]/4096)-0.586)/0.0231); |
|
|
} |
|
|
} |
|
|
TempCanv[ii]->cd(); |
|
|
tit<<"T"<<i+5<<" (magnetic module "<<i+1<<")"; |
|
|
pad6[i]->SetFillColor(10); |
|
|
pad6[i]->Draw(); |
|
|
pad6[i]->cd(); |
|
|
temp[i][ii]= new TGraph(v,xt,tempt_tmp); |
|
|
temp[i][ii]->SetTitle(tit.str().c_str()); |
|
|
temp[i][ii]->GetXaxis()->SetLabelSize(0.04); |
|
|
temp[i][ii]->GetXaxis()->SetTitleSize(0.04); |
|
|
temp[i][ii]->GetXaxis()->SetTitle("OBT (ms)"); |
|
|
temp[i][ii]->GetXaxis()->CenterTitle(); |
|
|
temp[i][ii]->GetXaxis()->SetTitleOffset(0.85); |
|
|
temp[i][ii]->GetYaxis()->SetTitleOffset(1.2); |
|
|
temp[i][ii]->GetYaxis()->SetLabelOffset(0.001); |
|
|
temp[i][ii]->GetYaxis()->SetLabelSize(0.04); |
|
|
temp[i][ii]->GetYaxis()->SetTitleSize(0.04); |
|
|
temp[i][ii]->GetYaxis()->SetTitle("Temperatures ( ^{o}C)"); |
|
|
temp[i][ii]->GetYaxis()->CenterTitle(); |
|
|
temp[i][ii]->SetMarkerStyle(21); |
|
|
temp[i][ii]->SetMarkerSize(0.2); |
|
|
temp[i][ii]->Draw("ap"); |
|
|
tit.str(""); |
|
|
TempCanv[ii]->Update(); |
|
|
} |
|
673 |
|
|
674 |
minev=maxev; |
minev=maxev; |
675 |
if(maxev==maxevent-1) { |
if(maxev==maxevent-1) { |
676 |
countrun=ii+1; |
cntpgdat=ii+1; |
677 |
break; |
break; |
678 |
} |
} |
679 |
|
|
|
warning.close(); |
|
680 |
} |
} |
681 |
|
|
682 |
//***************************************** |
|
|
//close all files |
|
|
//***************************************** |
|
683 |
alarm.close(); |
alarm.close(); |
684 |
|
|
685 |
|
//**************************************************************************************** |
686 |
|
//Cluster Signal ladder1 Output Pages |
687 |
|
//**************************************************************************************** |
688 |
|
|
689 |
|
fromfile.str(""); |
690 |
|
fromfile<<"FTrkQLook_EXPERT File: "<<ffile; |
691 |
|
isfile<<"Cluster Signal ladder1"; |
692 |
|
LandauCanv1=new TCanvas(isfile.str().c_str(),isfile.str().c_str(),900,1200); |
693 |
|
LandauCanv1->SetFillColor(10); |
694 |
|
LandauCanv1->Range(0,0,100,100); |
695 |
|
|
696 |
|
t->SetTextFont(32); |
697 |
|
t->SetTextColor(1); |
698 |
|
t->SetTextAlign(12); |
699 |
|
t->SetTextSize(0.02); |
700 |
|
t->DrawLatex(2.,98.7,fromfile.str().c_str()); |
701 |
|
t1->SetTextFont(32); |
702 |
|
t1->SetTextColor(1); |
703 |
|
t1->SetTextAlign(12); |
704 |
|
t1->SetTextSize(0.02); |
705 |
|
t1->DrawLatex(70.,98.7,isfile.str().c_str()); |
706 |
|
isfile.str(""); |
707 |
|
|
708 |
|
//**************************************************************************************** |
709 |
|
//Cluster Signal ladder2 Output Pages |
710 |
|
//**************************************************************************************** |
711 |
|
|
712 |
|
isfile<<"Cluster Signal ladder2"; |
713 |
|
LandauCanv2=new TCanvas(isfile.str().c_str(),isfile.str().c_str(),900,1200); |
714 |
|
LandauCanv2->SetFillColor(10); |
715 |
|
LandauCanv2->Range(0,0,100,100); |
716 |
|
|
717 |
|
t->SetTextFont(32); |
718 |
|
t->SetTextColor(1); |
719 |
|
t->SetTextAlign(12); |
720 |
|
t->SetTextSize(0.02); |
721 |
|
t->DrawLatex(2.,98.7,fromfile.str().c_str()); |
722 |
|
t1->SetTextFont(32); |
723 |
|
t1->SetTextColor(1); |
724 |
|
t1->SetTextAlign(12); |
725 |
|
t1->SetTextSize(0.02); |
726 |
|
t1->DrawLatex(70.,98.7,isfile.str().c_str()); |
727 |
|
isfile.str(""); |
728 |
|
|
729 |
|
//**************************************************************************************** |
730 |
|
//Cluster Signal ladder3 Output Pages |
731 |
|
//**************************************************************************************** |
732 |
|
|
733 |
|
isfile<<"Cluster Signal ladder3"; |
734 |
|
LandauCanv3=new TCanvas(isfile.str().c_str(),isfile.str().c_str(),900,1200); |
735 |
|
LandauCanv3->SetFillColor(10); |
736 |
|
LandauCanv3->Range(0,0,100,100); |
737 |
|
|
738 |
|
t->SetTextFont(32); |
739 |
|
t->SetTextColor(1); |
740 |
|
t->SetTextAlign(12); |
741 |
|
t->SetTextSize(0.02); |
742 |
|
t->DrawLatex(2.,98.7,fromfile.str().c_str()); |
743 |
|
t1->SetTextFont(32); |
744 |
|
t1->SetTextColor(1); |
745 |
|
t1->SetTextAlign(12); |
746 |
|
t1->SetTextSize(0.02); |
747 |
|
t1->DrawLatex(70.,98.7,isfile.str().c_str()); |
748 |
|
isfile.str(""); |
749 |
|
|
750 |
|
//**************************************************************************************** |
751 |
|
//Lighting of the views Output Pages |
752 |
|
//**************************************************************************************** |
753 |
|
|
754 |
|
isfile<<"lighting of the views"; |
755 |
|
IlluminaCanv=new TCanvas(isfile.str().c_str(),isfile.str().c_str(),900,1200); |
756 |
|
IlluminaCanv->SetFillColor(10); |
757 |
|
IlluminaCanv->Range(0,0,100,100); |
758 |
|
t->SetTextFont(32); |
759 |
|
t->SetTextColor(1); |
760 |
|
t->SetTextAlign(12); |
761 |
|
t->SetTextSize(0.02); |
762 |
|
t->DrawLatex(2.,98.7,fromfile.str().c_str()); |
763 |
|
t1->SetTextFont(32); |
764 |
|
t1->SetTextColor(1); |
765 |
|
t1->SetTextAlign(12); |
766 |
|
t1->SetTextSize(0.02); |
767 |
|
t1->DrawLatex(70.,98.7,isfile.str().c_str()); |
768 |
|
isfile.str(""); |
769 |
|
|
770 |
|
// |
771 |
|
// Draw the histos |
772 |
|
for (Int_t i=0; i<12 ; i++){ |
773 |
|
|
774 |
|
TBox b; |
775 |
|
b.SetFillColor(6); |
776 |
|
b.SetFillStyle(3945); |
777 |
|
|
778 |
|
Float_t maxhist=0; |
779 |
|
LandauCanv1->cd(); |
780 |
|
pad1[i]->SetFillColor(10); |
781 |
|
pad1[i]->SetFrameFillColor(10); |
782 |
|
pad1[i]->Draw(); |
783 |
|
pad1[i]->cd(); |
784 |
|
landau1[i]->GetXaxis()->SetTitle("max signal"); |
785 |
|
landau1[i]->GetXaxis()->CenterTitle(); |
786 |
|
landau1[i]->Draw(""); |
787 |
|
LandauCanv1->Update(); |
788 |
|
|
789 |
|
LandauCanv2->cd(); |
790 |
|
pad4[i]->SetFillColor(10); |
791 |
|
pad4[i]->SetFrameFillColor(10); |
792 |
|
pad4[i]->Draw(); |
793 |
|
pad4[i]->cd(); |
794 |
|
landau2[i]->GetXaxis()->SetTitle("max signal"); |
795 |
|
landau2[i]->GetXaxis()->CenterTitle(); |
796 |
|
landau2[i]->Draw(""); |
797 |
|
LandauCanv2->Update(); |
798 |
|
|
799 |
|
LandauCanv3->cd(); |
800 |
|
pad5[i]->SetFillColor(10); |
801 |
|
pad5[i]->SetFrameFillColor(10); |
802 |
|
pad5[i]->Draw(); |
803 |
|
pad5[i]->cd(); |
804 |
|
landau3[i]->GetXaxis()->SetTitle("max signal"); |
805 |
|
landau3[i]->GetXaxis()->CenterTitle(); |
806 |
|
landau3[i]->Draw(""); |
807 |
|
LandauCanv3->Update(); |
808 |
|
|
809 |
|
IlluminaCanv->cd(); |
810 |
|
pad2[i]->SetFillColor(10); |
811 |
|
pad2[i]->SetFrameFillColor(10); |
812 |
|
pad2[i]->SetLogy(); |
813 |
|
pad2[i]->Draw(); |
814 |
|
pad2[i]->cd(); |
815 |
|
illuminazione[i]->GetXaxis()->SetTitle("strip with max signal"); |
816 |
|
illuminazione[i]->GetXaxis()->CenterTitle(); |
817 |
|
illuminazione[i]->Draw(""); |
818 |
|
if(i==1){ |
819 |
|
maxhist= illuminazione[i]->GetMaximum(); |
820 |
|
b.DrawBox(2816.,0.,3060.,maxhist); |
821 |
|
} |
822 |
|
else if(i==6){ |
823 |
|
maxhist= illuminazione[i]->GetMaximum(); |
824 |
|
b.DrawBox(2560.,0.,2816.,maxhist); |
825 |
|
b.DrawBox(512.,0.,768.,maxhist); |
826 |
|
b.DrawBox(1024.,0.,1792.,maxhist); |
827 |
|
} |
828 |
|
else if(i==11){ |
829 |
|
maxhist= illuminazione[i]->GetMaximum(); |
830 |
|
b.DrawBox(768.,0.,1024.,maxhist); |
831 |
|
} |
832 |
|
IlluminaCanv->Update(); |
833 |
|
} |
834 |
|
|
835 |
printf("... end of packets. \n"); |
printf("... end of packets. \n"); |
836 |
|
|
837 |
//************************************************************************* |
//************************************************************************* |
838 |
// Save output Files |
// Save output Files |
839 |
//************************************************************************* |
//************************************************************************* |
840 |
stringstream out1,out2,out3,command; |
stringstream out1,out2,out3,command; |
841 |
|
Int_t totpg=0; |
842 |
for(Int_t fl=0;fl<countrun;fl++){ |
if(cntpgtemp>cntpgdat) totpg=cntpgtemp; |
843 |
|
else if(cntpgtemp<=cntpgdat) totpg=cntpgdat; |
844 |
|
|
845 |
|
for(Int_t fl=0;fl<totpg;fl++){ |
846 |
if(!strcmp(outfile.Data(),"ps")||!strcmp(outfile.Data(),"pdf")){ |
if(!strcmp(outfile.Data(),"ps")||!strcmp(outfile.Data(),"pdf")){ |
847 |
out1.str(""); |
out1.str(""); |
848 |
out2.str(""); |
out2.str(""); |
852 |
out2<<ffile<<"_FTrkQLook_EXPERT.ps"; |
out2<<ffile<<"_FTrkQLook_EXPERT.ps"; |
853 |
out3<<ffile<<"_FTrkQLook_EXPERT.ps)"; |
out3<<ffile<<"_FTrkQLook_EXPERT.ps)"; |
854 |
|
|
855 |
if(countrun==1){ |
if(totpg==1){ |
856 |
CompTimeCanv[fl]->Print(out+out1.str().c_str(),"Portrait"); |
CompTimeCanv[fl]->Print(out+out1.str().c_str(),"Portrait"); |
857 |
EventNumCanv[fl]->Print(out+out2.str().c_str(),"Portrait"); |
EventNumCanv[fl]->Print(out+out2.str().c_str(),"Portrait"); |
858 |
LandauCanv1[fl]->Print(out+out2.str().c_str(),"Portrait"); |
TempCanv[fl]->Print(out+out2.str().c_str(),"Portrait"); |
859 |
LandauCanv2[fl]->Print(out+out2.str().c_str(),"Portrait"); |
LandauCanv1->Print(out+out2.str().c_str(),"Portrait"); |
860 |
LandauCanv3[fl]->Print(out+out2.str().c_str(),"Portrait"); |
LandauCanv2->Print(out+out2.str().c_str(),"Portrait"); |
861 |
IlluminaCanv[fl]->Print(out+out2.str().c_str(),"Portrait"); |
LandauCanv3->Print(out+out2.str().c_str(),"Portrait"); |
862 |
TempCanv[fl]->Print(out+out3.str().c_str(),"Portrait"); |
IlluminaCanv->Print(out+out3.str().c_str(),"Portrait"); |
863 |
} |
} |
864 |
else if(countrun>=1){ |
else if(totpg>1){ |
865 |
if(fl==0) CompTimeCanv[fl]->Print(out+out1.str().c_str(),"Portrait"); |
if(fl==0) CompTimeCanv[fl]->Print(out+out1.str().c_str(),"Portrait"); |
866 |
else CompTimeCanv[fl]->Print(out+out2.str().c_str(),"Portrait"); |
if(fl>0 && fl<cntpgdat) CompTimeCanv[fl]->Print(out+out2.str().c_str(),"Portrait"); |
867 |
EventNumCanv[fl]->Print(out+out2.str().c_str(),"Portrait"); |
if(fl<cntpgdat) EventNumCanv[fl]->Print(out+out2.str().c_str(),"Portrait"); |
868 |
LandauCanv1[fl]->Print(out+out2.str().c_str(),"Portrait"); |
if(fl<cntpgtemp) TempCanv[fl]->Print(out+out2.str().c_str(),"Portrait"); |
869 |
LandauCanv2[fl]->Print(out+out2.str().c_str(),"Portrait"); |
if(fl==totpg-1){ |
870 |
LandauCanv3[fl]->Print(out+out2.str().c_str(),"Portrait"); |
LandauCanv1->Print(out+out2.str().c_str(),"Portrait"); |
871 |
IlluminaCanv[fl]->Print(out+out2.str().c_str(),"Portrait"); |
LandauCanv2->Print(out+out2.str().c_str(),"Portrait"); |
872 |
if(fl!=countrun-1) TempCanv[fl]->Print(out+out2.str().c_str(),"Portrait"); |
LandauCanv3->Print(out+out2.str().c_str(),"Portrait"); |
873 |
else TempCanv[fl]->Print(out+out3.str().c_str(),"Portrait"); |
IlluminaCanv->Print(out+out3.str().c_str(),"Portrait"); |
874 |
|
} |
875 |
} |
} |
876 |
} |
} |
877 |
else{ |
else{ |
878 |
out1.str(""); |
out1.str(""); |
879 |
out1<<ffile<<"_FTrkQLook_EXPERT-CompTime-pag"<<fl+1<<"."<<outfile.Data(); |
out1<<ffile<<"_FTrkQLook_EXPERT-CompTime-pag"<<fl+1<<"."<<outfile.Data(); |
880 |
CompTimeCanv[fl]->Print(out+out1.str().c_str()); |
if(fl<cntpgdat) CompTimeCanv[fl]->Print(out+out1.str().c_str()); |
881 |
out1.str(""); |
out1.str(""); |
882 |
out1<<ffile<<"_FTrkQLook_EXPERT-Temp-pag"<<fl+1<<"."<<outfile.Data(); |
out1<<ffile<<"_FTrkQLook_EXPERT-Temp-pag"<<fl+1<<"."<<outfile.Data(); |
883 |
TempCanv[fl]->Print(out+out1.str().c_str()); |
if(fl<cntpgtemp) TempCanv[fl]->Print(out+out1.str().c_str()); |
884 |
out1.str(""); |
out1.str(""); |
885 |
out1<<ffile<<"_FTrkQLook_EXPERT-EvNum-pag"<<fl+1<<"."<<outfile.Data(); |
out1<<ffile<<"_FTrkQLook_EXPERT-EvNum-pag"<<fl+1<<"."<<outfile.Data(); |
886 |
EventNumCanv[fl]->Print(out+out1.str().c_str()); |
if(fl<cntpgdat) EventNumCanv[fl]->Print(out+out1.str().c_str()); |
887 |
out1.str(""); |
if(fl==totpg-1){ |
888 |
out1<<ffile<<"_FTrkQLook_EXPERT-LandauL1-pag"<<fl+1<<"."<<outfile.Data(); |
out1.str(""); |
889 |
LandauCanv1[fl]->Print(out+out1.str().c_str()); |
out1<<ffile<<"_FTrkQLook_EXPERT-LandauL1."<<outfile.Data(); |
890 |
out1.str(""); |
LandauCanv1->Print(out+out1.str().c_str()); |
891 |
out1<<ffile<<"_FTrkQLook_EXPERT-LandauL2-pag"<<fl+1<<"."<<outfile.Data(); |
out1.str(""); |
892 |
LandauCanv2[fl]->Print(out+out1.str().c_str()); |
out1<<ffile<<"_FTrkQLook_EXPERT-LandauL2."<<outfile.Data(); |
893 |
out1.str(""); |
LandauCanv2->Print(out+out1.str().c_str()); |
894 |
out1<<ffile<<"_FTrkQLook_EXPERT-LandauL3-pag"<<fl+1<<"."<<outfile.Data(); |
out1.str(""); |
895 |
LandauCanv3[fl]->Print(out+out1.str().c_str()); |
out1<<ffile<<"_FTrkQLook_EXPERT-LandauL3."<<outfile.Data(); |
896 |
out1.str(""); |
LandauCanv3->Print(out+out1.str().c_str()); |
897 |
out1<<ffile<<"_FTrkQLook_EXPERT-Lighting-pag"<<fl+1<<"."<<outfile.Data(); |
out1.str(""); |
898 |
IlluminaCanv[fl]->Print(out+out1.str().c_str()); |
out1<<ffile<<"_FTrkQLook_EXPERT-Lighting."<<outfile.Data(); |
899 |
|
IlluminaCanv->Print(out+out1.str().c_str()); |
900 |
|
} |
901 |
} |
} |
902 |
} |
} |
903 |
|
|
904 |
|
// |
905 |
|
// Convert ps to pdf if required |
906 |
if(!strcmp(outfile.Data(),"pdf")){ |
if(!strcmp(outfile.Data(),"pdf")){ |
907 |
stringstream com; |
stringstream com; |
908 |
com<<"ps2pdf13 "<<out<<ffile<<"_FTrkQLook_EXPERT.ps "<<out<<ffile<<"_FTrkQLook_EXPERT.pdf"; |
com<<"ps2pdf13 "<<out<<ffile<<"_FTrkQLook_EXPERT.ps "<<out<<ffile<<"_FTrkQLook_EXPERT.pdf"; |
915 |
com.str(""); |
com.str(""); |
916 |
} |
} |
917 |
|
|
|
command.str(""); |
|
|
command<<"rm -f "<<out<<"warning.txt"; |
|
|
system(command.str().c_str()); |
|
|
|
|
918 |
gROOT->Reset(); |
gROOT->Reset(); |
919 |
return; |
return; |
920 |
} |
} |