| 1 |
// |
// |
| 2 |
// Check for possible errors and shows raw distribution of variables coming from the DSP (no calibrations needed) - Emiliano Mocchiutti |
// Check for possible errors and shows raw distribution of variables coming from the DSP (no calibrations needed) - Emiliano Mocchiutti |
| 3 |
// |
// |
| 4 |
// FCaloQLOOK.c version 1.07 (2006-05-23) |
// FCaloQLOOK.c version 1.11 (2006-07-17) |
| 5 |
// |
// |
| 6 |
// The only input needed is the path to the directory created by YODA for the data file you want to analyze. |
// The only input needed is the path to the directory created by YODA for the data file you want to analyze. |
| 7 |
// |
// |
| 8 |
// Changelog: |
// Changelog: |
| 9 |
// |
// |
| 10 |
|
// 1.09 - 1.11 (2006-07-17): Adapted to flight conditions. |
| 11 |
|
// |
| 12 |
|
// 1.07 - 1.09 (2006-05-29): Fixed bug in output filename when input is not in the form DW_YYMMDD_NNN. Bug in latchup alarm not coming from the status word, fixed. |
| 13 |
|
// |
| 14 |
// 1.06 - 1.07 (2006-05-23): Don't print warning in case of latchup not recognized from the status word, fixed. Added "expert" figures from 21 to 28 which appears only in the |
// 1.06 - 1.07 (2006-05-23): Don't print warning in case of latchup not recognized from the status word, fixed. Added "expert" figures from 21 to 28 which appears only in the |
| 15 |
// case of latchup alarm. |
// case of latchup alarm. |
| 16 |
// |
// |
| 69 |
} |
} |
| 70 |
|
|
| 71 |
TString getFilename(const TString filename){ |
TString getFilename(const TString filename){ |
| 72 |
const string fil = (const char*)filename; |
// |
| 73 |
Int_t posiz = fil.find("dw_"); |
const string fil = gSystem->BaseName(filename.Data()); |
| 74 |
if ( posiz == -1 ) posiz = fil.find("DW_"); |
Int_t posiz = fil.find(".root"); |
| 75 |
if ( posiz == -1 ) return 0; |
// |
|
Int_t posiz2 = posiz+13; |
|
| 76 |
TString file2; |
TString file2; |
| 77 |
stringcopy(file2,filename,posiz,posiz2); |
if ( posiz == -1 ){ |
| 78 |
TString pdat(".dat"); |
file2 = gSystem->BaseName(filename.Data()); |
| 79 |
stringappend(file2,pdat); |
} else { |
| 80 |
|
Int_t posiz2 = 0; |
| 81 |
|
stringcopy(file2,gSystem->BaseName(filename.Data()),posiz2,posiz); |
| 82 |
|
TString pdat(".dat"); |
| 83 |
|
stringappend(file2,pdat); |
| 84 |
|
}; |
| 85 |
return file2; |
return file2; |
| 86 |
} |
} |
| 87 |
|
|
| 88 |
void FCaloQLOOK(TString filename, Int_t fromevent=0, Int_t toevent=0, TString outDir="", TString saveas = "ps"){ |
void FCaloQLOOK(TString filename, Int_t fromevent=0, Int_t toevent=0, TString outDir="", TString saveas = "ps"){ |
| 89 |
gStyle->SetPaperSize(19.,25.); |
gStyle->SetPaperSize(19.,25.); |
| 90 |
const char* startingdir = gSystem->WorkingDirectory(); |
const char* startingdir = gSystem->WorkingDirectory(); |
| 91 |
|
// printf(" basename is %s \n",gSystem->BaseName(filename.Data())); |
| 92 |
|
// printf(" getfilename is %s \n",getFilename(filename).Data()); |
| 93 |
if ( !strcmp(outDir.Data(),"") ) outDir = startingdir; |
if ( !strcmp(outDir.Data(),"") ) outDir = startingdir; |
| 94 |
// |
// |
| 95 |
// |
// |
| 114 |
Float_t ctshitthr = 0.65; |
Float_t ctshitthr = 0.65; |
| 115 |
Float_t cbasethr = 0.95; |
Float_t cbasethr = 0.95; |
| 116 |
Float_t cdexythr = 0.995; |
Float_t cdexythr = 0.995; |
| 117 |
|
//Float_t cdexythr = 0.90; |
| 118 |
Float_t cdexycthr = 0.95; |
Float_t cdexycthr = 0.95; |
| 119 |
|
Float_t h1rth = 0.90; |
| 120 |
|
Int_t calevnth = 13; |
| 121 |
// |
// |
| 122 |
pamela::calorimeter::CalorimeterEvent *ce = 0; |
pamela::calorimeter::CalorimeterEvent *ce = 0; |
| 123 |
pamela::EventHeader *eh = 0; |
pamela::EventHeader *eh = 0; |
| 203 |
hdiff->SetBit(TH1F::kCanRebin); |
hdiff->SetBit(TH1F::kCanRebin); |
| 204 |
Baseline = new TH1F("C9","baselines",100,0,3); |
Baseline = new TH1F("C9","baselines",100,0,3); |
| 205 |
Baseline->SetBit(TH1F::kCanRebin); |
Baseline->SetBit(TH1F::kCanRebin); |
| 206 |
Dexy = new TH1F("C12","dexy",100,0.,37000.); |
Dexy = new TH1F("C12","dexy",100,0.,10000.); |
| 207 |
Dexyc = new TH1F("C10","dexyc",100,0,3); |
Dexy->SetBit(TH1F::kCanRebin); |
| 208 |
Dexyc->SetBit(TH1F::kCanRebin); |
Dexyc = new TH1F("C10","dexyc",100,-100.,37000.); |
| 209 |
|
// Dexyc->SetBit(TH1F::kCanRebin); |
| 210 |
Calstriphit = new TH1F("C11","calstriphit[1:4]",100,0.,200.); |
Calstriphit = new TH1F("C11","calstriphit[1:4]",100,0.,200.); |
| 211 |
|
|
| 212 |
calev01 = new TH1F("C3","|calevnum(1)-calevnum(2)|",100,0,1); |
calev01 = new TH1F("C3","|calevnum(1)-calevnum(2)|",100,0,1); |
| 287 |
bool isRAW = 0; |
bool isRAW = 0; |
| 288 |
Int_t alldexy=0; |
Int_t alldexy=0; |
| 289 |
Int_t alldexy2=0; |
Int_t alldexy2=0; |
| 290 |
Int_t stri=0; |
Int_t planebases=0; |
| 291 |
|
// Int_t stri=0; |
| 292 |
Int_t fcheck = 0; |
Int_t fcheck = 0; |
| 293 |
Int_t cestw=0; |
Int_t cestw=0; |
| 294 |
Int_t cmask = 127 ; |
Int_t cmask = 127 ; |
| 316 |
Float_t headc = 0.; |
Float_t headc = 0.; |
| 317 |
Float_t headco = 0.; |
Float_t headco = 0.; |
| 318 |
Bool_t h1rcheck = false; |
Bool_t h1rcheck = false; |
| 319 |
|
Int_t h1rin = 0; |
| 320 |
|
Int_t h1rout = 0; |
| 321 |
Int_t intshit = 0; |
Int_t intshit = 0; |
| 322 |
Int_t outtshit = 0; |
Int_t outtshit = 0; |
| 323 |
Int_t incshit = 0; |
Int_t incshit = 0; |
| 353 |
headco = headc; |
headco = headc; |
| 354 |
headc = ph->GetCounter(); |
headc = ph->GetCounter(); |
| 355 |
obt = ph->GetOrbitalTime(); |
obt = ph->GetOrbitalTime(); |
| 356 |
calevn1 += (int)abs((int)(ce->calevnum[0]-ce->calevnum[1])); |
if ( (int)abs((int)(ce->calevnum[0]-ce->calevnum[1])) ) calevn1++; |
| 357 |
calevn2 += (int)abs((int)(ce->calevnum[2]-ce->calevnum[3])); |
if ( (int)abs((int)(ce->calevnum[2]-ce->calevnum[3])) ) calevn2++; |
| 358 |
calevn3 += (int)abs((int)(ce->calevnum[0]-ce->calevnum[3])); |
if ( (int)abs((int)(ce->calevnum[0]-ce->calevnum[3])) ) calevn3++; |
| 359 |
|
// calevn1 += (int)abs((int)(ce->calevnum[0]-ce->calevnum[1])); |
| 360 |
|
// calevn2 += (int)abs((int)(ce->calevnum[2]-ce->calevnum[3])); |
| 361 |
|
// calevn3 += (int)abs((int)(ce->calevnum[0]-ce->calevnum[3])); |
| 362 |
calev01->Fill(abs((int)(ce->calevnum[0]-ce->calevnum[1]))); |
calev01->Fill(abs((int)(ce->calevnum[0]-ce->calevnum[1]))); |
| 363 |
calev23->Fill(abs((int)(ce->calevnum[2]-ce->calevnum[3]))); |
calev23->Fill(abs((int)(ce->calevnum[2]-ce->calevnum[3]))); |
| 364 |
calev03->Fill(abs((int)(ce->calevnum[0]-ce->calevnum[3]))); |
calev03->Fill(abs((int)(ce->calevnum[0]-ce->calevnum[3]))); |
| 444 |
bdone = 0; |
bdone = 0; |
| 445 |
bl++; |
bl++; |
| 446 |
allbase = ce->base[l][ii][bl]; |
allbase = ce->base[l][ii][bl]; |
| 447 |
|
// alldexy=0; |
| 448 |
|
// alldexy2=0; |
| 449 |
|
// stri=0; |
| 450 |
|
// for (Int_t e = 0; e < 16 ; e++ ){ |
| 451 |
|
// stri = e + 16 * bl; |
| 452 |
|
// alldexy += (int)ce->dexyc[l][ii][stri]; |
| 453 |
|
// alldexy2 += (int)ce->dexy[l][ii][stri]; |
| 454 |
|
// }; |
| 455 |
|
}; |
| 456 |
|
// |
| 457 |
|
if ( kk == 0 ){ |
| 458 |
|
planebases = 0; |
| 459 |
alldexy=0; |
alldexy=0; |
| 460 |
alldexy2=0; |
alldexy2=0; |
| 461 |
stri=0; |
for (Int_t e = 0; e < 96 ; e++ ){ |
| 462 |
for (Int_t e = 0; e < 16 ; e++ ){ |
if ( e < 6 ) planebases += (int)ce->base[l][ii][e]; |
| 463 |
stri = e + 16 * bl; |
alldexy += (int)ce->dexyc[l][ii][e]; |
| 464 |
alldexy += (int)ce->dexyc[l][ii][stri]; |
alldexy2 += (int)ce->dexy[l][ii][e]; |
|
alldexy2 += (int)ce->dexy[l][ii][stri]; |
|
| 465 |
}; |
}; |
| 466 |
}; |
}; |
| 467 |
|
// |
| 468 |
if ( !isRAW ) { |
if ( !isRAW ) { |
| 469 |
// |
// |
| 470 |
if ( !pdone ){ |
if ( !pdone ){ |
| 471 |
if ( (ce->base[l][ii][bl]>32000 || ce->base[l][ii][bl] == 0 ) && ( alldexy > 512000 || alldexy == 0) && ce->perror[se] == 0 ) { |
// if ( (ce->base[l][ii][bl]>32000 || ce->base[l][ii][bl] == 0 ) && ( alldexy > 512000 || alldexy == 0) && ce->perror[se] == 0 ) { |
| 472 |
|
if ( (planebases>192000 || planebases == 0 ) && ( alldexy > 3072000 || alldexy == 0) && ce->perror[se] == 0 ) { |
| 473 |
pdone = 1; |
pdone = 1; |
| 474 |
pshit[se][pl]++ ; |
pshit[se][pl]++ ; |
| 475 |
if ( (ce->stwerr[se] & (1 << 4)) == 0 ) { |
if ( (ce->stwerr[se] & (1 << 4)) == 0 ) { |
| 537 |
// |
// |
| 538 |
} else { |
} else { |
| 539 |
if ( !pdone ){ |
if ( !pdone ){ |
| 540 |
if ( (alldexy2>512000 || alldexy2 == 0) && ce->perror[se] == 0 ) { |
if ( ( alldexy2 > 3072000 || alldexy2 == 0) && ce->perror[se] == 0 ) { |
| 541 |
|
// if ( (alldexy2>512000 || alldexy2 == 0) && ce->perror[se] == 0 ) { |
| 542 |
pdone = 1; |
pdone = 1; |
| 543 |
pshit[se][pl]++ ; |
pshit[se][pl]++ ; |
| 544 |
if ( (ce->stwerr[se] & (1 << 4)) == 0 ){ |
if ( (ce->stwerr[se] & (1 << 4)) == 0 ){ |
| 607 |
trshit += rshit[k][kk]; |
trshit += rshit[k][kk]; |
| 608 |
}; |
}; |
| 609 |
}; |
}; |
| 610 |
Calstriphit->Fill(cshit); |
if (isCOMP || isFULL){ |
| 611 |
if ( (cshit > 0 && cshit < 25) || (cshit > 40 && cshit < 80) ){ |
Calstriphit->Fill(cshit); |
| 612 |
incshit++; |
// if ( (cshit > 0 && cshit < 25) || (cshit > 40 && cshit < 80) ){ |
| 613 |
} else { |
if ( (cshit > 10 && cshit < 100) ){ |
| 614 |
outcshit++; |
incshit++; |
| 615 |
}; |
} else { |
| 616 |
if ( tshit>0 ) h1->Fill(tshit); |
outcshit++; |
| 617 |
if ( (tshit > 0 && tshit < 25) || (tshit > 40 && tshit < 80) ){ |
}; |
| 618 |
intshit++; |
// |
| 619 |
} else { |
if ( tshit>0 ) h1->Fill(tshit); |
| 620 |
outtshit++; |
// if ( (tshit > 0 && tshit < 25) || (tshit > 40 && tshit < 80) ){ |
| 621 |
|
if ( (tshit > 10 && tshit < 100) ){ |
| 622 |
|
intshit++; |
| 623 |
|
} else { |
| 624 |
|
outtshit++; |
| 625 |
|
}; |
| 626 |
}; |
}; |
| 627 |
if ( trshit>0 ) { |
if ( trshit>0 ) { |
| 628 |
h1r->Fill(trshit); |
h1r->Fill(trshit); |
| 629 |
if ( trshit < 4210 ){ |
if ( trshit < 4210 ){ |
| 630 |
h1rcheck = true; |
h1rout++; |
| 631 |
// printf("ma come... trshit %i \n",trshit); |
// printf("ma come... trshit %i \n",trshit); |
| 632 |
|
} else { |
| 633 |
|
h1rin++; |
| 634 |
}; |
}; |
| 635 |
}; |
}; |
| 636 |
if ( i%1000 == 0 && i > 0 ) printf("%iK\n",i/1000); |
if ( i%1000 == 0 && i > 0 ) printf("%iK\n",i/1000); |
| 637 |
i++; |
i++; |
| 638 |
}; |
}; |
| 639 |
printf("\n"); |
printf("\n"); |
| 640 |
|
if ( (float)h1rout/((float)h1rin+(float)h1rout) > h1rth ){ |
| 641 |
|
h1rcheck = true; |
| 642 |
|
}; |
| 643 |
// |
// |
| 644 |
// output figures, first sheet: |
// output figures, first sheet: |
| 645 |
// |
// |
| 705 |
h1->Draw(); |
h1->Draw(); |
| 706 |
// |
// |
| 707 |
h1max = h1->GetMaximum()*1.05; |
h1max = h1->GetMaximum()*1.05; |
| 708 |
Double_t xc[4] = {0.,25.,25.,0.}; |
Double_t xc[4] = {10.,100.,100.,10.}; |
| 709 |
Double_t yc[4] = {0.,0.,h1max,h1max}; |
Double_t yc[4] = {0.,0.,h1max,h1max}; |
| 710 |
banda1 = new TPolyLine(4,xc,yc); |
banda1 = new TPolyLine(4,xc,yc); |
| 711 |
banda1->SetLineColor(5); |
banda1->SetLineColor(5); |
| 712 |
banda1->SetFillColor(5); |
banda1->SetFillColor(5); |
| 713 |
banda1->SetLineWidth(1); |
banda1->SetLineWidth(1); |
| 714 |
banda1->Draw("fSAME"); |
banda1->Draw("fSAME"); |
| 715 |
Double_t xd[4] = {40.,80.,80.,40.}; |
// Double_t xd[4] = {40.,80.,80.,40.}; |
| 716 |
Double_t yd[4] = {0.,0.,h1max,h1max}; |
// Double_t yd[4] = {0.,0.,h1max,h1max}; |
| 717 |
banda2 = new TPolyLine(4,xd,yd); |
// banda2 = new TPolyLine(4,xd,yd); |
| 718 |
banda2->SetLineColor(5); |
// banda2->SetLineColor(5); |
| 719 |
banda2->SetFillColor(5); |
// banda2->SetFillColor(5); |
| 720 |
banda2->SetLineWidth(1); |
// banda2->SetLineWidth(1); |
| 721 |
banda2->Draw("fSAME"); |
//banda2->Draw("fSAME"); |
| 722 |
h1->Draw("SAME"); |
h1->Draw("SAME"); |
| 723 |
// |
// |
| 724 |
figura->cd(); |
figura->cd(); |
| 755 |
h1->SetYTitle("Number of events"); |
h1->SetYTitle("Number of events"); |
| 756 |
h1->Draw(); |
h1->Draw(); |
| 757 |
h1max = h1->GetMaximum()*1.05; |
h1max = h1->GetMaximum()*1.05; |
| 758 |
Double_t xe[4] = {0.,25.,25.,0.}; |
Double_t xe[4] = {10.,100.,100.,10.}; |
| 759 |
Double_t ye[4] = {0.,0.,h1max,h1max}; |
Double_t ye[4] = {0.,0.,h1max,h1max}; |
| 760 |
banda1 = new TPolyLine(4,xe,ye); |
banda1 = new TPolyLine(4,xe,ye); |
| 761 |
banda1->SetLineColor(5); |
banda1->SetLineColor(5); |
| 762 |
banda1->SetFillColor(5); |
banda1->SetFillColor(5); |
| 763 |
banda1->SetLineWidth(1); |
banda1->SetLineWidth(1); |
| 764 |
banda1->Draw("fSAME"); |
banda1->Draw("fSAME"); |
| 765 |
Double_t xf[4] = {40.,80.,80.,40.}; |
// Double_t xf[4] = {40.,80.,80.,40.}; |
| 766 |
Double_t yf[4] = {0.,0.,h1max,h1max}; |
// Double_t yf[4] = {0.,0.,h1max,h1max}; |
| 767 |
banda2 = new TPolyLine(4,xf,yf); |
// banda2 = new TPolyLine(4,xf,yf); |
| 768 |
banda2->SetLineColor(5); |
// banda2->SetLineColor(5); |
| 769 |
banda2->SetFillColor(5); |
// banda2->SetFillColor(5); |
| 770 |
banda2->SetLineWidth(1); |
// banda2->SetLineWidth(1); |
| 771 |
banda2->Draw("fSAME"); |
// banda2->Draw("fSAME"); |
| 772 |
h1->Draw("SAME"); |
h1->Draw("SAME"); |
| 773 |
}; |
}; |
| 774 |
if ( trshit !=0 ) { |
if ( trshit !=0 ) { |
| 798 |
}; |
}; |
| 799 |
}; |
}; |
| 800 |
if ( !errorfull ) { |
if ( !errorfull ) { |
| 801 |
if ( calevn1 || calevn2 || calevn3 ) { |
if ( calevn1 > calevnth || calevn2 > calevnth || calevn3 > calevnth ) { |
| 802 |
pd1 = new TPad("pd1","This is pad1",0.02,0.51,0.24,0.98,45); |
pd1 = new TPad("pd1","This is pad1",0.02,0.51,0.24,0.98,45); |
| 803 |
pd2 = new TPad("pd2","This is pad2",0.26,0.51,0.49,0.98,45); |
pd2 = new TPad("pd2","This is pad2",0.26,0.51,0.49,0.98,45); |
| 804 |
pd3 = new TPad("pd3","This is pad3",0.02,0.02,0.24,0.49,45); |
pd3 = new TPad("pd3","This is pad3",0.02,0.02,0.24,0.49,45); |
| 973 |
Dexyc->Draw("SAME"); |
Dexyc->Draw("SAME"); |
| 974 |
// |
// |
| 975 |
pd3->cd(); |
pd3->cd(); |
| 976 |
|
// gPad->SetLogy(); |
| 977 |
Calstriphit->SetXTitle("Number of hit"); |
Calstriphit->SetXTitle("Number of hit"); |
| 978 |
Calstriphit->SetYTitle("Number of events"); |
Calstriphit->SetYTitle("Number of events"); |
| 979 |
Calstriphit->Draw(); |
Calstriphit->Draw(); |
| 980 |
h1max = Calstriphit->GetMaximum()*1.05; |
h1max = Calstriphit->GetMaximum()*1.05; |
| 981 |
Double_t xg[4] = {0.,25.,25.,0.}; |
Double_t xg[4] = {10.,100.,100.,10.}; |
| 982 |
Double_t yg[4] = {0.,0.,h1max,h1max}; |
Double_t yg[4] = {0.,0.,h1max,h1max}; |
| 983 |
banda1 = new TPolyLine(4,xg,yg); |
banda1 = new TPolyLine(4,xg,yg); |
| 984 |
banda1->SetLineColor(5); |
banda1->SetLineColor(5); |
| 985 |
banda1->SetFillColor(5); |
banda1->SetFillColor(5); |
| 986 |
banda1->SetLineWidth(1); |
banda1->SetLineWidth(1); |
| 987 |
banda1->Draw("fSAME"); |
banda1->Draw("fSAME"); |
| 988 |
Double_t xh[4] = {40.,80.,80.,40.}; |
// Double_t xh[4] = {40.,80.,80.,40.}; |
| 989 |
Double_t yh[4] = {0.,0.,h1max,h1max}; |
// Double_t yh[4] = {0.,0.,h1max,h1max}; |
| 990 |
banda2 = new TPolyLine(4,xh,yh); |
// banda2 = new TPolyLine(4,xh,yh); |
| 991 |
banda2->SetLineColor(5); |
// banda2->SetLineColor(5); |
| 992 |
banda2->SetFillColor(5); |
// banda2->SetFillColor(5); |
| 993 |
banda2->SetLineWidth(1); |
// banda2->SetLineWidth(1); |
| 994 |
banda2->Draw("fSAME"); |
// banda2->Draw("fSAME"); |
| 995 |
Calstriphit->Draw("SAME"); |
Calstriphit->Draw("SAME"); |
| 996 |
// |
// |
| 997 |
pd4->cd(); |
pd4->cd(); |
| 1103 |
pd7->Draw(); |
pd7->Draw(); |
| 1104 |
pd8->Draw(); |
pd8->Draw(); |
| 1105 |
pd1->cd(); |
pd1->cd(); |
| 1106 |
lup[0]->SetAxisRange((Double_t)minobt[0]*0.9,(Double_t)maxobt[0]*1.1,"X"); |
lup[0]->SetAxisRange((Double_t)min(minobt[0],swminobt[0])*0.9,(Double_t)max(maxobt[0],swmaxobt[0])*1.1,"X"); |
| 1107 |
|
lup[0]->SetXTitle("OBT"); |
| 1108 |
|
lup[0]->SetYTitle("Number of events"); |
| 1109 |
lup[0]->Draw(); |
lup[0]->Draw(); |
| 1110 |
pd5->cd(); |
pd5->cd(); |
| 1111 |
lupstw[0]->SetAxisRange((Double_t)swminobt[0]*0.9,(Double_t)swmaxobt[0]*1.1,"X"); |
lupstw[0]->SetAxisRange((Double_t)min(minobt[0],swminobt[0])*0.9,(Double_t)max(maxobt[0],swmaxobt[0])*1.1,"X"); |
| 1112 |
|
// lupstw[0]->SetAxisRange((Double_t)swminobt[0]*0.9,(Double_t)swmaxobt[0]*1.1,"X"); |
| 1113 |
|
lupstw[0]->SetXTitle("OBT"); |
| 1114 |
|
lupstw[0]->SetYTitle("Number of events"); |
| 1115 |
lupstw[0]->Draw(); |
lupstw[0]->Draw(); |
| 1116 |
pd2->cd(); |
pd2->cd(); |
| 1117 |
lup[1]->SetAxisRange((Double_t)minobt[1]*0.9,(Double_t)maxobt[1]*1.1,"X"); |
lup[1]->SetAxisRange((Double_t)min(minobt[1],swminobt[1])*0.9,(Double_t)max(maxobt[1],swmaxobt[1])*1.1,"X"); |
| 1118 |
|
// lup[1]->SetAxisRange((Double_t)minobt[1]*0.9,(Double_t)maxobt[1]*1.1,"X"); |
| 1119 |
|
lup[1]->SetXTitle("OBT"); |
| 1120 |
|
lup[1]->SetYTitle("Number of events"); |
| 1121 |
lup[1]->Draw(); |
lup[1]->Draw(); |
| 1122 |
pd6->cd(); |
pd6->cd(); |
| 1123 |
lupstw[1]->SetAxisRange((Double_t)swminobt[1]*0.9,(Double_t)swmaxobt[1]*1.1,"X"); |
lupstw[1]->SetAxisRange((Double_t)min(minobt[1],swminobt[1])*0.9,(Double_t)max(maxobt[1],swmaxobt[1])*1.1,"X"); |
| 1124 |
|
// lupstw[1]->SetAxisRange((Double_t)swminobt[1]*0.9,(Double_t)swmaxobt[1]*1.1,"X"); |
| 1125 |
|
lupstw[1]->SetXTitle("OBT"); |
| 1126 |
|
lupstw[1]->SetYTitle("Number of events"); |
| 1127 |
lupstw[1]->Draw(); |
lupstw[1]->Draw(); |
| 1128 |
pd3->cd(); |
pd3->cd(); |
| 1129 |
lup[2]->SetAxisRange((Double_t)minobt[2]*0.9,(Double_t)maxobt[2]*1.1,"X"); |
lup[2]->SetAxisRange((Double_t)min(minobt[2],swminobt[2])*0.9,(Double_t)max(maxobt[2],swmaxobt[2])*1.1,"X"); |
| 1130 |
|
// lup[2]->SetAxisRange((Double_t)minobt[2]*0.9,(Double_t)maxobt[2]*1.1,"X"); |
| 1131 |
|
lup[2]->SetXTitle("OBT"); |
| 1132 |
|
lup[2]->SetYTitle("Number of events"); |
| 1133 |
lup[2]->Draw(); |
lup[2]->Draw(); |
| 1134 |
pd7->cd(); |
pd7->cd(); |
| 1135 |
lupstw[2]->SetAxisRange((Double_t)swminobt[2]*0.9,(Double_t)swmaxobt[2]*1.1,"X"); |
lupstw[2]->SetAxisRange((Double_t)min(minobt[2],swminobt[2])*0.9,(Double_t)max(maxobt[2],swmaxobt[2])*1.1,"X"); |
| 1136 |
|
// lupstw[2]->SetAxisRange((Double_t)swminobt[2]*0.9,(Double_t)swmaxobt[2]*1.1,"X"); |
| 1137 |
|
lupstw[2]->SetXTitle("OBT"); |
| 1138 |
|
lupstw[2]->SetYTitle("Number of events"); |
| 1139 |
lupstw[2]->Draw(); |
lupstw[2]->Draw(); |
| 1140 |
pd4->cd(); |
pd4->cd(); |
| 1141 |
lup[3]->SetAxisRange((Double_t)minobt[3]*0.9,(Double_t)maxobt[3]*1.1,"X"); |
lup[3]->SetAxisRange((Double_t)min(minobt[3],swminobt[3])*0.9,(Double_t)max(maxobt[3],swmaxobt[3])*1.1,"X"); |
| 1142 |
|
// lup[3]->SetAxisRange((Double_t)minobt[3]*0.9,(Double_t)maxobt[3]*1.1,"X"); |
| 1143 |
|
lup[3]->SetXTitle("OBT"); |
| 1144 |
|
lup[3]->SetYTitle("Number of events"); |
| 1145 |
lup[3]->Draw(); |
lup[3]->Draw(); |
| 1146 |
pd8->cd(); |
pd8->cd(); |
| 1147 |
lupstw[3]->SetAxisRange((Double_t)swminobt[3]*0.9,(Double_t)swmaxobt[3]*1.1,"X"); |
lupstw[3]->SetAxisRange((Double_t)min(minobt[3],swminobt[3])*0.9,(Double_t)max(maxobt[3],swmaxobt[3])*1.1,"X"); |
| 1148 |
|
// lupstw[3]->SetAxisRange((Double_t)swminobt[3]*0.9,(Double_t)swmaxobt[3]*1.1,"X"); |
| 1149 |
|
lupstw[3]->SetXTitle("OBT"); |
| 1150 |
|
lupstw[3]->SetYTitle("Number of events"); |
| 1151 |
lupstw[3]->Draw(); |
lupstw[3]->Draw(); |
| 1152 |
}; |
}; |
| 1153 |
// |
// |
| 1304 |
errore << "Missing section: " << ver[i][j]; |
errore << "Missing section: " << ver[i][j]; |
| 1305 |
errore << " time(s)"; |
errore << " time(s)"; |
| 1306 |
t->DrawLatex(2.,50.,errore.str().c_str()); |
t->DrawLatex(2.,50.,errore.str().c_str()); |
| 1307 |
check = true; |
if ( ver[i][j] > 3 ) check = true; |
| 1308 |
} |
} |
| 1309 |
if (j == 10) { |
if (j == 10) { |
| 1310 |
errore.str(""); |
errore.str(""); |
| 1318 |
errore << "CRC error (data): " << ver[i][j]; |
errore << "CRC error (data): " << ver[i][j]; |
| 1319 |
errore << " time(s)"; |
errore << " time(s)"; |
| 1320 |
t->DrawLatex(2.,38.,errore.str().c_str()); |
t->DrawLatex(2.,38.,errore.str().c_str()); |
| 1321 |
check = true; |
if ( ver[i][j] > 10 ) check = true; |
| 1322 |
} |
} |
| 1323 |
if (j == 12) { |
if (j == 12) { |
| 1324 |
errore.str(""); |
errore.str(""); |
| 1431 |
t->DrawLatex(60.,95.," OK! "); |
t->DrawLatex(60.,95.," OK! "); |
| 1432 |
}; |
}; |
| 1433 |
// |
// |
| 1434 |
const string fil = (const char*)filename; |
// const string fil = (const char*)filename; |
| 1435 |
Int_t posiz = fil.find("dw_"); |
// Int_t posiz = fil.find("dw_"); |
| 1436 |
if ( posiz == -1 ) posiz = fil.find("DW_"); |
// if ( posiz == -1 ) posiz = fil.find("DW_"); |
| 1437 |
Int_t posiz2 = posiz+13; |
// Int_t posiz2 = posiz+13; |
| 1438 |
TString file2; |
// TString file2; |
| 1439 |
stringcopy(file2,filename,posiz,posiz2); |
// stringcopy(file2,filename,posiz,posiz2); |
| 1440 |
|
// |
| 1441 |
|
const string fil = gSystem->BaseName(filename.Data()); |
| 1442 |
|
Int_t posiz = fil.find(".root"); |
| 1443 |
// |
// |
| 1444 |
|
TString file2; |
| 1445 |
|
if ( posiz == -1 ){ |
| 1446 |
|
file2 = gSystem->BaseName(filename.Data()); |
| 1447 |
|
} else { |
| 1448 |
|
Int_t posiz2 = 0; |
| 1449 |
|
stringcopy(file2,gSystem->BaseName(filename.Data()),posiz2,posiz); |
| 1450 |
|
}; |
| 1451 |
const char *figrec = file2; |
const char *figrec = file2; |
| 1452 |
|
// |
| 1453 |
const char *outdir = outDir; |
const char *outdir = outDir; |
| 1454 |
stringstream figsave; |
stringstream figsave; |
| 1455 |
stringstream figsave1; |
stringstream figsave1; |
| 1458 |
if ( !strcmp(format,"ps") ) { |
if ( !strcmp(format,"ps") ) { |
| 1459 |
figsave.str(""); |
figsave.str(""); |
| 1460 |
figsave << outdir << "/" ; |
figsave << outdir << "/" ; |
| 1461 |
figsave << figrec << "_qlook."; |
figsave << figrec << "_CaloQLOOK."; |
| 1462 |
figsave << format << "("; |
figsave << format << "("; |
| 1463 |
rapporto->Print(figsave.str().c_str(),"Landscape"); |
rapporto->Print(figsave.str().c_str(),"Landscape"); |
| 1464 |
figsave1.str(""); |
figsave1.str(""); |
| 1465 |
figsave1 << outdir << "/" ; |
figsave1 << outdir << "/" ; |
| 1466 |
figsave1 << figrec << "_qlook."; |
figsave1 << figrec << "_CaloQLOOK."; |
| 1467 |
figsave1 << format; |
figsave1 << format; |
| 1468 |
figura->Print(figsave1.str().c_str(),"Landscape"); |
figura->Print(figsave1.str().c_str(),"Landscape"); |
| 1469 |
figsave2.str(""); |
figsave2.str(""); |
| 1470 |
figsave2 << outdir << "/" ; |
figsave2 << outdir << "/" ; |
| 1471 |
figsave2 << figrec << "_qlook."; |
figsave2 << figrec << "_CaloQLOOK."; |
| 1472 |
if ( printfigure3 ){ |
if ( printfigure3 ){ |
| 1473 |
figsave2 << format; |
figsave2 << format; |
| 1474 |
figura2->Print(figsave2.str().c_str(),"Landscape"); |
figura2->Print(figsave2.str().c_str(),"Landscape"); |
| 1475 |
figsave2.str(""); |
figsave2.str(""); |
| 1476 |
figsave2 << outdir << "/" ; |
figsave2 << outdir << "/" ; |
| 1477 |
figsave2 << figrec << "_qlook."; |
figsave2 << figrec << "_CaloQLOOK."; |
| 1478 |
figsave2 << format << ")"; |
figsave2 << format << ")"; |
| 1479 |
figura3->Print(figsave2.str().c_str(),"Landscape"); |
figura3->Print(figsave2.str().c_str(),"Landscape"); |
| 1480 |
} else { |
} else { |
| 1484 |
} else { |
} else { |
| 1485 |
figsave.str(""); |
figsave.str(""); |
| 1486 |
figsave << outdir << "/" ; |
figsave << outdir << "/" ; |
| 1487 |
figsave << figrec << "_qlook1."; |
figsave << figrec << "_CaloQLOOK1."; |
| 1488 |
figsave << format; |
figsave << format; |
| 1489 |
figura->SaveAs(figsave.str().c_str()); |
figura->SaveAs(figsave.str().c_str()); |
| 1490 |
figsave.str(""); |
figsave.str(""); |
| 1491 |
figsave << outdir << "/" ; |
figsave << outdir << "/" ; |
| 1492 |
figsave << figrec << "_qlook2."; |
figsave << figrec << "_CaloQLOOK2."; |
| 1493 |
figsave << format; |
figsave << format; |
| 1494 |
figura2->SaveAs(figsave.str().c_str()); |
figura2->SaveAs(figsave.str().c_str()); |
| 1495 |
if ( printfigure3 ){ |
if ( printfigure3 ){ |
| 1496 |
figsave.str(""); |
figsave.str(""); |
| 1497 |
figsave << outdir << "/" ; |
figsave << outdir << "/" ; |
| 1498 |
figsave << figrec << "_qlook2bis."; |
figsave << figrec << "_CaloQLOOK2bis."; |
| 1499 |
figsave << format; |
figsave << format; |
| 1500 |
figura3->SaveAs(figsave.str().c_str()); |
figura3->SaveAs(figsave.str().c_str()); |
| 1501 |
}; |
}; |
| 1502 |
figsave.str(""); |
figsave.str(""); |
| 1503 |
figsave << outdir << "/" ; |
figsave << outdir << "/" ; |
| 1504 |
figsave << figrec << "_qlook3."; |
figsave << figrec << "_CaloQLOOK3."; |
| 1505 |
figsave << format; |
figsave << format; |
| 1506 |
rapporto->SaveAs(figsave.str().c_str()); |
rapporto->SaveAs(figsave.str().c_str()); |
| 1507 |
}; |
}; |