29 |
#include <TrkAlarmEvent.h> |
#include <TrkAlarmEvent.h> |
30 |
#include <tsbt/TsbTRecord.h> |
#include <tsbt/TsbTRecord.h> |
31 |
#include <tsbt/TsbTEvent.h> |
#include <tsbt/TsbTEvent.h> |
32 |
|
#include <EventCounter.h> |
33 |
|
#include <PacketType.h> |
34 |
// |
// |
35 |
|
#define MAXSTORAGE 50000 |
36 |
|
|
37 |
void stringcopy(TString& s1, const TString& s2, Int_t from=0, Int_t to=0){ |
void stringcopy(TString& s1, const TString& s2, Int_t from=0, Int_t to=0){ |
38 |
if ( to == 0 ){ |
if ( to == 0 ){ |
75 |
pamela::PscuHeader *ph=0,*pH=0; |
pamela::PscuHeader *ph=0,*pH=0; |
76 |
pamela::TrkAlarmEvent *al=0; |
pamela::TrkAlarmEvent *al=0; |
77 |
pamela::RunHeaderEvent *reh=0; |
pamela::RunHeaderEvent *reh=0; |
78 |
|
pamela::EventCounter *cod=0; |
79 |
|
|
80 |
|
pamela::PacketType *pctp=0; |
81 |
|
|
82 |
TFile *datafile = new TFile(file); |
TFile *datafile = new TFile(file); |
83 |
|
|
153 |
pH = eH->GetPscuHeader(); |
pH = eH->GetPscuHeader(); |
154 |
HOBT[ev]= pH->GetOrbitalTime(); |
HOBT[ev]= pH->GetOrbitalTime(); |
155 |
trk_cal_us[ev]=reh->TRK_CALIB_USED; |
trk_cal_us[ev]=reh->TRK_CALIB_USED; |
156 |
if((HOBT[ev]<HOBT[ev-1]) && ev>0) |
// if((HOBT[ev]<HOBT[ev-1]) && ev>0) |
157 |
countrun+=1; |
// countrun+=1; |
158 |
// printf("\n%lld\t\tcountrun=%d\n",HOBT[ev],countrun); |
// printf("\n%lld\t\tcountrun=%d\n",HOBT[ev],countrun); |
159 |
} |
} |
|
countrun+=(Int_t)nevent/30000; |
|
|
printf("\ncountrun=%d\n",countrun); |
|
160 |
|
|
161 |
// |
// |
162 |
// other variables definitions |
// other variables definitions |
163 |
stringstream oss1,oss2,oss3,oss4,fromfile,isfile,tit; |
stringstream oss1,oss2,oss3,oss4,fromfile,isfile,tit; |
164 |
Int_t ALARM=0; |
Int_t ALARM=0; |
165 |
Int_t WARNING[12]; |
Int_t WARNING[12]; |
|
Float_t hi=0; |
|
166 |
|
|
167 |
// |
// |
168 |
// information about the entries for the temperatures |
// information about the entries for the temperatures |
181 |
tmpSize = event->Records->GetEntries(); |
tmpSize = event->Records->GetEntries(); |
182 |
for (Int_t j = 0; j < tmpSize; j++){ |
for (Int_t j = 0; j < tmpSize; j++){ |
183 |
record = (pamela::TsbTRecord*)event->Records->At(j); |
record = (pamela::TsbTRecord*)event->Records->At(j); |
184 |
xt[siztmp]=record->RECORD_OBT; //0.051*record->RECORD_OBT; |
xt[siztmp]=record->RECORD_OBT; //0.051*record->RECORD_OBT; |
185 |
|
if((xt[siztmp]<xt[siztmp-1]) && siztmp>0) |
186 |
|
countrun+=1; |
187 |
|
|
188 |
for (Int_t z = 0; z < 5; z++){ |
for (Int_t z = 0; z < 5; z++){ |
189 |
tempt[siztmp][z] = record->TEMPERATURES[z+1]; |
tempt[siztmp][z] = record->TEMPERATURES[z+1]; |
190 |
} |
} |
191 |
siztmp++; |
siztmp++; |
192 |
} |
} |
193 |
} |
} |
194 |
|
// printf("\ncountrun=%d\n",countrun); |
195 |
|
countrun+=(Int_t)nevent/30000; |
196 |
|
|
197 |
// |
// |
198 |
// open the output text files for the alarms |
// open the output text files for the alarms |
227 |
alarm1 << "================================================="<< endl<<endl; |
alarm1 << "================================================="<< endl<<endl; |
228 |
|
|
229 |
alarm1 << "Alarm variables (range 0-1)"<<endl; |
alarm1 << "Alarm variables (range 0-1)"<<endl; |
230 |
alarm1 << " ALARM[1]= "<< hex<< (Int_t)al->ALARM[1]<<dec<<endl; |
alarm1 << " ALARM[1]= 0x"<< hex << (Int_t)al->ALARM[1]<<endl; |
231 |
alarm1 << " ALARM[2]= "<< hex<< (Int_t)al->ALARM[2]<<dec<<endl; |
alarm1 << " ALARM[2]= 0x"<< (Int_t)al->ALARM[2]<<endl; |
232 |
alarm1 << " CmdDuringTrig= "<< hex<<(Int_t)al->CmdDuringTrig<<endl; |
alarm1 << " CmdDuringTrig= 0x"<< (Int_t)al->CmdDuringTrig<<endl; |
233 |
alarm1 << " FinalCheck= "<< hex<<(Int_t)al->FinalCheck<<endl; |
alarm1 << " FinalCheck= 0x"<< (Int_t)al->FinalCheck<<endl; |
234 |
alarm1 << " FlashData= "<< hex<<(Int_t)al->FlashData<<endl; |
alarm1 << " FlashData= 0x"<< (Int_t)al->FlashData<<endl; |
235 |
alarm1 << " FlashShutdown= "<< hex<<(Int_t)al->FlashShutdown<<endl; |
alarm1 << " FlashShutdown= 0x"<< (Int_t)al->FlashShutdown<<endl; |
236 |
alarm1 << " FlashUpset= "<< hex<<(Int_t)al->FlashUpset<<endl; |
alarm1 << " FlashUpset= 0x"<< (Int_t)al->FlashUpset<<endl; |
237 |
alarm1 << " InterCheck= "<< hex<<(Int_t)al->InterCheck<<endl; |
alarm1 << " InterCheck= 0x"<< (Int_t)al->InterCheck<<endl; |
238 |
alarm1 << " UnknownCmd= "<< hex<<(Int_t)al->UnknownCmd<<endl<<endl; |
alarm1 << " UnknownCmd= 0x"<<(Int_t)al->UnknownCmd<<endl<<endl; |
239 |
|
|
240 |
alarm1 << "Alarm variables (range 0-3F)"<<endl; |
alarm1 << "Alarm variables (range 0-3F)"<<endl; |
241 |
alarm1 << " CmdIDMA= "<< hex<<(Int_t)al->CmdIDMA<<endl; |
alarm1 << " CmdIDMA= 0x"<< (Int_t)al->CmdIDMA<<endl; |
242 |
alarm1 << " DSPSoft= "<< hex<<(Int_t)al->DSPSoft<<endl; |
alarm1 << " DSPSoft= 0x"<< (Int_t)al->DSPSoft<<endl; |
243 |
alarm1 << " TrigIDMA= "<< hex<<(Int_t)al->TrigIDMA<<endl<<endl; |
alarm1 << " TrigIDMA= 0x"<< (Int_t)al->TrigIDMA<<endl<<endl; |
244 |
|
|
245 |
alarm1 << "Alarm bits (range 0-1)"<<endl; |
alarm1 << "Control variables (range 0-3F)"<<endl; |
246 |
alarm1 << " Aswr= "<< hex<<(Int_t)al->Aswr<<endl; |
alarm1 << " DSPBusy= 0x"<< (Int_t)al->DSPBusy<<endl; |
247 |
alarm1 << " BID[1]= "<< hex<<(Int_t)al->BID[0]<<endl; |
alarm1 << " DSPMask= 0x"<< (Int_t)al->DSPMask<<endl<<endl; |
248 |
alarm1 << " BID[2]= "<< hex<<(Int_t)al->BID[1]<<endl; |
|
249 |
alarm1 << " BID[3]= "<< hex<<(Int_t)al->BID[2]<<endl; |
alarm1 << "Control variables (range 0-1)"<<endl; |
250 |
alarm1 << " BID[4]= "<< hex<<(Int_t)al->BID[3]<<endl; |
alarm1 << " FlashOn= 0x"<< (Int_t)al->FlashOn<<endl<<endl; |
251 |
alarm1 << " BID[5]= "<< hex<<(Int_t)al->BID[4]<<endl; |
|
252 |
alarm1 << " BID[6]= "<< hex<<(Int_t)al->BID[5]<<endl; |
alarm1 << "Control variables (range 0-3)"<<endl; |
253 |
alarm1 << " BID[7]= "<< hex<<(Int_t)al->BID[6]<<endl; |
alarm1 << " TrigMask= 0x"<< (Int_t)al->TrigMask<<endl<<endl; |
254 |
alarm1 << " CmdNum= "<< hex<<(Int_t)al->CmdNum<<endl; |
|
255 |
alarm1 << " DSPBusy= "<< hex<<(Int_t)al->DSPBusy<<endl; |
alarm1 << "Control bits fixed"<<endl; |
256 |
alarm1 << " DSPMask= "<< hex<<(Int_t)al->DSPMask<<endl; |
alarm1 << " Aswr= 0x"<< (Int_t)al->Aswr<<endl; |
257 |
alarm1 << " FlashOn= "<< hex<<(Int_t)al->FlashOn<<endl; |
alarm1 << " BID[1]= 0x"<< (Int_t)al->BID[0]<<endl; |
258 |
alarm1 << " PNum= "<< hex<<(Int_t)al->PNum<<endl; |
alarm1 << " BID[2]= 0x"<< (Int_t)al->BID[1]<<endl; |
259 |
alarm1 << " TrigMask= "<< hex<<(Int_t)al->TrigMask<<endl; |
alarm1 << " BID[3]= 0x"<< (Int_t)al->BID[2]<<endl; |
260 |
|
alarm1 << " BID[4]= 0x"<< (Int_t)al->BID[3]<<endl; |
261 |
|
alarm1 << " BID[5]= 0x"<< (Int_t)al->BID[4]<<endl; |
262 |
|
alarm1 << " BID[6]= 0x"<< (Int_t)al->BID[5]<<endl; |
263 |
|
alarm1 << " BID[7]= 0x"<< (Int_t)al->BID[6]<<endl; |
264 |
|
alarm1 << " CmdNum= 0x"<< (Int_t)al->CmdNum<<endl; |
265 |
|
alarm1 << " PNum= 0x"<< (Int_t)al->PNum<< dec <<endl; |
266 |
|
|
267 |
alarm1 << "================================================="<< endl<<endl; |
alarm1 << "================================================="<< endl<<endl; |
268 |
|
|
269 |
} |
} |
275 |
gStyle->SetStatFontSize(0.075); |
gStyle->SetStatFontSize(0.075); |
276 |
gStyle->SetOptStat(1110); |
gStyle->SetOptStat(1110); |
277 |
gStyle->SetFillColor(10); |
gStyle->SetFillColor(10); |
278 |
|
gStyle->SetStatColor(10); |
279 |
gStyle->SetTitleFillColor(10); |
gStyle->SetTitleFillColor(10); |
280 |
gStyle->SetTitleFontSize(0.1); |
gStyle->SetTitleFontSize(0.1); |
281 |
gStyle->SetTitleOffset(0.8,"y"); |
gStyle->SetTitleOffset(0.8,"y"); |
283 |
gStyle->SetTitleSize(0.06,"y"); |
gStyle->SetTitleSize(0.06,"y"); |
284 |
gStyle->SetTitleSize(0.055,"x"); |
gStyle->SetTitleSize(0.055,"x"); |
285 |
|
|
286 |
|
//************************************************************************************* |
287 |
|
//book pads and histos |
288 |
|
//*************************************************************************************** |
289 |
|
|
290 |
|
TCanvas *CompTimeCanv[countrun],*EventNumCanv[countrun],*TempCanv[countrun]; |
291 |
|
TCanvas *IlluminaCanv,*LandauCanv1,*LandauCanv2,*LandauCanv3; |
292 |
|
|
293 |
|
TH1F *landau1[12],*landau2[12],*landau3[12],*illuminazione[12]; |
294 |
|
TPad *pad1[12],*pad2[12],*pad3[12],*pad4[12],*pad5[12],*pad6[5]; |
295 |
|
|
296 |
|
for(Int_t n = 0; n<12; n++) { |
297 |
|
|
298 |
|
/* -----------> HISTOGRAMS */ |
299 |
|
|
300 |
|
tit<<"DSP "<<n+1; |
301 |
|
oss1<<"DSP "<<n+1; |
302 |
|
oss2<<"DSPh "<<n+1; |
303 |
|
oss3<<"DSP h "<<n+1; |
304 |
|
oss4<<"DSP h"<<n+1; |
305 |
|
|
306 |
|
landau1[n]= new TH1F(oss1.str().c_str(),tit.str().c_str(),401,-0.5,1200.5); |
307 |
|
landau2[n]= new TH1F(oss2.str().c_str(),tit.str().c_str(),401,-0.5,1200.5); |
308 |
|
landau3[n]= new TH1F(oss3.str().c_str(),tit.str().c_str(),401,-0.5,1200.5); |
309 |
|
|
310 |
|
illuminazione[n]= new TH1F(oss4.str().c_str(),tit.str().c_str(),3073,-0.5,3072.5); |
311 |
|
|
312 |
|
tit.str(""); |
313 |
|
oss1.str(""); |
314 |
|
oss2.str(""); |
315 |
|
oss3.str(""); |
316 |
|
oss4.str(""); |
317 |
|
}; |
318 |
|
|
319 |
|
|
320 |
|
|
321 |
//*************************************************************************************** |
//*************************************************************************************** |
322 |
// LOOP on each event |
// LOOP on each event |
326 |
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); |
327 |
else |
else |
328 |
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); |
329 |
|
|
330 |
|
TLatex *t=new TLatex(); |
331 |
|
TLatex *t1=new TLatex(); |
332 |
|
|
333 |
|
Int_t cntpgtemp=0,cntpgdat=0; |
334 |
Int_t minev=minevent,maxev=maxevent,countTEMP=0; |
Int_t minev=minevent,maxev=maxevent,countTEMP=0; |
335 |
TCanvas *CompTimeCanv[countrun],*EventNumCanv[countrun],*LandauCanv1[countrun],*LandauCanv2[countrun],*LandauCanv3[countrun]; |
TGraph *comprtime[12][countrun],*temp[5][countrun],*eventnumb[countrun]; |
|
TCanvas *IlluminaCanv[countrun],*TempCanv[countrun]; |
|
|
TGraph *comprtime[12][countrun],*temp[5][countrun]; |
|
|
TGraph *eventnumb[countrun]; |
|
|
TH1F *landau1[12][countrun],*landau2[12][countrun],*landau3[12][countrun],*illuminazione[12][countrun]; |
|
336 |
|
|
337 |
for(Int_t ii=0; ii<countrun;ii++){ |
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 |
|
|
|
|
|
|
|
|
ofstream warning(out + "warning.txt",ios::out); |
|
|
|
|
338 |
//**************************************************************************************** |
//**************************************************************************************** |
339 |
//Output figures --- First sheet: |
//Output figures --- Fifth sheet: |
340 |
//**************************************************************************************** |
//**************************************************************************************** |
341 |
|
fromfile.str(""); |
342 |
fromfile<<"FTrkQLook_EXPERT File: "<<ffile; |
fromfile<<"FTrkQLook_EXPERT File: "<<ffile; |
343 |
isfile<<"COMPRESSIONTIME vs. OBT pag"<<ii+1; |
isfile<<"Temperatures vs OBT pag"<<ii+1; |
344 |
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); |
345 |
CompTimeCanv[ii]->SetFillColor(10); |
TempCanv[ii]->SetFillColor(10); |
346 |
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(59.,98.7,isfile.str().c_str()); |
|
|
isfile.str(""); |
|
|
|
|
|
//**************************************************************************************** |
|
|
//Output figures --- Second sheet: |
|
|
//**************************************************************************************** |
|
347 |
|
|
|
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); |
|
348 |
t->SetTextFont(32); |
t->SetTextFont(32); |
349 |
t->SetTextColor(1); |
t->SetTextColor(1); |
350 |
t->SetTextAlign(12); |
t->SetTextAlign(12); |
354 |
t1->SetTextColor(1); |
t1->SetTextColor(1); |
355 |
t1->SetTextAlign(12); |
t1->SetTextAlign(12); |
356 |
t1->SetTextSize(0.02); |
t1->SetTextSize(0.02); |
357 |
t1->DrawLatex(63.4,98.7,isfile.str().c_str()); |
t1->DrawLatex(78.,98.7,isfile.str().c_str()); |
358 |
isfile.str(""); |
isfile.str(""); |
359 |
|
|
360 |
|
Float_t tposy = 0.95; // up y-coord - top pads |
361 |
|
Float_t thpad = 0; // pad height |
362 |
|
Float_t tposx1=0; // left x-coord - pad column |
363 |
|
Float_t tposx0=0; // x-coord - column division |
364 |
|
Float_t twrel = 0; // relative x size of first sub-column |
365 |
|
Float_t tmarg = 0.004; // margin among pads |
366 |
|
|
367 |
|
thpad = (tposy-tmarg*5)/3; |
368 |
|
twrel = (1-tmarg*4)/2; |
369 |
|
|
370 |
|
for(Int_t i=0; i<5; i++){ |
371 |
|
if ( (i+1)%2==1 ) { |
372 |
|
if(i>1) tposy = tposy-(tmarg*2+thpad); |
373 |
|
tposx1 = tmarg; |
374 |
|
tposx0 = tposx1 + twrel; |
375 |
|
} |
376 |
|
else { |
377 |
|
tposx1 = tposx0 + 2*tmarg; |
378 |
|
tposx0 = tposx1 + twrel; |
379 |
|
} |
380 |
|
|
381 |
|
/* -----------> pad for histograms */ |
382 |
|
pad6[i] = new TPad("pad6"," ",tposx1,tposy-thpad,tposx0,tposy,18,0,0); |
383 |
|
|
384 |
//**************************************************************************************** |
Int_t v=0,xt_tmp[tsize]; |
385 |
//Output figures --- Third sheet: |
for (Int_t ev=countTEMP; ev<tsize; ev++){ |
386 |
//**************************************************************************************** |
|
387 |
|
if(ev==tsize-1 && i==4) countTEMP=tsize-1; |
388 |
|
if(xt[ev]<xt[ev-1] && ev>countTEMP){ |
389 |
|
if(i==4) countTEMP=ev; |
390 |
|
break; |
391 |
|
} |
392 |
|
else{ |
393 |
|
if(tempt[ev][i]!=65535){ |
394 |
|
tempt_tmp[v]=(Int_t)(((3.3*tempt[ev][i]/4096)-0.586)/0.0231); |
395 |
|
if(tempt_tmp[v]>0) xt_tmp[v++]=xt[ev]; |
396 |
|
} |
397 |
|
} |
398 |
|
} |
399 |
|
TempCanv[ii]->cd(); |
400 |
|
tit<<"T"<<i+5<<" (magnetic module "<<i+1<<")"; |
401 |
|
pad6[i]->SetFillColor(10); |
402 |
|
pad6[i]->Draw(); |
403 |
|
pad6[i]->cd(); |
404 |
|
temp[i][ii]= new TGraph(v,xt_tmp,tempt_tmp); |
405 |
|
temp[i][ii]->SetTitle(tit.str().c_str()); |
406 |
|
temp[i][ii]->GetXaxis()->SetLabelSize(0.04); |
407 |
|
temp[i][ii]->GetXaxis()->SetTitleSize(0.04); |
408 |
|
temp[i][ii]->GetXaxis()->SetTitle("OBT (ms)"); |
409 |
|
temp[i][ii]->GetXaxis()->CenterTitle(); |
410 |
|
temp[i][ii]->GetXaxis()->SetTitleOffset(0.85); |
411 |
|
temp[i][ii]->GetYaxis()->SetTitleOffset(1.2); |
412 |
|
temp[i][ii]->GetYaxis()->SetLabelOffset(0.001); |
413 |
|
temp[i][ii]->GetYaxis()->SetLabelSize(0.04); |
414 |
|
temp[i][ii]->GetYaxis()->SetTitleSize(0.04); |
415 |
|
temp[i][ii]->GetYaxis()->SetTitle("Temperatures ( ^{o}C)"); |
416 |
|
temp[i][ii]->GetYaxis()->CenterTitle(); |
417 |
|
temp[i][ii]->SetMarkerStyle(21); |
418 |
|
temp[i][ii]->SetMarkerSize(0.2); |
419 |
|
temp[i][ii]->Draw("ap"); |
420 |
|
tit.str(""); |
421 |
|
TempCanv[ii]->Update(); |
422 |
|
|
423 |
|
} |
424 |
|
if(countTEMP==tsize-1){ |
425 |
|
cntpgtemp=ii+1; |
426 |
|
break; |
427 |
|
} |
428 |
|
} |
429 |
|
|
|
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); |
|
430 |
|
|
431 |
t->SetTextFont(32); |
for(Int_t ii=0; ii<countrun;ii++){ |
432 |
t->SetTextColor(1); |
TPaveText *pt1; |
433 |
t->SetTextAlign(12); |
TPad *pt,*pt0; //pad for histos |
|
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(60.,98.7,isfile.str().c_str()); |
|
|
isfile.str(""); |
|
434 |
|
|
435 |
//**************************************************************************************** |
ofstream warning(out + "warning.txt",ios::out); |
|
//Output figures --- Third sheet: |
|
|
//**************************************************************************************** |
|
|
|
|
|
isfile<<"Cluster Signal ladder2 pag"<<ii+1; |
|
|
LandauCanv2[ii]=new TCanvas(isfile.str().c_str(),isfile.str().c_str(),900,1200); |
|
|
LandauCanv2[ii]->SetFillColor(10); |
|
|
LandauCanv2[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(60.,98.7,isfile.str().c_str()); |
|
|
isfile.str(""); |
|
436 |
|
|
437 |
//**************************************************************************************** |
//**************************************************************************************** |
438 |
//Output figures --- Third sheet: |
//Output figures --- First sheet: |
439 |
//**************************************************************************************** |
//**************************************************************************************** |
440 |
|
fromfile.str(""); |
441 |
isfile<<"Cluster Signal ladder3 pag"<<ii+1; |
fromfile<<"FTrkQLook_EXPERT File: "<<ffile; |
442 |
LandauCanv3[ii]=new TCanvas(isfile.str().c_str(),isfile.str().c_str(),900,1200); |
isfile<<"COMPRESSIONTIME vs. OBT pag"<<ii+1; |
443 |
LandauCanv3[ii]->SetFillColor(10); |
CompTimeCanv[ii]=new TCanvas(isfile.str().c_str(),isfile.str().c_str(),900,1200); |
444 |
LandauCanv3[ii]->Range(0,0,100,100); |
CompTimeCanv[ii]->SetFillColor(10); |
445 |
|
CompTimeCanv[ii]->Range(0,0,100,100); |
446 |
t->SetTextFont(32); |
t->SetTextFont(32); |
447 |
t->SetTextColor(1); |
t->SetTextColor(1); |
448 |
t->SetTextAlign(12); |
t->SetTextAlign(12); |
452 |
t1->SetTextColor(1); |
t1->SetTextColor(1); |
453 |
t1->SetTextAlign(12); |
t1->SetTextAlign(12); |
454 |
t1->SetTextSize(0.02); |
t1->SetTextSize(0.02); |
455 |
t1->DrawLatex(60.,98.7,isfile.str().c_str()); |
t1->DrawLatex(62.,98.7,isfile.str().c_str()); |
456 |
isfile.str(""); |
isfile.str(""); |
457 |
|
|
458 |
//**************************************************************************************** |
//**************************************************************************************** |
459 |
//Output figures --- Fourth sheet: |
//Output figures --- Second sheet: |
460 |
//**************************************************************************************** |
//**************************************************************************************** |
461 |
|
|
462 |
isfile<<"lighting of the views pag"<<ii+1; |
isfile<<"WARNINGS on DSP EVENT NUMBER pag"<<ii+1; |
463 |
IlluminaCanv[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); |
464 |
IlluminaCanv[ii]->SetFillColor(10); |
EventNumCanv[ii]->SetFillColor(10); |
465 |
IlluminaCanv[ii]->Range(0,0,100,100); |
EventNumCanv[ii]->Range(0,0,100,100); |
466 |
t->SetTextFont(32); |
t->SetTextFont(32); |
467 |
t->SetTextColor(1); |
t->SetTextColor(1); |
468 |
t->SetTextAlign(12); |
t->SetTextAlign(12); |
475 |
t1->DrawLatex(65.,98.7,isfile.str().c_str()); |
t1->DrawLatex(65.,98.7,isfile.str().c_str()); |
476 |
isfile.str(""); |
isfile.str(""); |
477 |
|
|
|
//**************************************************************************************** |
|
|
//Output figures --- Fifth sheet: |
|
|
//**************************************************************************************** |
|
|
|
|
|
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); |
|
|
|
|
|
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(75.,98.7,isfile.str().c_str()); |
|
|
isfile.str(""); |
|
|
|
|
|
//************************************************************************************* |
|
|
//book pads and histos |
|
|
//*************************************************************************************** |
|
478 |
Float_t posy = 0.95; // up y-coord - top pads |
Float_t posy = 0.95; // up y-coord - top pads |
479 |
Float_t hpad = 0; // pad height |
Float_t hpad = 0; // pad height |
480 |
Float_t posx1=0; // left x-coord - pad column |
Float_t posx1=0; // left x-coord - pad column |
481 |
Float_t posx0=0; // x-coord - column division |
Float_t posx0=0; // x-coord - column division |
482 |
Float_t wrel = 0; // relative x size of first sub-column |
Float_t wrel = 0; // relative x size of first sub-column |
483 |
Float_t marg = 0.004; // margin among pads |
Float_t marg = 0.004; // margin among pads |
484 |
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 |
|
|
|
|
485 |
hpad = (posy-marg*11)/6; |
hpad = (posy-marg*11)/6; |
486 |
wrel = (1-marg*4)/2; |
wrel = (1-marg*4)/2; |
487 |
thpad = (tposy-tmarg*5)/3; |
|
|
twrel = (1-tmarg*4)/2; |
|
|
|
|
488 |
for(Int_t n = 0; n<12; n++) { |
for(Int_t n = 0; n<12; n++) { |
489 |
|
|
490 |
if ( (n+1)%2==1 ) { |
if ( (n+1)%2==1 ) { |
491 |
if(n>1) posy = posy-(marg*2+hpad); |
if(n>1) posy = posy-(marg*2+hpad); |
492 |
posx1 = marg; |
posx1 = marg; |
495 |
else { |
else { |
496 |
posx1 = posx0 + 2*marg; |
posx1 = posx0 + 2*marg; |
497 |
posx0 = posx1 + wrel; |
posx0 = posx1 + wrel; |
498 |
} |
} |
499 |
|
|
|
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; |
|
|
} |
|
|
|
|
|
|
|
500 |
/* -----------> pad for histograms */ |
/* -----------> pad for histograms */ |
501 |
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); |
502 |
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); |
503 |
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); |
504 |
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); |
505 |
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); |
506 |
if(n<5) pad6[n] = new TPad("pad6"," ",tposx1,tposy-thpad,tposx0,tposy,18,0,0); |
} |
|
|
|
|
|
|
|
/* -----------> HISTOGRAMS */ |
|
|
|
|
|
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(),oss1.str().c_str(),401,-0.5,1200.5); |
|
|
landau1[n][ii]->GetXaxis()->SetTitle("max signal"); |
|
|
landau1[n][ii]->GetXaxis()->CenterTitle(); |
|
|
landau2[n][ii]=new TH1F(oss2.str().c_str(),oss1.str().c_str(),401,-0.5,1200.5); |
|
|
landau2[n][ii]->GetXaxis()->SetTitle("max signal"); |
|
|
landau2[n][ii]->GetXaxis()->CenterTitle(); |
|
|
landau3[n][ii]=new TH1F(oss3.str().c_str(),oss1.str().c_str(),401,-0.5,1200.5); |
|
|
landau3[n][ii]->GetXaxis()->SetTitle("max signal"); |
|
|
landau3[n][ii]->GetXaxis()->CenterTitle(); |
|
|
|
|
|
illuminazione[n][ii]=new TH1F(oss4.str().c_str(),oss1.str().c_str(),3073,-0.5,3072.5); |
|
|
illuminazione[n][ii]->GetXaxis()->SetTitle("strip with max signal"); |
|
|
illuminazione[n][ii]->GetXaxis()->CenterTitle(); |
|
|
|
|
|
oss1.str(""); |
|
|
oss2.str(""); |
|
|
oss3.str(""); |
|
|
oss4.str(""); |
|
|
}; |
|
|
|
|
|
|
|
|
// printf("\nprova0\n"); |
|
|
|
|
|
|
|
507 |
//********************************************************************************** |
//********************************************************************************** |
508 |
// Fill Graphs and Histos |
// Fill Graphs and Histos |
509 |
//********************************************************************************** |
//********************************************************************************** |
511 |
// |
// |
512 |
// information about the tracker data |
// information about the tracker data |
513 |
Int_t warning_dspnumber=0; |
Int_t warning_dspnumber=0; |
514 |
Float_t x[30000]; |
Float_t x[MAXSTORAGE]; |
515 |
Float_t yc[30000][12]; |
Float_t yc[MAXSTORAGE][12]; |
516 |
Float_t eventint[30000]; |
Float_t eventint[MAXSTORAGE]; |
517 |
|
|
518 |
for (Int_t ev=minev; ev<maxevent; ev++){ |
for (Int_t ev=minev; ev<maxevent; ev++){ |
519 |
tr->GetEntry(ev); |
tr->GetEntry(ev); |
520 |
ph = eh->GetPscuHeader(); |
ph = eh->GetPscuHeader(); |
521 |
|
cod = eh->GetCounter(); |
522 |
|
|
523 |
if(ev==maxevent-1) maxev=maxevent-1; |
if(ev==maxevent-1) maxev=maxevent-1; |
524 |
|
|
525 |
if((ph->GetOrbitalTime()<x[ev-minev-1] && ev-minev!=0) || ev-minev==30000){ |
if((ph->GetOrbitalTime()<x[ev-minev-1] && ev-minev!=0) || ev-minev==MAXSTORAGE){ |
526 |
maxev=ev; |
maxev=ev; |
|
printf("prova12 ev=%d\tev-minev=%d\n",ev,ev-minev); |
|
527 |
break; |
break; |
528 |
} |
} |
529 |
else{ |
else{ |
|
// if(ii==32)printf("\nprova1 %d\tev-minev=%d\n",ev,ev-minev); |
|
530 |
x[(ev-minev)]= ph->GetOrbitalTime(); |
x[(ev-minev)]= ph->GetOrbitalTime(); |
531 |
ALARM=0; |
ALARM=0; |
532 |
|
|
537 |
|
|
538 |
for(Int_t j=0;j<3;j++){ |
for(Int_t j=0;j<3;j++){ |
539 |
if(te->signcluster[i][j]!=0){ |
if(te->signcluster[i][j]!=0){ |
540 |
hi=(j*1024)+te->addrcluster[i][j]; |
if((te->addrcluster[i][j]>6 && te->addrcluster[i][j]<505) ||(te->addrcluster[i][j]>518 && te->addrcluster[i][j]<1018)){ |
541 |
if((hi>505 && hi<519) ||(hi>1017 && hi<1031) ||(hi>1529 && hi<1543) || (hi>2041 && hi<2055) ||(hi>2553 && hi<2567)) |
illuminazione[dsp]->Fill((Float_t)((j*1024.)+te->addrcluster[i][j])); |
|
continue; |
|
|
else illuminazione[dsp][ii]->Fill(hi); |
|
|
|
|
|
if(!(dsp%2)){ |
|
|
landau1[dsp][ii]->Fill(1024-(te->signcluster[i][j])); |
|
|
landau2[dsp][ii]->Fill(1024-(te->signcluster[i][j])); |
|
|
landau3[dsp][ii]->Fill(1024-(te->signcluster[i][j])); |
|
|
} |
|
|
else{ |
|
|
landau1[dsp][ii]->Fill(te->signcluster[i][j]); |
|
|
landau2[dsp][ii]->Fill(te->signcluster[i][j]); |
|
|
landau3[dsp][ii]->Fill(te->signcluster[i][j]); |
|
542 |
} |
} |
543 |
} |
} |
544 |
} |
} |
545 |
|
if(trk_cal_us[cod->Get(pctp->RunHeader)]!=104){ |
546 |
|
if(!(dsp%2)){ |
547 |
|
// if((te->addrcluster[i][0]>6 && te->addrcluster[i][0]<505) ||(te->addrcluster[i][0]>518 && te->addrcluster[i][0]<1018)) |
548 |
|
if(te->signcluster[i][0]!=0) landau1[dsp]->Fill((Float_t)(1024.-te->signcluster[i][0])); |
549 |
|
// if((te->addrcluster[i][1]>6 && te->addrcluster[i][1]<505) ||(te->addrcluster[i][1]>518 && te->addrcluster[i][1]<1018)) |
550 |
|
if(te->signcluster[i][1]!=0) landau2[dsp]->Fill((Float_t)(1024.-te->signcluster[i][1])); |
551 |
|
// if((te->addrcluster[i][2]>6 && te->addrcluster[i][2]<505) ||(te->addrcluster[i][2]>518 && te->addrcluster[i][2]<1018)) |
552 |
|
if(te->signcluster[i][2]!=0) landau3[dsp]->Fill((Float_t)(1024.-te->signcluster[i][2])); |
553 |
|
} |
554 |
|
else{ |
555 |
|
// if((te->addrcluster[i][0]>6 && te->addrcluster[i][0]<505) ||(te->addrcluster[i][0]>518 && te->addrcluster[i][0]<1018)) |
556 |
|
if(te->signcluster[i][0]!=0) landau1[dsp]->Fill((Float_t)te->signcluster[i][0]); |
557 |
|
// if((te->addrcluster[i][1]>6 && te->addrcluster[i][1]<505) ||(te->addrcluster[i][1]>518 && te->addrcluster[i][1]<1018)) |
558 |
|
if(te->signcluster[i][1]!=0) landau2[dsp]->Fill((Float_t)te->signcluster[i][1]); |
559 |
|
// if((te->addrcluster[i][2]>6 && te->addrcluster[i][2]<505) ||(te->addrcluster[i][2]>518 && te->addrcluster[i][2]<1018)) |
560 |
|
if(te->signcluster[i][2]!=0) landau3[dsp]->Fill((Float_t)te->signcluster[i][2]); |
561 |
|
} |
562 |
|
} |
563 |
|
|
564 |
WARNING[i]=0; |
WARNING[i]=0; |
565 |
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){ |
566 |
ALARM = 1; //general alarm |
ALARM = 1; //general alarm |
598 |
//******************************************************************************************** |
//******************************************************************************************** |
599 |
// file ALARM |
// file ALARM |
600 |
//******************************************************************************************** |
//******************************************************************************************** |
601 |
|
|
602 |
alarm <<endl<< "================================================="<< endl; |
if(ALARM==1) { |
603 |
alarm << "PSCU-Pkt N. "<< ph->GetCounter() ; |
alarm <<endl<< "================================================="<< endl; |
604 |
alarm << " - OBT "<< ph->GetOrbitalTime() << " ms"<<endl; |
alarm << "PSCU-Pkt N. "<< ph->GetCounter() ; |
605 |
alarm << "(ROOT-tree entry "<<ev<<")"<<endl; |
alarm << " - OBT "<< ph->GetOrbitalTime() << " ms"<<endl; |
606 |
alarm << "================================================="<< endl; |
alarm << "(ROOT-tree entry "<<ev<<")"<<endl; |
607 |
|
alarm << "================================================="<< endl; |
608 |
if(ALARM==1) { |
|
609 |
alarm << " DSPn"; |
alarm << " DSPn"; |
610 |
alarm << " Event"; |
alarm << " Event"; |
611 |
alarm << " Words"; |
alarm << " Words"; |
636 |
} |
} |
637 |
} |
} |
638 |
} |
} |
|
if(ALARM==0) alarm << endl<< "------> NO ALARM!!! <-------"<<endl; |
|
|
|
|
|
if(warning_dspnumber==0) warning<<"NONE"<<endl; |
|
639 |
} |
} |
640 |
|
if(ALARM==0) alarm << endl<< "------> NO ALARM!!! <-------"<<endl; |
641 |
// printf("prova2\n"); |
if(warning_dspnumber==0) warning<<"NONE"<<endl; |
|
|
|
|
Float_t maxhist=0; |
|
|
TBox b; |
|
|
b.SetFillColor(5); |
|
642 |
|
|
643 |
for (Int_t i=0; i<12 ; i++){ |
for (Int_t i=0; i<12 ; i++){ |
644 |
Float_t yyc[maxev-minev]; |
Float_t yyc[maxev-minev]; |
645 |
for (Int_t v=0; v<maxev-minev; v++){ |
for (Int_t v=0; v<maxev-minev; v++){ |
646 |
yyc[v]=yc[v][i]; |
yyc[v]=yc[v][i]; |
647 |
} |
} |
|
|
|
|
printf("prova3\n"); |
|
|
LandauCanv1[ii]->cd(); |
|
|
pad1[i]->SetFillColor(10); |
|
|
pad1[i]->SetFrameFillColor(10); |
|
|
pad1[i]->Draw(); |
|
|
pad1[i]->cd(); |
|
|
landau1[i][ii]->Draw(""); |
|
|
LandauCanv2[ii]->cd(); |
|
|
pad4[i]->SetFillColor(10); |
|
|
pad4[i]->SetFrameFillColor(10); |
|
|
pad4[i]->Draw(); |
|
|
pad4[i]->cd(); |
|
|
landau2[i][ii]->Draw(""); |
|
|
LandauCanv3[ii]->cd(); |
|
|
pad5[i]->SetFillColor(10); |
|
|
pad5[i]->SetFrameFillColor(10); |
|
|
pad5[i]->Draw(); |
|
|
pad5[i]->cd(); |
|
|
landau3[i][ii]->Draw(""); |
|
|
|
|
|
printf("prova4\n"); |
|
|
IlluminaCanv[ii]->cd(); |
|
|
pad2[i]->SetFillColor(10); |
|
|
pad2[i]->SetFrameFillColor(10); |
|
|
pad2[i]->Draw(); |
|
|
pad2[i]->cd(); |
|
|
pad2[i]->SetLogy(); |
|
|
// illuminazione[i][ii]->SetStats(KFALSE); |
|
|
if(i==1){ |
|
|
illuminazione[i][ii]->Draw("ah"); |
|
|
maxhist= illuminazione[i][ii]->GetMaximum(); |
|
|
b.DrawBox(2816.,0.,3060.,maxhist); |
|
|
illuminazione[i][ii]->Draw("axis same"); |
|
|
illuminazione[i][ii]->Draw("same ]["); |
|
|
} |
|
|
else if(i==6){ |
|
|
illuminazione[i][ii]->Draw("ah"); |
|
|
maxhist= illuminazione[i][ii]->GetMaximum(); |
|
|
b.DrawBox(2560.,0.,2816.,maxhist); |
|
|
b.DrawBox(512.,0.,768.,maxhist); |
|
|
b.DrawBox(1024.,0.,1792.,maxhist); |
|
|
illuminazione[i][ii]->Draw("axis same"); |
|
|
illuminazione[i][ii]->Draw("same]["); |
|
|
} |
|
|
else if(i==11){ |
|
|
illuminazione[i][ii]->Draw("ah"); |
|
|
maxhist= illuminazione[i][ii]->GetMaximum(); |
|
|
b.DrawBox(768.,0.,1024.,maxhist); |
|
|
illuminazione[i][ii]->Draw("axis same"); |
|
|
illuminazione[i][ii]->Draw("same]["); |
|
|
} |
|
|
else illuminazione[i][ii]->Draw(""); |
|
|
|
|
|
printf("prova5\n"); |
|
|
|
|
648 |
|
|
649 |
CompTimeCanv[ii]->cd(); |
CompTimeCanv[ii]->cd(); |
650 |
pad3[i]->SetFillColor(10); |
pad3[i]->SetFillColor(10); |
661 |
comprtime[i][ii]->GetYaxis()->SetRangeUser(0,2); |
comprtime[i][ii]->GetYaxis()->SetRangeUser(0,2); |
662 |
comprtime[i][ii]->Draw("ap"); |
comprtime[i][ii]->Draw("ap"); |
663 |
oss1.str(""); |
oss1.str(""); |
|
|
|
664 |
CompTimeCanv[ii]->Update(); |
CompTimeCanv[ii]->Update(); |
665 |
LandauCanv1[ii]->Update(); |
} |
|
LandauCanv2[ii]->Update(); |
|
|
LandauCanv3[ii]->Update(); |
|
|
IlluminaCanv[ii]->Update(); |
|
|
}; |
|
666 |
|
|
|
printf("prova6\n"); |
|
667 |
EventNumCanv[ii]->cd(); |
EventNumCanv[ii]->cd(); |
668 |
pt0=new TPad("pt0"," ",0.704,0.004,0.996,0.98); |
pt0=new TPad("pt0"," ",0.704,0.004,0.996,0.98); |
669 |
pt1 = new TPaveText(0.004,0.004,0.986,0.996); |
pt1 = new TPaveText(0.004,0.004,0.986,0.996); |
700 |
eventnumb[ii]->SetMarkerSize(0.3); |
eventnumb[ii]->SetMarkerSize(0.3); |
701 |
eventnumb[ii]->Draw("ap"); |
eventnumb[ii]->Draw("ap"); |
702 |
EventNumCanv[ii]->Update(); |
EventNumCanv[ii]->Update(); |
|
|
|
|
printf("prova7\n"); |
|
|
|
|
|
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(); |
|
|
} |
|
703 |
|
|
704 |
printf("prova8\n"); |
|
705 |
|
warning.close(); |
706 |
minev=maxev; |
minev=maxev; |
|
printf("\ncountrun=%d\n",ii); |
|
707 |
if(maxev==maxevent-1) { |
if(maxev==maxevent-1) { |
708 |
countrun=ii+1; |
cntpgdat=ii+1; |
709 |
break; |
break; |
710 |
} |
} |
|
|
|
|
warning.close(); |
|
|
|
|
711 |
} |
} |
712 |
|
|
|
//***************************************** |
|
|
//close all files |
|
|
//***************************************** |
|
713 |
alarm.close(); |
alarm.close(); |
714 |
datafile->Close(); |
|
715 |
|
//**************************************************************************************** |
716 |
|
//Output figures --- Third sheet: |
717 |
|
//**************************************************************************************** |
718 |
|
|
719 |
|
fromfile.str(""); |
720 |
|
fromfile<<"FTrkQLook_EXPERT File: "<<ffile; |
721 |
|
isfile<<"Cluster Signal ladder1"; |
722 |
|
LandauCanv1=new TCanvas(isfile.str().c_str(),isfile.str().c_str(),900,1200); |
723 |
|
LandauCanv1->SetFillColor(10); |
724 |
|
LandauCanv1->Range(0,0,100,100); |
725 |
|
|
726 |
|
t->SetTextFont(32); |
727 |
|
t->SetTextColor(1); |
728 |
|
t->SetTextAlign(12); |
729 |
|
t->SetTextSize(0.02); |
730 |
|
t->DrawLatex(2.,98.7,fromfile.str().c_str()); |
731 |
|
t1->SetTextFont(32); |
732 |
|
t1->SetTextColor(1); |
733 |
|
t1->SetTextAlign(12); |
734 |
|
t1->SetTextSize(0.02); |
735 |
|
t1->DrawLatex(70.,98.7,isfile.str().c_str()); |
736 |
|
isfile.str(""); |
737 |
|
|
738 |
|
//**************************************************************************************** |
739 |
|
//Output figures --- Third sheet: |
740 |
|
//**************************************************************************************** |
741 |
|
|
742 |
|
isfile<<"Cluster Signal ladder2"; |
743 |
|
LandauCanv2=new TCanvas(isfile.str().c_str(),isfile.str().c_str(),900,1200); |
744 |
|
LandauCanv2->SetFillColor(10); |
745 |
|
LandauCanv2->Range(0,0,100,100); |
746 |
|
|
747 |
|
t->SetTextFont(32); |
748 |
|
t->SetTextColor(1); |
749 |
|
t->SetTextAlign(12); |
750 |
|
t->SetTextSize(0.02); |
751 |
|
t->DrawLatex(2.,98.7,fromfile.str().c_str()); |
752 |
|
t1->SetTextFont(32); |
753 |
|
t1->SetTextColor(1); |
754 |
|
t1->SetTextAlign(12); |
755 |
|
t1->SetTextSize(0.02); |
756 |
|
t1->DrawLatex(70.,98.7,isfile.str().c_str()); |
757 |
|
isfile.str(""); |
758 |
|
|
759 |
|
//**************************************************************************************** |
760 |
|
//Output figures --- Third sheet: |
761 |
|
//**************************************************************************************** |
762 |
|
|
763 |
|
isfile<<"Cluster Signal ladder3"; |
764 |
|
LandauCanv3=new TCanvas(isfile.str().c_str(),isfile.str().c_str(),900,1200); |
765 |
|
LandauCanv3->SetFillColor(10); |
766 |
|
LandauCanv3->Range(0,0,100,100); |
767 |
|
|
768 |
|
t->SetTextFont(32); |
769 |
|
t->SetTextColor(1); |
770 |
|
t->SetTextAlign(12); |
771 |
|
t->SetTextSize(0.02); |
772 |
|
t->DrawLatex(2.,98.7,fromfile.str().c_str()); |
773 |
|
t1->SetTextFont(32); |
774 |
|
t1->SetTextColor(1); |
775 |
|
t1->SetTextAlign(12); |
776 |
|
t1->SetTextSize(0.02); |
777 |
|
t1->DrawLatex(70.,98.7,isfile.str().c_str()); |
778 |
|
isfile.str(""); |
779 |
|
|
780 |
|
//**************************************************************************************** |
781 |
|
//Output figures --- Fourth sheet: |
782 |
|
//**************************************************************************************** |
783 |
|
|
784 |
|
isfile<<"lighting of the views"; |
785 |
|
IlluminaCanv=new TCanvas(isfile.str().c_str(),isfile.str().c_str(),900,1200); |
786 |
|
IlluminaCanv->SetFillColor(10); |
787 |
|
IlluminaCanv->Range(0,0,100,100); |
788 |
|
t->SetTextFont(32); |
789 |
|
t->SetTextColor(1); |
790 |
|
t->SetTextAlign(12); |
791 |
|
t->SetTextSize(0.02); |
792 |
|
t->DrawLatex(2.,98.7,fromfile.str().c_str()); |
793 |
|
t1->SetTextFont(32); |
794 |
|
t1->SetTextColor(1); |
795 |
|
t1->SetTextAlign(12); |
796 |
|
t1->SetTextSize(0.02); |
797 |
|
t1->DrawLatex(70.,98.7,isfile.str().c_str()); |
798 |
|
isfile.str(""); |
799 |
|
|
800 |
|
for (Int_t i=0; i<12 ; i++){ |
801 |
|
|
802 |
|
TBox b; |
803 |
|
b.SetFillColor(6); |
804 |
|
b.SetFillStyle(3945); |
805 |
|
|
806 |
|
Float_t maxhist=0; |
807 |
|
LandauCanv1->cd(); |
808 |
|
pad1[i]->SetFillColor(10); |
809 |
|
pad1[i]->SetFrameFillColor(10); |
810 |
|
pad1[i]->Draw(); |
811 |
|
pad1[i]->cd(); |
812 |
|
landau1[i]->GetXaxis()->SetTitle("max signal"); |
813 |
|
landau1[i]->GetXaxis()->CenterTitle(); |
814 |
|
landau1[i]->Draw(""); |
815 |
|
LandauCanv1->Update(); |
816 |
|
|
817 |
|
LandauCanv2->cd(); |
818 |
|
pad4[i]->SetFillColor(10); |
819 |
|
pad4[i]->SetFrameFillColor(10); |
820 |
|
pad4[i]->Draw(); |
821 |
|
pad4[i]->cd(); |
822 |
|
landau2[i]->GetXaxis()->SetTitle("max signal"); |
823 |
|
landau2[i]->GetXaxis()->CenterTitle(); |
824 |
|
landau2[i]->Draw(""); |
825 |
|
LandauCanv2->Update(); |
826 |
|
|
827 |
|
LandauCanv3->cd(); |
828 |
|
pad5[i]->SetFillColor(10); |
829 |
|
pad5[i]->SetFrameFillColor(10); |
830 |
|
pad5[i]->Draw(); |
831 |
|
pad5[i]->cd(); |
832 |
|
landau3[i]->GetXaxis()->SetTitle("max signal"); |
833 |
|
landau3[i]->GetXaxis()->CenterTitle(); |
834 |
|
landau3[i]->Draw(""); |
835 |
|
LandauCanv3->Update(); |
836 |
|
|
837 |
|
IlluminaCanv->cd(); |
838 |
|
pad2[i]->SetFillColor(10); |
839 |
|
pad2[i]->SetFrameFillColor(10); |
840 |
|
pad2[i]->SetLogy(); |
841 |
|
pad2[i]->Draw(); |
842 |
|
pad2[i]->cd(); |
843 |
|
illuminazione[i]->GetXaxis()->SetTitle("strip with max signal"); |
844 |
|
illuminazione[i]->GetXaxis()->CenterTitle(); |
845 |
|
illuminazione[i]->Draw(""); |
846 |
|
if(i==1){ |
847 |
|
maxhist= illuminazione[i]->GetMaximum(); |
848 |
|
b.DrawBox(2816.,0.,3060.,maxhist); |
849 |
|
} |
850 |
|
else if(i==6){ |
851 |
|
maxhist= illuminazione[i]->GetMaximum(); |
852 |
|
b.DrawBox(2560.,0.,2816.,maxhist); |
853 |
|
b.DrawBox(512.,0.,768.,maxhist); |
854 |
|
b.DrawBox(1024.,0.,1792.,maxhist); |
855 |
|
} |
856 |
|
else if(i==11){ |
857 |
|
maxhist= illuminazione[i]->GetMaximum(); |
858 |
|
b.DrawBox(768.,0.,1024.,maxhist); |
859 |
|
} |
860 |
|
IlluminaCanv->Update(); |
861 |
|
} |
862 |
|
|
863 |
printf("... end of packets. \n"); |
printf("... end of packets. \n"); |
864 |
//************************************************************************* |
//************************************************************************* |
865 |
// Save output Files |
// Save output Files |
866 |
//************************************************************************* |
//************************************************************************* |
867 |
stringstream out1,out2,out3,command; |
stringstream out1,out2,out3,command; |
868 |
|
Int_t totpg=0; |
869 |
for(Int_t fl=0;fl<countrun;fl++){ |
if(cntpgtemp>cntpgdat) totpg=cntpgtemp; |
870 |
|
else if(cntpgtemp<=cntpgdat) totpg=cntpgdat; |
871 |
|
|
872 |
|
for(Int_t fl=0;fl<totpg;fl++){ |
873 |
if(!strcmp(outfile.Data(),"ps")||!strcmp(outfile.Data(),"pdf")){ |
if(!strcmp(outfile.Data(),"ps")||!strcmp(outfile.Data(),"pdf")){ |
874 |
out1.str(""); |
out1.str(""); |
875 |
out2.str(""); |
out2.str(""); |
879 |
out2<<ffile<<"_FTrkQLook_EXPERT.ps"; |
out2<<ffile<<"_FTrkQLook_EXPERT.ps"; |
880 |
out3<<ffile<<"_FTrkQLook_EXPERT.ps)"; |
out3<<ffile<<"_FTrkQLook_EXPERT.ps)"; |
881 |
|
|
882 |
if(countrun==1){ |
if(totpg==1){ |
883 |
CompTimeCanv[fl]->Print(out+out1.str().c_str(),"Portrait"); |
CompTimeCanv[fl]->Print(out+out1.str().c_str(),"Portrait"); |
884 |
EventNumCanv[fl]->Print(out+out2.str().c_str(),"Portrait"); |
EventNumCanv[fl]->Print(out+out2.str().c_str(),"Portrait"); |
885 |
LandauCanv1[fl]->Print(out+out2.str().c_str(),"Portrait"); |
TempCanv[fl]->Print(out+out2.str().c_str(),"Portrait"); |
886 |
LandauCanv2[fl]->Print(out+out2.str().c_str(),"Portrait"); |
LandauCanv1->Print(out+out2.str().c_str(),"Portrait"); |
887 |
LandauCanv3[fl]->Print(out+out2.str().c_str(),"Portrait"); |
LandauCanv2->Print(out+out2.str().c_str(),"Portrait"); |
888 |
IlluminaCanv[fl]->Print(out+out2.str().c_str(),"Portrait"); |
LandauCanv3->Print(out+out2.str().c_str(),"Portrait"); |
889 |
TempCanv[fl]->Print(out+out3.str().c_str(),"Portrait"); |
IlluminaCanv->Print(out+out3.str().c_str(),"Portrait"); |
890 |
} |
} |
891 |
else if(countrun>=1){ |
else if(totpg>1){ |
892 |
if(fl==0) CompTimeCanv[fl]->Print(out+out1.str().c_str(),"Portrait"); |
if(fl==0) CompTimeCanv[fl]->Print(out+out1.str().c_str(),"Portrait"); |
893 |
else CompTimeCanv[fl]->Print(out+out2.str().c_str(),"Portrait"); |
if(fl>0 && fl<cntpgdat) CompTimeCanv[fl]->Print(out+out2.str().c_str(),"Portrait"); |
894 |
EventNumCanv[fl]->Print(out+out2.str().c_str(),"Portrait"); |
if(fl<cntpgdat) EventNumCanv[fl]->Print(out+out2.str().c_str(),"Portrait"); |
895 |
LandauCanv1[fl]->Print(out+out2.str().c_str(),"Portrait"); |
if(fl<cntpgtemp) TempCanv[fl]->Print(out+out2.str().c_str(),"Portrait"); |
896 |
LandauCanv2[fl]->Print(out+out2.str().c_str(),"Portrait"); |
if(fl==totpg-1){ |
897 |
LandauCanv3[fl]->Print(out+out2.str().c_str(),"Portrait"); |
LandauCanv1->Print(out+out2.str().c_str(),"Portrait"); |
898 |
IlluminaCanv[fl]->Print(out+out2.str().c_str(),"Portrait"); |
LandauCanv2->Print(out+out2.str().c_str(),"Portrait"); |
899 |
if(fl!=countrun-1) TempCanv[fl]->Print(out+out2.str().c_str(),"Portrait"); |
LandauCanv3->Print(out+out2.str().c_str(),"Portrait"); |
900 |
else TempCanv[fl]->Print(out+out3.str().c_str(),"Portrait"); |
IlluminaCanv->Print(out+out3.str().c_str(),"Portrait"); |
901 |
} |
} |
|
|
|
|
if(!strcmp(outfile.Data(),"pdf")){ |
|
|
stringstream com; |
|
|
com<<"ps2pdf13 "<<out<<ffile<<"_FTrkQLook_EXPERT.ps "<<out<<ffile<<"_FTrkQLook_EXPERT.pdf"; |
|
|
system(com.str().c_str()); |
|
|
printf("\n---> ps file converted in pdf format!\n"); |
|
|
com.str(""); |
|
|
com<<"rm -f "<<out<<ffile<<"_FTrkQLook_EXPERT.ps "; |
|
|
system(com.str().c_str()); |
|
|
printf("---> ps file removed!\n\n"); |
|
|
com.str(""); |
|
902 |
} |
} |
903 |
} |
} |
904 |
else{ |
else{ |
905 |
out1.str(""); |
out1.str(""); |
906 |
out1<<ffile<<"_FTrkQLook_EXPERT-CompTime-pag"<<fl+1<<"."<<outfile.Data(); |
out1<<ffile<<"_FTrkQLook_EXPERT-CompTime-pag"<<fl+1<<"."<<outfile.Data(); |
907 |
CompTimeCanv[fl]->Print(out+out1.str().c_str()); |
if(fl<cntpgdat) CompTimeCanv[fl]->Print(out+out1.str().c_str()); |
908 |
out1.str(""); |
out1.str(""); |
909 |
out1<<ffile<<"_FTrkQLook_EXPERT-Temp-pag"<<fl+1<<"."<<outfile.Data(); |
out1<<ffile<<"_FTrkQLook_EXPERT-Temp-pag"<<fl+1<<"."<<outfile.Data(); |
910 |
TempCanv[fl]->Print(out+out1.str().c_str()); |
if(fl<cntpgtemp) TempCanv[fl]->Print(out+out1.str().c_str()); |
911 |
out1.str(""); |
out1.str(""); |
912 |
out1<<ffile<<"_FTrkQLook_EXPERT-EvNum-pag"<<fl+1<<"."<<outfile.Data(); |
out1<<ffile<<"_FTrkQLook_EXPERT-EvNum-pag"<<fl+1<<"."<<outfile.Data(); |
913 |
EventNumCanv[fl]->Print(out+out1.str().c_str()); |
if(fl<cntpgdat) EventNumCanv[fl]->Print(out+out1.str().c_str()); |
914 |
out1.str(""); |
if(fl==countrun-1){ |
915 |
out1<<ffile<<"_FTrkQLook_EXPERT-LandauL1-pag"<<fl+1<<"."<<outfile.Data(); |
out1.str(""); |
916 |
LandauCanv1[fl]->Print(out+out1.str().c_str()); |
out1<<ffile<<"_FTrkQLook_EXPERT-LandauL1."<<outfile.Data(); |
917 |
out1.str(""); |
LandauCanv1->Print(out+out1.str().c_str()); |
918 |
out1<<ffile<<"_FTrkQLook_EXPERT-LandauL2-pag"<<fl+1<<"."<<outfile.Data(); |
out1.str(""); |
919 |
LandauCanv2[fl]->Print(out+out1.str().c_str()); |
out1<<ffile<<"_FTrkQLook_EXPERT-LandauL2."<<outfile.Data(); |
920 |
out1.str(""); |
LandauCanv2->Print(out+out1.str().c_str()); |
921 |
out1<<ffile<<"_FTrkQLook_EXPERT-LandauL3-pag"<<fl+1<<"."<<outfile.Data(); |
out1.str(""); |
922 |
LandauCanv3[fl]->Print(out+out1.str().c_str()); |
out1<<ffile<<"_FTrkQLook_EXPERT-LandauL3."<<outfile.Data(); |
923 |
out1.str(""); |
LandauCanv3->Print(out+out1.str().c_str()); |
924 |
out1<<ffile<<"_FTrkQLook_EXPERT-Lighting-pag"<<fl+1<<"."<<outfile.Data(); |
out1.str(""); |
925 |
IlluminaCanv[fl]->Print(out+out1.str().c_str()); |
out1<<ffile<<"_FTrkQLook_EXPERT-Lighting."<<outfile.Data(); |
926 |
|
IlluminaCanv->Print(out+out1.str().c_str()); |
927 |
|
} |
928 |
} |
} |
929 |
|
} |
930 |
|
|
931 |
|
if(!strcmp(outfile.Data(),"pdf")){ |
932 |
|
stringstream com; |
933 |
|
com<<"ps2pdf13 "<<out<<ffile<<"_FTrkQLook_EXPERT.ps "<<out<<ffile<<"_FTrkQLook_EXPERT.pdf"; |
934 |
|
system(com.str().c_str()); |
935 |
|
printf("\n---> ps file converted in pdf format!\n"); |
936 |
|
com.str(""); |
937 |
|
com<<"rm -f "<<out<<ffile<<"_FTrkQLook_EXPERT.ps "; |
938 |
|
system(com.str().c_str()); |
939 |
|
printf("---> ps file removed!\n\n"); |
940 |
|
com.str(""); |
941 |
} |
} |
942 |
|
|
943 |
command.str(""); |
command.str(""); |
944 |
command<<"rm -f "<<out<<"warning.txt"; |
command<<"rm -f "<<out<<"warning.txt"; |
945 |
system(command.str().c_str()); |
system(command.str().c_str()); |
946 |
|
|
947 |
gROOT->Reset(); |
gROOT->Reset(); |
948 |
return; |
return; |
949 |
} |
} |