86 |
} else { |
} else { |
87 |
Int_t posiz2 = 0; |
Int_t posiz2 = 0; |
88 |
stringcopy(file2,gSystem->BaseName(filename.Data()),posiz2,posiz); |
stringcopy(file2,gSystem->BaseName(filename.Data()),posiz2,posiz); |
89 |
TString pdat(".dat"); |
TString pdat(".pam"); |
90 |
stringappend(file2,pdat); |
stringappend(file2,pdat); |
91 |
}; |
}; |
92 |
return file2; |
return file2; |
140 |
// |
// |
141 |
Float_t ctshitthr = 0.65; |
Float_t ctshitthr = 0.65; |
142 |
Float_t cbasethr = 0.95; |
Float_t cbasethr = 0.95; |
143 |
Float_t cdexythr = 0.995; |
// Float_t cdexythr = 0.995; |
144 |
|
Float_t cdexythr = 0.95; |
145 |
//Float_t cdexythr = 0.90; |
//Float_t cdexythr = 0.90; |
146 |
Float_t cdexycthr = 0.95; |
Float_t cdexycthr = 0.95; |
147 |
Float_t h1rth = 0.90; |
Float_t h1rth = 0.90; |
192 |
}; |
}; |
193 |
Int_t const size = nevents; |
Int_t const size = nevents; |
194 |
Double_t iev2[size+1]; |
Double_t iev2[size+1]; |
195 |
Int_t ver[4][23], lver[4][23],shit[4][11], rshit[4][11], se,bl, pl, fulldiff[4],cshit, cpre[4],nullsh[4][11], lalarm[4]; |
//aumentata la lunghezza di ver, prima era 23 |
196 |
|
Int_t ver[4][24], lver[4][23],shit[4][11], rshit[4][11], se,bl, pl, fulldiff[4],cshit, cpre[4],nullsh[4][11], lalarm[4]; |
197 |
se = 0; |
se = 0; |
198 |
pl = 0; |
pl = 0; |
199 |
Float_t allbase = 0.; |
Float_t allbase = 0.; |
295 |
maxevent = fromevent - 1; |
maxevent = fromevent - 1; |
296 |
}; |
}; |
297 |
}; |
}; |
298 |
|
//azzera i tipi di errore |
299 |
for (Int_t k = 0; k < 4; k++ ){ |
for (Int_t k = 0; k < 4; k++ ){ |
300 |
for (Int_t m = 0; m < 23 ; m++ ){ |
for (Int_t m = 0; m < 23 ; m++ ){ |
301 |
ver[k][m] = 0 ; |
ver[k][m] = 0 ; |
307 |
}; |
}; |
308 |
lalarm[k] = 0; |
lalarm[k] = 0; |
309 |
}; |
}; |
310 |
|
//il 23 lo azzero cosi per non modificare le altre variabili |
311 |
|
ver[k][23]=0; |
312 |
}; |
}; |
313 |
Int_t pdone, bdone; |
Int_t pdone, bdone; |
314 |
pdone = 0; |
pdone = 0; |
382 |
tshit = 0; |
tshit = 0; |
383 |
trshit = 0; |
trshit = 0; |
384 |
tr->GetEntry(i); |
tr->GetEntry(i); |
385 |
|
|
386 |
iev2[i] = ce->iev; |
iev2[i] = ce->iev; |
387 |
// |
// |
388 |
ph = eh->GetPscuHeader(); |
ph = eh->GetPscuHeader(); |
389 |
headco = headc; |
headco = headc; |
390 |
headc = ph->GetCounter(); |
headc = ph->GetCounter(); |
391 |
obt = ph->GetOrbitalTime(); |
obt = ph->GetOrbitalTime(); |
392 |
|
|
393 |
if ( (int)abs((int)(ce->calevnum[0]-ce->calevnum[1])) ) calevn1++; |
if ( (int)abs((int)(ce->calevnum[0]-ce->calevnum[1])) ) calevn1++; |
394 |
if ( (int)abs((int)(ce->calevnum[2]-ce->calevnum[3])) ) calevn2++; |
if ( (int)abs((int)(ce->calevnum[2]-ce->calevnum[3])) ) calevn2++; |
395 |
if ( (int)abs((int)(ce->calevnum[0]-ce->calevnum[3])) ) calevn3++; |
if ( (int)abs((int)(ce->calevnum[0]-ce->calevnum[3])) ) calevn3++; |
446 |
sighandler(headc,obt,i,3,nevents,evdone); |
sighandler(headc,obt,i,3,nevents,evdone); |
447 |
printf(" jump in the counter calev is %i oldcalev was %i \n",calev3,oldcalev3); |
printf(" jump in the counter calev is %i oldcalev was %i \n",calev3,oldcalev3); |
448 |
}; |
}; |
449 |
} |
}; |
450 |
}; |
}; |
451 |
// jumpprintout: |
// jumpprintout: |
452 |
memcpy(shit, nullsh, sizeof(nullsh)); |
memcpy(shit, nullsh, sizeof(nullsh)); |
520 |
if ( obt > maxobt[se] ) maxobt[se] = obt; |
if ( obt > maxobt[se] ) maxobt[se] = obt; |
521 |
}; |
}; |
522 |
lver[se][2]++ ; |
lver[se][2]++ ; |
523 |
sighandler(headc,obt,i,se,nevents,evdone); |
if ( lver[se][2] == 1000 ){ |
524 |
printf(" latch up (data) in DSP mode alldexy %i planebases %i \n",alldexy,planebases); |
sighandler(headc,obt,i,se,nevents,evdone); |
525 |
|
printf(" latch up (data) in DSP mode alldexy %i planebases %i \n",alldexy,planebases); |
526 |
|
printf(" WARNING TOO MANY LATCHUP ERRORS ON DATA FOR THIS SECTION \n"); |
527 |
|
printf(" THEY WILL NOT BE DISPLAYED HERE ANYMORE FOR THIS FILE! \n"); |
528 |
|
}; |
529 |
|
if ( lver[se][2] < 1000 ){ |
530 |
|
sighandler(headc,obt,i,se,nevents,evdone); |
531 |
|
printf(" latch up (data) in DSP mode alldexy %i planebases %i \n",alldexy,planebases); |
532 |
|
}; |
533 |
}; |
}; |
534 |
} |
} |
535 |
// |
// |
536 |
if ( !bdone ){ |
if ( !bdone ){ |
537 |
Baseline->Fill(ce->base[l][ii][bl]); |
Baseline->Fill(ce->base[l][ii][bl]); |
538 |
if ( ce->base[l][ii][bl] > 2000. && ce->base[l][ii][bl] < 4500. ){ |
if ( ce->base[l][ii][bl] > 2000. && ce->base[l][ii][bl] < 5500. ){ |
539 |
inbase++; |
inbase++; |
540 |
} else { |
} else { |
541 |
outbase++; |
outbase++; |
593 |
} else { |
} else { |
594 |
if ( !pdone ){ |
if ( !pdone ){ |
595 |
if ( ( alldexy2 > 3072000 || alldexy2 == 0) && ce->perror[se] == 0 ) { |
if ( ( alldexy2 > 3072000 || alldexy2 == 0) && ce->perror[se] == 0 ) { |
596 |
// if ( (alldexy2>512000 || alldexy2 == 0) && ce->perror[se] == 0 ) { |
// if ( (alldexy2>512000 || alldexy2 == 0) && ce->perror[se] == 0 ) |
597 |
pdone = 1; |
pdone = 1; |
598 |
pshit[se][pl]++ ; |
pshit[se][pl]++ ; |
599 |
if ( (ce->stwerr[se] & (1 << 4)) == 0 ){ |
if ( (ce->stwerr[se] & (1 << 4)) == 0 ){ |
603 |
if ( obt > maxobt[se] ) maxobt[se] = obt; |
if ( obt > maxobt[se] ) maxobt[se] = obt; |
604 |
}; |
}; |
605 |
lver[se][2]++ ; |
lver[se][2]++ ; |
606 |
sighandler(headc,obt,i,se,nevents,evdone); |
if ( lver[se][2] == 1000 ){ |
607 |
printf(" latch up (data) in RAW mode alldexy2 %i \n",alldexy2); |
sighandler(headc,obt,i,se,nevents,evdone); |
608 |
|
printf(" latch up (data) in RAW mode alldexy2 %i \n",alldexy2); |
609 |
|
printf(" WARNING TOO MANY LATCHUP ERRORS ON DATA FOR THIS SECTION \n"); |
610 |
|
printf(" THEY WILL NOT BE DISPLAYED HERE ANYMORE FOR THIS FILE! \n"); |
611 |
|
}; |
612 |
|
if ( lver[se][2] < 1000 ){ |
613 |
|
sighandler(headc,obt,i,se,nevents,evdone); |
614 |
|
printf(" latch up (data) in RAW mode alldexy2 %i \n",alldexy2); |
615 |
|
}; |
616 |
}; |
}; |
617 |
}; |
}; |
618 |
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 ) { |
633 |
for (Int_t k = 0; k < 4 ; k++ ){ |
for (Int_t k = 0; k < 4 ; k++ ){ |
634 |
isCOMP = false; |
isCOMP = false; |
635 |
isFULL = false; |
isFULL = false; |
636 |
cestw=0; |
cestw=0;// queste righe qui |
637 |
if ( ce->stwerr[k] ) cestw = ce->stwerr[k] & cmask ; |
if ( ce->stwerr[k] ) cestw = ce->stwerr[k] & cmask ;// |
638 |
if ( ce->stwerr[k] & (1 << 16) && !(cestw & (1 << 3)) ) isCOMP = true; |
if ( ce->stwerr[k] & (1 << 16) && !(cestw & (1 << 3)) ) isCOMP = true; |
639 |
if ( ce->stwerr[k] & (1 << 17) && !(cestw & (1 << 3)) ) isFULL = true; |
if ( ce->stwerr[k] & (1 << 17) && !(cestw & (1 << 3)) ) isFULL = true; |
640 |
// |
// |
660 |
if ( cestw & (1 << 3) ) ver[k][3]++ ; // raw mode |
if ( cestw & (1 << 3) ) ver[k][3]++ ; // raw mode |
661 |
if ( cestw & (1 << 4) ){ |
if ( cestw & (1 << 4) ){ |
662 |
ver[k][2]++ ; |
ver[k][2]++ ; |
663 |
sighandler(headc,obt,i,k,nevents,evdone); |
if ( ver[k][2] == 1000 ){ |
664 |
printf(" latch up alarm (st. word)\n"); |
sighandler(headc,obt,i,k,nevents,evdone); |
665 |
|
printf(" latch up alarm (st. word)\n"); |
666 |
|
printf(" WARNING TOO MANY LATCHUP ERRORS ON DATA FOR THIS SECTION \n"); |
667 |
|
printf(" THEY WILL NOT BE DISPLAYED HERE ANYMORE FOR THIS FILE! \n"); |
668 |
|
}; |
669 |
|
if ( ver[k][2] < 1000 ){ |
670 |
|
sighandler(headc,obt,i,k,nevents,evdone); |
671 |
|
printf(" latch up alarm (st. word)\n"); |
672 |
|
}; |
673 |
lupstw[k]->Fill(obt); |
lupstw[k]->Fill(obt); |
674 |
if ( swfirstobt[k] ) swminobt[k] = obt; |
if ( swfirstobt[k] ) swminobt[k] = obt; |
675 |
if ( obt > swmaxobt[k] ) swmaxobt[k] = obt; |
if ( obt > swmaxobt[k] ) swmaxobt[k] = obt; |
684 |
sighandler(headc,obt,i,k,nevents,evdone); |
sighandler(headc,obt,i,k,nevents,evdone); |
685 |
printf(" DSP ack error \n"); |
printf(" DSP ack error \n"); |
686 |
}; |
}; |
687 |
}; |
};// controllo se ci sono errori crc se perr=0 ok! |
688 |
if ( ce->stwerr[k] == 0 && ce->perror[k] == 0 ) ver[k][8]++ ; |
if ( ce->stwerr[k] == 0 && ce->perror[k] == 0 ) ver[k][8]++ ; |
689 |
if ( ce->perror[k] != 0. ){ |
if ( ce->perror[k] != 0. ){ |
690 |
if (ce->perror[k] == 128){ |
if (ce->perror[k] == 128){ |
750 |
sighandler(headc,obt,i,k,nevents,evdone); |
sighandler(headc,obt,i,k,nevents,evdone); |
751 |
printf(" packet length is zero (YODA input error), skipped\n"); |
printf(" packet length is zero (YODA input error), skipped\n"); |
752 |
}; |
}; |
753 |
|
//aggiunto questo errore |
754 |
|
if (ce->perror[k] == 143){ |
755 |
|
ver[k][23]++ ; |
756 |
|
sighandler(headc,obt,i,k,nevents,evdone); |
757 |
|
printf(" corrupted packet lenght \n"); |
758 |
|
}; |
759 |
}; |
}; |
760 |
for (Int_t kk = 0; kk < 11 ; kk++ ){ |
for (Int_t kk = 0; kk < 11 ; kk++ ){ |
761 |
tshit += shit[k][kk]; |
tshit += shit[k][kk]; |
765 |
if (isCOMP || isFULL){ |
if (isCOMP || isFULL){ |
766 |
Calstriphit->Fill(cshit); |
Calstriphit->Fill(cshit); |
767 |
// if ( (cshit > 0 && cshit < 25) || (cshit > 40 && cshit < 80) ){ |
// if ( (cshit > 0 && cshit < 25) || (cshit > 40 && cshit < 80) ){ |
768 |
if ( (cshit > 10 && cshit < 100) ){ |
// |
769 |
|
//cambiata la banda di soglia ora 5 prima era 10 |
770 |
|
// |
771 |
|
if ( (cshit > 5 && cshit < 100) ){ |
772 |
incshit++; |
incshit++; |
773 |
} else { |
} else { |
774 |
outcshit++; |
outcshit++; |
776 |
// |
// |
777 |
if ( tshit>0 ) h1->Fill(tshit); |
if ( tshit>0 ) h1->Fill(tshit); |
778 |
// if ( (tshit > 0 && tshit < 25) || (tshit > 40 && tshit < 80) ){ |
// if ( (tshit > 0 && tshit < 25) || (tshit > 40 && tshit < 80) ){ |
779 |
if ( (tshit > 10 && tshit < 100) ){ |
//cambiata la soglia ora 5 prima era 10 |
780 |
|
if ( (tshit > 5 && tshit < 100) ){ |
781 |
intshit++; |
intshit++; |
782 |
} else { |
} else { |
783 |
outtshit++; |
outtshit++; |
865 |
h1->Draw(); |
h1->Draw(); |
866 |
// |
// |
867 |
h1max = h1->GetMaximum()*1.05; |
h1max = h1->GetMaximum()*1.05; |
868 |
Double_t xc[4] = {10.,100.,100.,10.}; |
|
869 |
|
//cambiata banda prima era 10 ora 5 |
870 |
|
Double_t xc[4] = {5.,100.,100.,5.}; |
871 |
Double_t yc[4] = {0.,0.,h1max,h1max}; |
Double_t yc[4] = {0.,0.,h1max,h1max}; |
872 |
banda1 = new TPolyLine(4,xc,yc); |
banda1 = new TPolyLine(4,xc,yc); |
873 |
banda1->SetLineColor(5); |
banda1->SetLineColor(5); |
917 |
h1->SetYTitle("Number of events"); |
h1->SetYTitle("Number of events"); |
918 |
h1->Draw(); |
h1->Draw(); |
919 |
h1max = h1->GetMaximum()*1.05; |
h1max = h1->GetMaximum()*1.05; |
920 |
Double_t xe[4] = {10.,100.,100.,10.}; |
//cambiato banda, prima era 10,ora 5 |
921 |
|
Double_t xe[4] = {5.,100.,100.,5.}; |
922 |
Double_t ye[4] = {0.,0.,h1max,h1max}; |
Double_t ye[4] = {0.,0.,h1max,h1max}; |
923 |
banda1 = new TPolyLine(4,xe,ye); |
banda1 = new TPolyLine(4,xe,ye); |
924 |
banda1->SetLineColor(5); |
banda1->SetLineColor(5); |
1104 |
Baseline->SetYTitle("Number of events"); |
Baseline->SetYTitle("Number of events"); |
1105 |
Baseline->Draw(); |
Baseline->Draw(); |
1106 |
h1max = Baseline->GetMaximum()*1.05; |
h1max = Baseline->GetMaximum()*1.05; |
1107 |
Double_t xc[4] = {2000.,4500.,4500.,2000.}; |
Double_t xc[4] = {2000.,5500.,5500.,2000.}; |
1108 |
Double_t yc[4] = {0.,0.,h1max,h1max}; |
Double_t yc[4] = {0.,0.,h1max,h1max}; |
1109 |
banda1 = new TPolyLine(4,xc,yc); |
banda1 = new TPolyLine(4,xc,yc); |
1110 |
banda1->SetLineColor(5); |
banda1->SetLineColor(5); |
1141 |
Calstriphit->SetYTitle("Number of events"); |
Calstriphit->SetYTitle("Number of events"); |
1142 |
Calstriphit->Draw(); |
Calstriphit->Draw(); |
1143 |
h1max = Calstriphit->GetMaximum()*1.05; |
h1max = Calstriphit->GetMaximum()*1.05; |
1144 |
Double_t xg[4] = {10.,100.,100.,10.}; |
|
1145 |
|
//banda di sogla portata a 5, prima era a 10 |
1146 |
|
Double_t xg[4] = {5.,100.,100.,5.}; |
1147 |
Double_t yg[4] = {0.,0.,h1max,h1max}; |
Double_t yg[4] = {0.,0.,h1max,h1max}; |
1148 |
banda1 = new TPolyLine(4,xg,yg); |
banda1 = new TPolyLine(4,xg,yg); |
1149 |
banda1->SetLineColor(5); |
banda1->SetLineColor(5); |
1385 |
t->SetTextAlign(12); |
t->SetTextAlign(12); |
1386 |
t->DrawLatex(33.,97.,sezione); |
t->DrawLatex(33.,97.,sezione); |
1387 |
t->SetTextSize(0.05); |
t->SetTextSize(0.05); |
1388 |
for (Int_t j = 0; j < 23; j++){ |
//aggiunto un errore jmax=23 |
1389 |
|
for (Int_t j = 0; j < 24; j++){ |
1390 |
if ( ver[i][j] || lver[i][j] ) { |
if ( ver[i][j] || lver[i][j] ) { |
1391 |
t->SetTextColor(50); |
t->SetTextColor(50); |
1392 |
if (j == 0) { |
if (j == 0) { |
1574 |
t->DrawLatex(2.,3.,errore.str().c_str()); |
t->DrawLatex(2.,3.,errore.str().c_str()); |
1575 |
check = true; |
check = true; |
1576 |
}; |
}; |
1577 |
}; |
//aggiunto questo errore |
1578 |
}; |
if (j == 23) { |
1579 |
|
errore.str(""); |
1580 |
|
errore << "Corrupted packet lenght " << ver[i][j]; |
1581 |
|
errore << " time(s) "; |
1582 |
|
t->DrawLatex(2.,2.,errore.str().c_str()); |
1583 |
|
check = true; |
1584 |
|
}; |
1585 |
|
}; |
1586 |
|
}; |
1587 |
t->SetTextColor(50); |
t->SetTextColor(50); |
1588 |
if ( fulldiff[i] !=0 ) { |
if ( fulldiff[i] !=0 ) { |
1589 |
check = true; |
check = true; |
1610 |
if ( check ){ |
if ( check ){ |
1611 |
t->SetTextColor(50); |
t->SetTextColor(50); |
1612 |
t->DrawLatex(60.,95.," WARNING, CHECK! "); |
t->DrawLatex(60.,95.," WARNING, CHECK! "); |
|
printf("cdexyc %f cdexy %f ctshit %f cbase %f \n",cdexyc,cdexy,ctshit,cbase); |
|
1613 |
} else { |
} else { |
1614 |
t->SetTextColor(32); |
t->SetTextColor(32); |
1615 |
t->DrawLatex(60.,95.," OK! "); |
t->DrawLatex(60.,95.," OK! "); |
1616 |
}; |
}; |
1617 |
|
printf("cdexyc %f cdexy %f ctshit %f cbase %f \n",cdexyc,cdexy,ctshit,cbase); |
1618 |
// |
// |
1619 |
// const string fil = (const char*)filename; |
// const string fil = (const char*)filename; |
1620 |
// Int_t posiz = fil.find("dw_"); |
// Int_t posiz = fil.find("dw_"); |
1697 |
}; |
}; |
1698 |
}; |
}; |
1699 |
} |
} |
|
|
|