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.03 (2006-03-20) |
// FCaloQLOOK.c version 1.09 (2006-05-29) |
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.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. |
11 |
|
// |
12 |
|
// 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 |
13 |
|
// case of latchup alarm. |
14 |
|
// |
15 |
|
// 1.05 - 1.06 (2006-03-22): Add optimize flag in compiling the script! |
16 |
|
// |
17 |
|
// 1.04 - 1.05 (2006-03-22): Corrected wrong .C files. |
18 |
|
// |
19 |
|
// 1.03 - 1.04 (2006-03-20): Documentation updated. |
20 |
|
// |
21 |
// 1.02 - 1.03 (2006-03-20): Changed name of shared libraries (from FCaloQLOOK_cxx.so to libFCaloQLOOK.so). |
// 1.02 - 1.03 (2006-03-20): Changed name of shared libraries (from FCaloQLOOK_cxx.so to libFCaloQLOOK.so). |
22 |
// |
// |
23 |
// 1.01 - 1.02 (2006-03-13): Include files from YODA without "event" directory. |
// 1.01 - 1.02 (2006-03-13): Include files from YODA without "event" directory. |
67 |
} |
} |
68 |
|
|
69 |
TString getFilename(const TString filename){ |
TString getFilename(const TString filename){ |
70 |
const string fil = (const char*)filename; |
// |
71 |
Int_t posiz = fil.find("dw_"); |
const string fil = gSystem->BaseName(filename.Data()); |
72 |
if ( posiz == -1 ) posiz = fil.find("DW_"); |
Int_t posiz = fil.find(".root"); |
73 |
if ( posiz == -1 ) return 0; |
// |
|
Int_t posiz2 = posiz+13; |
|
74 |
TString file2; |
TString file2; |
75 |
stringcopy(file2,filename,posiz,posiz2); |
if ( posiz == -1 ){ |
76 |
TString pdat(".dat"); |
file2 = gSystem->BaseName(filename.Data()); |
77 |
stringappend(file2,pdat); |
} else { |
78 |
|
Int_t posiz2 = 0; |
79 |
|
stringcopy(file2,gSystem->BaseName(filename.Data()),posiz2,posiz); |
80 |
|
TString pdat(".dat"); |
81 |
|
stringappend(file2,pdat); |
82 |
|
}; |
83 |
return file2; |
return file2; |
84 |
} |
} |
85 |
|
|
86 |
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"){ |
87 |
gStyle->SetPaperSize(19.,25.); |
gStyle->SetPaperSize(19.,25.); |
88 |
const char* startingdir = gSystem->WorkingDirectory(); |
const char* startingdir = gSystem->WorkingDirectory(); |
89 |
|
// printf(" basename is %s \n",gSystem->BaseName(filename.Data())); |
90 |
|
// printf(" getfilename is %s \n",getFilename(filename).Data()); |
91 |
if ( !strcmp(outDir.Data(),"") ) outDir = startingdir; |
if ( !strcmp(outDir.Data(),"") ) outDir = startingdir; |
92 |
// |
// |
93 |
// |
// |
187 |
TH1F *calev01; |
TH1F *calev01; |
188 |
TH1F *calev23; |
TH1F *calev23; |
189 |
TH1F *calev03; |
TH1F *calev03; |
190 |
|
TH1F *lupstw[4]; |
191 |
|
TH1F *lup[4]; |
192 |
TH2D *calev2; |
TH2D *calev2; |
193 |
|
|
194 |
h1 = new TH1F("C7","Strips hit, compress mode",100,0.,200.); |
h1 = new TH1F("C7","Strips hit, compress mode",100,0.,200.); |
211 |
calev03->SetBit(TH1F::kCanRebin); |
calev03->SetBit(TH1F::kCanRebin); |
212 |
calev2 = new TH2D("C2","calevnum(2)%iev",3000,0.,2.,100,0.,2.); |
calev2 = new TH2D("C2","calevnum(2)%iev",3000,0.,2.,100,0.,2.); |
213 |
calev2->SetBit(TH2D::kCanRebin); |
calev2->SetBit(TH2D::kCanRebin); |
214 |
|
|
215 |
|
stringstream oss; |
216 |
|
stringstream noss; |
217 |
|
for ( Int_t i=0; i<4; i++){ |
218 |
|
oss.str(""); |
219 |
|
oss << "OBT stw latch up section " << i; |
220 |
|
noss.str(""); |
221 |
|
noss << "C" << 21+i; |
222 |
|
lupstw[i] = new TH1F(noss.str().c_str(),oss.str().c_str(),100,-1,1); |
223 |
|
lupstw[i]->SetBit(TH1F::kCanRebin); |
224 |
|
oss.str(""); |
225 |
|
oss << "OBT no stw latch up section " << i; |
226 |
|
noss.str(""); |
227 |
|
noss << "C" << 25+i; |
228 |
|
lup[i] = new TH1F(noss.str().c_str(),oss.str().c_str(),100,-1,1); |
229 |
|
lup[i]->SetBit(TH1F::kCanRebin); |
230 |
|
}; |
231 |
|
|
232 |
// |
// |
233 |
// run over each event and take out some variables |
// run over each event and take out some variables |
234 |
// |
// |
281 |
bool isRAW = 0; |
bool isRAW = 0; |
282 |
Int_t alldexy=0; |
Int_t alldexy=0; |
283 |
Int_t alldexy2=0; |
Int_t alldexy2=0; |
284 |
Int_t stri=0; |
Int_t planebases=0; |
285 |
|
// Int_t stri=0; |
286 |
Int_t fcheck = 0; |
Int_t fcheck = 0; |
287 |
Int_t cestw=0; |
Int_t cestw=0; |
288 |
Int_t cmask = 127 ; |
Int_t cmask = 127 ; |
320 |
Int_t outdexy = 0; |
Int_t outdexy = 0; |
321 |
Int_t indexyc = 0; |
Int_t indexyc = 0; |
322 |
Int_t outdexyc = 0; |
Int_t outdexyc = 0; |
323 |
|
Int_t obt = 0; |
324 |
|
Int_t minobt[4]; |
325 |
|
Int_t maxobt[4]; |
326 |
|
Int_t swminobt[4]; |
327 |
|
Int_t swmaxobt[4]; |
328 |
|
Bool_t firstobt[4]; |
329 |
|
Bool_t swfirstobt[4]; |
330 |
|
for ( Int_t i = 0; i<4; i++){ |
331 |
|
minobt[i] = 0; |
332 |
|
maxobt[i] = 0; |
333 |
|
swminobt[i] = 0; |
334 |
|
swmaxobt[i] = 0; |
335 |
|
firstobt[i] = true; |
336 |
|
swfirstobt[i] = true; |
337 |
|
}; |
338 |
while ( i < maxevent+1){ |
while ( i < maxevent+1){ |
339 |
tshit = 0; |
tshit = 0; |
340 |
trshit = 0; |
trshit = 0; |
344 |
ph = eh->GetPscuHeader(); |
ph = eh->GetPscuHeader(); |
345 |
headco = headc; |
headco = headc; |
346 |
headc = ph->GetCounter(); |
headc = ph->GetCounter(); |
347 |
|
obt = ph->GetOrbitalTime(); |
348 |
calevn1 += (int)abs((int)(ce->calevnum[0]-ce->calevnum[1])); |
calevn1 += (int)abs((int)(ce->calevnum[0]-ce->calevnum[1])); |
349 |
calevn2 += (int)abs((int)(ce->calevnum[2]-ce->calevnum[3])); |
calevn2 += (int)abs((int)(ce->calevnum[2]-ce->calevnum[3])); |
350 |
calevn3 += (int)abs((int)(ce->calevnum[0]-ce->calevnum[3])); |
calevn3 += (int)abs((int)(ce->calevnum[0]-ce->calevnum[3])); |
433 |
bdone = 0; |
bdone = 0; |
434 |
bl++; |
bl++; |
435 |
allbase = ce->base[l][ii][bl]; |
allbase = ce->base[l][ii][bl]; |
436 |
|
// alldexy=0; |
437 |
|
// alldexy2=0; |
438 |
|
// stri=0; |
439 |
|
// for (Int_t e = 0; e < 16 ; e++ ){ |
440 |
|
// stri = e + 16 * bl; |
441 |
|
// alldexy += (int)ce->dexyc[l][ii][stri]; |
442 |
|
// alldexy2 += (int)ce->dexy[l][ii][stri]; |
443 |
|
// }; |
444 |
|
}; |
445 |
|
// |
446 |
|
if ( kk == 0 ){ |
447 |
|
planebases = 0; |
448 |
alldexy=0; |
alldexy=0; |
449 |
alldexy2=0; |
alldexy2=0; |
450 |
stri=0; |
for (Int_t e = 0; e < 96 ; e++ ){ |
451 |
for (Int_t e = 0; e < 16 ; e++ ){ |
if ( e < 6 ) planebases += (int)ce->base[l][ii][e]; |
452 |
stri = e + 16 * bl; |
alldexy += (int)ce->dexyc[l][ii][e]; |
453 |
alldexy += (int)ce->dexyc[l][ii][stri]; |
alldexy2 += (int)ce->dexy[l][ii][e]; |
|
alldexy2 += (int)ce->dexy[l][ii][stri]; |
|
454 |
}; |
}; |
455 |
}; |
}; |
456 |
|
// |
457 |
if ( !isRAW ) { |
if ( !isRAW ) { |
458 |
// |
// |
459 |
if ( !pdone ){ |
if ( !pdone ){ |
460 |
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 ) { |
461 |
|
if ( (planebases>192000 || planebases == 0 ) && ( alldexy > 3072000 || alldexy == 0) && ce->perror[se] == 0 ) { |
462 |
pdone = 1; |
pdone = 1; |
463 |
pshit[se][pl]++ ; |
pshit[se][pl]++ ; |
464 |
if ( (ce->stwerr[se] & (1 << 4)) == 0 ) lalarm[se]++; |
if ( (ce->stwerr[se] & (1 << 4)) == 0 ) { |
465 |
lver[se][2]++ ; |
lalarm[se]++; |
466 |
|
lup[se]->Fill(obt); |
467 |
|
if ( firstobt[se] ) minobt[se] = obt; |
468 |
|
if ( obt > maxobt[se] ) maxobt[se] = obt; |
469 |
|
}; |
470 |
|
lver[se][2]++ ; |
471 |
}; |
}; |
472 |
} |
} |
473 |
// |
// |
526 |
// |
// |
527 |
} else { |
} else { |
528 |
if ( !pdone ){ |
if ( !pdone ){ |
529 |
if ( (alldexy2>512000 || alldexy2 == 0) && ce->perror[se] == 0 ) { |
if ( ( alldexy2 > 3072000 || alldexy2 == 0) && ce->perror[se] == 0 ) { |
530 |
|
// if ( (alldexy2>512000 || alldexy2 == 0) && ce->perror[se] == 0 ) { |
531 |
pdone = 1; |
pdone = 1; |
532 |
pshit[se][pl]++ ; |
pshit[se][pl]++ ; |
533 |
if ( (ce->stwerr[se] & (1 << 4)) == 0 ) lalarm[se]++; |
if ( (ce->stwerr[se] & (1 << 4)) == 0 ){ |
534 |
|
lalarm[se]++; |
535 |
|
lup[se]->Fill(obt); |
536 |
|
if ( firstobt[se] ) minobt[se] = obt; |
537 |
|
if ( obt > maxobt[se] ) maxobt[se] = obt; |
538 |
|
}; |
539 |
lver[se][2]++ ; |
lver[se][2]++ ; |
540 |
}; |
}; |
541 |
}; |
}; |
569 |
if ( cestw & (1 << 1) ) ver[k][5]++ ; |
if ( cestw & (1 << 1) ) ver[k][5]++ ; |
570 |
if ( cestw & (1 << 2) ) ver[k][4]++ ; |
if ( cestw & (1 << 2) ) ver[k][4]++ ; |
571 |
if ( cestw & (1 << 3) ) ver[k][3]++ ; |
if ( cestw & (1 << 3) ) ver[k][3]++ ; |
572 |
if ( cestw & (1 << 4) ) ver[k][2]++ ; |
if ( cestw & (1 << 4) ){ |
573 |
|
ver[k][2]++ ; |
574 |
|
lupstw[k]->Fill(obt); |
575 |
|
if ( swfirstobt[k] ) swminobt[k] = obt; |
576 |
|
if ( obt > swmaxobt[k] ) swmaxobt[k] = obt; |
577 |
|
}; |
578 |
if ( cestw & (1 << 5) ) ver[k][1]++ ; |
if ( cestw & (1 << 5) ) ver[k][1]++ ; |
579 |
if ( cestw & (1 << 6) ) ver[k][0]++ ; |
if ( cestw & (1 << 6) ) ver[k][0]++ ; |
580 |
}; |
}; |
639 |
t->DrawLatex(2.,99.,errore.str().c_str()); |
t->DrawLatex(2.,99.,errore.str().c_str()); |
640 |
TPad *pd5; |
TPad *pd5; |
641 |
TPad *pd6; |
TPad *pd6; |
642 |
|
TPad *pd7; |
643 |
|
TPad *pd8; |
644 |
TPad *pad1; |
TPad *pad1; |
645 |
TPad *pad2; |
TPad *pad2; |
646 |
TPad *pad3; |
TPad *pad3; |
1027 |
Dexy->Draw("SAME"); |
Dexy->Draw("SAME"); |
1028 |
}; |
}; |
1029 |
// |
// |
1030 |
|
TCanvas *figura3 = 0; |
1031 |
|
Bool_t printfigure3 = false; |
1032 |
|
for (Int_t i = 0; i<4; i++){ |
1033 |
|
if ( ver[i][2] || lver[i][2] ){ |
1034 |
|
printfigure3 = true; |
1035 |
|
break; |
1036 |
|
}; |
1037 |
|
}; |
1038 |
|
if ( printfigure3 ){ |
1039 |
|
figura3 = new TCanvas("Calorimeter_Detector_Report_2bis/3","Calorimeter_Detector_Report_2bis/3", 1100, 900); |
1040 |
|
figura3->SetFillColor(10); |
1041 |
|
figura3->Range(0,0,100,100); |
1042 |
|
errore.str(""); |
1043 |
|
errore << "EXPERT -- File: " << file; |
1044 |
|
errore << " "; |
1045 |
|
t=new TLatex(); |
1046 |
|
t->SetTextFont(32); |
1047 |
|
t->SetTextColor(1); |
1048 |
|
t->SetTextAlign(12); |
1049 |
|
t->SetTextSize(0.015); |
1050 |
|
t->DrawLatex(2.,99.,errore.str().c_str()); |
1051 |
|
pd1 = new TPad("pd1","This is pad1",0.02,0.51,0.49,0.73,45); |
1052 |
|
pd5 = new TPad("pd5","This is pad5",0.02,0.76,0.49,0.98,45); |
1053 |
|
pd2 = new TPad("pd2","This is pad2",0.51,0.51,0.98,0.73,45); |
1054 |
|
pd6 = new TPad("pd6","This is pad6",0.51,0.76,0.98,0.98,45); |
1055 |
|
pd3 = new TPad("pd3","This is pad3",0.02,0.02,0.49,0.23,45); |
1056 |
|
pd7 = new TPad("pd7","This is pad7",0.02,0.26,0.49,0.49,45); |
1057 |
|
pd4 = new TPad("pd4","This is pad4",0.51,0.02,0.98,0.23,45); |
1058 |
|
pd8 = new TPad("pd8","This is pad8",0.51,0.26,0.98,0.49,45); |
1059 |
|
figura3->cd(); |
1060 |
|
pd1->Range(0,0,100,100); |
1061 |
|
pd2->Range(0,0,100,100); |
1062 |
|
pd3->Range(0,0,100,100); |
1063 |
|
pd4->Range(0,0,100,100); |
1064 |
|
pd1->SetTicks(); |
1065 |
|
pd2->SetTicks(); |
1066 |
|
pd3->SetTicks(); |
1067 |
|
pd4->SetTicks(); |
1068 |
|
pd1->Draw(); |
1069 |
|
pd2->Draw(); |
1070 |
|
pd3->Draw(); |
1071 |
|
pd4->Draw(); |
1072 |
|
pd5->Range(0,0,100,100); |
1073 |
|
pd6->Range(0,0,100,100); |
1074 |
|
pd7->Range(0,0,100,100); |
1075 |
|
pd8->Range(0,0,100,100); |
1076 |
|
pd5->SetTicks(); |
1077 |
|
pd6->SetTicks(); |
1078 |
|
pd7->SetTicks(); |
1079 |
|
pd8->SetTicks(); |
1080 |
|
pd5->Draw(); |
1081 |
|
pd6->Draw(); |
1082 |
|
pd7->Draw(); |
1083 |
|
pd8->Draw(); |
1084 |
|
pd1->cd(); |
1085 |
|
lup[0]->SetAxisRange((Double_t)min(minobt[0],swminobt[0])*0.9,(Double_t)max(maxobt[0],swmaxobt[0])*1.1,"X"); |
1086 |
|
lup[0]->SetXTitle("OBT"); |
1087 |
|
lup[0]->SetYTitle("Number of events"); |
1088 |
|
lup[0]->Draw(); |
1089 |
|
pd5->cd(); |
1090 |
|
lupstw[0]->SetAxisRange((Double_t)min(minobt[0],swminobt[0])*0.9,(Double_t)max(maxobt[0],swmaxobt[0])*1.1,"X"); |
1091 |
|
// lupstw[0]->SetAxisRange((Double_t)swminobt[0]*0.9,(Double_t)swmaxobt[0]*1.1,"X"); |
1092 |
|
lupstw[0]->SetXTitle("OBT"); |
1093 |
|
lupstw[0]->SetYTitle("Number of events"); |
1094 |
|
lupstw[0]->Draw(); |
1095 |
|
pd2->cd(); |
1096 |
|
lup[1]->SetAxisRange((Double_t)min(minobt[1],swminobt[1])*0.9,(Double_t)max(maxobt[1],swmaxobt[1])*1.1,"X"); |
1097 |
|
// lup[1]->SetAxisRange((Double_t)minobt[1]*0.9,(Double_t)maxobt[1]*1.1,"X"); |
1098 |
|
lup[1]->SetXTitle("OBT"); |
1099 |
|
lup[1]->SetYTitle("Number of events"); |
1100 |
|
lup[1]->Draw(); |
1101 |
|
pd6->cd(); |
1102 |
|
lupstw[1]->SetAxisRange((Double_t)min(minobt[1],swminobt[1])*0.9,(Double_t)max(maxobt[1],swmaxobt[1])*1.1,"X"); |
1103 |
|
// lupstw[1]->SetAxisRange((Double_t)swminobt[1]*0.9,(Double_t)swmaxobt[1]*1.1,"X"); |
1104 |
|
lupstw[1]->SetXTitle("OBT"); |
1105 |
|
lupstw[1]->SetYTitle("Number of events"); |
1106 |
|
lupstw[1]->Draw(); |
1107 |
|
pd3->cd(); |
1108 |
|
lup[2]->SetAxisRange((Double_t)min(minobt[2],swminobt[2])*0.9,(Double_t)max(maxobt[2],swmaxobt[2])*1.1,"X"); |
1109 |
|
// lup[2]->SetAxisRange((Double_t)minobt[2]*0.9,(Double_t)maxobt[2]*1.1,"X"); |
1110 |
|
lup[2]->SetXTitle("OBT"); |
1111 |
|
lup[2]->SetYTitle("Number of events"); |
1112 |
|
lup[2]->Draw(); |
1113 |
|
pd7->cd(); |
1114 |
|
lupstw[2]->SetAxisRange((Double_t)min(minobt[2],swminobt[2])*0.9,(Double_t)max(maxobt[2],swmaxobt[2])*1.1,"X"); |
1115 |
|
// lupstw[2]->SetAxisRange((Double_t)swminobt[2]*0.9,(Double_t)swmaxobt[2]*1.1,"X"); |
1116 |
|
lupstw[2]->SetXTitle("OBT"); |
1117 |
|
lupstw[2]->SetYTitle("Number of events"); |
1118 |
|
lupstw[2]->Draw(); |
1119 |
|
pd4->cd(); |
1120 |
|
lup[3]->SetAxisRange((Double_t)min(minobt[3],swminobt[3])*0.9,(Double_t)max(maxobt[3],swmaxobt[3])*1.1,"X"); |
1121 |
|
// lup[3]->SetAxisRange((Double_t)minobt[3]*0.9,(Double_t)maxobt[3]*1.1,"X"); |
1122 |
|
lup[3]->SetXTitle("OBT"); |
1123 |
|
lup[3]->SetYTitle("Number of events"); |
1124 |
|
lup[3]->Draw(); |
1125 |
|
pd8->cd(); |
1126 |
|
lupstw[3]->SetAxisRange((Double_t)min(minobt[3],swminobt[3])*0.9,(Double_t)max(maxobt[3],swmaxobt[3])*1.1,"X"); |
1127 |
|
// lupstw[3]->SetAxisRange((Double_t)swminobt[3]*0.9,(Double_t)swmaxobt[3]*1.1,"X"); |
1128 |
|
lupstw[3]->SetXTitle("OBT"); |
1129 |
|
lupstw[3]->SetYTitle("Number of events"); |
1130 |
|
lupstw[3]->Draw(); |
1131 |
|
}; |
1132 |
|
// |
1133 |
// output figures, report sheet: |
// output figures, report sheet: |
1134 |
// |
// |
1135 |
TCanvas *rapporto= new TCanvas("Calorimeter_Detector_Report_3/3", "Calorimeter_Detector_Report_3/3", 1100, 900); |
TCanvas *rapporto= new TCanvas("Calorimeter_Detector_Report_3/3", "Calorimeter_Detector_Report_3/3", 1100, 900); |
1206 |
check = true; |
check = true; |
1207 |
} |
} |
1208 |
if (j == 2) { |
if (j == 2) { |
1209 |
|
// printf("boh! lalarm[%i] = %i \n",i,lalarm[i]); |
1210 |
if ( lalarm[i] ){ |
if ( lalarm[i] ){ |
1211 |
errore.str(""); |
errore.str(""); |
1212 |
errore << "* Latch up: " << ver[i][j]; |
errore << "* Latch up: " << ver[i][j]; |
1213 |
errore << " (" << lalarm[i]; |
errore << " (" << lalarm[i]; |
1214 |
errore << " NOT rec!): "; |
errore << " NOT rec!): "; |
1215 |
t->DrawLatex(0.,70.,errore.str().c_str()); |
t->DrawLatex(2.,70.,errore.str().c_str()); |
1216 |
check = true; |
check = true; |
1217 |
} else { |
} else { |
1218 |
errore.str(""); |
errore.str(""); |
1410 |
t->DrawLatex(60.,95.," OK! "); |
t->DrawLatex(60.,95.," OK! "); |
1411 |
}; |
}; |
1412 |
// |
// |
1413 |
const string fil = (const char*)filename; |
// const string fil = (const char*)filename; |
1414 |
Int_t posiz = fil.find("dw_"); |
// Int_t posiz = fil.find("dw_"); |
1415 |
if ( posiz == -1 ) posiz = fil.find("DW_"); |
// if ( posiz == -1 ) posiz = fil.find("DW_"); |
1416 |
Int_t posiz2 = posiz+13; |
// Int_t posiz2 = posiz+13; |
1417 |
TString file2; |
// TString file2; |
1418 |
stringcopy(file2,filename,posiz,posiz2); |
// stringcopy(file2,filename,posiz,posiz2); |
1419 |
// |
// |
1420 |
|
const string fil = gSystem->BaseName(filename.Data()); |
1421 |
|
Int_t posiz = fil.find(".root"); |
1422 |
|
// |
1423 |
|
TString file2; |
1424 |
|
if ( posiz == -1 ){ |
1425 |
|
file2 = gSystem->BaseName(filename.Data()); |
1426 |
|
} else { |
1427 |
|
Int_t posiz2 = 0; |
1428 |
|
stringcopy(file2,gSystem->BaseName(filename.Data()),posiz2,posiz); |
1429 |
|
}; |
1430 |
const char *figrec = file2; |
const char *figrec = file2; |
1431 |
|
// |
1432 |
const char *outdir = outDir; |
const char *outdir = outDir; |
1433 |
stringstream figsave; |
stringstream figsave; |
1434 |
stringstream figsave1; |
stringstream figsave1; |
1437 |
if ( !strcmp(format,"ps") ) { |
if ( !strcmp(format,"ps") ) { |
1438 |
figsave.str(""); |
figsave.str(""); |
1439 |
figsave << outdir << "/" ; |
figsave << outdir << "/" ; |
1440 |
figsave << figrec << "_qlook."; |
figsave << figrec << "_CaloQLOOK."; |
1441 |
figsave << format << "("; |
figsave << format << "("; |
1442 |
rapporto->Print(figsave.str().c_str(),"Landscape"); |
rapporto->Print(figsave.str().c_str(),"Landscape"); |
1443 |
figsave1.str(""); |
figsave1.str(""); |
1444 |
figsave1 << outdir << "/" ; |
figsave1 << outdir << "/" ; |
1445 |
figsave1 << figrec << "_qlook."; |
figsave1 << figrec << "_CaloQLOOK."; |
1446 |
figsave1 << format; |
figsave1 << format; |
1447 |
figura->Print(figsave1.str().c_str(),"Landscape"); |
figura->Print(figsave1.str().c_str(),"Landscape"); |
1448 |
figsave2.str(""); |
figsave2.str(""); |
1449 |
figsave2 << outdir << "/" ; |
figsave2 << outdir << "/" ; |
1450 |
figsave2 << figrec << "_qlook."; |
figsave2 << figrec << "_CaloQLOOK."; |
1451 |
figsave2 << format << ")"; |
if ( printfigure3 ){ |
1452 |
figura2->Print(figsave2.str().c_str(),"Landscape"); |
figsave2 << format; |
1453 |
|
figura2->Print(figsave2.str().c_str(),"Landscape"); |
1454 |
|
figsave2.str(""); |
1455 |
|
figsave2 << outdir << "/" ; |
1456 |
|
figsave2 << figrec << "_CaloQLOOK."; |
1457 |
|
figsave2 << format << ")"; |
1458 |
|
figura3->Print(figsave2.str().c_str(),"Landscape"); |
1459 |
|
} else { |
1460 |
|
figsave2 << format << ")";; |
1461 |
|
figura2->Print(figsave2.str().c_str(),"Landscape"); |
1462 |
|
}; |
1463 |
} else { |
} else { |
1464 |
figsave.str(""); |
figsave.str(""); |
1465 |
figsave << outdir << "/" ; |
figsave << outdir << "/" ; |
1466 |
figsave << figrec << "_qlook1."; |
figsave << figrec << "_CaloQLOOK1."; |
1467 |
figsave << format; |
figsave << format; |
1468 |
figura->SaveAs(figsave.str().c_str()); |
figura->SaveAs(figsave.str().c_str()); |
1469 |
figsave.str(""); |
figsave.str(""); |
1470 |
figsave << outdir << "/" ; |
figsave << outdir << "/" ; |
1471 |
figsave << figrec << "_qlook2."; |
figsave << figrec << "_CaloQLOOK2."; |
1472 |
figsave << format; |
figsave << format; |
1473 |
figura2->SaveAs(figsave.str().c_str()); |
figura2->SaveAs(figsave.str().c_str()); |
1474 |
|
if ( printfigure3 ){ |
1475 |
|
figsave.str(""); |
1476 |
|
figsave << outdir << "/" ; |
1477 |
|
figsave << figrec << "_CaloQLOOK2bis."; |
1478 |
|
figsave << format; |
1479 |
|
figura3->SaveAs(figsave.str().c_str()); |
1480 |
|
}; |
1481 |
figsave.str(""); |
figsave.str(""); |
1482 |
figsave << outdir << "/" ; |
figsave << outdir << "/" ; |
1483 |
figsave << figrec << "_qlook3."; |
figsave << figrec << "_CaloQLOOK3."; |
1484 |
figsave << format; |
figsave << format; |
1485 |
rapporto->SaveAs(figsave.str().c_str()); |
rapporto->SaveAs(figsave.str().c_str()); |
1486 |
}; |
}; |