857 |
// if ( nevent < jump ) jump = int(nevent/10); |
// if ( nevent < jump ) jump = int(nevent/10); |
858 |
// if ( !jump ) jump = 1; |
// if ( !jump ) jump = 1; |
859 |
// |
// |
860 |
if ( (PKT(pktlast) < PKT(pktfirst) && OBT(obtlast) < OBT(obtfirst)) || (labs(PKT(pktlast)-PKT(pktfirst))<deltapkt && labs(OBT(obtlast)-OBT(obtfirst))<deltaobt) && nevent > deltapkt ){ |
|
861 |
|
if ( ((PKT(pktlast) < PKT(pktfirst) && OBT(obtlast) < OBT(obtfirst)) || (labs(PKT(pktlast)-PKT(pktfirst))<deltapkt && labs(OBT(obtlast)-OBT(obtfirst))<deltaobt)) && nevent > deltapkt ){ |
862 |
// |
// |
863 |
if ( IsDebug() ) printf(" starting jump %i \n",jump); |
if ( IsDebug() ) printf(" starting jump %i \n",jump); |
864 |
// if ( IsDebug() ) printf(" (PKT(pktlast) < PKT(pktfirst) && OBT(obtlast) > OBT(obtfirst)) %llu < %llu && %llu > %llu \n OR \n (PKT(pktlast) > PKT(pktfirst) && OBT(obtlast) < OBT(obtfirst)) %llu > %llu && %llu < %llu \n",PKT(pktlast),PKT(pktfirst),OBT(obtlast),OBT(obtfirst),PKT(pktlast),PKT(pktfirst),OBT(obtlast),OBT(obtfirst)); |
// if ( IsDebug() ) printf(" (PKT(pktlast) < PKT(pktfirst) && OBT(obtlast) > OBT(obtfirst)) %llu < %llu && %llu > %llu \n OR \n (PKT(pktlast) > PKT(pktfirst) && OBT(obtlast) < OBT(obtfirst)) %llu > %llu && %llu < %llu \n",PKT(pktlast),PKT(pktfirst),OBT(obtlast),OBT(obtfirst),PKT(pktlast),PKT(pktfirst),OBT(obtlast),OBT(obtfirst)); |
4236 |
UInt_t totime = 0; |
UInt_t totime = 0; |
4237 |
UInt_t obt = 0; |
UInt_t obt = 0; |
4238 |
UInt_t pkt = 0; |
UInt_t pkt = 0; |
4239 |
|
Float_t totped = 0.; |
4240 |
// |
// |
4241 |
tr = (TTree*)file->Get("CalibCalPed"); |
tr = (TTree*)file->Get("CalibCalPed"); |
4242 |
if ( !tr || tr->IsZombie() ) throw -21; |
if ( !tr || tr->IsZombie() ) throw -21; |
4254 |
if ( calibCalPed->cstwerr[section] ){ |
if ( calibCalPed->cstwerr[section] ){ |
4255 |
valid = 1; |
valid = 1; |
4256 |
if ( calibCalPed->cperror[section] ) valid = 0; |
if ( calibCalPed->cperror[section] ) valid = 0; |
4257 |
|
// |
4258 |
|
// 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.] |
4259 |
|
// |
4260 |
|
totped = 0.; |
4261 |
|
for (UInt_t ss=0; ss<96; ss++){ |
4262 |
|
totped += calibCalPed->calped[section][0][ss]; |
4263 |
|
} |
4264 |
|
if ( totped < 1. ){ |
4265 |
|
if ( IsDebug() ) printf(" Section %i totped %f - No calibration data! Calorimeter power problems? \n",section,totped); |
4266 |
|
valid = 0; |
4267 |
|
}; |
4268 |
|
// |
4269 |
ph = eh->GetPscuHeader(); |
ph = eh->GetPscuHeader(); |
4270 |
obt = ph->GetOrbitalTime(); |
obt = ph->GetOrbitalTime(); |
4271 |
pkt = ph->GetCounter(); |
pkt = ph->GetCounter(); |
4433 |
tr->SetBranchAddress("Header", &eh); |
tr->SetBranchAddress("Header", &eh); |
4434 |
nevents = tr->GetEntries(); |
nevents = tr->GetEntries(); |
4435 |
// |
// |
4436 |
|
Float_t totpul = 0.; |
4437 |
|
// |
4438 |
if ( nevents > 0 ){ |
if ( nevents > 0 ){ |
4439 |
// |
// |
4440 |
for (UInt_t i=0; i < nevents; i++){ |
for (UInt_t i=0; i < nevents; i++){ |
4444 |
if ( cp1->pstwerr[section] && cp1->unpackError == 0 ){ |
if ( cp1->pstwerr[section] && cp1->unpackError == 0 ){ |
4445 |
valid = 1; |
valid = 1; |
4446 |
if ( cp1->pperror[section] ) valid = 0; |
if ( cp1->pperror[section] ) valid = 0; |
4447 |
|
// |
4448 |
|
// 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.] |
4449 |
|
// |
4450 |
|
totpul = 0.; |
4451 |
|
for (UInt_t ss=0; ss<96; ss++){ |
4452 |
|
totpul += cp1->calpuls[section][0][ss]; |
4453 |
|
} |
4454 |
|
if ( totpul >= 3145632. ){ |
4455 |
|
if ( IsDebug() ) printf(" PULSE1 Section %i totpul %f - No calibration data! Calorimeter power problems? \n",section,totpul); |
4456 |
|
valid = 0; |
4457 |
|
}; |
4458 |
|
// |
4459 |
ph = eh->GetPscuHeader(); |
ph = eh->GetPscuHeader(); |
4460 |
obt = ph->GetOrbitalTime(); |
obt = ph->GetOrbitalTime(); |
4461 |
pkt = ph->GetCounter(); |
pkt = ph->GetCounter(); |
4613 |
if ( cp2->pstwerr[section] && cp2->unpackError == 0 ){ |
if ( cp2->pstwerr[section] && cp2->unpackError == 0 ){ |
4614 |
valid = 1; |
valid = 1; |
4615 |
if ( cp2->pperror[section] ) valid = 0; |
if ( cp2->pperror[section] ) valid = 0; |
4616 |
|
// |
4617 |
|
// 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.] |
4618 |
|
// |
4619 |
|
totpul = 0.; |
4620 |
|
for (UInt_t ss=0; ss<96; ss++){ |
4621 |
|
totpul += cp2->calpuls[section][0][ss]; |
4622 |
|
} |
4623 |
|
if ( totpul >= 3145632. ){ |
4624 |
|
if ( IsDebug() ) printf(" PULSE2 Section %i totpul %f - No calibration data! Calorimeter power problems? \n",section,totpul); |
4625 |
|
valid = 0; |
4626 |
|
}; |
4627 |
|
// |
4628 |
ph = eh->GetPscuHeader(); |
ph = eh->GetPscuHeader(); |
4629 |
obt = ph->GetOrbitalTime(); |
obt = ph->GetOrbitalTime(); |
4630 |
pkt = ph->GetCounter(); |
pkt = ph->GetCounter(); |