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)); |
585 |
} else { |
} else { |
586 |
if ( !pdone ){ |
if ( !pdone ){ |
587 |
if ( ( alldexy2 > 3072000 || alldexy2 == 0) && ce->perror[se] == 0 ) { |
if ( ( alldexy2 > 3072000 || alldexy2 == 0) && ce->perror[se] == 0 ) { |
588 |
// if ( (alldexy2>512000 || alldexy2 == 0) && ce->perror[se] == 0 ) { |
// if ( (alldexy2>512000 || alldexy2 == 0) && ce->perror[se] == 0 ) |
589 |
pdone = 1; |
pdone = 1; |
590 |
pshit[se][pl]++ ; |
pshit[se][pl]++ ; |
591 |
if ( (ce->stwerr[se] & (1 << 4)) == 0 ){ |
if ( (ce->stwerr[se] & (1 << 4)) == 0 ){ |
617 |
for (Int_t k = 0; k < 4 ; k++ ){ |
for (Int_t k = 0; k < 4 ; k++ ){ |
618 |
isCOMP = false; |
isCOMP = false; |
619 |
isFULL = false; |
isFULL = false; |
620 |
cestw=0; |
cestw=0;// queste righe qui |
621 |
if ( ce->stwerr[k] ) cestw = ce->stwerr[k] & cmask ; |
if ( ce->stwerr[k] ) cestw = ce->stwerr[k] & cmask ;// |
622 |
if ( ce->stwerr[k] & (1 << 16) && !(cestw & (1 << 3)) ) isCOMP = true; |
if ( ce->stwerr[k] & (1 << 16) && !(cestw & (1 << 3)) ) isCOMP = true; |
623 |
if ( ce->stwerr[k] & (1 << 17) && !(cestw & (1 << 3)) ) isFULL = true; |
if ( ce->stwerr[k] & (1 << 17) && !(cestw & (1 << 3)) ) isFULL = true; |
624 |
// |
// |
660 |
sighandler(headc,obt,i,k,nevents,evdone); |
sighandler(headc,obt,i,k,nevents,evdone); |
661 |
printf(" DSP ack error \n"); |
printf(" DSP ack error \n"); |
662 |
}; |
}; |
663 |
}; |
};// controllo se ci sono errori crc se perr=0 ok! |
664 |
if ( ce->stwerr[k] == 0 && ce->perror[k] == 0 ) ver[k][8]++ ; |
if ( ce->stwerr[k] == 0 && ce->perror[k] == 0 ) ver[k][8]++ ; |
665 |
if ( ce->perror[k] != 0. ){ |
if ( ce->perror[k] != 0. ){ |
666 |
if (ce->perror[k] == 128){ |
if (ce->perror[k] == 128){ |
726 |
sighandler(headc,obt,i,k,nevents,evdone); |
sighandler(headc,obt,i,k,nevents,evdone); |
727 |
printf(" packet length is zero (YODA input error), skipped\n"); |
printf(" packet length is zero (YODA input error), skipped\n"); |
728 |
}; |
}; |
729 |
|
//aggiunto questo errore |
730 |
|
if (ce->perror[k] == 143){ |
731 |
|
ver[k][23]++ ; |
732 |
|
sighandler(headc,obt,i,k,nevents,evdone); |
733 |
|
printf(" corrupted packet lenght \n"); |
734 |
|
}; |
735 |
}; |
}; |
736 |
for (Int_t kk = 0; kk < 11 ; kk++ ){ |
for (Int_t kk = 0; kk < 11 ; kk++ ){ |
737 |
tshit += shit[k][kk]; |
tshit += shit[k][kk]; |
741 |
if (isCOMP || isFULL){ |
if (isCOMP || isFULL){ |
742 |
Calstriphit->Fill(cshit); |
Calstriphit->Fill(cshit); |
743 |
// if ( (cshit > 0 && cshit < 25) || (cshit > 40 && cshit < 80) ){ |
// if ( (cshit > 0 && cshit < 25) || (cshit > 40 && cshit < 80) ){ |
744 |
if ( (cshit > 10 && cshit < 100) ){ |
// |
745 |
|
//cambiata la banda di soglia ora 5 prima era 10 |
746 |
|
// |
747 |
|
if ( (cshit > 5 && cshit < 100) ){ |
748 |
incshit++; |
incshit++; |
749 |
} else { |
} else { |
750 |
outcshit++; |
outcshit++; |
752 |
// |
// |
753 |
if ( tshit>0 ) h1->Fill(tshit); |
if ( tshit>0 ) h1->Fill(tshit); |
754 |
// if ( (tshit > 0 && tshit < 25) || (tshit > 40 && tshit < 80) ){ |
// if ( (tshit > 0 && tshit < 25) || (tshit > 40 && tshit < 80) ){ |
755 |
if ( (tshit > 10 && tshit < 100) ){ |
//cambiata la soglia ora 5 prima era 10 |
756 |
|
if ( (tshit > 5 && tshit < 100) ){ |
757 |
intshit++; |
intshit++; |
758 |
} else { |
} else { |
759 |
outtshit++; |
outtshit++; |
841 |
h1->Draw(); |
h1->Draw(); |
842 |
// |
// |
843 |
h1max = h1->GetMaximum()*1.05; |
h1max = h1->GetMaximum()*1.05; |
844 |
Double_t xc[4] = {10.,100.,100.,10.}; |
|
845 |
|
//cambiata banda prima era 10 ora 5 |
846 |
|
Double_t xc[4] = {5.,100.,100.,5.}; |
847 |
Double_t yc[4] = {0.,0.,h1max,h1max}; |
Double_t yc[4] = {0.,0.,h1max,h1max}; |
848 |
banda1 = new TPolyLine(4,xc,yc); |
banda1 = new TPolyLine(4,xc,yc); |
849 |
banda1->SetLineColor(5); |
banda1->SetLineColor(5); |
893 |
h1->SetYTitle("Number of events"); |
h1->SetYTitle("Number of events"); |
894 |
h1->Draw(); |
h1->Draw(); |
895 |
h1max = h1->GetMaximum()*1.05; |
h1max = h1->GetMaximum()*1.05; |
896 |
Double_t xe[4] = {10.,100.,100.,10.}; |
//cambiato banda, prima era 10,ora 5 |
897 |
|
Double_t xe[4] = {5.,100.,100.,5.}; |
898 |
Double_t ye[4] = {0.,0.,h1max,h1max}; |
Double_t ye[4] = {0.,0.,h1max,h1max}; |
899 |
banda1 = new TPolyLine(4,xe,ye); |
banda1 = new TPolyLine(4,xe,ye); |
900 |
banda1->SetLineColor(5); |
banda1->SetLineColor(5); |
1117 |
Calstriphit->SetYTitle("Number of events"); |
Calstriphit->SetYTitle("Number of events"); |
1118 |
Calstriphit->Draw(); |
Calstriphit->Draw(); |
1119 |
h1max = Calstriphit->GetMaximum()*1.05; |
h1max = Calstriphit->GetMaximum()*1.05; |
1120 |
Double_t xg[4] = {10.,100.,100.,10.}; |
|
1121 |
|
//banda di sogla portata a 5, prima era a 10 |
1122 |
|
Double_t xg[4] = {5.,100.,100.,5.}; |
1123 |
Double_t yg[4] = {0.,0.,h1max,h1max}; |
Double_t yg[4] = {0.,0.,h1max,h1max}; |
1124 |
banda1 = new TPolyLine(4,xg,yg); |
banda1 = new TPolyLine(4,xg,yg); |
1125 |
banda1->SetLineColor(5); |
banda1->SetLineColor(5); |
1361 |
t->SetTextAlign(12); |
t->SetTextAlign(12); |
1362 |
t->DrawLatex(33.,97.,sezione); |
t->DrawLatex(33.,97.,sezione); |
1363 |
t->SetTextSize(0.05); |
t->SetTextSize(0.05); |
1364 |
for (Int_t j = 0; j < 23; j++){ |
//aggiunto un errore jmax=23 |
1365 |
|
for (Int_t j = 0; j < 24; j++){ |
1366 |
if ( ver[i][j] || lver[i][j] ) { |
if ( ver[i][j] || lver[i][j] ) { |
1367 |
t->SetTextColor(50); |
t->SetTextColor(50); |
1368 |
if (j == 0) { |
if (j == 0) { |
1550 |
t->DrawLatex(2.,3.,errore.str().c_str()); |
t->DrawLatex(2.,3.,errore.str().c_str()); |
1551 |
check = true; |
check = true; |
1552 |
}; |
}; |
1553 |
}; |
//aggiunto questo errore |
1554 |
}; |
if (j == 23) { |
1555 |
|
errore.str(""); |
1556 |
|
errore << "Corrupted packet lenght " << ver[i][j]; |
1557 |
|
errore << " time(s) "; |
1558 |
|
t->DrawLatex(2.,2.,errore.str().c_str()); |
1559 |
|
check = true; |
1560 |
|
}; |
1561 |
|
}; |
1562 |
|
}; |
1563 |
t->SetTextColor(50); |
t->SetTextColor(50); |
1564 |
if ( fulldiff[i] !=0 ) { |
if ( fulldiff[i] !=0 ) { |
1565 |
check = true; |
check = true; |
1586 |
if ( check ){ |
if ( check ){ |
1587 |
t->SetTextColor(50); |
t->SetTextColor(50); |
1588 |
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); |
|
1589 |
} else { |
} else { |
1590 |
t->SetTextColor(32); |
t->SetTextColor(32); |
1591 |
t->DrawLatex(60.,95.," OK! "); |
t->DrawLatex(60.,95.," OK! "); |
1592 |
}; |
}; |
1593 |
|
printf("cdexyc %f cdexy %f ctshit %f cbase %f \n",cdexyc,cdexy,ctshit,cbase); |
1594 |
// |
// |
1595 |
// const string fil = (const char*)filename; |
// const string fil = (const char*)filename; |
1596 |
// Int_t posiz = fil.find("dw_"); |
// Int_t posiz = fil.find("dw_"); |
1673 |
}; |
}; |
1674 |
}; |
}; |
1675 |
} |
} |
|
|
|