--- chewbacca/YodaProfiler/src/PamelaDBOperations.cpp 2009/08/05 18:48:44 1.25 +++ chewbacca/YodaProfiler/src/PamelaDBOperations.cpp 2009/11/25 09:39:50 1.26 @@ -4236,6 +4236,7 @@ UInt_t totime = 0; UInt_t obt = 0; UInt_t pkt = 0; + Float_t totped = 0.; // tr = (TTree*)file->Get("CalibCalPed"); if ( !tr || tr->IsZombie() ) throw -21; @@ -4253,6 +4254,18 @@ if ( calibCalPed->cstwerr[section] ){ valid = 1; if ( calibCalPed->cperror[section] ) valid = 0; + // + // check pedestal values for one plane, if all zeros calibration is not valid (calorimeter power problems) [8th data reduction bug, fixed on 25/11/2009 by E.M.] + // + totped = 0.; + for (UInt_t ss=0; ss<96; ss++){ + totped += calibCalPed->calped[section][0][ss]; + } + if ( totped < 1. ){ + if ( IsDebug() ) printf(" Section %i totped %f - No calibration data! Calorimeter power problems? \n",section,totped); + valid = 0; + }; + // ph = eh->GetPscuHeader(); obt = ph->GetOrbitalTime(); pkt = ph->GetCounter(); @@ -4420,6 +4433,8 @@ tr->SetBranchAddress("Header", &eh); nevents = tr->GetEntries(); // + Float_t totpul = 0.; + // if ( nevents > 0 ){ // for (UInt_t i=0; i < nevents; i++){ @@ -4429,6 +4444,18 @@ if ( cp1->pstwerr[section] && cp1->unpackError == 0 ){ valid = 1; if ( cp1->pperror[section] ) valid = 0; + // + // check pulse values for one plane, if all zeros calibration is not valid (calorimeter power problems) [8th data reduction bug, fixed on 25/11/2009 by E.M.] + // + totpul = 0.; + for (UInt_t ss=0; ss<96; ss++){ + totpul += cp1->calpuls[section][0][ss]; + } + if ( totpul >= 3145632. ){ + if ( IsDebug() ) printf(" PULSE1 Section %i totpul %f - No calibration data! Calorimeter power problems? \n",section,totpul); + valid = 0; + }; + // ph = eh->GetPscuHeader(); obt = ph->GetOrbitalTime(); pkt = ph->GetCounter(); @@ -4586,6 +4613,18 @@ if ( cp2->pstwerr[section] && cp2->unpackError == 0 ){ valid = 1; if ( cp2->pperror[section] ) valid = 0; + // + // check pulse values for one plane, if all zeros calibration is not valid (calorimeter power problems) [8th data reduction bug, fixed on 25/11/2009 by E.M.] + // + totpul = 0.; + for (UInt_t ss=0; ss<96; ss++){ + totpul += cp2->calpuls[section][0][ss]; + } + if ( totpul >= 3145632. ){ + if ( IsDebug() ) printf(" PULSE2 Section %i totpul %f - No calibration data! Calorimeter power problems? \n",section,totpul); + valid = 0; + }; + // ph = eh->GetPscuHeader(); obt = ph->GetOrbitalTime(); pkt = ph->GetCounter();