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.02 (2006-03-13) |
// FCaloQLOOK.c version 1.12 (2006-09-22) |
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.11 - 1.12 (2006-09-22): Check for different number of events, put output in a file and write down errors for each event. Fixed jumpev bug. |
11 |
|
// |
12 |
|
// 1.09 - 1.11 (2006-07-17): Adapted to flight conditions. |
13 |
|
// |
14 |
|
// 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. |
15 |
|
// |
16 |
|
// 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 |
17 |
|
// case of latchup alarm. |
18 |
|
// |
19 |
|
// 1.05 - 1.06 (2006-03-22): Add optimize flag in compiling the script! |
20 |
|
// |
21 |
|
// 1.04 - 1.05 (2006-03-22): Corrected wrong .C files. |
22 |
|
// |
23 |
|
// 1.03 - 1.04 (2006-03-20): Documentation updated. |
24 |
|
// |
25 |
|
// 1.02 - 1.03 (2006-03-20): Changed name of shared libraries (from FCaloQLOOK_cxx.so to libFCaloQLOOK.so). |
26 |
|
// |
27 |
// 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. |
28 |
// |
// |
29 |
// 1.00 - 1.01 (2006-02-28): Works on YODA v6 output (single file), does not require anymore calocommon package. |
// 1.00 - 1.01 (2006-02-28): Works on YODA v6 output (single file), does not require anymore calocommon package. |
45 |
#include <TPolyLine.h> |
#include <TPolyLine.h> |
46 |
#include <TStyle.h> |
#include <TStyle.h> |
47 |
#include <TSystem.h> |
#include <TSystem.h> |
48 |
|
#include <TApplication.h> |
49 |
// |
// |
50 |
#include <PamelaRun.h> |
#include <PamelaRun.h> |
51 |
#include <physics/calorimeter/CalorimeterEvent.h> |
#include <physics/calorimeter/CalorimeterEvent.h> |
72 |
} |
} |
73 |
|
|
74 |
TString getFilename(const TString filename){ |
TString getFilename(const TString filename){ |
75 |
const string fil = (const char*)filename; |
// |
76 |
Int_t posiz = fil.find("dw_"); |
const string fil = gSystem->BaseName(filename.Data()); |
77 |
if ( posiz == -1 ) posiz = fil.find("DW_"); |
Int_t posiz = fil.find(".root"); |
78 |
if ( posiz == -1 ) return 0; |
// |
|
Int_t posiz2 = posiz+13; |
|
79 |
TString file2; |
TString file2; |
80 |
stringcopy(file2,filename,posiz,posiz2); |
if ( posiz == -1 ){ |
81 |
TString pdat(".dat"); |
file2 = gSystem->BaseName(filename.Data()); |
82 |
stringappend(file2,pdat); |
} else { |
83 |
|
Int_t posiz2 = 0; |
84 |
|
stringcopy(file2,gSystem->BaseName(filename.Data()),posiz2,posiz); |
85 |
|
TString pdat(".dat"); |
86 |
|
stringappend(file2,pdat); |
87 |
|
}; |
88 |
return file2; |
return file2; |
89 |
} |
} |
90 |
|
|
91 |
void FCaloQLOOK(TString filename, Int_t fromevent=0, Int_t toevent=0, TString outDir="", TString saveas = "ps"){ |
void sighandler(UInt_t pkt_num, UInt_t obt, UInt_t entry, UInt_t section, UInt_t totev, Bool_t &evdone){ |
92 |
|
if ( !evdone ){ |
93 |
|
printf("\n\n=================================================\n"); |
94 |
|
printf("PSCU-Pkt N. %u - OBT %u ms\n",pkt_num,obt); |
95 |
|
printf("Total events %u\n",totev); |
96 |
|
printf("(ROOT-tree entry %u )\n",entry); |
97 |
|
printf("=================================================\n"); |
98 |
|
evdone = true; |
99 |
|
}; |
100 |
|
TString sec = "UNKNOWN"; |
101 |
|
if ( section == 0 ) sec = "XE"; |
102 |
|
if ( section == 1 ) sec = "XO"; |
103 |
|
if ( section == 2 ) sec = "YE"; |
104 |
|
if ( section == 3 ) sec = "YO"; |
105 |
|
printf(" Section %s (DSP n. %i) message: ",sec.Data(),section); |
106 |
|
}; |
107 |
|
|
108 |
|
void FCaloQLOOK(TString filename, Int_t fromevent=0, Int_t toevent=0, TString outDir="", TString saveas = "png", Bool_t iactive =false, Bool_t w4i=false){ |
109 |
gStyle->SetPaperSize(19.,25.); |
gStyle->SetPaperSize(19.,25.); |
110 |
const char* startingdir = gSystem->WorkingDirectory(); |
const char* startingdir = gSystem->WorkingDirectory(); |
111 |
|
// printf(" basename is %s \n",gSystem->BaseName(filename.Data())); |
112 |
|
// printf(" getfilename is %s \n",getFilename(filename).Data()); |
113 |
if ( !strcmp(outDir.Data(),"") ) outDir = startingdir; |
if ( !strcmp(outDir.Data(),"") ) outDir = startingdir; |
114 |
// |
// |
115 |
|
TApplication *app = 0; |
116 |
|
if ( iactive ) app = new TApplication("app",0,0); |
117 |
// |
// |
118 |
ifstream myfile; |
ifstream myfile; |
119 |
myfile.open(filename.Data()); |
myfile.open(filename.Data()); |
136 |
Float_t ctshitthr = 0.65; |
Float_t ctshitthr = 0.65; |
137 |
Float_t cbasethr = 0.95; |
Float_t cbasethr = 0.95; |
138 |
Float_t cdexythr = 0.995; |
Float_t cdexythr = 0.995; |
139 |
|
//Float_t cdexythr = 0.90; |
140 |
Float_t cdexycthr = 0.95; |
Float_t cdexycthr = 0.95; |
141 |
|
Float_t h1rth = 0.90; |
142 |
|
Int_t calevnth = 13; |
143 |
// |
// |
144 |
pamela::calorimeter::CalorimeterEvent *ce = 0; |
pamela::calorimeter::CalorimeterEvent *ce = 0; |
145 |
pamela::EventHeader *eh = 0; |
pamela::EventHeader *eh = 0; |
214 |
TH1F *calev01; |
TH1F *calev01; |
215 |
TH1F *calev23; |
TH1F *calev23; |
216 |
TH1F *calev03; |
TH1F *calev03; |
217 |
|
TH1F *lupstw[4]; |
218 |
|
TH1F *lup[4]; |
219 |
TH2D *calev2; |
TH2D *calev2; |
220 |
|
|
221 |
h1 = new TH1F("C7","Strips hit, compress mode",100,0.,200.); |
h1 = new TH1F("C7","Strips hit, compress mode",100,0.,200.); |
225 |
hdiff->SetBit(TH1F::kCanRebin); |
hdiff->SetBit(TH1F::kCanRebin); |
226 |
Baseline = new TH1F("C9","baselines",100,0,3); |
Baseline = new TH1F("C9","baselines",100,0,3); |
227 |
Baseline->SetBit(TH1F::kCanRebin); |
Baseline->SetBit(TH1F::kCanRebin); |
228 |
Dexy = new TH1F("C12","dexy",100,0.,37000.); |
Dexy = new TH1F("C12","dexy",100,0.,10000.); |
229 |
Dexyc = new TH1F("C10","dexyc",100,0,3); |
Dexy->SetBit(TH1F::kCanRebin); |
230 |
Dexyc->SetBit(TH1F::kCanRebin); |
Dexyc = new TH1F("C10","dexyc",100,-100.,37000.); |
231 |
|
// Dexyc->SetBit(TH1F::kCanRebin); |
232 |
Calstriphit = new TH1F("C11","calstriphit[1:4]",100,0.,200.); |
Calstriphit = new TH1F("C11","calstriphit[1:4]",100,0.,200.); |
233 |
|
|
234 |
calev01 = new TH1F("C3","|calevnum(1)-calevnum(2)|",100,0,1); |
calev01 = new TH1F("C3","|calevnum(1)-calevnum(2)|",100,0,1); |
239 |
calev03->SetBit(TH1F::kCanRebin); |
calev03->SetBit(TH1F::kCanRebin); |
240 |
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.); |
241 |
calev2->SetBit(TH2D::kCanRebin); |
calev2->SetBit(TH2D::kCanRebin); |
242 |
|
|
243 |
|
stringstream oss; |
244 |
|
stringstream noss; |
245 |
|
for ( Int_t i=0; i<4; i++){ |
246 |
|
oss.str(""); |
247 |
|
oss << "OBT stw latch up section " << i; |
248 |
|
noss.str(""); |
249 |
|
noss << "C" << 21+i; |
250 |
|
lupstw[i] = new TH1F(noss.str().c_str(),oss.str().c_str(),100,-1,1); |
251 |
|
lupstw[i]->SetBit(TH1F::kCanRebin); |
252 |
|
oss.str(""); |
253 |
|
oss << "OBT no stw latch up section " << i; |
254 |
|
noss.str(""); |
255 |
|
noss << "C" << 25+i; |
256 |
|
lup[i] = new TH1F(noss.str().c_str(),oss.str().c_str(),100,-1,1); |
257 |
|
lup[i]->SetBit(TH1F::kCanRebin); |
258 |
|
}; |
259 |
|
|
260 |
// |
// |
261 |
// run over each event and take out some variables |
// run over each event and take out some variables |
262 |
// |
// |
309 |
bool isRAW = 0; |
bool isRAW = 0; |
310 |
Int_t alldexy=0; |
Int_t alldexy=0; |
311 |
Int_t alldexy2=0; |
Int_t alldexy2=0; |
312 |
Int_t stri=0; |
Int_t planebases=0; |
313 |
|
// Int_t stri=0; |
314 |
Int_t fcheck = 0; |
Int_t fcheck = 0; |
315 |
Int_t cestw=0; |
Int_t cestw=0; |
316 |
Int_t cmask = 127 ; |
Int_t cmask = 127 ; |
325 |
fulldiff[1] = 0; |
fulldiff[1] = 0; |
326 |
fulldiff[2] = 0; |
fulldiff[2] = 0; |
327 |
fulldiff[3] = 0; |
fulldiff[3] = 0; |
328 |
printf("\n Processed events: \n\n"); |
// printf("\n Processed events: \n\n"); |
329 |
|
printf("\n Start processing: \n\n"); |
330 |
unsigned short int calev0=0; |
unsigned short int calev0=0; |
331 |
unsigned short int oldcalev0; |
unsigned short int oldcalev0; |
332 |
unsigned short int calev1=0; |
unsigned short int calev1=0; |
336 |
unsigned short int calev3=0; |
unsigned short int calev3=0; |
337 |
unsigned short int oldcalev3; |
unsigned short int oldcalev3; |
338 |
Int_t i = minevent; |
Int_t i = minevent; |
339 |
Float_t headc = 0.; |
UInt_t headc = 0; |
340 |
Float_t headco = 0.; |
UInt_t headco = 0; |
341 |
Bool_t h1rcheck = false; |
Bool_t h1rcheck = false; |
342 |
|
Int_t h1rin = 0; |
343 |
|
Int_t h1rout = 0; |
344 |
Int_t intshit = 0; |
Int_t intshit = 0; |
345 |
Int_t outtshit = 0; |
Int_t outtshit = 0; |
346 |
Int_t incshit = 0; |
Int_t incshit = 0; |
351 |
Int_t outdexy = 0; |
Int_t outdexy = 0; |
352 |
Int_t indexyc = 0; |
Int_t indexyc = 0; |
353 |
Int_t outdexyc = 0; |
Int_t outdexyc = 0; |
354 |
|
UInt_t obt = 0; |
355 |
|
UInt_t minobt[4]; |
356 |
|
UInt_t maxobt[4]; |
357 |
|
UInt_t swminobt[4]; |
358 |
|
UInt_t swmaxobt[4]; |
359 |
|
Bool_t firstobt[4]; |
360 |
|
Bool_t swfirstobt[4]; |
361 |
|
for ( Int_t i = 0; i<4; i++){ |
362 |
|
minobt[i] = 0; |
363 |
|
maxobt[i] = 0; |
364 |
|
swminobt[i] = 0; |
365 |
|
swmaxobt[i] = 0; |
366 |
|
firstobt[i] = true; |
367 |
|
swfirstobt[i] = true; |
368 |
|
}; |
369 |
|
Bool_t evdone = false; |
370 |
|
// |
371 |
while ( i < maxevent+1){ |
while ( i < maxevent+1){ |
372 |
|
evdone = false; |
373 |
tshit = 0; |
tshit = 0; |
374 |
trshit = 0; |
trshit = 0; |
375 |
tr->GetEntry(i); |
tr->GetEntry(i); |
378 |
ph = eh->GetPscuHeader(); |
ph = eh->GetPscuHeader(); |
379 |
headco = headc; |
headco = headc; |
380 |
headc = ph->GetCounter(); |
headc = ph->GetCounter(); |
381 |
calevn1 += (int)abs((int)(ce->calevnum[0]-ce->calevnum[1])); |
obt = ph->GetOrbitalTime(); |
382 |
calevn2 += (int)abs((int)(ce->calevnum[2]-ce->calevnum[3])); |
if ( (int)abs((int)(ce->calevnum[0]-ce->calevnum[1])) ) calevn1++; |
383 |
calevn3 += (int)abs((int)(ce->calevnum[0]-ce->calevnum[3])); |
if ( (int)abs((int)(ce->calevnum[2]-ce->calevnum[3])) ) calevn2++; |
384 |
|
if ( (int)abs((int)(ce->calevnum[0]-ce->calevnum[3])) ) calevn3++; |
385 |
calev01->Fill(abs((int)(ce->calevnum[0]-ce->calevnum[1]))); |
calev01->Fill(abs((int)(ce->calevnum[0]-ce->calevnum[1]))); |
386 |
calev23->Fill(abs((int)(ce->calevnum[2]-ce->calevnum[3]))); |
calev23->Fill(abs((int)(ce->calevnum[2]-ce->calevnum[3]))); |
387 |
calev03->Fill(abs((int)(ce->calevnum[0]-ce->calevnum[3]))); |
calev03->Fill(abs((int)(ce->calevnum[0]-ce->calevnum[3]))); |
396 |
calevv2 = (int)ce->calevnum[2]; |
calevv2 = (int)ce->calevnum[2]; |
397 |
oldcalev3 = calev3; |
oldcalev3 = calev3; |
398 |
calev3 = (int)ce->calevnum[3]; |
calev3 = (int)ce->calevnum[3]; |
399 |
goto jumpprintout; |
// goto jumpprintout; |
400 |
if ( (headc - headco -1.) == 0. && ((calev0 - oldcalev0 - 1) > 0 || (calev1 - oldcalev1 - 1) > 0 || (calevv2 - oldcalev2 - 1) > 0 || (calev3 - oldcalev3 - 1) > 0) ){ |
if ( (headc - headco -1) == 0. && ((calev0 - oldcalev0 - 1) > 0 || (calev1 - oldcalev1 - 1) > 0 || (calevv2 - oldcalev2 - 1) > 0 || (calev3 - oldcalev3 - 1) > 0) ){ |
401 |
if ( i != minevent ) { |
if ( i != minevent ) { |
402 |
printf(" %f 0 Event %i: %i\n",headco,i,oldcalev0); |
// printf(" %f 0 Event %i: %i\n",headco,i,oldcalev0); |
403 |
printf(" %f 0 Event %i: %i\n",headc,i+1,calev0); |
// printf(" %f 0 Event %i: %i\n",headc,i+1,calev0); |
404 |
printf(" %f 1 Event %i: %i\n",headco,i,oldcalev1); |
// printf(" %f 1 Event %i: %i\n",headco,i,oldcalev1); |
405 |
printf(" %f 1 Event %i: %i\n",headc,i+1,calev1); |
// printf(" %f 1 Event %i: %i\n",headc,i+1,calev1); |
406 |
printf(" %f 2 Event %i: %i\n",headco,i,oldcalev2); |
// printf(" %f 2 Event %i: %i\n",headco,i,oldcalev2); |
407 |
printf(" %f 2 Event %i: %i\n",headc,i+1,calevv2); |
// printf(" %f 2 Event %i: %i\n",headc,i+1,calevv2); |
408 |
printf(" %f 3 Event %i: %i\n",headco,i,oldcalev3); |
// printf(" %f 3 Event %i: %i\n",headco,i,oldcalev3); |
409 |
printf(" %f 3 Event %i: %i\n",headc,i+1,calev3); |
// printf(" %f 3 Event %i: %i\n",headc,i+1,calev3); |
410 |
isRAW = 0; |
isRAW = 0; |
411 |
if ( ce->stwerr[0] & (1 << 3)) isRAW = 1; |
if ( ce->stwerr[0] & (1 << 3)) isRAW = 1; |
412 |
if ( (calev0 - oldcalev0 - 1) > 0 && !isRAW && ce->perror[0] != 129 && oldcalev0 != 0) { |
if ( (calev0 - oldcalev0 - 1) > 0 && !isRAW && ce->perror[0] != 129 && oldcalev0 != 0) { |
413 |
ver[0][10]++; |
ver[0][10]++; |
414 |
|
sighandler(headc,obt,i,0,nevents,evdone); |
415 |
|
printf(" jump in the counter calev is %i oldcalev was %i \n",calev0,oldcalev0); |
416 |
}; |
}; |
417 |
isRAW = 0; |
isRAW = 0; |
418 |
if ( ce->stwerr[0] & (1 << 3)) isRAW = 1; |
if ( ce->stwerr[0] & (1 << 3)) isRAW = 1; |
419 |
if ( (calev1 - oldcalev1 - 1) > 0 && !isRAW && ce->perror[1] != 129 && oldcalev1 != 0 ){ |
if ( (calev1 - oldcalev1 - 1) > 0 && !isRAW && ce->perror[1] != 129 && oldcalev1 != 0 ){ |
420 |
ver[1][10]++; |
ver[1][10]++; |
421 |
|
sighandler(headc,obt,i,1,nevents,evdone); |
422 |
|
printf(" jump in the counter calev is %i oldcalev was %i \n",calev1,oldcalev1); |
423 |
}; |
}; |
424 |
isRAW = 0; |
isRAW = 0; |
425 |
if ( ce->stwerr[0] & (1 << 3)) isRAW = 1; |
if ( ce->stwerr[0] & (1 << 3)) isRAW = 1; |
426 |
if ( (calevv2 - oldcalev2 - 1) > 0 && !isRAW && ce->perror[2] != 129 && oldcalev2 != 0 ){ |
if ( (calevv2 - oldcalev2 - 1) > 0 && !isRAW && ce->perror[2] != 129 && oldcalev2 != 0 ){ |
427 |
ver[2][10]++; |
ver[2][10]++; |
428 |
|
sighandler(headc,obt,i,2,nevents,evdone); |
429 |
|
printf(" jump in the counter calev is %i oldcalev was %i \n",calevv2,oldcalev2); |
430 |
}; |
}; |
431 |
isRAW = 0; |
isRAW = 0; |
432 |
if ( ce->stwerr[0] & (1 << 3)) isRAW = 1; |
if ( ce->stwerr[0] & (1 << 3)) isRAW = 1; |
433 |
if ( (calev3 - oldcalev3 - 1) > 0 && !isRAW && ce->perror[3] != 129 && oldcalev3 != 0 ){ |
if ( (calev3 - oldcalev3 - 1) > 0 && !isRAW && ce->perror[3] != 129 && oldcalev3 != 0 ){ |
434 |
ver[3][10]++; |
ver[3][10]++; |
435 |
|
sighandler(headc,obt,i,3,nevents,evdone); |
436 |
|
printf(" jump in the counter calev is %i oldcalev was %i \n",calev3,oldcalev3); |
437 |
}; |
}; |
438 |
} |
} |
439 |
}; |
}; |
440 |
jumpprintout: |
// jumpprintout: |
441 |
memcpy(shit, nullsh, sizeof(nullsh)); |
memcpy(shit, nullsh, sizeof(nullsh)); |
442 |
memcpy(rshit, nullsh, sizeof(nullsh)); |
memcpy(rshit, nullsh, sizeof(nullsh)); |
443 |
for (Int_t l = 0; l < 2; l++ ){ |
for (Int_t l = 0; l < 2; l++ ){ |
475 |
bdone = 0; |
bdone = 0; |
476 |
bl++; |
bl++; |
477 |
allbase = ce->base[l][ii][bl]; |
allbase = ce->base[l][ii][bl]; |
478 |
|
// alldexy=0; |
479 |
|
// alldexy2=0; |
480 |
|
// stri=0; |
481 |
|
// for (Int_t e = 0; e < 16 ; e++ ){ |
482 |
|
// stri = e + 16 * bl; |
483 |
|
// alldexy += (int)ce->dexyc[l][ii][stri]; |
484 |
|
// alldexy2 += (int)ce->dexy[l][ii][stri]; |
485 |
|
// }; |
486 |
|
}; |
487 |
|
// |
488 |
|
if ( kk == 0 ){ |
489 |
|
planebases = 0; |
490 |
alldexy=0; |
alldexy=0; |
491 |
alldexy2=0; |
alldexy2=0; |
492 |
stri=0; |
for (Int_t e = 0; e < 96 ; e++ ){ |
493 |
for (Int_t e = 0; e < 16 ; e++ ){ |
if ( e < 6 ) planebases += (int)ce->base[l][ii][e]; |
494 |
stri = e + 16 * bl; |
alldexy += (int)ce->dexyc[l][ii][e]; |
495 |
alldexy += (int)ce->dexyc[l][ii][stri]; |
alldexy2 += (int)ce->dexy[l][ii][e]; |
|
alldexy2 += (int)ce->dexy[l][ii][stri]; |
|
496 |
}; |
}; |
497 |
}; |
}; |
498 |
|
// |
499 |
if ( !isRAW ) { |
if ( !isRAW ) { |
500 |
// |
// |
501 |
if ( !pdone ){ |
if ( !pdone ){ |
502 |
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 ) { |
503 |
|
if ( (planebases>192000 || planebases == 0 ) && ( alldexy > 3072000 || alldexy == 0) && ce->perror[se] == 0 ) { |
504 |
pdone = 1; |
pdone = 1; |
505 |
pshit[se][pl]++ ; |
pshit[se][pl]++ ; |
506 |
if ( (ce->stwerr[se] & (1 << 4)) == 0 ) lalarm[se]++; |
if ( (ce->stwerr[se] & (1 << 4)) == 0 ) { |
507 |
lver[se][2]++ ; |
lalarm[se]++; |
508 |
|
lup[se]->Fill(obt); |
509 |
|
if ( firstobt[se] ) minobt[se] = obt; |
510 |
|
if ( obt > maxobt[se] ) maxobt[se] = obt; |
511 |
|
}; |
512 |
|
lver[se][2]++ ; |
513 |
|
sighandler(headc,obt,i,se,nevents,evdone); |
514 |
|
printf(" latch up (data) in DSP mode alldexy %i planebases %i \n",alldexy,planebases); |
515 |
}; |
}; |
516 |
} |
} |
517 |
// |
// |
555 |
indexyc++; |
indexyc++; |
556 |
}; |
}; |
557 |
// |
// |
558 |
if (ce->dexyc[l][ii][kk] < 0 ) ver[se][21]++ ; |
if (ce->dexyc[l][ii][kk] < 0 ){ |
559 |
|
ver[se][21]++ ; |
560 |
|
sighandler(headc,obt,i,se,nevents,evdone); |
561 |
|
printf(" negative ADC values!! ce->dexyc[%i][%i][%i] = %f \n",l,ii,kk,ce->dexyc[l][ii][kk]); |
562 |
|
}; |
563 |
// |
// |
564 |
if ( allbase == 0. || allbase > 32000.) { |
if ( allbase == 0. || allbase > 32000.) { |
565 |
fcheck = 0; |
fcheck = 0; |
574 |
// |
// |
575 |
} else { |
} else { |
576 |
if ( !pdone ){ |
if ( !pdone ){ |
577 |
if ( (alldexy2>512000 || alldexy2 == 0) && ce->perror[se] == 0 ) { |
if ( ( alldexy2 > 3072000 || alldexy2 == 0) && ce->perror[se] == 0 ) { |
578 |
|
// if ( (alldexy2>512000 || alldexy2 == 0) && ce->perror[se] == 0 ) { |
579 |
pdone = 1; |
pdone = 1; |
580 |
pshit[se][pl]++ ; |
pshit[se][pl]++ ; |
581 |
if ( (ce->stwerr[se] & (1 << 4)) == 0 ) lalarm[se]++; |
if ( (ce->stwerr[se] & (1 << 4)) == 0 ){ |
582 |
|
lalarm[se]++; |
583 |
|
lup[se]->Fill(obt); |
584 |
|
if ( firstobt[se] ) minobt[se] = obt; |
585 |
|
if ( obt > maxobt[se] ) maxobt[se] = obt; |
586 |
|
}; |
587 |
lver[se][2]++ ; |
lver[se][2]++ ; |
588 |
|
sighandler(headc,obt,i,se,nevents,evdone); |
589 |
|
printf(" latch up (data) in RAW mode alldexy2 %i \n",alldexy2); |
590 |
}; |
}; |
591 |
}; |
}; |
592 |
if ( ce->dexy[l][ii][kk] > 0 && ce->dexy[l][ii][kk] < 32000 ) { |
if ( ce->dexy[l][ii][kk] > 0 && ce->dexy[l][ii][kk] < 32000 ) { |
615 |
cestw=0; |
cestw=0; |
616 |
if ( ce->stwerr[k] ) cestw = ce->stwerr[k] & cmask ; |
if ( ce->stwerr[k] ) cestw = ce->stwerr[k] & cmask ; |
617 |
if ( cestw ){ |
if ( cestw ){ |
618 |
if ( cestw & (1 << 0) ) ver[k][6]++ ; |
if ( cestw & (1 << 0) ){ |
619 |
if ( cestw & (1 << 1) ) ver[k][5]++ ; |
ver[k][6]++ ; |
620 |
if ( cestw & (1 << 2) ) ver[k][4]++ ; |
sighandler(headc,obt,i,k,nevents,evdone); |
621 |
if ( cestw & (1 << 3) ) ver[k][3]++ ; |
printf(" CRC error (st. word) \n"); |
622 |
if ( cestw & (1 << 4) ) ver[k][2]++ ; |
}; |
623 |
if ( cestw & (1 << 5) ) ver[k][1]++ ; |
if ( cestw & (1 << 1) ){ |
624 |
if ( cestw & (1 << 6) ) ver[k][0]++ ; |
ver[k][5]++ ; |
625 |
|
sighandler(headc,obt,i,k,nevents,evdone); |
626 |
|
printf(" execution error \n"); |
627 |
|
}; |
628 |
|
if ( cestw & (1 << 2) ){ |
629 |
|
ver[k][4]++ ; |
630 |
|
sighandler(headc,obt,i,k,nevents,evdone); |
631 |
|
printf(" CMD length error \n"); |
632 |
|
}; |
633 |
|
if ( cestw & (1 << 3) ) ver[k][3]++ ; // raw mode |
634 |
|
if ( cestw & (1 << 4) ){ |
635 |
|
ver[k][2]++ ; |
636 |
|
sighandler(headc,obt,i,k,nevents,evdone); |
637 |
|
printf(" latch up alarm (st. word)\n"); |
638 |
|
lupstw[k]->Fill(obt); |
639 |
|
if ( swfirstobt[k] ) swminobt[k] = obt; |
640 |
|
if ( obt > swmaxobt[k] ) swmaxobt[k] = obt; |
641 |
|
}; |
642 |
|
if ( cestw & (1 << 5) ){ |
643 |
|
ver[k][1]++ ; |
644 |
|
sighandler(headc,obt,i,k,nevents,evdone); |
645 |
|
printf(" temperature alarm \n"); |
646 |
|
}; |
647 |
|
if ( cestw & (1 << 6) ){ |
648 |
|
ver[k][0]++ ; |
649 |
|
sighandler(headc,obt,i,k,nevents,evdone); |
650 |
|
printf(" DSP ack error \n"); |
651 |
|
}; |
652 |
}; |
}; |
653 |
|
if ( ce->stwerr[k] == 0 && ce->perror[k] == 0 ) ver[k][8]++ ; |
654 |
if ( ce->perror[k] != 0. ){ |
if ( ce->perror[k] != 0. ){ |
655 |
if (ce->perror[k] == 128) ver[k][7]++ ; |
if (ce->perror[k] == 128){ |
656 |
if (ce->perror[k] == 129) ver[k][8]++ ; |
ver[k][7]++ ; |
657 |
if (ce->perror[k] == 132) ver[k][11]++ ; |
sighandler(headc,obt,i,k,nevents,evdone); |
658 |
if (ce->perror[k] == 133) ver[k][12]++ ; |
printf(" view or command not recognized \n"); |
659 |
if (ce->perror[k] == 134) ver[k][13]++ ; |
}; |
660 |
if (ce->perror[k] == 135) ver[k][14]++ ; |
if (ce->perror[k] == 129){ |
661 |
if (ce->perror[k] == 136) ver[k][15]++ ; |
ver[k][8]++ ; |
662 |
if (ce->perror[k] == 139) ver[k][18]++ ; |
sighandler(headc,obt,i,k,nevents,evdone); |
663 |
if (ce->perror[k] == 140) ver[k][19]++ ; |
printf(" missing section \n"); |
664 |
if (ce->perror[k] == 141) ver[k][20]++ ; |
}; |
665 |
if (ce->perror[k] == 142) ver[k][22]++ ; |
if (ce->perror[k] == 132){ |
666 |
|
ver[k][11]++ ; |
667 |
|
if ( ver[k][11] < 30 ){ |
668 |
|
sighandler(headc,obt,i,k,nevents,evdone); |
669 |
|
printf(" CRC error (data) \n"); |
670 |
|
}; |
671 |
|
if ( ver[k][11] == 30 ){ |
672 |
|
sighandler(headc,obt,i,k,nevents,evdone); |
673 |
|
printf(" CRC error (data) \n"); |
674 |
|
printf(" WARNING TOO MANY CRC ERRORS ON DATA FOR THIS SECTION \n"); |
675 |
|
printf(" THEY WILL NOT BE DISPLAYED HERE ANYMORE FOR THIS FILE! \n"); |
676 |
|
}; |
677 |
|
}; |
678 |
|
if (ce->perror[k] == 133){ |
679 |
|
ver[k][12]++ ; |
680 |
|
sighandler(headc,obt,i,k,nevents,evdone); |
681 |
|
printf(" length problems in RAW mode \n"); |
682 |
|
}; |
683 |
|
if (ce->perror[k] == 134){ |
684 |
|
ver[k][13]++ ; |
685 |
|
sighandler(headc,obt,i,k,nevents,evdone); |
686 |
|
printf(" length problems in COMPRESS mode \n"); |
687 |
|
}; |
688 |
|
if (ce->perror[k] == 135){ |
689 |
|
ver[k][14]++ ; |
690 |
|
sighandler(headc,obt,i,k,nevents,evdone); |
691 |
|
printf(" length problems in FULL mode \n"); |
692 |
|
}; |
693 |
|
if (ce->perror[k] == 136){ |
694 |
|
ver[k][15]++ ; |
695 |
|
sighandler(headc,obt,i,k,nevents,evdone); |
696 |
|
printf(" acquisition mode problems \n"); |
697 |
|
}; |
698 |
|
if (ce->perror[k] == 139){ |
699 |
|
ver[k][18]++ ; |
700 |
|
sighandler(headc,obt,i,k,nevents,evdone); |
701 |
|
printf(" problems with coding\n"); |
702 |
|
}; |
703 |
|
if (ce->perror[k] == 140){ |
704 |
|
ver[k][19]++ ; |
705 |
|
sighandler(headc,obt,i,k,nevents,evdone); |
706 |
|
printf(" pedestal checksum wrong\n"); |
707 |
|
}; |
708 |
|
if (ce->perror[k] == 141){ |
709 |
|
ver[k][20]++ ; |
710 |
|
sighandler(headc,obt,i,k,nevents,evdone); |
711 |
|
printf(" thresholds checksum wrong\n"); |
712 |
|
}; |
713 |
|
if (ce->perror[k] == 142){ |
714 |
|
ver[k][22]++ ; |
715 |
|
sighandler(headc,obt,i,k,nevents,evdone); |
716 |
|
printf(" packet length is zero (YODA input error), skipped\n"); |
717 |
|
}; |
718 |
}; |
}; |
719 |
for (Int_t kk = 0; kk < 11 ; kk++ ){ |
for (Int_t kk = 0; kk < 11 ; kk++ ){ |
720 |
tshit += shit[k][kk]; |
tshit += shit[k][kk]; |
721 |
trshit += rshit[k][kk]; |
trshit += rshit[k][kk]; |
722 |
}; |
}; |
723 |
}; |
}; |
724 |
Calstriphit->Fill(cshit); |
if (isCOMP || isFULL){ |
725 |
if ( (cshit > 0 && cshit < 25) || (cshit > 40 && cshit < 80) ){ |
Calstriphit->Fill(cshit); |
726 |
incshit++; |
// if ( (cshit > 0 && cshit < 25) || (cshit > 40 && cshit < 80) ){ |
727 |
} else { |
if ( (cshit > 10 && cshit < 100) ){ |
728 |
outcshit++; |
incshit++; |
729 |
}; |
} else { |
730 |
if ( tshit>0 ) h1->Fill(tshit); |
outcshit++; |
731 |
if ( (tshit > 0 && tshit < 25) || (tshit > 40 && tshit < 80) ){ |
}; |
732 |
intshit++; |
// |
733 |
} else { |
if ( tshit>0 ) h1->Fill(tshit); |
734 |
outtshit++; |
// if ( (tshit > 0 && tshit < 25) || (tshit > 40 && tshit < 80) ){ |
735 |
|
if ( (tshit > 10 && tshit < 100) ){ |
736 |
|
intshit++; |
737 |
|
} else { |
738 |
|
outtshit++; |
739 |
|
}; |
740 |
}; |
}; |
741 |
if ( trshit>0 ) { |
if ( trshit>0 ) { |
742 |
h1r->Fill(trshit); |
h1r->Fill(trshit); |
743 |
if ( trshit < 4210 ){ |
if ( trshit < 4210 ){ |
744 |
h1rcheck = true; |
h1rout++; |
745 |
// printf("ma come... trshit %i \n",trshit); |
// printf("ma come... trshit %i \n",trshit); |
746 |
|
} else { |
747 |
|
h1rin++; |
748 |
}; |
}; |
749 |
}; |
}; |
750 |
if ( i%1000 == 0 && i > 0 ) printf("%iK\n",i/1000); |
// if ( i%1000 == 0 && i > 0 ) printf("%iK\n",i/1000); |
751 |
i++; |
i++; |
752 |
}; |
}; |
753 |
printf("\n"); |
printf("\n"); |
754 |
|
printf("\n end processing. \n\n"); |
755 |
|
if ( (float)h1rout/((float)h1rin+(float)h1rout) > h1rth ){ |
756 |
|
h1rcheck = true; |
757 |
|
}; |
758 |
// |
// |
759 |
// output figures, first sheet: |
// output figures, first sheet: |
760 |
// |
// |
774 |
t->DrawLatex(2.,99.,errore.str().c_str()); |
t->DrawLatex(2.,99.,errore.str().c_str()); |
775 |
TPad *pd5; |
TPad *pd5; |
776 |
TPad *pd6; |
TPad *pd6; |
777 |
|
TPad *pd7; |
778 |
|
TPad *pd8; |
779 |
TPad *pad1; |
TPad *pad1; |
780 |
TPad *pad2; |
TPad *pad2; |
781 |
TPad *pad3; |
TPad *pad3; |
820 |
h1->Draw(); |
h1->Draw(); |
821 |
// |
// |
822 |
h1max = h1->GetMaximum()*1.05; |
h1max = h1->GetMaximum()*1.05; |
823 |
Double_t xc[4] = {0.,25.,25.,0.}; |
Double_t xc[4] = {10.,100.,100.,10.}; |
824 |
Double_t yc[4] = {0.,0.,h1max,h1max}; |
Double_t yc[4] = {0.,0.,h1max,h1max}; |
825 |
banda1 = new TPolyLine(4,xc,yc); |
banda1 = new TPolyLine(4,xc,yc); |
826 |
banda1->SetLineColor(5); |
banda1->SetLineColor(5); |
827 |
banda1->SetFillColor(5); |
banda1->SetFillColor(5); |
828 |
banda1->SetLineWidth(1); |
banda1->SetLineWidth(1); |
829 |
banda1->Draw("fSAME"); |
banda1->Draw("fSAME"); |
830 |
Double_t xd[4] = {40.,80.,80.,40.}; |
// Double_t xd[4] = {40.,80.,80.,40.}; |
831 |
Double_t yd[4] = {0.,0.,h1max,h1max}; |
// Double_t yd[4] = {0.,0.,h1max,h1max}; |
832 |
banda2 = new TPolyLine(4,xd,yd); |
// banda2 = new TPolyLine(4,xd,yd); |
833 |
banda2->SetLineColor(5); |
// banda2->SetLineColor(5); |
834 |
banda2->SetFillColor(5); |
// banda2->SetFillColor(5); |
835 |
banda2->SetLineWidth(1); |
// banda2->SetLineWidth(1); |
836 |
banda2->Draw("fSAME"); |
//banda2->Draw("fSAME"); |
837 |
h1->Draw("SAME"); |
h1->Draw("SAME"); |
838 |
// |
// |
839 |
figura->cd(); |
figura->cd(); |
870 |
h1->SetYTitle("Number of events"); |
h1->SetYTitle("Number of events"); |
871 |
h1->Draw(); |
h1->Draw(); |
872 |
h1max = h1->GetMaximum()*1.05; |
h1max = h1->GetMaximum()*1.05; |
873 |
Double_t xe[4] = {0.,25.,25.,0.}; |
Double_t xe[4] = {10.,100.,100.,10.}; |
874 |
Double_t ye[4] = {0.,0.,h1max,h1max}; |
Double_t ye[4] = {0.,0.,h1max,h1max}; |
875 |
banda1 = new TPolyLine(4,xe,ye); |
banda1 = new TPolyLine(4,xe,ye); |
876 |
banda1->SetLineColor(5); |
banda1->SetLineColor(5); |
877 |
banda1->SetFillColor(5); |
banda1->SetFillColor(5); |
878 |
banda1->SetLineWidth(1); |
banda1->SetLineWidth(1); |
879 |
banda1->Draw("fSAME"); |
banda1->Draw("fSAME"); |
880 |
Double_t xf[4] = {40.,80.,80.,40.}; |
// Double_t xf[4] = {40.,80.,80.,40.}; |
881 |
Double_t yf[4] = {0.,0.,h1max,h1max}; |
// Double_t yf[4] = {0.,0.,h1max,h1max}; |
882 |
banda2 = new TPolyLine(4,xf,yf); |
// banda2 = new TPolyLine(4,xf,yf); |
883 |
banda2->SetLineColor(5); |
// banda2->SetLineColor(5); |
884 |
banda2->SetFillColor(5); |
// banda2->SetFillColor(5); |
885 |
banda2->SetLineWidth(1); |
// banda2->SetLineWidth(1); |
886 |
banda2->Draw("fSAME"); |
// banda2->Draw("fSAME"); |
887 |
h1->Draw("SAME"); |
h1->Draw("SAME"); |
888 |
}; |
}; |
889 |
if ( trshit !=0 ) { |
if ( trshit !=0 ) { |
913 |
}; |
}; |
914 |
}; |
}; |
915 |
if ( !errorfull ) { |
if ( !errorfull ) { |
916 |
if ( calevn1 || calevn2 || calevn3 ) { |
if ( calevn1 > calevnth || calevn2 > calevnth || calevn3 > calevnth ) { |
917 |
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); |
918 |
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); |
919 |
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); |
1088 |
Dexyc->Draw("SAME"); |
Dexyc->Draw("SAME"); |
1089 |
// |
// |
1090 |
pd3->cd(); |
pd3->cd(); |
1091 |
|
// gPad->SetLogy(); |
1092 |
Calstriphit->SetXTitle("Number of hit"); |
Calstriphit->SetXTitle("Number of hit"); |
1093 |
Calstriphit->SetYTitle("Number of events"); |
Calstriphit->SetYTitle("Number of events"); |
1094 |
Calstriphit->Draw(); |
Calstriphit->Draw(); |
1095 |
h1max = Calstriphit->GetMaximum()*1.05; |
h1max = Calstriphit->GetMaximum()*1.05; |
1096 |
Double_t xg[4] = {0.,25.,25.,0.}; |
Double_t xg[4] = {10.,100.,100.,10.}; |
1097 |
Double_t yg[4] = {0.,0.,h1max,h1max}; |
Double_t yg[4] = {0.,0.,h1max,h1max}; |
1098 |
banda1 = new TPolyLine(4,xg,yg); |
banda1 = new TPolyLine(4,xg,yg); |
1099 |
banda1->SetLineColor(5); |
banda1->SetLineColor(5); |
1100 |
banda1->SetFillColor(5); |
banda1->SetFillColor(5); |
1101 |
banda1->SetLineWidth(1); |
banda1->SetLineWidth(1); |
1102 |
banda1->Draw("fSAME"); |
banda1->Draw("fSAME"); |
1103 |
Double_t xh[4] = {40.,80.,80.,40.}; |
// Double_t xh[4] = {40.,80.,80.,40.}; |
1104 |
Double_t yh[4] = {0.,0.,h1max,h1max}; |
// Double_t yh[4] = {0.,0.,h1max,h1max}; |
1105 |
banda2 = new TPolyLine(4,xh,yh); |
// banda2 = new TPolyLine(4,xh,yh); |
1106 |
banda2->SetLineColor(5); |
// banda2->SetLineColor(5); |
1107 |
banda2->SetFillColor(5); |
// banda2->SetFillColor(5); |
1108 |
banda2->SetLineWidth(1); |
// banda2->SetLineWidth(1); |
1109 |
banda2->Draw("fSAME"); |
// banda2->Draw("fSAME"); |
1110 |
Calstriphit->Draw("SAME"); |
Calstriphit->Draw("SAME"); |
1111 |
// |
// |
1112 |
pd4->cd(); |
pd4->cd(); |
1113 |
|
gPad->SetLogy(); |
1114 |
Dexy->SetXTitle("ADC channels"); |
Dexy->SetXTitle("ADC channels"); |
1115 |
Dexy->SetYTitle("Number of events"); |
Dexy->SetYTitle("Number of events"); |
1116 |
Dexy->Draw(); |
Dexy->Draw(); |
1117 |
h1max = Dexy->GetMaximum()*1.05; |
// h1max = Dexy->GetMaximum()*1.05; |
1118 |
|
h1max = Dexy->GetMaximum()*2.05; |
1119 |
Double_t xd[4] = {2000.,5000.,5000.,2000.}; |
Double_t xd[4] = {2000.,5000.,5000.,2000.}; |
1120 |
Double_t yd[4] = {0.,0.,h1max,h1max}; |
Double_t yd[4] = {0.,0.,h1max,h1max}; |
1121 |
banda1 = new TPolyLine(4,xd,yd); |
banda1 = new TPolyLine(4,xd,yd); |
1151 |
pd4->Draw(); |
pd4->Draw(); |
1152 |
// |
// |
1153 |
pd4->cd(); |
pd4->cd(); |
1154 |
|
gPad->SetLogy(); |
1155 |
Dexy->SetXTitle("ADC channels"); |
Dexy->SetXTitle("ADC channels"); |
1156 |
Dexy->SetYTitle("Number of events"); |
Dexy->SetYTitle("Number of events"); |
1157 |
Dexy->Draw(); |
Dexy->Draw(); |
1158 |
h1max = Dexy->GetMaximum()*1.05; |
// h1max = Dexy->GetMaximum()*1.05; |
1159 |
|
h1max = Dexy->GetMaximum()*2.05; |
1160 |
Double_t xd[4] = {2000.,5000.,5000.,2000.}; |
Double_t xd[4] = {2000.,5000.,5000.,2000.}; |
1161 |
Double_t yd[4] = {0.,0.,h1max,h1max}; |
Double_t yd[4] = {0.,0.,h1max,h1max}; |
1162 |
banda1 = new TPolyLine(4,xd,yd); |
banda1 = new TPolyLine(4,xd,yd); |
1167 |
Dexy->Draw("SAME"); |
Dexy->Draw("SAME"); |
1168 |
}; |
}; |
1169 |
// |
// |
1170 |
|
TCanvas *figura3 = 0; |
1171 |
|
Bool_t printfigure3 = false; |
1172 |
|
for (Int_t i = 0; i<4; i++){ |
1173 |
|
if ( ver[i][2] || lver[i][2] ){ |
1174 |
|
printfigure3 = true; |
1175 |
|
break; |
1176 |
|
}; |
1177 |
|
}; |
1178 |
|
if ( printfigure3 ){ |
1179 |
|
figura3 = new TCanvas("Calorimeter_Detector_Report_2bis/3","Calorimeter_Detector_Report_2bis/3", 1100, 900); |
1180 |
|
figura3->SetFillColor(10); |
1181 |
|
figura3->Range(0,0,100,100); |
1182 |
|
errore.str(""); |
1183 |
|
errore << "EXPERT -- File: " << file; |
1184 |
|
errore << " "; |
1185 |
|
t=new TLatex(); |
1186 |
|
t->SetTextFont(32); |
1187 |
|
t->SetTextColor(1); |
1188 |
|
t->SetTextAlign(12); |
1189 |
|
t->SetTextSize(0.015); |
1190 |
|
t->DrawLatex(2.,99.,errore.str().c_str()); |
1191 |
|
pd1 = new TPad("pd1","This is pad1",0.02,0.51,0.49,0.73,45); |
1192 |
|
pd5 = new TPad("pd5","This is pad5",0.02,0.76,0.49,0.98,45); |
1193 |
|
pd2 = new TPad("pd2","This is pad2",0.51,0.51,0.98,0.73,45); |
1194 |
|
pd6 = new TPad("pd6","This is pad6",0.51,0.76,0.98,0.98,45); |
1195 |
|
pd3 = new TPad("pd3","This is pad3",0.02,0.02,0.49,0.23,45); |
1196 |
|
pd7 = new TPad("pd7","This is pad7",0.02,0.26,0.49,0.49,45); |
1197 |
|
pd4 = new TPad("pd4","This is pad4",0.51,0.02,0.98,0.23,45); |
1198 |
|
pd8 = new TPad("pd8","This is pad8",0.51,0.26,0.98,0.49,45); |
1199 |
|
figura3->cd(); |
1200 |
|
pd1->Range(0,0,100,100); |
1201 |
|
pd2->Range(0,0,100,100); |
1202 |
|
pd3->Range(0,0,100,100); |
1203 |
|
pd4->Range(0,0,100,100); |
1204 |
|
pd1->SetTicks(); |
1205 |
|
pd2->SetTicks(); |
1206 |
|
pd3->SetTicks(); |
1207 |
|
pd4->SetTicks(); |
1208 |
|
pd1->Draw(); |
1209 |
|
pd2->Draw(); |
1210 |
|
pd3->Draw(); |
1211 |
|
pd4->Draw(); |
1212 |
|
pd5->Range(0,0,100,100); |
1213 |
|
pd6->Range(0,0,100,100); |
1214 |
|
pd7->Range(0,0,100,100); |
1215 |
|
pd8->Range(0,0,100,100); |
1216 |
|
pd5->SetTicks(); |
1217 |
|
pd6->SetTicks(); |
1218 |
|
pd7->SetTicks(); |
1219 |
|
pd8->SetTicks(); |
1220 |
|
pd5->Draw(); |
1221 |
|
pd6->Draw(); |
1222 |
|
pd7->Draw(); |
1223 |
|
pd8->Draw(); |
1224 |
|
pd1->cd(); |
1225 |
|
lup[0]->SetAxisRange((Double_t)min(minobt[0],swminobt[0])*0.9,(Double_t)max(maxobt[0],swmaxobt[0])*1.1,"X"); |
1226 |
|
lup[0]->SetXTitle("OBT"); |
1227 |
|
lup[0]->SetYTitle("Number of events"); |
1228 |
|
lup[0]->Draw(); |
1229 |
|
pd5->cd(); |
1230 |
|
lupstw[0]->SetAxisRange((Double_t)min(minobt[0],swminobt[0])*0.9,(Double_t)max(maxobt[0],swmaxobt[0])*1.1,"X"); |
1231 |
|
// lupstw[0]->SetAxisRange((Double_t)swminobt[0]*0.9,(Double_t)swmaxobt[0]*1.1,"X"); |
1232 |
|
lupstw[0]->SetXTitle("OBT"); |
1233 |
|
lupstw[0]->SetYTitle("Number of events"); |
1234 |
|
lupstw[0]->Draw(); |
1235 |
|
pd2->cd(); |
1236 |
|
lup[1]->SetAxisRange((Double_t)min(minobt[1],swminobt[1])*0.9,(Double_t)max(maxobt[1],swmaxobt[1])*1.1,"X"); |
1237 |
|
// lup[1]->SetAxisRange((Double_t)minobt[1]*0.9,(Double_t)maxobt[1]*1.1,"X"); |
1238 |
|
lup[1]->SetXTitle("OBT"); |
1239 |
|
lup[1]->SetYTitle("Number of events"); |
1240 |
|
lup[1]->Draw(); |
1241 |
|
pd6->cd(); |
1242 |
|
lupstw[1]->SetAxisRange((Double_t)min(minobt[1],swminobt[1])*0.9,(Double_t)max(maxobt[1],swmaxobt[1])*1.1,"X"); |
1243 |
|
// lupstw[1]->SetAxisRange((Double_t)swminobt[1]*0.9,(Double_t)swmaxobt[1]*1.1,"X"); |
1244 |
|
lupstw[1]->SetXTitle("OBT"); |
1245 |
|
lupstw[1]->SetYTitle("Number of events"); |
1246 |
|
lupstw[1]->Draw(); |
1247 |
|
pd3->cd(); |
1248 |
|
lup[2]->SetAxisRange((Double_t)min(minobt[2],swminobt[2])*0.9,(Double_t)max(maxobt[2],swmaxobt[2])*1.1,"X"); |
1249 |
|
// lup[2]->SetAxisRange((Double_t)minobt[2]*0.9,(Double_t)maxobt[2]*1.1,"X"); |
1250 |
|
lup[2]->SetXTitle("OBT"); |
1251 |
|
lup[2]->SetYTitle("Number of events"); |
1252 |
|
lup[2]->Draw(); |
1253 |
|
pd7->cd(); |
1254 |
|
lupstw[2]->SetAxisRange((Double_t)min(minobt[2],swminobt[2])*0.9,(Double_t)max(maxobt[2],swmaxobt[2])*1.1,"X"); |
1255 |
|
// lupstw[2]->SetAxisRange((Double_t)swminobt[2]*0.9,(Double_t)swmaxobt[2]*1.1,"X"); |
1256 |
|
lupstw[2]->SetXTitle("OBT"); |
1257 |
|
lupstw[2]->SetYTitle("Number of events"); |
1258 |
|
lupstw[2]->Draw(); |
1259 |
|
pd4->cd(); |
1260 |
|
lup[3]->SetAxisRange((Double_t)min(minobt[3],swminobt[3])*0.9,(Double_t)max(maxobt[3],swmaxobt[3])*1.1,"X"); |
1261 |
|
// lup[3]->SetAxisRange((Double_t)minobt[3]*0.9,(Double_t)maxobt[3]*1.1,"X"); |
1262 |
|
lup[3]->SetXTitle("OBT"); |
1263 |
|
lup[3]->SetYTitle("Number of events"); |
1264 |
|
lup[3]->Draw(); |
1265 |
|
pd8->cd(); |
1266 |
|
lupstw[3]->SetAxisRange((Double_t)min(minobt[3],swminobt[3])*0.9,(Double_t)max(maxobt[3],swmaxobt[3])*1.1,"X"); |
1267 |
|
// lupstw[3]->SetAxisRange((Double_t)swminobt[3]*0.9,(Double_t)swmaxobt[3]*1.1,"X"); |
1268 |
|
lupstw[3]->SetXTitle("OBT"); |
1269 |
|
lupstw[3]->SetYTitle("Number of events"); |
1270 |
|
lupstw[3]->Draw(); |
1271 |
|
}; |
1272 |
|
// |
1273 |
// output figures, report sheet: |
// output figures, report sheet: |
1274 |
// |
// |
1275 |
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); |
1300 |
pad2->Draw(); |
pad2->Draw(); |
1301 |
pad3->Draw(); |
pad3->Draw(); |
1302 |
pad4->Draw(); |
pad4->Draw(); |
1303 |
|
// |
1304 |
|
Bool_t redevent = true; |
1305 |
|
// |
1306 |
|
if ( ver[0][3]+ver[0][16]+ver[0][17] == ver[1][3]+ver[1][16]+ver[1][17] && ver[1][3]+ver[1][16]+ver[1][17] == ver[2][3]+ver[2][16]+ver[2][17] && ver[2][3]+ver[2][16]+ver[2][17] == ver[3][3]+ver[3][16]+ver[3][17] ){ |
1307 |
|
redevent = false; |
1308 |
|
}; |
1309 |
|
if ( redevent ) check = true; |
1310 |
|
// |
1311 |
for (Int_t i = 0; i < 4; i++){ |
for (Int_t i = 0; i < 4; i++){ |
1312 |
if (i == 2) |
if (i == 2) |
1313 |
{ |
{ |
1353 |
check = true; |
check = true; |
1354 |
} |
} |
1355 |
if (j == 2) { |
if (j == 2) { |
1356 |
|
// printf("boh! lalarm[%i] = %i \n",i,lalarm[i]); |
1357 |
if ( lalarm[i] ){ |
if ( lalarm[i] ){ |
1358 |
errore.str(""); |
errore.str(""); |
1359 |
errore << "* Latch up: " << ver[i][j]; |
errore << "* Latch up: " << ver[i][j]; |
1360 |
errore << " (" << lalarm[i]; |
errore << " (" << lalarm[i]; |
1361 |
errore << " NOT rec!): "; |
errore << " NOT rec!): "; |
1362 |
t->DrawLatex(0.,70.,errore.str().c_str()); |
t->DrawLatex(2.,70.,errore.str().c_str()); |
1363 |
check = true; |
check = true; |
1364 |
} else { |
} else { |
1365 |
errore.str(""); |
errore.str(""); |
1394 |
errore.str(""); |
errore.str(""); |
1395 |
errore << "RAW mode: " << ver[i][j]; |
errore << "RAW mode: " << ver[i][j]; |
1396 |
errore << " time(s)"; |
errore << " time(s)"; |
1397 |
t->SetTextColor(32); |
if ( !redevent ) t->SetTextColor(32); |
1398 |
t->DrawLatex(2.,90.,errore.str().c_str()); |
t->DrawLatex(2.,90.,errore.str().c_str()); |
1399 |
} |
} |
1400 |
if (j == 4) { |
if (j == 4) { |
1430 |
errore << "Missing section: " << ver[i][j]; |
errore << "Missing section: " << ver[i][j]; |
1431 |
errore << " time(s)"; |
errore << " time(s)"; |
1432 |
t->DrawLatex(2.,50.,errore.str().c_str()); |
t->DrawLatex(2.,50.,errore.str().c_str()); |
1433 |
check = true; |
if ( ver[i][j] > 3 ) check = true; |
1434 |
} |
} |
1435 |
if (j == 10) { |
if (j == 10) { |
1436 |
errore.str(""); |
errore.str(""); |
1444 |
errore << "CRC error (data): " << ver[i][j]; |
errore << "CRC error (data): " << ver[i][j]; |
1445 |
errore << " time(s)"; |
errore << " time(s)"; |
1446 |
t->DrawLatex(2.,38.,errore.str().c_str()); |
t->DrawLatex(2.,38.,errore.str().c_str()); |
1447 |
check = true; |
if ( ver[i][j] > 10 ) check = true; |
1448 |
} |
} |
1449 |
if (j == 12) { |
if (j == 12) { |
1450 |
errore.str(""); |
errore.str(""); |
1478 |
errore.str(""); |
errore.str(""); |
1479 |
errore << "COMPRESS mode: " << ver[i][j]; |
errore << "COMPRESS mode: " << ver[i][j]; |
1480 |
errore << " time(s)"; |
errore << " time(s)"; |
1481 |
t->SetTextColor(32); |
if ( !redevent ) t->SetTextColor(32); |
1482 |
t->DrawLatex(2.,86.,errore.str().c_str()); |
t->DrawLatex(2.,86.,errore.str().c_str()); |
1483 |
} |
} |
1484 |
if (j == 17) { |
if (j == 17) { |
1485 |
errore.str(""); |
errore.str(""); |
1486 |
errore << "FULL mode: " << ver[i][j]; |
errore << "FULL mode: " << ver[i][j]; |
1487 |
errore << " time(s)"; |
errore << " time(s)"; |
1488 |
t->SetTextColor(32); |
if ( !redevent ) t->SetTextColor(32); |
1489 |
t->DrawLatex(2.,82.,errore.str().c_str()); |
t->DrawLatex(2.,82.,errore.str().c_str()); |
1490 |
} |
} |
1491 |
if (j == 18) { |
if (j == 18) { |
1557 |
t->DrawLatex(60.,95.," OK! "); |
t->DrawLatex(60.,95.," OK! "); |
1558 |
}; |
}; |
1559 |
// |
// |
1560 |
const string fil = (const char*)filename; |
// const string fil = (const char*)filename; |
1561 |
Int_t posiz = fil.find("dw_"); |
// Int_t posiz = fil.find("dw_"); |
1562 |
if ( posiz == -1 ) posiz = fil.find("DW_"); |
// if ( posiz == -1 ) posiz = fil.find("DW_"); |
1563 |
Int_t posiz2 = posiz+13; |
// Int_t posiz2 = posiz+13; |
1564 |
TString file2; |
// TString file2; |
1565 |
stringcopy(file2,filename,posiz,posiz2); |
// stringcopy(file2,filename,posiz,posiz2); |
1566 |
// |
// |
1567 |
|
const string fil = gSystem->BaseName(filename.Data()); |
1568 |
|
Int_t posiz = fil.find(".root"); |
1569 |
|
// |
1570 |
|
TString file2; |
1571 |
|
if ( posiz == -1 ){ |
1572 |
|
file2 = gSystem->BaseName(filename.Data()); |
1573 |
|
} else { |
1574 |
|
Int_t posiz2 = 0; |
1575 |
|
stringcopy(file2,gSystem->BaseName(filename.Data()),posiz2,posiz); |
1576 |
|
}; |
1577 |
const char *figrec = file2; |
const char *figrec = file2; |
1578 |
|
// |
1579 |
const char *outdir = outDir; |
const char *outdir = outDir; |
1580 |
stringstream figsave; |
stringstream figsave; |
1581 |
stringstream figsave1; |
stringstream figsave1; |
1584 |
if ( !strcmp(format,"ps") ) { |
if ( !strcmp(format,"ps") ) { |
1585 |
figsave.str(""); |
figsave.str(""); |
1586 |
figsave << outdir << "/" ; |
figsave << outdir << "/" ; |
1587 |
figsave << figrec << "_qlook."; |
figsave << figrec << "_CaloQLOOK."; |
1588 |
figsave << format << "("; |
figsave << format << "("; |
1589 |
rapporto->Print(figsave.str().c_str(),"Landscape"); |
rapporto->Print(figsave.str().c_str(),"Landscape"); |
1590 |
figsave1.str(""); |
figsave1.str(""); |
1591 |
figsave1 << outdir << "/" ; |
figsave1 << outdir << "/" ; |
1592 |
figsave1 << figrec << "_qlook."; |
figsave1 << figrec << "_CaloQLOOK."; |
1593 |
figsave1 << format; |
figsave1 << format; |
1594 |
figura->Print(figsave1.str().c_str(),"Landscape"); |
figura->Print(figsave1.str().c_str(),"Landscape"); |
1595 |
figsave2.str(""); |
figsave2.str(""); |
1596 |
figsave2 << outdir << "/" ; |
figsave2 << outdir << "/" ; |
1597 |
figsave2 << figrec << "_qlook."; |
figsave2 << figrec << "_CaloQLOOK."; |
1598 |
figsave2 << format << ")"; |
if ( printfigure3 ){ |
1599 |
figura2->Print(figsave2.str().c_str(),"Landscape"); |
figsave2 << format; |
1600 |
|
figura2->Print(figsave2.str().c_str(),"Landscape"); |
1601 |
|
figsave2.str(""); |
1602 |
|
figsave2 << outdir << "/" ; |
1603 |
|
figsave2 << figrec << "_CaloQLOOK."; |
1604 |
|
figsave2 << format << ")"; |
1605 |
|
figura3->Print(figsave2.str().c_str(),"Landscape"); |
1606 |
|
} else { |
1607 |
|
figsave2 << format << ")";; |
1608 |
|
figura2->Print(figsave2.str().c_str(),"Landscape"); |
1609 |
|
}; |
1610 |
} else { |
} else { |
1611 |
figsave.str(""); |
figsave.str(""); |
1612 |
figsave << outdir << "/" ; |
figsave << outdir << "/" ; |
1613 |
figsave << figrec << "_qlook1."; |
figsave << figrec << "_CaloQLOOK1."; |
1614 |
figsave << format; |
figsave << format; |
1615 |
figura->SaveAs(figsave.str().c_str()); |
figura->SaveAs(figsave.str().c_str()); |
1616 |
figsave.str(""); |
figsave.str(""); |
1617 |
figsave << outdir << "/" ; |
figsave << outdir << "/" ; |
1618 |
figsave << figrec << "_qlook2."; |
figsave << figrec << "_CaloQLOOK2."; |
1619 |
figsave << format; |
figsave << format; |
1620 |
figura2->SaveAs(figsave.str().c_str()); |
figura2->SaveAs(figsave.str().c_str()); |
1621 |
|
if ( printfigure3 ){ |
1622 |
|
figsave.str(""); |
1623 |
|
figsave << outdir << "/" ; |
1624 |
|
figsave << figrec << "_CaloQLOOK2bis."; |
1625 |
|
figsave << format; |
1626 |
|
figura3->SaveAs(figsave.str().c_str()); |
1627 |
|
}; |
1628 |
figsave.str(""); |
figsave.str(""); |
1629 |
figsave << outdir << "/" ; |
figsave << outdir << "/" ; |
1630 |
figsave << figrec << "_qlook3."; |
figsave << figrec << "_CaloQLOOK3."; |
1631 |
figsave << format; |
figsave << format; |
1632 |
rapporto->SaveAs(figsave.str().c_str()); |
rapporto->SaveAs(figsave.str().c_str()); |
1633 |
}; |
}; |
1634 |
|
if ( iactive && w4i ){ |
1635 |
|
while ( gROOT->GetListOfCanvases()->FindObject(rapporto) || gROOT->GetListOfCanvases()->FindObject(figura3) || gROOT->GetListOfCanvases()->FindObject(figura2) || gROOT->GetListOfCanvases()->FindObject(figura) ){ |
1636 |
|
gSystem->ProcessEvents(); |
1637 |
|
gSystem->Sleep(10); |
1638 |
|
}; |
1639 |
|
}; |
1640 |
} |
} |
1641 |
|
|