--- calo/flight/FQLOOK/macros/FCaloQLOOK.cxx 2006/09/29 06:22:43 1.18 +++ calo/flight/FQLOOK/macros/FCaloQLOOK.cxx 2008/09/22 20:12:28 1.23 @@ -40,6 +40,7 @@ #include #include #include +#include #include #include #include @@ -86,7 +87,7 @@ } else { Int_t posiz2 = 0; stringcopy(file2,gSystem->BaseName(filename.Data()),posiz2,posiz); - TString pdat(".dat"); + TString pdat(".pam"); stringappend(file2,pdat); }; return file2; @@ -140,7 +141,8 @@ // Float_t ctshitthr = 0.65; Float_t cbasethr = 0.95; - Float_t cdexythr = 0.995; + // Float_t cdexythr = 0.995; + Float_t cdexythr = 0.95; //Float_t cdexythr = 0.90; Float_t cdexycthr = 0.95; Float_t h1rth = 0.90; @@ -191,7 +193,8 @@ }; Int_t const size = nevents; Double_t iev2[size+1]; - 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 + 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]; se = 0; pl = 0; Float_t allbase = 0.; @@ -293,7 +296,7 @@ maxevent = fromevent - 1; }; }; - + //azzera i tipi di errore for (Int_t k = 0; k < 4; k++ ){ for (Int_t m = 0; m < 23 ; m++ ){ ver[k][m] = 0 ; @@ -305,6 +308,8 @@ }; lalarm[k] = 0; }; + //il 23 lo azzero cosi per non modificare le altre variabili + ver[k][23]=0; }; Int_t pdone, bdone; pdone = 0; @@ -378,12 +383,14 @@ tshit = 0; trshit = 0; tr->GetEntry(i); + iev2[i] = ce->iev; // ph = eh->GetPscuHeader(); headco = headc; headc = ph->GetCounter(); obt = ph->GetOrbitalTime(); + if ( (int)abs((int)(ce->calevnum[0]-ce->calevnum[1])) ) calevn1++; if ( (int)abs((int)(ce->calevnum[2]-ce->calevnum[3])) ) calevn2++; if ( (int)abs((int)(ce->calevnum[0]-ce->calevnum[3])) ) calevn3++; @@ -440,7 +447,7 @@ sighandler(headc,obt,i,3,nevents,evdone); printf(" jump in the counter calev is %i oldcalev was %i \n",calev3,oldcalev3); }; - } + }; }; // jumpprintout: memcpy(shit, nullsh, sizeof(nullsh)); @@ -514,14 +521,22 @@ if ( obt > maxobt[se] ) maxobt[se] = obt; }; lver[se][2]++ ; - sighandler(headc,obt,i,se,nevents,evdone); - printf(" latch up (data) in DSP mode alldexy %i planebases %i \n",alldexy,planebases); + if ( lver[se][2] == 1000 ){ + sighandler(headc,obt,i,se,nevents,evdone); + printf(" latch up (data) in DSP mode alldexy %i planebases %i \n",alldexy,planebases); + printf(" WARNING TOO MANY LATCHUP ERRORS ON DATA FOR THIS SECTION \n"); + printf(" THEY WILL NOT BE DISPLAYED HERE ANYMORE FOR THIS FILE! \n"); + }; + if ( lver[se][2] < 1000 ){ + sighandler(headc,obt,i,se,nevents,evdone); + printf(" latch up (data) in DSP mode alldexy %i planebases %i \n",alldexy,planebases); + }; }; } // if ( !bdone ){ Baseline->Fill(ce->base[l][ii][bl]); - 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. ){ inbase++; } else { outbase++; @@ -579,7 +594,7 @@ } else { if ( !pdone ){ if ( ( alldexy2 > 3072000 || alldexy2 == 0) && ce->perror[se] == 0 ) { - // if ( (alldexy2>512000 || alldexy2 == 0) && ce->perror[se] == 0 ) { + // if ( (alldexy2>512000 || alldexy2 == 0) && ce->perror[se] == 0 ) pdone = 1; pshit[se][pl]++ ; if ( (ce->stwerr[se] & (1 << 4)) == 0 ){ @@ -589,8 +604,16 @@ if ( obt > maxobt[se] ) maxobt[se] = obt; }; lver[se][2]++ ; - sighandler(headc,obt,i,se,nevents,evdone); - printf(" latch up (data) in RAW mode alldexy2 %i \n",alldexy2); + if ( lver[se][2] == 1000 ){ + sighandler(headc,obt,i,se,nevents,evdone); + printf(" latch up (data) in RAW mode alldexy2 %i \n",alldexy2); + printf(" WARNING TOO MANY LATCHUP ERRORS ON DATA FOR THIS SECTION \n"); + printf(" THEY WILL NOT BE DISPLAYED HERE ANYMORE FOR THIS FILE! \n"); + }; + if ( lver[se][2] < 1000 ){ + sighandler(headc,obt,i,se,nevents,evdone); + printf(" latch up (data) in RAW mode alldexy2 %i \n",alldexy2); + }; }; }; if ( ce->dexy[l][ii][kk] > 0 && ce->dexy[l][ii][kk] < 32000 ) { @@ -611,8 +634,8 @@ for (Int_t k = 0; k < 4 ; k++ ){ isCOMP = false; isFULL = false; - cestw=0; - if ( ce->stwerr[k] ) cestw = ce->stwerr[k] & cmask ; + cestw=0;// queste righe qui + if ( ce->stwerr[k] ) cestw = ce->stwerr[k] & cmask ;// if ( ce->stwerr[k] & (1 << 16) && !(cestw & (1 << 3)) ) isCOMP = true; if ( ce->stwerr[k] & (1 << 17) && !(cestw & (1 << 3)) ) isFULL = true; // @@ -638,8 +661,16 @@ if ( cestw & (1 << 3) ) ver[k][3]++ ; // raw mode if ( cestw & (1 << 4) ){ ver[k][2]++ ; - sighandler(headc,obt,i,k,nevents,evdone); - printf(" latch up alarm (st. word)\n"); + if ( ver[k][2] == 1000 ){ + sighandler(headc,obt,i,k,nevents,evdone); + printf(" latch up alarm (st. word)\n"); + printf(" WARNING TOO MANY LATCHUP ERRORS ON DATA FOR THIS SECTION \n"); + printf(" THEY WILL NOT BE DISPLAYED HERE ANYMORE FOR THIS FILE! \n"); + }; + if ( ver[k][2] < 1000 ){ + sighandler(headc,obt,i,k,nevents,evdone); + printf(" latch up alarm (st. word)\n"); + }; lupstw[k]->Fill(obt); if ( swfirstobt[k] ) swminobt[k] = obt; if ( obt > swmaxobt[k] ) swmaxobt[k] = obt; @@ -654,7 +685,7 @@ sighandler(headc,obt,i,k,nevents,evdone); printf(" DSP ack error \n"); }; - }; + };// controllo se ci sono errori crc se perr=0 ok! if ( ce->stwerr[k] == 0 && ce->perror[k] == 0 ) ver[k][8]++ ; if ( ce->perror[k] != 0. ){ if (ce->perror[k] == 128){ @@ -720,6 +751,12 @@ sighandler(headc,obt,i,k,nevents,evdone); printf(" packet length is zero (YODA input error), skipped\n"); }; + //aggiunto questo errore + if (ce->perror[k] == 143){ + ver[k][23]++ ; + sighandler(headc,obt,i,k,nevents,evdone); + printf(" corrupted packet lenght \n"); + }; }; for (Int_t kk = 0; kk < 11 ; kk++ ){ tshit += shit[k][kk]; @@ -729,7 +766,10 @@ if (isCOMP || isFULL){ Calstriphit->Fill(cshit); // if ( (cshit > 0 && cshit < 25) || (cshit > 40 && cshit < 80) ){ - if ( (cshit > 10 && cshit < 100) ){ + // + //cambiata la banda di soglia ora 5 prima era 10 + // + if ( (cshit > 5 && cshit < 100) ){ incshit++; } else { outcshit++; @@ -737,7 +777,8 @@ // if ( tshit>0 ) h1->Fill(tshit); // if ( (tshit > 0 && tshit < 25) || (tshit > 40 && tshit < 80) ){ - if ( (tshit > 10 && tshit < 100) ){ + //cambiata la soglia ora 5 prima era 10 + if ( (tshit > 5 && tshit < 100) ){ intshit++; } else { outtshit++; @@ -825,7 +866,9 @@ h1->Draw(); // h1max = h1->GetMaximum()*1.05; - Double_t xc[4] = {10.,100.,100.,10.}; + + //cambiata banda prima era 10 ora 5 + Double_t xc[4] = {5.,100.,100.,5.}; Double_t yc[4] = {0.,0.,h1max,h1max}; banda1 = new TPolyLine(4,xc,yc); banda1->SetLineColor(5); @@ -875,7 +918,8 @@ h1->SetYTitle("Number of events"); h1->Draw(); h1max = h1->GetMaximum()*1.05; - Double_t xe[4] = {10.,100.,100.,10.}; + //cambiato banda, prima era 10,ora 5 + Double_t xe[4] = {5.,100.,100.,5.}; Double_t ye[4] = {0.,0.,h1max,h1max}; banda1 = new TPolyLine(4,xe,ye); banda1->SetLineColor(5); @@ -1061,7 +1105,7 @@ Baseline->SetYTitle("Number of events"); Baseline->Draw(); h1max = Baseline->GetMaximum()*1.05; - Double_t xc[4] = {2000.,4500.,4500.,2000.}; + Double_t xc[4] = {2000.,5500.,5500.,2000.}; Double_t yc[4] = {0.,0.,h1max,h1max}; banda1 = new TPolyLine(4,xc,yc); banda1->SetLineColor(5); @@ -1098,7 +1142,9 @@ Calstriphit->SetYTitle("Number of events"); Calstriphit->Draw(); h1max = Calstriphit->GetMaximum()*1.05; - Double_t xg[4] = {10.,100.,100.,10.}; + + //banda di sogla portata a 5, prima era a 10 + Double_t xg[4] = {5.,100.,100.,5.}; Double_t yg[4] = {0.,0.,h1max,h1max}; banda1 = new TPolyLine(4,xg,yg); banda1->SetLineColor(5); @@ -1340,7 +1386,8 @@ t->SetTextAlign(12); t->DrawLatex(33.,97.,sezione); t->SetTextSize(0.05); - for (Int_t j = 0; j < 23; j++){ + //aggiunto un errore jmax=23 + for (Int_t j = 0; j < 24; j++){ if ( ver[i][j] || lver[i][j] ) { t->SetTextColor(50); if (j == 0) { @@ -1528,8 +1575,16 @@ t->DrawLatex(2.,3.,errore.str().c_str()); check = true; }; - }; - }; + //aggiunto questo errore + if (j == 23) { + errore.str(""); + errore << "Corrupted packet lenght " << ver[i][j]; + errore << " time(s) "; + t->DrawLatex(2.,2.,errore.str().c_str()); + check = true; + }; + }; + }; t->SetTextColor(50); if ( fulldiff[i] !=0 ) { check = true; @@ -1556,11 +1611,11 @@ if ( check ){ t->SetTextColor(50); t->DrawLatex(60.,95.," WARNING, CHECK! "); - printf("cdexyc %f cdexy %f ctshit %f cbase %f \n",cdexyc,cdexy,ctshit,cbase); } else { t->SetTextColor(32); t->DrawLatex(60.,95.," OK! "); }; + printf("cdexyc %f cdexy %f ctshit %f cbase %f \n",cdexyc,cdexy,ctshit,cbase); // // const string fil = (const char*)filename; // Int_t posiz = fil.find("dw_"); @@ -1643,4 +1698,3 @@ }; }; } -