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.11 (2006-07-17) |
// FCaloQLOOK.c version 1.14 (2006-09-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.13 - 1.14 (2006-09-29): Flag the last entry in the txt file, count missing section when checking for DSP entries correspondence. |
11 |
|
// |
12 |
|
// 1.12 - 1.13 (2006-09-28): Give wrong number of events in compress mode, fixed. |
13 |
|
// |
14 |
|
// 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. |
15 |
|
// |
16 |
// 1.09 - 1.11 (2006-07-17): Adapted to flight conditions. |
// 1.09 - 1.11 (2006-07-17): Adapted to flight conditions. |
17 |
// |
// |
18 |
// 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. |
// 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. |
49 |
#include <TPolyLine.h> |
#include <TPolyLine.h> |
50 |
#include <TStyle.h> |
#include <TStyle.h> |
51 |
#include <TSystem.h> |
#include <TSystem.h> |
52 |
|
#include <TApplication.h> |
53 |
// |
// |
54 |
#include <PamelaRun.h> |
#include <PamelaRun.h> |
55 |
#include <physics/calorimeter/CalorimeterEvent.h> |
#include <physics/calorimeter/CalorimeterEvent.h> |
92 |
return file2; |
return file2; |
93 |
} |
} |
94 |
|
|
95 |
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){ |
96 |
|
if ( !evdone ){ |
97 |
|
printf("\n\n=================================================\n"); |
98 |
|
printf("PSCU-Pkt N. %u - OBT %u ms\n",pkt_num,obt); |
99 |
|
printf("Total events %u\n",totev); |
100 |
|
printf("(ROOT-tree entry %u )\n",entry); |
101 |
|
if ( (totev-1) == entry ) printf("NOTICE: this is last entry! \n"); |
102 |
|
printf("=================================================\n"); |
103 |
|
evdone = true; |
104 |
|
}; |
105 |
|
TString sec = "UNKNOWN"; |
106 |
|
if ( section == 0 ) sec = "XE"; |
107 |
|
if ( section == 1 ) sec = "XO"; |
108 |
|
if ( section == 2 ) sec = "YE"; |
109 |
|
if ( section == 3 ) sec = "YO"; |
110 |
|
printf(" Section %s (DSP n. %i) message: ",sec.Data(),section); |
111 |
|
}; |
112 |
|
|
113 |
|
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){ |
114 |
gStyle->SetPaperSize(19.,25.); |
gStyle->SetPaperSize(19.,25.); |
115 |
const char* startingdir = gSystem->WorkingDirectory(); |
const char* startingdir = gSystem->WorkingDirectory(); |
116 |
// printf(" basename is %s \n",gSystem->BaseName(filename.Data())); |
// printf(" basename is %s \n",gSystem->BaseName(filename.Data())); |
117 |
// printf(" getfilename is %s \n",getFilename(filename).Data()); |
// printf(" getfilename is %s \n",getFilename(filename).Data()); |
118 |
if ( !strcmp(outDir.Data(),"") ) outDir = startingdir; |
if ( !strcmp(outDir.Data(),"") ) outDir = startingdir; |
119 |
// |
// |
120 |
|
TApplication *app = 0; |
121 |
|
if ( iactive ) app = new TApplication("app",0,0); |
122 |
// |
// |
123 |
ifstream myfile; |
ifstream myfile; |
124 |
myfile.open(filename.Data()); |
myfile.open(filename.Data()); |
309 |
Int_t pdone, bdone; |
Int_t pdone, bdone; |
310 |
pdone = 0; |
pdone = 0; |
311 |
bdone = 0; |
bdone = 0; |
312 |
bool isCOMP = 0; |
bool isCOMP = false; |
313 |
bool isFULL = 0; |
bool isFULL = false; |
314 |
bool isRAW = 0; |
bool isRAW = false; |
315 |
Int_t alldexy=0; |
Int_t alldexy=0; |
316 |
Int_t alldexy2=0; |
Int_t alldexy2=0; |
317 |
Int_t planebases=0; |
Int_t planebases=0; |
330 |
fulldiff[1] = 0; |
fulldiff[1] = 0; |
331 |
fulldiff[2] = 0; |
fulldiff[2] = 0; |
332 |
fulldiff[3] = 0; |
fulldiff[3] = 0; |
333 |
printf("\n Processed events: \n\n"); |
// printf("\n Processed events: \n\n"); |
334 |
|
printf("\n Start processing: \n\n"); |
335 |
unsigned short int calev0=0; |
unsigned short int calev0=0; |
336 |
unsigned short int oldcalev0; |
unsigned short int oldcalev0; |
337 |
unsigned short int calev1=0; |
unsigned short int calev1=0; |
341 |
unsigned short int calev3=0; |
unsigned short int calev3=0; |
342 |
unsigned short int oldcalev3; |
unsigned short int oldcalev3; |
343 |
Int_t i = minevent; |
Int_t i = minevent; |
344 |
Float_t headc = 0.; |
UInt_t headc = 0; |
345 |
Float_t headco = 0.; |
UInt_t headco = 0; |
346 |
Bool_t h1rcheck = false; |
Bool_t h1rcheck = false; |
347 |
Int_t h1rin = 0; |
Int_t h1rin = 0; |
348 |
Int_t h1rout = 0; |
Int_t h1rout = 0; |
356 |
Int_t outdexy = 0; |
Int_t outdexy = 0; |
357 |
Int_t indexyc = 0; |
Int_t indexyc = 0; |
358 |
Int_t outdexyc = 0; |
Int_t outdexyc = 0; |
359 |
Int_t obt = 0; |
UInt_t obt = 0; |
360 |
Int_t minobt[4]; |
UInt_t minobt[4]; |
361 |
Int_t maxobt[4]; |
UInt_t maxobt[4]; |
362 |
Int_t swminobt[4]; |
UInt_t swminobt[4]; |
363 |
Int_t swmaxobt[4]; |
UInt_t swmaxobt[4]; |
364 |
Bool_t firstobt[4]; |
Bool_t firstobt[4]; |
365 |
Bool_t swfirstobt[4]; |
Bool_t swfirstobt[4]; |
366 |
for ( Int_t i = 0; i<4; i++){ |
for ( Int_t i = 0; i<4; i++){ |
371 |
firstobt[i] = true; |
firstobt[i] = true; |
372 |
swfirstobt[i] = true; |
swfirstobt[i] = true; |
373 |
}; |
}; |
374 |
|
Bool_t evdone = false; |
375 |
|
// |
376 |
while ( i < maxevent+1){ |
while ( i < maxevent+1){ |
377 |
|
evdone = false; |
378 |
tshit = 0; |
tshit = 0; |
379 |
trshit = 0; |
trshit = 0; |
380 |
tr->GetEntry(i); |
tr->GetEntry(i); |
387 |
if ( (int)abs((int)(ce->calevnum[0]-ce->calevnum[1])) ) calevn1++; |
if ( (int)abs((int)(ce->calevnum[0]-ce->calevnum[1])) ) calevn1++; |
388 |
if ( (int)abs((int)(ce->calevnum[2]-ce->calevnum[3])) ) calevn2++; |
if ( (int)abs((int)(ce->calevnum[2]-ce->calevnum[3])) ) calevn2++; |
389 |
if ( (int)abs((int)(ce->calevnum[0]-ce->calevnum[3])) ) calevn3++; |
if ( (int)abs((int)(ce->calevnum[0]-ce->calevnum[3])) ) calevn3++; |
|
// calevn1 += (int)abs((int)(ce->calevnum[0]-ce->calevnum[1])); |
|
|
// calevn2 += (int)abs((int)(ce->calevnum[2]-ce->calevnum[3])); |
|
|
// calevn3 += (int)abs((int)(ce->calevnum[0]-ce->calevnum[3])); |
|
390 |
calev01->Fill(abs((int)(ce->calevnum[0]-ce->calevnum[1]))); |
calev01->Fill(abs((int)(ce->calevnum[0]-ce->calevnum[1]))); |
391 |
calev23->Fill(abs((int)(ce->calevnum[2]-ce->calevnum[3]))); |
calev23->Fill(abs((int)(ce->calevnum[2]-ce->calevnum[3]))); |
392 |
calev03->Fill(abs((int)(ce->calevnum[0]-ce->calevnum[3]))); |
calev03->Fill(abs((int)(ce->calevnum[0]-ce->calevnum[3]))); |
401 |
calevv2 = (int)ce->calevnum[2]; |
calevv2 = (int)ce->calevnum[2]; |
402 |
oldcalev3 = calev3; |
oldcalev3 = calev3; |
403 |
calev3 = (int)ce->calevnum[3]; |
calev3 = (int)ce->calevnum[3]; |
404 |
goto jumpprintout; |
// goto jumpprintout; |
405 |
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) ){ |
406 |
if ( i != minevent ) { |
if ( i != minevent ) { |
407 |
printf(" %f 0 Event %i: %i\n",headco,i,oldcalev0); |
// printf(" %f 0 Event %i: %i\n",headco,i,oldcalev0); |
408 |
printf(" %f 0 Event %i: %i\n",headc,i+1,calev0); |
// printf(" %f 0 Event %i: %i\n",headc,i+1,calev0); |
409 |
printf(" %f 1 Event %i: %i\n",headco,i,oldcalev1); |
// printf(" %f 1 Event %i: %i\n",headco,i,oldcalev1); |
410 |
printf(" %f 1 Event %i: %i\n",headc,i+1,calev1); |
// printf(" %f 1 Event %i: %i\n",headc,i+1,calev1); |
411 |
printf(" %f 2 Event %i: %i\n",headco,i,oldcalev2); |
// printf(" %f 2 Event %i: %i\n",headco,i,oldcalev2); |
412 |
printf(" %f 2 Event %i: %i\n",headc,i+1,calevv2); |
// printf(" %f 2 Event %i: %i\n",headc,i+1,calevv2); |
413 |
printf(" %f 3 Event %i: %i\n",headco,i,oldcalev3); |
// printf(" %f 3 Event %i: %i\n",headco,i,oldcalev3); |
414 |
printf(" %f 3 Event %i: %i\n",headc,i+1,calev3); |
// printf(" %f 3 Event %i: %i\n",headc,i+1,calev3); |
415 |
isRAW = 0; |
isRAW = 0; |
416 |
if ( ce->stwerr[0] & (1 << 3)) isRAW = 1; |
if ( ce->stwerr[0] & (1 << 3)) isRAW = 1; |
417 |
if ( (calev0 - oldcalev0 - 1) > 0 && !isRAW && ce->perror[0] != 129 && oldcalev0 != 0) { |
if ( (calev0 - oldcalev0 - 1) > 0 && !isRAW && ce->perror[0] != 129 && oldcalev0 != 0) { |
418 |
ver[0][10]++; |
ver[0][10]++; |
419 |
|
sighandler(headc,obt,i,0,nevents,evdone); |
420 |
|
printf(" jump in the counter calev is %i oldcalev was %i \n",calev0,oldcalev0); |
421 |
}; |
}; |
422 |
isRAW = 0; |
isRAW = 0; |
423 |
if ( ce->stwerr[0] & (1 << 3)) isRAW = 1; |
if ( ce->stwerr[0] & (1 << 3)) isRAW = 1; |
424 |
if ( (calev1 - oldcalev1 - 1) > 0 && !isRAW && ce->perror[1] != 129 && oldcalev1 != 0 ){ |
if ( (calev1 - oldcalev1 - 1) > 0 && !isRAW && ce->perror[1] != 129 && oldcalev1 != 0 ){ |
425 |
ver[1][10]++; |
ver[1][10]++; |
426 |
|
sighandler(headc,obt,i,1,nevents,evdone); |
427 |
|
printf(" jump in the counter calev is %i oldcalev was %i \n",calev1,oldcalev1); |
428 |
}; |
}; |
429 |
isRAW = 0; |
isRAW = 0; |
430 |
if ( ce->stwerr[0] & (1 << 3)) isRAW = 1; |
if ( ce->stwerr[0] & (1 << 3)) isRAW = 1; |
431 |
if ( (calevv2 - oldcalev2 - 1) > 0 && !isRAW && ce->perror[2] != 129 && oldcalev2 != 0 ){ |
if ( (calevv2 - oldcalev2 - 1) > 0 && !isRAW && ce->perror[2] != 129 && oldcalev2 != 0 ){ |
432 |
ver[2][10]++; |
ver[2][10]++; |
433 |
|
sighandler(headc,obt,i,2,nevents,evdone); |
434 |
|
printf(" jump in the counter calev is %i oldcalev was %i \n",calevv2,oldcalev2); |
435 |
}; |
}; |
436 |
isRAW = 0; |
isRAW = 0; |
437 |
if ( ce->stwerr[0] & (1 << 3)) isRAW = 1; |
if ( ce->stwerr[0] & (1 << 3)) isRAW = 1; |
438 |
if ( (calev3 - oldcalev3 - 1) > 0 && !isRAW && ce->perror[3] != 129 && oldcalev3 != 0 ){ |
if ( (calev3 - oldcalev3 - 1) > 0 && !isRAW && ce->perror[3] != 129 && oldcalev3 != 0 ){ |
439 |
ver[3][10]++; |
ver[3][10]++; |
440 |
|
sighandler(headc,obt,i,3,nevents,evdone); |
441 |
|
printf(" jump in the counter calev is %i oldcalev was %i \n",calev3,oldcalev3); |
442 |
}; |
}; |
443 |
} |
} |
444 |
}; |
}; |
445 |
jumpprintout: |
// jumpprintout: |
446 |
memcpy(shit, nullsh, sizeof(nullsh)); |
memcpy(shit, nullsh, sizeof(nullsh)); |
447 |
memcpy(rshit, nullsh, sizeof(nullsh)); |
memcpy(rshit, nullsh, sizeof(nullsh)); |
448 |
for (Int_t l = 0; l < 2; l++ ){ |
for (Int_t l = 0; l < 2; l++ ){ |
466 |
se = 1; |
se = 1; |
467 |
pl = (ii-1)/2; |
pl = (ii-1)/2; |
468 |
pdone = 0; |
pdone = 0; |
469 |
}; |
}; |
470 |
|
isCOMP = false; |
471 |
isCOMP = 0; |
isFULL = false; |
472 |
isFULL = 0; |
isRAW = false; |
473 |
isRAW = 0; |
if ( ce->stwerr[se] & (1 << 16) ) isCOMP = true; |
474 |
if ( ce->stwerr[se] & (1 << 16) ) isCOMP = 1; |
if ( ce->stwerr[se] & (1 << 17) ) isFULL = true; |
475 |
if ( ce->stwerr[se] & (1 << 17) ) isFULL = 1; |
if ( ce->stwerr[se] & (1 << 3) ) isRAW = true; |
|
if ( ce->stwerr[se] & (1 << 3) ) isRAW = 1; |
|
476 |
bl = -1; |
bl = -1; |
477 |
for (Int_t kk = 0; kk < 96 ; kk++ ){ |
for (Int_t kk = 0; kk < 96 ; kk++ ){ |
478 |
if ( kk%16 == 0 ){ |
if ( kk%16 == 0 ){ |
514 |
if ( obt > maxobt[se] ) maxobt[se] = obt; |
if ( obt > maxobt[se] ) maxobt[se] = obt; |
515 |
}; |
}; |
516 |
lver[se][2]++ ; |
lver[se][2]++ ; |
517 |
|
sighandler(headc,obt,i,se,nevents,evdone); |
518 |
|
printf(" latch up (data) in DSP mode alldexy %i planebases %i \n",alldexy,planebases); |
519 |
}; |
}; |
520 |
} |
} |
521 |
// |
// |
559 |
indexyc++; |
indexyc++; |
560 |
}; |
}; |
561 |
// |
// |
562 |
if (ce->dexyc[l][ii][kk] < 0 ) ver[se][21]++ ; |
if (ce->dexyc[l][ii][kk] < 0 ){ |
563 |
|
ver[se][21]++ ; |
564 |
|
sighandler(headc,obt,i,se,nevents,evdone); |
565 |
|
printf(" negative ADC values!! ce->dexyc[%i][%i][%i] = %f \n",l,ii,kk,ce->dexyc[l][ii][kk]); |
566 |
|
}; |
567 |
// |
// |
568 |
if ( allbase == 0. || allbase > 32000.) { |
if ( allbase == 0. || allbase > 32000.) { |
569 |
fcheck = 0; |
fcheck = 0; |
589 |
if ( obt > maxobt[se] ) maxobt[se] = obt; |
if ( obt > maxobt[se] ) maxobt[se] = obt; |
590 |
}; |
}; |
591 |
lver[se][2]++ ; |
lver[se][2]++ ; |
592 |
|
sighandler(headc,obt,i,se,nevents,evdone); |
593 |
|
printf(" latch up (data) in RAW mode alldexy2 %i \n",alldexy2); |
594 |
}; |
}; |
595 |
}; |
}; |
596 |
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 ) { |
609 |
}; |
}; |
610 |
cshit = 0; |
cshit = 0; |
611 |
for (Int_t k = 0; k < 4 ; k++ ){ |
for (Int_t k = 0; k < 4 ; k++ ){ |
612 |
isCOMP = 0; |
isCOMP = false; |
613 |
isFULL = 0; |
isFULL = false; |
614 |
if ( ce->stwerr[se] & (1 << 16) ) isCOMP = 1; |
cestw=0; |
615 |
if ( ce->stwerr[se] & (1 << 17) ) isFULL = 1; |
if ( ce->stwerr[k] ) cestw = ce->stwerr[k] & cmask ; |
616 |
|
if ( ce->stwerr[k] & (1 << 16) && !(cestw & (1 << 3)) ) isCOMP = true; |
617 |
|
if ( ce->stwerr[k] & (1 << 17) && !(cestw & (1 << 3)) ) isFULL = true; |
618 |
|
// |
619 |
if ( isCOMP ) ver[k][16]++; |
if ( isCOMP ) ver[k][16]++; |
620 |
if ( isFULL ) ver[k][17]++; |
if ( isFULL ) ver[k][17]++; |
621 |
cshit += (int)ce->calstriphit[k]; |
cshit += (int)ce->calstriphit[k]; |
|
cestw=0; |
|
|
if ( ce->stwerr[k] ) cestw = ce->stwerr[k] & cmask ; |
|
622 |
if ( cestw ){ |
if ( cestw ){ |
623 |
if ( cestw & (1 << 0) ) ver[k][6]++ ; |
if ( cestw & (1 << 0) ){ |
624 |
if ( cestw & (1 << 1) ) ver[k][5]++ ; |
ver[k][6]++ ; |
625 |
if ( cestw & (1 << 2) ) ver[k][4]++ ; |
sighandler(headc,obt,i,k,nevents,evdone); |
626 |
if ( cestw & (1 << 3) ) ver[k][3]++ ; |
printf(" CRC error (st. word) \n"); |
627 |
|
}; |
628 |
|
if ( cestw & (1 << 1) ){ |
629 |
|
ver[k][5]++ ; |
630 |
|
sighandler(headc,obt,i,k,nevents,evdone); |
631 |
|
printf(" execution error \n"); |
632 |
|
}; |
633 |
|
if ( cestw & (1 << 2) ){ |
634 |
|
ver[k][4]++ ; |
635 |
|
sighandler(headc,obt,i,k,nevents,evdone); |
636 |
|
printf(" CMD length error \n"); |
637 |
|
}; |
638 |
|
if ( cestw & (1 << 3) ) ver[k][3]++ ; // raw mode |
639 |
if ( cestw & (1 << 4) ){ |
if ( cestw & (1 << 4) ){ |
640 |
ver[k][2]++ ; |
ver[k][2]++ ; |
641 |
|
sighandler(headc,obt,i,k,nevents,evdone); |
642 |
|
printf(" latch up alarm (st. word)\n"); |
643 |
lupstw[k]->Fill(obt); |
lupstw[k]->Fill(obt); |
644 |
if ( swfirstobt[k] ) swminobt[k] = obt; |
if ( swfirstobt[k] ) swminobt[k] = obt; |
645 |
if ( obt > swmaxobt[k] ) swmaxobt[k] = obt; |
if ( obt > swmaxobt[k] ) swmaxobt[k] = obt; |
646 |
}; |
}; |
647 |
if ( cestw & (1 << 5) ) ver[k][1]++ ; |
if ( cestw & (1 << 5) ){ |
648 |
if ( cestw & (1 << 6) ) ver[k][0]++ ; |
ver[k][1]++ ; |
649 |
|
sighandler(headc,obt,i,k,nevents,evdone); |
650 |
|
printf(" temperature alarm \n"); |
651 |
|
}; |
652 |
|
if ( cestw & (1 << 6) ){ |
653 |
|
ver[k][0]++ ; |
654 |
|
sighandler(headc,obt,i,k,nevents,evdone); |
655 |
|
printf(" DSP ack error \n"); |
656 |
|
}; |
657 |
}; |
}; |
658 |
|
if ( ce->stwerr[k] == 0 && ce->perror[k] == 0 ) ver[k][8]++ ; |
659 |
if ( ce->perror[k] != 0. ){ |
if ( ce->perror[k] != 0. ){ |
660 |
if (ce->perror[k] == 128) ver[k][7]++ ; |
if (ce->perror[k] == 128){ |
661 |
if (ce->perror[k] == 129) ver[k][8]++ ; |
ver[k][7]++ ; |
662 |
if (ce->perror[k] == 132) ver[k][11]++ ; |
sighandler(headc,obt,i,k,nevents,evdone); |
663 |
if (ce->perror[k] == 133) ver[k][12]++ ; |
printf(" view or command not recognized \n"); |
664 |
if (ce->perror[k] == 134) ver[k][13]++ ; |
}; |
665 |
if (ce->perror[k] == 135) ver[k][14]++ ; |
if (ce->perror[k] == 129){ |
666 |
if (ce->perror[k] == 136) ver[k][15]++ ; |
ver[k][8]++ ; |
667 |
if (ce->perror[k] == 139) ver[k][18]++ ; |
sighandler(headc,obt,i,k,nevents,evdone); |
668 |
if (ce->perror[k] == 140) ver[k][19]++ ; |
printf(" missing section \n"); |
669 |
if (ce->perror[k] == 141) ver[k][20]++ ; |
}; |
670 |
if (ce->perror[k] == 142) ver[k][22]++ ; |
if (ce->perror[k] == 132){ |
671 |
|
ver[k][11]++ ; |
672 |
|
if ( ver[k][11] < 30 ){ |
673 |
|
sighandler(headc,obt,i,k,nevents,evdone); |
674 |
|
printf(" CRC error (data) \n"); |
675 |
|
}; |
676 |
|
if ( ver[k][11] == 30 ){ |
677 |
|
sighandler(headc,obt,i,k,nevents,evdone); |
678 |
|
printf(" CRC error (data) \n"); |
679 |
|
printf(" WARNING TOO MANY CRC ERRORS ON DATA FOR THIS SECTION \n"); |
680 |
|
printf(" THEY WILL NOT BE DISPLAYED HERE ANYMORE FOR THIS FILE! \n"); |
681 |
|
}; |
682 |
|
}; |
683 |
|
if (ce->perror[k] == 133){ |
684 |
|
ver[k][12]++ ; |
685 |
|
sighandler(headc,obt,i,k,nevents,evdone); |
686 |
|
printf(" length problems in RAW mode \n"); |
687 |
|
}; |
688 |
|
if (ce->perror[k] == 134){ |
689 |
|
ver[k][13]++ ; |
690 |
|
sighandler(headc,obt,i,k,nevents,evdone); |
691 |
|
printf(" length problems in COMPRESS mode \n"); |
692 |
|
}; |
693 |
|
if (ce->perror[k] == 135){ |
694 |
|
ver[k][14]++ ; |
695 |
|
sighandler(headc,obt,i,k,nevents,evdone); |
696 |
|
printf(" length problems in FULL mode \n"); |
697 |
|
}; |
698 |
|
if (ce->perror[k] == 136){ |
699 |
|
ver[k][15]++ ; |
700 |
|
sighandler(headc,obt,i,k,nevents,evdone); |
701 |
|
printf(" acquisition mode problems \n"); |
702 |
|
}; |
703 |
|
if (ce->perror[k] == 139){ |
704 |
|
ver[k][18]++ ; |
705 |
|
sighandler(headc,obt,i,k,nevents,evdone); |
706 |
|
printf(" problems with coding\n"); |
707 |
|
}; |
708 |
|
if (ce->perror[k] == 140){ |
709 |
|
ver[k][19]++ ; |
710 |
|
sighandler(headc,obt,i,k,nevents,evdone); |
711 |
|
printf(" pedestal checksum wrong\n"); |
712 |
|
}; |
713 |
|
if (ce->perror[k] == 141){ |
714 |
|
ver[k][20]++ ; |
715 |
|
sighandler(headc,obt,i,k,nevents,evdone); |
716 |
|
printf(" thresholds checksum wrong\n"); |
717 |
|
}; |
718 |
|
if (ce->perror[k] == 142){ |
719 |
|
ver[k][22]++ ; |
720 |
|
sighandler(headc,obt,i,k,nevents,evdone); |
721 |
|
printf(" packet length is zero (YODA input error), skipped\n"); |
722 |
|
}; |
723 |
}; |
}; |
724 |
for (Int_t kk = 0; kk < 11 ; kk++ ){ |
for (Int_t kk = 0; kk < 11 ; kk++ ){ |
725 |
tshit += shit[k][kk]; |
tshit += shit[k][kk]; |
752 |
h1rin++; |
h1rin++; |
753 |
}; |
}; |
754 |
}; |
}; |
755 |
if ( i%1000 == 0 && i > 0 ) printf("%iK\n",i/1000); |
// if ( i%1000 == 0 && i > 0 ) printf("%iK\n",i/1000); |
756 |
i++; |
i++; |
757 |
}; |
}; |
758 |
printf("\n"); |
printf("\n"); |
759 |
|
printf("\n end processing. \n\n"); |
760 |
if ( (float)h1rout/((float)h1rin+(float)h1rout) > h1rth ){ |
if ( (float)h1rout/((float)h1rin+(float)h1rout) > h1rth ){ |
761 |
h1rcheck = true; |
h1rcheck = true; |
762 |
}; |
}; |
1115 |
Calstriphit->Draw("SAME"); |
Calstriphit->Draw("SAME"); |
1116 |
// |
// |
1117 |
pd4->cd(); |
pd4->cd(); |
1118 |
|
gPad->SetLogy(); |
1119 |
Dexy->SetXTitle("ADC channels"); |
Dexy->SetXTitle("ADC channels"); |
1120 |
Dexy->SetYTitle("Number of events"); |
Dexy->SetYTitle("Number of events"); |
1121 |
Dexy->Draw(); |
Dexy->Draw(); |
1122 |
h1max = Dexy->GetMaximum()*1.05; |
// h1max = Dexy->GetMaximum()*1.05; |
1123 |
|
h1max = Dexy->GetMaximum()*2.05; |
1124 |
Double_t xd[4] = {2000.,5000.,5000.,2000.}; |
Double_t xd[4] = {2000.,5000.,5000.,2000.}; |
1125 |
Double_t yd[4] = {0.,0.,h1max,h1max}; |
Double_t yd[4] = {0.,0.,h1max,h1max}; |
1126 |
banda1 = new TPolyLine(4,xd,yd); |
banda1 = new TPolyLine(4,xd,yd); |
1156 |
pd4->Draw(); |
pd4->Draw(); |
1157 |
// |
// |
1158 |
pd4->cd(); |
pd4->cd(); |
1159 |
|
gPad->SetLogy(); |
1160 |
Dexy->SetXTitle("ADC channels"); |
Dexy->SetXTitle("ADC channels"); |
1161 |
Dexy->SetYTitle("Number of events"); |
Dexy->SetYTitle("Number of events"); |
1162 |
Dexy->Draw(); |
Dexy->Draw(); |
1163 |
h1max = Dexy->GetMaximum()*1.05; |
// h1max = Dexy->GetMaximum()*1.05; |
1164 |
|
h1max = Dexy->GetMaximum()*2.05; |
1165 |
Double_t xd[4] = {2000.,5000.,5000.,2000.}; |
Double_t xd[4] = {2000.,5000.,5000.,2000.}; |
1166 |
Double_t yd[4] = {0.,0.,h1max,h1max}; |
Double_t yd[4] = {0.,0.,h1max,h1max}; |
1167 |
banda1 = new TPolyLine(4,xd,yd); |
banda1 = new TPolyLine(4,xd,yd); |
1305 |
pad2->Draw(); |
pad2->Draw(); |
1306 |
pad3->Draw(); |
pad3->Draw(); |
1307 |
pad4->Draw(); |
pad4->Draw(); |
1308 |
|
// |
1309 |
|
Bool_t redevent = true; |
1310 |
|
// |
1311 |
|
if ( ver[0][3]+ver[0][16]+ver[0][17]+ver[0][8] == ver[1][3]+ver[1][16]+ver[1][17]+ver[1][8] && ver[1][3]+ver[1][16]+ver[1][17]+ver[1][8] == ver[2][3]+ver[2][16]+ver[2][17]+ver[2][8] && ver[2][3]+ver[2][16]+ver[2][17]+ver[2][8] == ver[3][3]+ver[3][16]+ver[3][17]+ver[3][8] ){ |
1312 |
|
redevent = false; |
1313 |
|
}; |
1314 |
|
if ( redevent ) check = true; |
1315 |
|
// |
1316 |
for (Int_t i = 0; i < 4; i++){ |
for (Int_t i = 0; i < 4; i++){ |
1317 |
if (i == 2) |
if (i == 2) |
1318 |
{ |
{ |
1399 |
errore.str(""); |
errore.str(""); |
1400 |
errore << "RAW mode: " << ver[i][j]; |
errore << "RAW mode: " << ver[i][j]; |
1401 |
errore << " time(s)"; |
errore << " time(s)"; |
1402 |
t->SetTextColor(32); |
if ( !redevent ) t->SetTextColor(32); |
1403 |
t->DrawLatex(2.,90.,errore.str().c_str()); |
t->DrawLatex(2.,90.,errore.str().c_str()); |
1404 |
} |
} |
1405 |
if (j == 4) { |
if (j == 4) { |
1442 |
errore << "Calevnum jump: " << ver[i][j]; |
errore << "Calevnum jump: " << ver[i][j]; |
1443 |
errore << " time(s)"; |
errore << " time(s)"; |
1444 |
t->DrawLatex(2.,42.,errore.str().c_str()); |
t->DrawLatex(2.,42.,errore.str().c_str()); |
1445 |
check = true; |
if ( ver[i][j] > 3 ) check = true; |
1446 |
} |
} |
1447 |
if (j == 11) { |
if (j == 11) { |
1448 |
errore.str(""); |
errore.str(""); |
1483 |
errore.str(""); |
errore.str(""); |
1484 |
errore << "COMPRESS mode: " << ver[i][j]; |
errore << "COMPRESS mode: " << ver[i][j]; |
1485 |
errore << " time(s)"; |
errore << " time(s)"; |
1486 |
t->SetTextColor(32); |
if ( !redevent ) t->SetTextColor(32); |
1487 |
t->DrawLatex(2.,86.,errore.str().c_str()); |
t->DrawLatex(2.,86.,errore.str().c_str()); |
1488 |
} |
} |
1489 |
if (j == 17) { |
if (j == 17) { |
1490 |
errore.str(""); |
errore.str(""); |
1491 |
errore << "FULL mode: " << ver[i][j]; |
errore << "FULL mode: " << ver[i][j]; |
1492 |
errore << " time(s)"; |
errore << " time(s)"; |
1493 |
t->SetTextColor(32); |
if ( !redevent ) t->SetTextColor(32); |
1494 |
t->DrawLatex(2.,82.,errore.str().c_str()); |
t->DrawLatex(2.,82.,errore.str().c_str()); |
1495 |
} |
} |
1496 |
if (j == 18) { |
if (j == 18) { |
1636 |
figsave << format; |
figsave << format; |
1637 |
rapporto->SaveAs(figsave.str().c_str()); |
rapporto->SaveAs(figsave.str().c_str()); |
1638 |
}; |
}; |
1639 |
|
if ( iactive && w4i ){ |
1640 |
|
while ( gROOT->GetListOfCanvases()->FindObject(rapporto) || gROOT->GetListOfCanvases()->FindObject(figura3) || gROOT->GetListOfCanvases()->FindObject(figura2) || gROOT->GetListOfCanvases()->FindObject(figura) ){ |
1641 |
|
gSystem->ProcessEvents(); |
1642 |
|
gSystem->Sleep(10); |
1643 |
|
}; |
1644 |
|
}; |
1645 |
} |
} |
1646 |
|
|