| 2 |
* FTrkQLook_EXPERT |
* FTrkQLook_EXPERT |
| 3 |
* |
* |
| 4 |
* autor: D.Fedele |
* autor: D.Fedele |
| 5 |
* version 2.0 |
* version 3.0 |
| 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 |
| 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 |
#define MAXSTORAGE 50000 |
| 36 |
|
|
| 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 |
|
if ( !datafile ){ |
| 84 |
|
printf("No data file, exiting...\n"); |
| 85 |
|
return; |
| 86 |
|
} |
| 87 |
|
|
| 88 |
TTree *tree = (TTree*)datafile->Get("TsbT"); |
TTree *tree = (TTree*)datafile->Get("TsbT"); |
| 89 |
tree->SetBranchAddress("TsbT",&event); |
tree->SetBranchAddress("TsbT",&event); |
| 144 |
nevent=maxevent-minevent ; |
nevent=maxevent-minevent ; |
| 145 |
} |
} |
| 146 |
|
|
| 147 |
Long64_t obt=0; |
// |
| 148 |
const Int_t sizeH=neventH; |
// information about the RunHeader |
| 149 |
ULong64_t HOBT[sizeH]; |
ULong64_t HOBT[neventH]; |
| 150 |
Int_t trk_cal_us[sizeH],countrun=1; |
Int_t trk_cal_us[neventH]; |
| 151 |
for (Int_t vi=0; vi<sizeH;vi++){ |
for (Int_t vi=0; vi<neventH;vi++){ |
| 152 |
HOBT[vi]=0; |
HOBT[vi]=0; |
| 153 |
trk_cal_us[vi]=0; |
trk_cal_us[vi]=0; |
| 154 |
} |
} |
| 157 |
pH = eH->GetPscuHeader(); |
pH = eH->GetPscuHeader(); |
| 158 |
HOBT[ev]= pH->GetOrbitalTime(); |
HOBT[ev]= pH->GetOrbitalTime(); |
| 159 |
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); |
|
| 160 |
} |
} |
|
countrun+=(Int_t)nevent/30000; |
|
|
// printf("\ncountrun=%d\n",countrun); |
|
| 161 |
|
|
| 162 |
// |
// |
| 163 |
// other variables definitions |
// other variables definitions |
| 175 |
} |
} |
| 176 |
const Int_t tsize=maxsize; |
const Int_t tsize=maxsize; |
| 177 |
Int_t tempt[tsize][5],xt[tsize], tempt_tmp[tsize]; |
Int_t tempt[tsize][5],xt[tsize], tempt_tmp[tsize]; |
| 178 |
|
Int_t countnboot=1; |
| 179 |
// |
// |
| 180 |
// information about the temperatures |
// information about the temperatures |
| 181 |
for (Int_t ev=0; ev<tnevent; ev++){ |
for (Int_t ev=0; ev<tnevent; ev++){ |
| 183 |
tmpSize = event->Records->GetEntries(); |
tmpSize = event->Records->GetEntries(); |
| 184 |
for (Int_t j = 0; j < tmpSize; j++){ |
for (Int_t j = 0; j < tmpSize; j++){ |
| 185 |
record = (pamela::TsbTRecord*)event->Records->At(j); |
record = (pamela::TsbTRecord*)event->Records->At(j); |
| 186 |
xt[siztmp]=record->RECORD_OBT; //0.051*record->RECORD_OBT; |
xt[siztmp]=record->RECORD_OBT; |
| 187 |
|
if((xt[siztmp]<xt[siztmp-1]) && siztmp>0) |
| 188 |
|
countnboot+=1; |
| 189 |
|
|
| 190 |
for (Int_t z = 0; z < 5; z++){ |
for (Int_t z = 0; z < 5; z++){ |
| 191 |
tempt[siztmp][z] = record->TEMPERATURES[z+1]; |
tempt[siztmp][z] = record->TEMPERATURES[z+1]; |
| 192 |
} |
} |
| 193 |
siztmp++; |
siztmp++; |
| 194 |
} |
} |
| 195 |
} |
} |
| 196 |
|
countnboot+=2*(Int_t)nevent/MAXSTORAGE; |
| 197 |
|
// printf("\ncountnboot=%d\n",countnboot); |
| 198 |
|
|
| 199 |
// |
// |
| 200 |
// open the output text files for the alarms |
// open the output text files for the alarms |
| 214 |
// write the file for the TrkAlarm packet |
// write the file for the TrkAlarm packet |
| 215 |
if(alnevent==0) alarm1 <<endl<< "------> NO ALARM!!! <-------"<< endl; |
if(alnevent==0) alarm1 <<endl<< "------> NO ALARM!!! <-------"<< endl; |
| 216 |
else{ |
else{ |
| 217 |
|
Long64_t obt=0; |
| 218 |
for (Int_t ev=0; ev<alnevent; ev++){ |
for (Int_t ev=0; ev<alnevent; ev++){ |
| 219 |
altr->GetEntry(ev); |
altr->GetEntry(ev); |
| 220 |
ph = aleh->GetPscuHeader(); |
ph = aleh->GetPscuHeader(); |
| 272 |
} |
} |
| 273 |
} |
} |
| 274 |
|
|
| 275 |
|
// |
| 276 |
|
// Set Style options |
| 277 |
gStyle->SetLabelSize(0.05,"x"); |
gStyle->SetLabelSize(0.05,"x"); |
| 278 |
gStyle->SetLabelSize(0.06,"y"); |
gStyle->SetLabelSize(0.06,"y"); |
| 279 |
gStyle->SetStatFontSize(0.075); |
gStyle->SetStatFontSize(0.075); |
| 287 |
gStyle->SetTitleSize(0.06,"y"); |
gStyle->SetTitleSize(0.06,"y"); |
| 288 |
gStyle->SetTitleSize(0.055,"x"); |
gStyle->SetTitleSize(0.055,"x"); |
| 289 |
|
|
| 290 |
|
// |
| 291 |
|
// Define output canvas, histos and graphs |
| 292 |
|
TCanvas *CompTimeCanv[countnboot],*EventNumCanv[countnboot],*TempCanv[countnboot]; |
| 293 |
|
TCanvas *IlluminaCanv,*LandauCanv1,*LandauCanv2,*LandauCanv3; |
| 294 |
|
|
| 295 |
|
TH1F *landau1[12],*landau2[12],*landau3[12],*illuminazione[12]; |
| 296 |
|
TGraph *comprtime[12][countnboot],*temp[5][countnboot],*eventnumb[countnboot]; |
| 297 |
|
TPad *pad1[12],*pad2[12],*pad3[12],*pad4[12],*pad5[12],*pad6[5]; |
| 298 |
|
|
| 299 |
|
for(Int_t n = 0; n<12; n++) { |
| 300 |
|
|
| 301 |
|
/* -----------> HISTOGRAMS */ |
| 302 |
|
|
| 303 |
|
tit<<"DSP "<<n+1; |
| 304 |
|
oss1<<"DSP "<<n+1; |
| 305 |
|
oss2<<"DSPh "<<n+1; |
| 306 |
|
oss3<<"DSP h "<<n+1; |
| 307 |
|
oss4<<"DSP h"<<n+1; |
| 308 |
|
|
| 309 |
|
landau1[n]= new TH1F(oss1.str().c_str(),tit.str().c_str(),401,-0.5,1200.5); |
| 310 |
|
landau2[n]= new TH1F(oss2.str().c_str(),tit.str().c_str(),401,-0.5,1200.5); |
| 311 |
|
landau3[n]= new TH1F(oss3.str().c_str(),tit.str().c_str(),401,-0.5,1200.5); |
| 312 |
|
|
| 313 |
|
illuminazione[n]= new TH1F(oss4.str().c_str(),tit.str().c_str(),3073,-0.5,3072.5); |
| 314 |
|
|
| 315 |
|
tit.str(""); |
| 316 |
|
oss1.str(""); |
| 317 |
|
oss2.str(""); |
| 318 |
|
oss3.str(""); |
| 319 |
|
oss4.str(""); |
| 320 |
|
}; |
| 321 |
|
|
| 322 |
|
|
| 323 |
//*************************************************************************************** |
//*************************************************************************************** |
| 324 |
// LOOP on each event |
// LOOP on each event |
| 328 |
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); |
| 329 |
else |
else |
| 330 |
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 |
|
| 331 |
|
|
| 332 |
ofstream warning(out + "warning.txt",ios::out); |
TLatex *t=new TLatex(); |
| 333 |
|
TLatex *t1=new TLatex(); |
| 334 |
|
|
| 335 |
|
Int_t cntpgtemp=0,cntpgdat=0; |
| 336 |
|
Int_t minev=minevent,maxev=maxevent,countTEMP=0; |
| 337 |
|
|
| 338 |
|
// |
| 339 |
|
// Fill temperature graphs |
| 340 |
|
for(Int_t ii=0; ii<countnboot;ii++){ |
| 341 |
//**************************************************************************************** |
//**************************************************************************************** |
| 342 |
//Output figures --- First sheet: |
//Temperature Output Pages |
| 343 |
//**************************************************************************************** |
//**************************************************************************************** |
| 344 |
fromfile.str(""); |
fromfile.str(""); |
| 345 |
fromfile<<"FTrkQLook_EXPERT File: "<<ffile; |
fromfile<<"FTrkQLook_EXPERT File: "<<ffile; |
| 346 |
isfile<<"COMPRESSIONTIME vs. OBT pag"<<ii+1; |
isfile<<"Temperatures vs OBT pag"<<ii+1; |
| 347 |
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); |
| 348 |
CompTimeCanv[ii]->SetFillColor(10); |
TempCanv[ii]->SetFillColor(10); |
| 349 |
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: |
|
|
//**************************************************************************************** |
|
| 350 |
|
|
|
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); |
|
| 351 |
t->SetTextFont(32); |
t->SetTextFont(32); |
| 352 |
t->SetTextColor(1); |
t->SetTextColor(1); |
| 353 |
t->SetTextAlign(12); |
t->SetTextAlign(12); |
| 357 |
t1->SetTextColor(1); |
t1->SetTextColor(1); |
| 358 |
t1->SetTextAlign(12); |
t1->SetTextAlign(12); |
| 359 |
t1->SetTextSize(0.02); |
t1->SetTextSize(0.02); |
| 360 |
t1->DrawLatex(65.,98.7,isfile.str().c_str()); |
t1->DrawLatex(78.,98.7,isfile.str().c_str()); |
| 361 |
isfile.str(""); |
isfile.str(""); |
| 362 |
|
|
| 363 |
|
Float_t tposy = 0.95; // up y-coord - top pads |
| 364 |
|
Float_t thpad = 0; // pad height |
| 365 |
|
Float_t tposx1=0; // left x-coord - pad column |
| 366 |
|
Float_t tposx0=0; // x-coord - column division |
| 367 |
|
Float_t twrel = 0; // relative x size of first sub-column |
| 368 |
|
Float_t tmarg = 0.004; // margin among pads |
| 369 |
|
|
| 370 |
|
thpad = (tposy-tmarg*5)/3; |
| 371 |
|
twrel = (1-tmarg*4)/2; |
| 372 |
|
|
| 373 |
|
for(Int_t i=0; i<5; i++){ |
| 374 |
|
if ( (i+1)%2==1 ) { |
| 375 |
|
if(i>1) tposy = tposy-(tmarg*2+thpad); |
| 376 |
|
tposx1 = tmarg; |
| 377 |
|
tposx0 = tposx1 + twrel; |
| 378 |
|
} |
| 379 |
|
else { |
| 380 |
|
tposx1 = tposx0 + 2*tmarg; |
| 381 |
|
tposx0 = tposx1 + twrel; |
| 382 |
|
} |
| 383 |
|
|
| 384 |
|
/* -----------> pad for histograms */ |
| 385 |
|
pad6[i] = new TPad("pad6"," ",tposx1,tposy-thpad,tposx0,tposy,18,0,0); |
| 386 |
|
|
| 387 |
//**************************************************************************************** |
Int_t v=0,xt_tmp[tsize]; |
| 388 |
//Output figures --- Third sheet: |
for (Int_t ev=countTEMP; ev<tsize; ev++){ |
| 389 |
//**************************************************************************************** |
|
| 390 |
|
if(ev==tsize-1 && i==4) countTEMP=tsize-1; |
| 391 |
|
if(xt[ev]<xt[ev-1] && ev>countTEMP){ |
| 392 |
|
if(i==4) countTEMP=ev; |
| 393 |
|
break; |
| 394 |
|
} |
| 395 |
|
else{ |
| 396 |
|
if(tempt[ev][i]!=65535){ |
| 397 |
|
tempt_tmp[v]=(Int_t)(((3.3*tempt[ev][i]/4096)-0.586)/0.0231); |
| 398 |
|
if(tempt_tmp[v]>0) xt_tmp[v++]=xt[ev]; |
| 399 |
|
} |
| 400 |
|
} |
| 401 |
|
} |
| 402 |
|
TempCanv[ii]->cd(); |
| 403 |
|
tit<<"T"<<i+5<<" (magnetic module "<<i+1<<")"; |
| 404 |
|
pad6[i]->SetFillColor(10); |
| 405 |
|
pad6[i]->Draw(); |
| 406 |
|
pad6[i]->cd(); |
| 407 |
|
temp[i][ii]= new TGraph(v,xt_tmp,tempt_tmp); |
| 408 |
|
temp[i][ii]->SetTitle(tit.str().c_str()); |
| 409 |
|
temp[i][ii]->GetXaxis()->SetLabelSize(0.04); |
| 410 |
|
temp[i][ii]->GetXaxis()->SetTitleSize(0.04); |
| 411 |
|
temp[i][ii]->GetXaxis()->SetTitle("OBT (ms)"); |
| 412 |
|
temp[i][ii]->GetXaxis()->CenterTitle(); |
| 413 |
|
temp[i][ii]->GetXaxis()->SetTitleOffset(0.85); |
| 414 |
|
temp[i][ii]->GetYaxis()->SetTitleOffset(1.2); |
| 415 |
|
temp[i][ii]->GetYaxis()->SetLabelOffset(0.001); |
| 416 |
|
temp[i][ii]->GetYaxis()->SetLabelSize(0.04); |
| 417 |
|
temp[i][ii]->GetYaxis()->SetTitleSize(0.04); |
| 418 |
|
temp[i][ii]->GetYaxis()->SetTitle("Temperatures ( ^{o}C)"); |
| 419 |
|
temp[i][ii]->GetYaxis()->CenterTitle(); |
| 420 |
|
temp[i][ii]->SetMarkerStyle(21); |
| 421 |
|
temp[i][ii]->SetMarkerSize(0.2); |
| 422 |
|
temp[i][ii]->Draw("ap"); |
| 423 |
|
tit.str(""); |
| 424 |
|
TempCanv[ii]->Update(); |
| 425 |
|
|
| 426 |
|
} |
| 427 |
|
if(countTEMP==tsize-1){ |
| 428 |
|
cntpgtemp=ii+1; |
| 429 |
|
break; |
| 430 |
|
} |
| 431 |
|
} |
| 432 |
|
|
|
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); |
|
| 433 |
|
|
| 434 |
t->SetTextFont(32); |
// |
| 435 |
t->SetTextColor(1); |
// Fill compressiontime and eventnumber graphs and DSP warnings |
| 436 |
t->SetTextAlign(12); |
for(Int_t ii=0; ii<countnboot;ii++){ |
| 437 |
t->SetTextSize(0.02); |
TPaveText *pt1; |
| 438 |
t->DrawLatex(2.,98.7,fromfile.str().c_str()); |
TPad *pt,*pt0; //pad for histos |
|
t1->SetTextFont(32); |
|
|
t1->SetTextColor(1); |
|
|
t1->SetTextAlign(12); |
|
|
t1->SetTextSize(0.02); |
|
|
t1->DrawLatex(65.,98.7,isfile.str().c_str()); |
|
|
isfile.str(""); |
|
| 439 |
|
|
| 440 |
|
ofstream warning(out + "warning.txt",ios::out); |
| 441 |
|
|
| 442 |
//**************************************************************************************** |
//**************************************************************************************** |
| 443 |
//Output figures --- Third sheet: |
//COMPRESSIONTIME vs. OBT Output Pages |
| 444 |
//**************************************************************************************** |
//**************************************************************************************** |
| 445 |
|
fromfile.str(""); |
| 446 |
isfile<<"Cluster Signal ladder2 pag"<<ii+1; |
fromfile<<"FTrkQLook_EXPERT File: "<<ffile; |
| 447 |
LandauCanv2[ii]=new TCanvas(isfile.str().c_str(),isfile.str().c_str(),900,1200); |
isfile<<"COMPRESSIONTIME vs. OBT pag"<<ii+1; |
| 448 |
LandauCanv2[ii]->SetFillColor(10); |
CompTimeCanv[ii]=new TCanvas(isfile.str().c_str(),isfile.str().c_str(),900,1200); |
| 449 |
LandauCanv2[ii]->Range(0,0,100,100); |
CompTimeCanv[ii]->SetFillColor(10); |
| 450 |
|
CompTimeCanv[ii]->Range(0,0,100,100); |
| 451 |
t->SetTextFont(32); |
t->SetTextFont(32); |
| 452 |
t->SetTextColor(1); |
t->SetTextColor(1); |
| 453 |
t->SetTextAlign(12); |
t->SetTextAlign(12); |
| 457 |
t1->SetTextColor(1); |
t1->SetTextColor(1); |
| 458 |
t1->SetTextAlign(12); |
t1->SetTextAlign(12); |
| 459 |
t1->SetTextSize(0.02); |
t1->SetTextSize(0.02); |
| 460 |
t1->DrawLatex(65.,98.7,isfile.str().c_str()); |
t1->DrawLatex(62.,98.7,isfile.str().c_str()); |
| 461 |
isfile.str(""); |
isfile.str(""); |
| 462 |
|
|
| 463 |
//**************************************************************************************** |
//**************************************************************************************** |
| 464 |
//Output figures --- Third sheet: |
//DSP EVENT NUMBER Output Pages |
| 465 |
//**************************************************************************************** |
//**************************************************************************************** |
| 466 |
|
|
| 467 |
isfile<<"Cluster Signal ladder3 pag"<<ii+1; |
isfile<<"WARNINGS on DSP EVENT NUMBER pag"<<ii+1; |
| 468 |
LandauCanv3[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); |
| 469 |
LandauCanv3[ii]->SetFillColor(10); |
EventNumCanv[ii]->SetFillColor(10); |
| 470 |
LandauCanv3[ii]->Range(0,0,100,100); |
EventNumCanv[ii]->Range(0,0,100,100); |
|
|
|
| 471 |
t->SetTextFont(32); |
t->SetTextFont(32); |
| 472 |
t->SetTextColor(1); |
t->SetTextColor(1); |
| 473 |
t->SetTextAlign(12); |
t->SetTextAlign(12); |
| 479 |
t1->SetTextSize(0.02); |
t1->SetTextSize(0.02); |
| 480 |
t1->DrawLatex(65.,98.7,isfile.str().c_str()); |
t1->DrawLatex(65.,98.7,isfile.str().c_str()); |
| 481 |
isfile.str(""); |
isfile.str(""); |
|
|
|
|
//**************************************************************************************** |
|
|
//Output figures --- Fourth sheet: |
|
|
//**************************************************************************************** |
|
| 482 |
|
|
|
isfile<<"lighting of the views pag"<<ii+1; |
|
|
IlluminaCanv[ii]=new TCanvas(isfile.str().c_str(),isfile.str().c_str(),900,1200); |
|
|
IlluminaCanv[ii]->SetFillColor(10); |
|
|
IlluminaCanv[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(70.,98.7,isfile.str().c_str()); |
|
|
isfile.str(""); |
|
|
|
|
|
//**************************************************************************************** |
|
|
//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(78.,98.7,isfile.str().c_str()); |
|
|
isfile.str(""); |
|
|
|
|
|
//************************************************************************************* |
|
|
//book pads and histos |
|
|
//*************************************************************************************** |
|
| 483 |
Float_t posy = 0.95; // up y-coord - top pads |
Float_t posy = 0.95; // up y-coord - top pads |
| 484 |
Float_t hpad = 0; // pad height |
Float_t hpad = 0; // pad height |
| 485 |
Float_t posx1=0; // left x-coord - pad column |
Float_t posx1=0; // left x-coord - pad column |
| 486 |
Float_t posx0=0; // x-coord - column division |
Float_t posx0=0; // x-coord - column division |
| 487 |
Float_t wrel = 0; // relative x size of first sub-column |
Float_t wrel = 0; // relative x size of first sub-column |
| 488 |
Float_t marg = 0.004; // margin among pads |
Float_t marg = 0.004; // margin among pads |
| 489 |
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 |
|
|
|
|
| 490 |
hpad = (posy-marg*11)/6; |
hpad = (posy-marg*11)/6; |
| 491 |
wrel = (1-marg*4)/2; |
wrel = (1-marg*4)/2; |
| 492 |
thpad = (tposy-tmarg*5)/3; |
|
|
twrel = (1-tmarg*4)/2; |
|
|
|
|
| 493 |
for(Int_t n = 0; n<12; n++) { |
for(Int_t n = 0; n<12; n++) { |
| 494 |
|
|
| 495 |
if ( (n+1)%2==1 ) { |
if ( (n+1)%2==1 ) { |
| 496 |
if(n>1) posy = posy-(marg*2+hpad); |
if(n>1) posy = posy-(marg*2+hpad); |
| 497 |
posx1 = marg; |
posx1 = marg; |
| 500 |
else { |
else { |
| 501 |
posx1 = posx0 + 2*marg; |
posx1 = posx0 + 2*marg; |
| 502 |
posx0 = posx1 + wrel; |
posx0 = posx1 + wrel; |
| 503 |
} |
} |
| 504 |
|
|
|
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; |
|
|
} |
|
|
|
|
|
|
|
| 505 |
/* -----------> pad for histograms */ |
/* -----------> pad for histograms */ |
| 506 |
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); |
| 507 |
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); |
| 508 |
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); |
| 509 |
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); |
| 510 |
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); |
| 511 |
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 |
|
|
//********************************************************************************** |
|
| 512 |
|
|
| 513 |
// |
// |
| 514 |
// information about the tracker data |
// Obtain information about the tracker data |
| 515 |
Int_t warning_dspnumber=0; |
// and fill graphs and histos |
| 516 |
|
Int_t warning_dspnumber=0,al=0; |
| 517 |
Float_t x[MAXSTORAGE]; |
Float_t x[MAXSTORAGE]; |
| 518 |
Float_t yc[MAXSTORAGE][12]; |
Float_t yc[MAXSTORAGE][12]; |
| 519 |
Float_t eventint[MAXSTORAGE]; |
Float_t eventint[MAXSTORAGE]; |
| 520 |
|
|
| 521 |
for (Int_t ev=minev; ev<maxevent; ev++){ |
for (Int_t ev=minev; ev<maxevent; ev++){ |
| 522 |
tr->GetEntry(ev); |
tr->GetEntry(ev); |
| 523 |
ph = eh->GetPscuHeader(); |
ph = eh->GetPscuHeader(); |
| 524 |
|
cod = eh->GetCounter(); |
| 525 |
|
|
| 526 |
if(ev==maxevent-1) maxev=maxevent-1; |
if(ev==maxevent-1) maxev=maxevent-1; |
| 527 |
|
|
| 528 |
if((ph->GetOrbitalTime()<x[ev-minev-1] && ev-minev!=0) || ev-minev==MAXSTORAGE){ |
if((ph->GetOrbitalTime()<x[ev-minev-1] && ev-minev!=0) || ev-minev==MAXSTORAGE){ |
| 538 |
dsp=te->DSPnumber[i]-1; |
dsp=te->DSPnumber[i]-1; |
| 539 |
yc[(ev-minev)][dsp]= 0.051*te->compressiontime[i]; |
yc[(ev-minev)][dsp]= 0.051*te->compressiontime[i]; |
| 540 |
|
|
| 541 |
|
// |
| 542 |
|
// Fill Cluster Signal and Lighting of the view histos |
| 543 |
for(Int_t j=0;j<3;j++){ |
for(Int_t j=0;j<3;j++){ |
| 544 |
if(te->signcluster[i][j]!=0){ |
if(te->signcluster[i][j]!=0){ |
| 545 |
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)){ |
| 546 |
// 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])); |
|
| 547 |
} |
} |
| 548 |
} |
} |
| 549 |
} |
} |
| 550 |
if(x[ev-minev]>HOBT[countHOBT+1]) |
if(trk_cal_us[cod->Get(pctp->RunHeader)]!=104){ |
|
countHOBT+=1; |
|
|
if(trk_cal_us[countHOBT]!=104){ |
|
| 551 |
if(!(dsp%2)){ |
if(!(dsp%2)){ |
| 552 |
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])); |
| 553 |
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])); |
| 554 |
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])); |
| 555 |
} |
} |
| 556 |
else{ |
else{ |
| 557 |
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]); |
| 558 |
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]); |
| 559 |
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]); |
| 560 |
} |
} |
| 561 |
} |
} |
| 562 |
|
|
| 563 |
WARNING[i]=0; |
WARNING[i]=0; |
| 564 |
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){ |
| 565 |
ALARM = 1; //general alarm |
ALARM = 1; //general alarm |
| 566 |
|
al=1; |
| 567 |
WARNING[i] = 1; // DSP warning |
WARNING[i] = 1; // DSP warning |
| 568 |
}; |
}; |
| 569 |
|
|
| 570 |
if(te->alarm[i]!=0){ // hardware alarm |
if(te->alarm[i]!=0){ // hardware alarm |
| 571 |
ALARM = 1; |
ALARM = 1; |
| 572 |
|
al=1; |
| 573 |
}; |
}; |
| 574 |
|
|
| 575 |
//************************************************************************************** |
//************************************************************************************** |
| 597 |
} |
} |
| 598 |
|
|
| 599 |
//******************************************************************************************** |
//******************************************************************************************** |
| 600 |
// file ALARM |
// file DSP warning |
| 601 |
//******************************************************************************************** |
//******************************************************************************************** |
| 602 |
|
|
| 603 |
if(ALARM==1) { |
if(ALARM==1) { |
| 604 |
alarm <<endl<< "================================================="<< endl; |
alarm <<endl<< "================================================="<< endl; |
| 605 |
alarm << "PSCU-Pkt N. "<< ph->GetCounter() ; |
alarm << "PSCU-Pkt N. "<< ph->GetCounter() ; |
| 606 |
alarm << " - OBT "<< ph->GetOrbitalTime() << " ms"<<endl; |
alarm << " - OBT "<< ph->GetOrbitalTime() << " ms"<<endl; |
| 607 |
alarm << "(ROOT-tree entry "<<ev<<")"<<endl; |
alarm << "(ROOT-tree entry "<<ev<<" in page "<<ii+1<<" )"<<endl; |
| 608 |
alarm << "================================================="<< endl; |
alarm << "================================================="<< endl; |
| 609 |
|
|
| 610 |
alarm << " DSPn"; |
alarm << " DSPn"; |
| 638 |
} |
} |
| 639 |
} |
} |
| 640 |
} |
} |
| 641 |
if(ALARM==0) alarm << endl<< "------> NO ALARM!!! <-------"<<endl; |
if(al==0) alarm << endl<< "Page "<<ii+1<< ": ------> NO ALARM!!! <-------"<<endl; |
| 642 |
if(warning_dspnumber==0) warning<<"NONE"<<endl; |
if(warning_dspnumber==0) warning<<"NONE"<<endl; |
| 643 |
|
|
| 644 |
|
// |
| 645 |
Float_t maxhist=0; |
// Draw the graphs |
|
TBox b; |
|
|
b.SetFillColor(6); |
|
|
b.SetFillStyle(3945); |
|
|
|
|
| 646 |
for (Int_t i=0; i<12 ; i++){ |
for (Int_t i=0; i<12 ; i++){ |
| 647 |
Float_t yyc[maxev-minev]; |
Float_t yyc[maxev-minev]; |
| 648 |
for (Int_t v=0; v<maxev-minev; v++){ |
for (Int_t v=0; v<maxev-minev; v++){ |
| 649 |
yyc[v]=yc[v][i]; |
yyc[v]=yc[v][i]; |
| 650 |
} |
} |
|
|
|
|
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(); |
|
|
|
|
| 651 |
|
|
| 652 |
CompTimeCanv[ii]->cd(); |
CompTimeCanv[ii]->cd(); |
| 653 |
pad3[i]->SetFillColor(10); |
pad3[i]->SetFillColor(10); |
| 665 |
comprtime[i][ii]->Draw("ap"); |
comprtime[i][ii]->Draw("ap"); |
| 666 |
oss1.str(""); |
oss1.str(""); |
| 667 |
CompTimeCanv[ii]->Update(); |
CompTimeCanv[ii]->Update(); |
| 668 |
}; |
} |
| 669 |
|
|
| 670 |
EventNumCanv[ii]->cd(); |
EventNumCanv[ii]->cd(); |
| 671 |
pt0=new TPad("pt0"," ",0.704,0.004,0.996,0.98); |
pt0=new TPad("pt0"," ",0.704,0.004,0.996,0.98); |
| 687 |
pt->cd(); |
pt->cd(); |
| 688 |
eventnumb[ii]=new TGraph(maxev-minev,x,eventint); |
eventnumb[ii]=new TGraph(maxev-minev,x,eventint); |
| 689 |
eventnumb[ii]->SetTitle(""); |
eventnumb[ii]->SetTitle(""); |
| 690 |
eventnumb[ii]->GetXaxis()->SetLabelSize(0.04); |
eventnumb[ii]->GetXaxis()->SetLabelSize(0.03); |
| 691 |
eventnumb[ii]->GetXaxis()->SetTitleSize(0.04); |
eventnumb[ii]->GetXaxis()->SetTitleSize(0.04); |
| 692 |
eventnumb[ii]->GetXaxis()->SetTitle("OBT (ms)"); |
eventnumb[ii]->GetXaxis()->SetTitle("OBT (ms)"); |
| 693 |
eventnumb[ii]->GetXaxis()->CenterTitle(); |
eventnumb[ii]->GetXaxis()->CenterTitle(); |
| 694 |
eventnumb[ii]->GetXaxis()->SetTickLength(0.01); |
eventnumb[ii]->GetXaxis()->SetTickLength(0.01); |
| 695 |
eventnumb[ii]->GetXaxis()->SetTitleOffset(1.2); |
eventnumb[ii]->GetXaxis()->SetTitleOffset(1.2); |
| 696 |
eventnumb[ii]->GetYaxis()->SetLabelSize(0.04); |
eventnumb[ii]->GetYaxis()->SetLabelSize(0.03); |
| 697 |
eventnumb[ii]->GetYaxis()->SetTitleSize(0.04); |
eventnumb[ii]->GetYaxis()->SetTitleSize(0.04); |
| 698 |
eventnumb[ii]->GetYaxis()->SetTitle("DSP event-number"); |
eventnumb[ii]->GetYaxis()->SetTitle("DSP event-number"); |
| 699 |
eventnumb[ii]->GetYaxis()->CenterTitle(); |
eventnumb[ii]->GetYaxis()->CenterTitle(); |
| 703 |
eventnumb[ii]->SetMarkerSize(0.3); |
eventnumb[ii]->SetMarkerSize(0.3); |
| 704 |
eventnumb[ii]->Draw("ap"); |
eventnumb[ii]->Draw("ap"); |
| 705 |
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(); |
|
|
} |
|
| 706 |
|
|
| 707 |
|
|
| 708 |
|
warning.close(); |
| 709 |
minev=maxev; |
minev=maxev; |
| 710 |
if(maxev==maxevent-1) { |
if(maxev==maxevent-1) { |
| 711 |
countrun=ii+1; |
cntpgdat=ii+1; |
| 712 |
break; |
break; |
| 713 |
} |
} |
|
|
|
|
warning.close(); |
|
| 714 |
} |
} |
| 715 |
|
|
|
//***************************************** |
|
|
//close all files |
|
|
//***************************************** |
|
| 716 |
alarm.close(); |
alarm.close(); |
| 717 |
|
|
| 718 |
|
//**************************************************************************************** |
| 719 |
|
//Cluster Signal ladder1 Output Pages |
| 720 |
|
//**************************************************************************************** |
| 721 |
|
|
| 722 |
|
fromfile.str(""); |
| 723 |
|
fromfile<<"FTrkQLook_EXPERT File: "<<ffile; |
| 724 |
|
isfile<<"Cluster Signal ladder1"; |
| 725 |
|
LandauCanv1=new TCanvas(isfile.str().c_str(),isfile.str().c_str(),900,1200); |
| 726 |
|
LandauCanv1->SetFillColor(10); |
| 727 |
|
LandauCanv1->Range(0,0,100,100); |
| 728 |
|
|
| 729 |
|
t->SetTextFont(32); |
| 730 |
|
t->SetTextColor(1); |
| 731 |
|
t->SetTextAlign(12); |
| 732 |
|
t->SetTextSize(0.02); |
| 733 |
|
t->DrawLatex(2.,98.7,fromfile.str().c_str()); |
| 734 |
|
t1->SetTextFont(32); |
| 735 |
|
t1->SetTextColor(1); |
| 736 |
|
t1->SetTextAlign(12); |
| 737 |
|
t1->SetTextSize(0.02); |
| 738 |
|
t1->DrawLatex(70.,98.7,isfile.str().c_str()); |
| 739 |
|
isfile.str(""); |
| 740 |
|
|
| 741 |
|
//**************************************************************************************** |
| 742 |
|
//Cluster Signal ladder2 Output Pages |
| 743 |
|
//**************************************************************************************** |
| 744 |
|
|
| 745 |
|
isfile<<"Cluster Signal ladder2"; |
| 746 |
|
LandauCanv2=new TCanvas(isfile.str().c_str(),isfile.str().c_str(),900,1200); |
| 747 |
|
LandauCanv2->SetFillColor(10); |
| 748 |
|
LandauCanv2->Range(0,0,100,100); |
| 749 |
|
|
| 750 |
|
t->SetTextFont(32); |
| 751 |
|
t->SetTextColor(1); |
| 752 |
|
t->SetTextAlign(12); |
| 753 |
|
t->SetTextSize(0.02); |
| 754 |
|
t->DrawLatex(2.,98.7,fromfile.str().c_str()); |
| 755 |
|
t1->SetTextFont(32); |
| 756 |
|
t1->SetTextColor(1); |
| 757 |
|
t1->SetTextAlign(12); |
| 758 |
|
t1->SetTextSize(0.02); |
| 759 |
|
t1->DrawLatex(70.,98.7,isfile.str().c_str()); |
| 760 |
|
isfile.str(""); |
| 761 |
|
|
| 762 |
|
//**************************************************************************************** |
| 763 |
|
//Cluster Signal ladder3 Output Pages |
| 764 |
|
//**************************************************************************************** |
| 765 |
|
|
| 766 |
|
isfile<<"Cluster Signal ladder3"; |
| 767 |
|
LandauCanv3=new TCanvas(isfile.str().c_str(),isfile.str().c_str(),900,1200); |
| 768 |
|
LandauCanv3->SetFillColor(10); |
| 769 |
|
LandauCanv3->Range(0,0,100,100); |
| 770 |
|
|
| 771 |
|
t->SetTextFont(32); |
| 772 |
|
t->SetTextColor(1); |
| 773 |
|
t->SetTextAlign(12); |
| 774 |
|
t->SetTextSize(0.02); |
| 775 |
|
t->DrawLatex(2.,98.7,fromfile.str().c_str()); |
| 776 |
|
t1->SetTextFont(32); |
| 777 |
|
t1->SetTextColor(1); |
| 778 |
|
t1->SetTextAlign(12); |
| 779 |
|
t1->SetTextSize(0.02); |
| 780 |
|
t1->DrawLatex(70.,98.7,isfile.str().c_str()); |
| 781 |
|
isfile.str(""); |
| 782 |
|
|
| 783 |
|
//**************************************************************************************** |
| 784 |
|
//Lighting of the views Output Pages |
| 785 |
|
//**************************************************************************************** |
| 786 |
|
|
| 787 |
|
isfile<<"lighting of the views"; |
| 788 |
|
IlluminaCanv=new TCanvas(isfile.str().c_str(),isfile.str().c_str(),900,1200); |
| 789 |
|
IlluminaCanv->SetFillColor(10); |
| 790 |
|
IlluminaCanv->Range(0,0,100,100); |
| 791 |
|
t->SetTextFont(32); |
| 792 |
|
t->SetTextColor(1); |
| 793 |
|
t->SetTextAlign(12); |
| 794 |
|
t->SetTextSize(0.02); |
| 795 |
|
t->DrawLatex(2.,98.7,fromfile.str().c_str()); |
| 796 |
|
t1->SetTextFont(32); |
| 797 |
|
t1->SetTextColor(1); |
| 798 |
|
t1->SetTextAlign(12); |
| 799 |
|
t1->SetTextSize(0.02); |
| 800 |
|
t1->DrawLatex(70.,98.7,isfile.str().c_str()); |
| 801 |
|
isfile.str(""); |
| 802 |
|
|
| 803 |
|
// |
| 804 |
|
// Draw the histos |
| 805 |
|
for (Int_t i=0; i<12 ; i++){ |
| 806 |
|
|
| 807 |
|
TBox b; |
| 808 |
|
b.SetFillColor(6); |
| 809 |
|
b.SetFillStyle(3945); |
| 810 |
|
|
| 811 |
|
Float_t maxhist=0; |
| 812 |
|
LandauCanv1->cd(); |
| 813 |
|
pad1[i]->SetFillColor(10); |
| 814 |
|
pad1[i]->SetFrameFillColor(10); |
| 815 |
|
pad1[i]->Draw(); |
| 816 |
|
pad1[i]->cd(); |
| 817 |
|
landau1[i]->GetXaxis()->SetTitle("max signal"); |
| 818 |
|
landau1[i]->GetXaxis()->CenterTitle(); |
| 819 |
|
landau1[i]->Draw(""); |
| 820 |
|
LandauCanv1->Update(); |
| 821 |
|
|
| 822 |
|
LandauCanv2->cd(); |
| 823 |
|
pad4[i]->SetFillColor(10); |
| 824 |
|
pad4[i]->SetFrameFillColor(10); |
| 825 |
|
pad4[i]->Draw(); |
| 826 |
|
pad4[i]->cd(); |
| 827 |
|
landau2[i]->GetXaxis()->SetTitle("max signal"); |
| 828 |
|
landau2[i]->GetXaxis()->CenterTitle(); |
| 829 |
|
landau2[i]->Draw(""); |
| 830 |
|
LandauCanv2->Update(); |
| 831 |
|
|
| 832 |
|
LandauCanv3->cd(); |
| 833 |
|
pad5[i]->SetFillColor(10); |
| 834 |
|
pad5[i]->SetFrameFillColor(10); |
| 835 |
|
pad5[i]->Draw(); |
| 836 |
|
pad5[i]->cd(); |
| 837 |
|
landau3[i]->GetXaxis()->SetTitle("max signal"); |
| 838 |
|
landau3[i]->GetXaxis()->CenterTitle(); |
| 839 |
|
landau3[i]->Draw(""); |
| 840 |
|
LandauCanv3->Update(); |
| 841 |
|
|
| 842 |
|
IlluminaCanv->cd(); |
| 843 |
|
pad2[i]->SetFillColor(10); |
| 844 |
|
pad2[i]->SetFrameFillColor(10); |
| 845 |
|
pad2[i]->SetLogy(); |
| 846 |
|
pad2[i]->Draw(); |
| 847 |
|
pad2[i]->cd(); |
| 848 |
|
illuminazione[i]->GetXaxis()->SetTitle("strip with max signal"); |
| 849 |
|
illuminazione[i]->GetXaxis()->CenterTitle(); |
| 850 |
|
illuminazione[i]->Draw(""); |
| 851 |
|
if(i==1){ |
| 852 |
|
maxhist= illuminazione[i]->GetMaximum(); |
| 853 |
|
b.DrawBox(2816.,0.,3060.,maxhist); |
| 854 |
|
} |
| 855 |
|
else if(i==6){ |
| 856 |
|
maxhist= illuminazione[i]->GetMaximum(); |
| 857 |
|
b.DrawBox(2560.,0.,2816.,maxhist); |
| 858 |
|
b.DrawBox(512.,0.,768.,maxhist); |
| 859 |
|
b.DrawBox(1024.,0.,1792.,maxhist); |
| 860 |
|
} |
| 861 |
|
else if(i==11){ |
| 862 |
|
maxhist= illuminazione[i]->GetMaximum(); |
| 863 |
|
b.DrawBox(768.,0.,1024.,maxhist); |
| 864 |
|
} |
| 865 |
|
IlluminaCanv->Update(); |
| 866 |
|
} |
| 867 |
|
|
| 868 |
printf("... end of packets. \n"); |
printf("... end of packets. \n"); |
| 869 |
|
|
| 870 |
//************************************************************************* |
//************************************************************************* |
| 871 |
// Save output Files |
// Save output Files |
| 872 |
//************************************************************************* |
//************************************************************************* |
| 873 |
stringstream out1,out2,out3,command; |
stringstream out1,out2,out3,command; |
| 874 |
|
Int_t totpg=0; |
| 875 |
for(Int_t fl=0;fl<countrun;fl++){ |
if(cntpgtemp>cntpgdat) totpg=cntpgtemp; |
| 876 |
|
else if(cntpgtemp<=cntpgdat) totpg=cntpgdat; |
| 877 |
|
|
| 878 |
|
for(Int_t fl=0;fl<totpg;fl++){ |
| 879 |
if(!strcmp(outfile.Data(),"ps")||!strcmp(outfile.Data(),"pdf")){ |
if(!strcmp(outfile.Data(),"ps")||!strcmp(outfile.Data(),"pdf")){ |
| 880 |
out1.str(""); |
out1.str(""); |
| 881 |
out2.str(""); |
out2.str(""); |
| 885 |
out2<<ffile<<"_FTrkQLook_EXPERT.ps"; |
out2<<ffile<<"_FTrkQLook_EXPERT.ps"; |
| 886 |
out3<<ffile<<"_FTrkQLook_EXPERT.ps)"; |
out3<<ffile<<"_FTrkQLook_EXPERT.ps)"; |
| 887 |
|
|
| 888 |
if(countrun==1){ |
if(totpg==1){ |
| 889 |
CompTimeCanv[fl]->Print(out+out1.str().c_str(),"Portrait"); |
CompTimeCanv[fl]->Print(out+out1.str().c_str(),"Portrait"); |
| 890 |
EventNumCanv[fl]->Print(out+out2.str().c_str(),"Portrait"); |
EventNumCanv[fl]->Print(out+out2.str().c_str(),"Portrait"); |
| 891 |
LandauCanv1[fl]->Print(out+out2.str().c_str(),"Portrait"); |
TempCanv[fl]->Print(out+out2.str().c_str(),"Portrait"); |
| 892 |
LandauCanv2[fl]->Print(out+out2.str().c_str(),"Portrait"); |
LandauCanv1->Print(out+out2.str().c_str(),"Portrait"); |
| 893 |
LandauCanv3[fl]->Print(out+out2.str().c_str(),"Portrait"); |
LandauCanv2->Print(out+out2.str().c_str(),"Portrait"); |
| 894 |
IlluminaCanv[fl]->Print(out+out2.str().c_str(),"Portrait"); |
LandauCanv3->Print(out+out2.str().c_str(),"Portrait"); |
| 895 |
TempCanv[fl]->Print(out+out3.str().c_str(),"Portrait"); |
IlluminaCanv->Print(out+out3.str().c_str(),"Portrait"); |
| 896 |
} |
} |
| 897 |
else if(countrun>=1){ |
else if(totpg>1){ |
| 898 |
if(fl==0) CompTimeCanv[fl]->Print(out+out1.str().c_str(),"Portrait"); |
if(fl==0) CompTimeCanv[fl]->Print(out+out1.str().c_str(),"Portrait"); |
| 899 |
else CompTimeCanv[fl]->Print(out+out2.str().c_str(),"Portrait"); |
if(fl>0 && fl<cntpgdat) CompTimeCanv[fl]->Print(out+out2.str().c_str(),"Portrait"); |
| 900 |
EventNumCanv[fl]->Print(out+out2.str().c_str(),"Portrait"); |
if(fl<cntpgdat) EventNumCanv[fl]->Print(out+out2.str().c_str(),"Portrait"); |
| 901 |
LandauCanv1[fl]->Print(out+out2.str().c_str(),"Portrait"); |
if(fl<cntpgtemp) TempCanv[fl]->Print(out+out2.str().c_str(),"Portrait"); |
| 902 |
LandauCanv2[fl]->Print(out+out2.str().c_str(),"Portrait"); |
if(fl==totpg-1){ |
| 903 |
LandauCanv3[fl]->Print(out+out2.str().c_str(),"Portrait"); |
LandauCanv1->Print(out+out2.str().c_str(),"Portrait"); |
| 904 |
IlluminaCanv[fl]->Print(out+out2.str().c_str(),"Portrait"); |
LandauCanv2->Print(out+out2.str().c_str(),"Portrait"); |
| 905 |
if(fl!=countrun-1) TempCanv[fl]->Print(out+out2.str().c_str(),"Portrait"); |
LandauCanv3->Print(out+out2.str().c_str(),"Portrait"); |
| 906 |
else TempCanv[fl]->Print(out+out3.str().c_str(),"Portrait"); |
IlluminaCanv->Print(out+out3.str().c_str(),"Portrait"); |
| 907 |
|
} |
| 908 |
} |
} |
| 909 |
} |
} |
| 910 |
else{ |
else{ |
| 911 |
out1.str(""); |
out1.str(""); |
| 912 |
out1<<ffile<<"_FTrkQLook_EXPERT-CompTime-pag"<<fl+1<<"."<<outfile.Data(); |
out1<<ffile<<"_FTrkQLook_EXPERT-CompTime-pag"<<fl+1<<"."<<outfile.Data(); |
| 913 |
CompTimeCanv[fl]->Print(out+out1.str().c_str()); |
if(fl<cntpgdat) CompTimeCanv[fl]->Print(out+out1.str().c_str()); |
| 914 |
out1.str(""); |
out1.str(""); |
| 915 |
out1<<ffile<<"_FTrkQLook_EXPERT-Temp-pag"<<fl+1<<"."<<outfile.Data(); |
out1<<ffile<<"_FTrkQLook_EXPERT-Temp-pag"<<fl+1<<"."<<outfile.Data(); |
| 916 |
TempCanv[fl]->Print(out+out1.str().c_str()); |
if(fl<cntpgtemp) TempCanv[fl]->Print(out+out1.str().c_str()); |
| 917 |
out1.str(""); |
out1.str(""); |
| 918 |
out1<<ffile<<"_FTrkQLook_EXPERT-EvNum-pag"<<fl+1<<"."<<outfile.Data(); |
out1<<ffile<<"_FTrkQLook_EXPERT-EvNum-pag"<<fl+1<<"."<<outfile.Data(); |
| 919 |
EventNumCanv[fl]->Print(out+out1.str().c_str()); |
if(fl<cntpgdat) EventNumCanv[fl]->Print(out+out1.str().c_str()); |
| 920 |
out1.str(""); |
if(fl==totpg-1){ |
| 921 |
out1<<ffile<<"_FTrkQLook_EXPERT-LandauL1-pag"<<fl+1<<"."<<outfile.Data(); |
out1.str(""); |
| 922 |
LandauCanv1[fl]->Print(out+out1.str().c_str()); |
out1<<ffile<<"_FTrkQLook_EXPERT-LandauL1."<<outfile.Data(); |
| 923 |
out1.str(""); |
LandauCanv1->Print(out+out1.str().c_str()); |
| 924 |
out1<<ffile<<"_FTrkQLook_EXPERT-LandauL2-pag"<<fl+1<<"."<<outfile.Data(); |
out1.str(""); |
| 925 |
LandauCanv2[fl]->Print(out+out1.str().c_str()); |
out1<<ffile<<"_FTrkQLook_EXPERT-LandauL2."<<outfile.Data(); |
| 926 |
out1.str(""); |
LandauCanv2->Print(out+out1.str().c_str()); |
| 927 |
out1<<ffile<<"_FTrkQLook_EXPERT-LandauL3-pag"<<fl+1<<"."<<outfile.Data(); |
out1.str(""); |
| 928 |
LandauCanv3[fl]->Print(out+out1.str().c_str()); |
out1<<ffile<<"_FTrkQLook_EXPERT-LandauL3."<<outfile.Data(); |
| 929 |
out1.str(""); |
LandauCanv3->Print(out+out1.str().c_str()); |
| 930 |
out1<<ffile<<"_FTrkQLook_EXPERT-Lighting-pag"<<fl+1<<"."<<outfile.Data(); |
out1.str(""); |
| 931 |
IlluminaCanv[fl]->Print(out+out1.str().c_str()); |
out1<<ffile<<"_FTrkQLook_EXPERT-Lighting."<<outfile.Data(); |
| 932 |
|
IlluminaCanv->Print(out+out1.str().c_str()); |
| 933 |
|
} |
| 934 |
} |
} |
| 935 |
} |
} |
| 936 |
|
|
| 937 |
|
// |
| 938 |
|
// Convert ps to pdf if required |
| 939 |
if(!strcmp(outfile.Data(),"pdf")){ |
if(!strcmp(outfile.Data(),"pdf")){ |
| 940 |
stringstream com; |
stringstream com; |
| 941 |
com<<"ps2pdf13 "<<out<<ffile<<"_FTrkQLook_EXPERT.ps "<<out<<ffile<<"_FTrkQLook_EXPERT.pdf"; |
com<<"ps2pdf13 "<<out<<ffile<<"_FTrkQLook_EXPERT.ps "<<out<<ffile<<"_FTrkQLook_EXPERT.pdf"; |