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.08 (2006-05-29) |
// 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.08 (2006-05-29): Fixed bug in output filename when input is not in the form DW_YYMMDD_NNN. |
// 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 |
// 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. |
// case of latchup alarm. |
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 ; |
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 ) { |
if ( (ce->stwerr[se] & (1 << 4)) == 0 ) { |
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 ){ |
if ( (ce->stwerr[se] & (1 << 4)) == 0 ){ |
1082 |
pd7->Draw(); |
pd7->Draw(); |
1083 |
pd8->Draw(); |
pd8->Draw(); |
1084 |
pd1->cd(); |
pd1->cd(); |
1085 |
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"); |
1086 |
|
lup[0]->SetXTitle("OBT"); |
1087 |
|
lup[0]->SetYTitle("Number of events"); |
1088 |
lup[0]->Draw(); |
lup[0]->Draw(); |
1089 |
pd5->cd(); |
pd5->cd(); |
1090 |
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"); |
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(); |
lupstw[0]->Draw(); |
1095 |
pd2->cd(); |
pd2->cd(); |
1096 |
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"); |
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(); |
lup[1]->Draw(); |
1101 |
pd6->cd(); |
pd6->cd(); |
1102 |
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"); |
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(); |
lupstw[1]->Draw(); |
1107 |
pd3->cd(); |
pd3->cd(); |
1108 |
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"); |
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(); |
lup[2]->Draw(); |
1113 |
pd7->cd(); |
pd7->cd(); |
1114 |
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"); |
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(); |
lupstw[2]->Draw(); |
1119 |
pd4->cd(); |
pd4->cd(); |
1120 |
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"); |
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(); |
lup[3]->Draw(); |
1125 |
pd8->cd(); |
pd8->cd(); |
1126 |
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"); |
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(); |
lupstw[3]->Draw(); |
1131 |
}; |
}; |
1132 |
// |
// |