22 #include "boost/date_time/local_time/local_time.hpp"
23 #include "boost/date_time/posix_time/posix_time.hpp"
31 static std::string drwname(
int id) {
32 static const char name[5][6] = {
"",
"LBA",
"LBC",
"EBA",
"EBC" };
63 , m_readRawChannels(true)
289 msg(MSG::INFO) <<
"Drawers which will be always printed:" << MSG::hex;
290 for (
int frag:
m_drawer)
msg(MSG::INFO) <<
" 0x" << frag;
295 msg(MSG::INFO) <<
"Only those drawers will be checked:" << MSG::hex;
301 msg(MSG::INFO) <<
"Only those channels will be checked:";
322 for (
int j=0; j<3; ++j) {
340 for (
int frag : {0x100,0x200,0x300,0x400}) {
342 std::iota(itr, itr1, frag);
371 return StatusCode::SUCCESS;
378 const EventContext& ctx = Gaudi::Hive::currentContext();
399 std::ostringstream evState;
400 evState <<
"Run "<< std::setw(6) <<
m_runNum
402 <<
" Evt "<< std::setw(9) <<
m_evtNum
404 <<
" Flags 0x" << std::hex <<
m_tileFlag << std::dec;
406 std::ostringstream evtnum;
407 evtnum <<
"Run "<< std::setw(6) <<
m_runNum
409 <<
" Evt "<< std::setw(9) <<
m_evtNum
412 std::ostringstream nevtnum;
413 nevtnum << evtnum.str()
416 bool emptyBad =
true;
417 bool badFromCell =
false;
444 using namespace boost::local_time;
445 using namespace boost::posix_time;
446 static const time_zone_ptr gva_tz(
new posix_time_zone((std::string)
"CET+01CEST01:00:00,M3.5.0/02:00:00,M10.5.0/03:00:00"));
447 local_date_time gva_time(from_time_t(eventInfo->
timeStamp()),gva_tz);
448 evState <<
" " << gva_time <<
" ";
451 const char *
part[5] = {
"UNK",
"LBA",
"LBC",
"EBA",
"EBC" };
455 int n2 = (
n1 +
dn - 1) % 64;
457 evState <<
" " <<
part[
rr] <<std::setw(2)<<std::setfill(
'0')<<
n1+1
458 <<
" - " <<
part[
rr] <<std::setw(2)<<std::setfill(
'0')<<n2+1
459 <<
" " <<
dn <<
" consec bad ";
467 for (
int rr = 1;
rr < 5; ++
rr) {
468 if ((
p2 & pp) || (
p1 & pp)) {
469 evState <<
" " <<
part[
rr];
471 if (
p0 & pp) evState <<
" off";
472 else evState <<
" OFF";
475 if (
p0 & pp) evState <<
" mask";
476 else evState <<
" MASK";
481 evState <<
" " <<
dn <<
" consec bad ";
492 std::vector<int> allmod;
493 std::vector<int> consec;
496 for (
int dr = 0;
dr < drmax; ++
dr) {
501 if (
dr < 64) allmod.push_back((
ros << 8) +
dr);
502 }
else if (
m1 >= 0) {
504 if (
m1 == 0) drmax +=
dm;
511 consec.push_back((
ros << 8) +
m1);
512 }
else if (
dm ==
dn) {
513 if (
m1 < 64) consec.push_back((
ros << 8) +
m1);
519 evState <<
" DCS " << allmod.size() <<
" off ";
522 if (consec.size() > 1) evState <<
"*" << (consec.size());
523 evState <<
" consec "
524 <<
part[
rr] << std::setw(2) << std::setfill(
'0') << (
n1 % 64) + 1 <<
" - "
525 <<
part[
rr] << std::setw(2) << std::setfill(
'0') << (n2 % 64) + 1 <<
" ";
528 for (
size_t n = 1;
n < consec.size(); ++
n) {
531 evState << part[m1 >> 8] << std::setw(2) << std::setfill(
'0') << (
m1 % 64) + 1 <<
" - "
532 <<
part[
m2 >> 8] << std::setw(2) << std::setfill(
'0') << (
m2 % 64) + 1 <<
" ";
533 for (
size_t m = 0;
m < allmod.size(); ++
m) {
536 allmod[
m] +=
n1 -
m1;
543 if (allmod.size() > (size_t)
dn) {
544 for (
size_t m = 0;
m < allmod.size(); ++
m) {
546 if (!(
mm >=
n1 &&
mm <= n2)) {
547 evState << part[mm >> 8] << std::setw(2) << std::setfill(
'0') << (
mm % 64) + 1 <<
" ";
567 if (!cellContainer.
isValid()) {
569 ATH_MSG_WARNING(
"Unable to read CaloCellContainer from EventStore, disable reading of this container");
599 if (tile_cell==0)
continue;
609 bool bad1 = tile_cell->
badch1();
610 bool bad2 = tile_cell->
badch2();
611 float ene1 = tile_cell->
ene1();
612 float ene2 = tile_cell->
ene2();
613 float time1 = tile_cell->
time1();
614 float time2 = tile_cell->
time2();
624 float ene = tile_cell->
energy();
660 if (timeOk && eneOk) {
664 <<
" ene = " << ene <<
" time = " <<
time);
672 }
else if (ene > emax) {
679 tcellmin = tile_cell;
681 else if (
time>tmax) {
683 tcellmax = tile_cell;
687 if ( !(bad1 && bad2) ) {
690 bool time1Ok =
false;
723 bool time2Ok =
false;
762 if ((ene1Ok && time1Ok) || over1) {
766 <<
" ch_ene1 = " << ene1 <<
" ch_t1 = " << time1
767 << ((over1)?
" overflow":
""));
774 cellminCh = tile_cell;
775 }
else if (ene1 >
chmax) {
777 cellmaxCh = tile_cell;
782 tcellminCh = tile_cell;
783 }
else if (time1 > tcmax) {
785 tcellmaxCh = tile_cell;
789 if ((ene2Ok && time2Ok) || over2) {
793 <<
" ch_ene2 = " << ene2 <<
" ch_t2 = " << time2
794 << ((over2)?
" overflow":
""));
801 cellminCh = tile_cell;
802 }
else if (ene2 >
chmax) {
804 cellmaxCh = tile_cell;
809 tcellminCh = tile_cell;
810 }
else if (time2 > tcmax) {
812 tcellmaxCh = tile_cell;
823 <<
" ene = " << tcellmin->
energy()
824 <<
" tmin = " << tcellmin->
time());
829 <<
" ene = " << tcellmax->
energy()
830 <<
" tmax = " << tcellmax->
energy());
833 if (tcellminCh && tcellminCh != cellminCh && tcellminCh != cellmaxCh) {
836 <<
" ch_ene = " << tcellminCh->
ene1() <<
" " << tcellminCh->
ene2()
837 <<
" ch_tmin = " << tcellminCh->
time1() <<
" " << tcellminCh->
time2());
839 if (tcellmaxCh && tcellmaxCh != cellminCh && tcellmaxCh != cellmaxCh) {
842 <<
" ch_ene = " << tcellmaxCh->
ene1() <<
" " << tcellmaxCh->
ene2()
843 <<
" ch_tmax = " << tcellmaxCh->
time1() <<
" " << tcellmaxCh->
time2());
849 const char *
tit = (tcellmin ==
cellmin) ?
" tmin = ": ((tcellmax ==
cellmin) ?
" tmax = ":
" t = ");
853 <<
" emin = " << emin
860 <<
" emin = " << emin
861 <<
" ch_emin = " <<
chmin
870 const char *
tit = (tcellminCh == cellminCh) ?
" tmin = ": ((tcellmaxCh == cellminCh) ?
" tmax = ":
" t = ");
874 <<
" ch_emin = " <<
chmin
883 const char *
tit = (tcellmin ==
cellmax) ?
" tmin = ": ((tcellmax ==
cellmax) ?
" tmax = ":
" t = ");
887 <<
" emax = " << emax
894 <<
" emax = " << emax
895 <<
" ch_emax = " <<
chmax
904 const char *
tit = (tcellminCh == cellmaxCh) ?
" tmin = ": ((tcellmaxCh == cellmaxCh) ?
" tmax = ":
" t = ");
908 <<
" ch_emax = " <<
chmax
927 ATH_MSG_WARNING(
"Unable to read TileRawChannelContainer from EventStore, disable reading of this container");
943 bool fillChanEne = ( !
m_readCells && allowAmpCheck );
965 bool someDQerrors =
false;
969 int frag = rawChannelCollection->
identify();
970 bool eb = (frag > 0x2ff);
971 bool ebsp = (frag == 0x30e || frag == 0x411);
980 for (
int ch: {12,4,0}) {
995 uint32_t RODBCID = rawChannelCollection->getRODBCID();
996 uint32_t DSPBCID = rawChannelCollection->getFragDSPBCID();
997 uint32_t GlobalCRCErr = rawChannelCollection->getFragGlobalCRC() & 0x1;
998 uint32_t FE_DMUmask = rawChannelCollection->getFragFEChipMask();
999 uint32_t ROD_DMUmask = rawChannelCollection->getFragRODChipMask();
1000 uint32_t BCIDErr = rawChannelCollection->getFragBCID();
1001 uint32_t MemoryParityErr = rawChannelCollection->getFragMemoryPar();
1002 uint32_t HeaderFormatErr = rawChannelCollection->getFragHeaderBit();
1003 uint32_t HeaderParityErr = rawChannelCollection->getFragHeaderPar();
1004 uint32_t SampleFormatErr = rawChannelCollection->getFragSampleBit();
1005 uint32_t SampleParityErr = rawChannelCollection->getFragSamplePar();
1006 uint32_t SingleStrobeErr = rawChannelCollection->getFragSstrobe();
1007 uint32_t DoubleStrobeErr = rawChannelCollection->getFragDstrobe();
1009 if (RODBCID!=0 && RODBCID !=
m_evtBCID ) {
1012 <<
" drw " << drwname(rawChannelCollection->identify())
1013 <<
" ROD BCID " << RODBCID <<
" is wrong - skipping");
1017 <<
" suppressing further messages about drawer 0x" << std::hex << rawChannelCollection->identify()
1018 << std::dec <<
" being bad");
1020 someDQerrors =
true;
1024 if (DSPBCID >= 0x7FFF
1026 && FE_DMUmask == 0xFFFF
1027 && ROD_DMUmask == 0xFFFF
1028 && BCIDErr == 0xFFFF
1029 && MemoryParityErr == 0xFFFF
1030 && HeaderFormatErr == 0xFFFF
1031 && HeaderParityErr == 0xFFFF
1032 && SampleFormatErr == 0xFFFF
1033 && SampleParityErr == 0xFFFF
1034 && SingleStrobeErr == 0xFFFF
1035 && DoubleStrobeErr == 0xFFFF) {
1039 <<
" drw " << drwname(rawChannelCollection->identify())
1040 <<
" is OFF - skipping");
1044 <<
" suppressing further messages about drawer 0x" << std::hex
1045 << rawChannelCollection->identify()
1046 << std::dec <<
" being bad");
1052 && GlobalCRCErr == 0
1056 && MemoryParityErr == 0
1057 && HeaderFormatErr == 0
1058 && HeaderParityErr == 0
1059 && SampleFormatErr == 0
1060 && SampleParityErr == 0
1061 && SingleStrobeErr == 0
1062 && DoubleStrobeErr == 0) {
1066 <<
" drw " << drwname(rawChannelCollection->identify())
1067 <<
" is MISSING - skipping");
1071 <<
" suppressing further messages about drawer 0x" << std::hex
1072 << rawChannelCollection->identify() << std::dec <<
" being bad");
1078 GlobalCRCErr = 0xFFFF;
1082 <<
" drw " << drwname(rawChannelCollection->identify())
1083 <<
" global CRC error - skipping");
1087 <<
" suppressing further messages about drawer 0x" << std::hex
1088 << rawChannelCollection->identify() << std::dec <<
" being bad");
1090 someDQerrors =
true;
1095 if (HeaderFormatErr || HeaderParityErr || SampleFormatErr || SampleParityErr ) {
1096 FE_DMUmask = 0xFFFF;
1099 if (ebsp) FE_DMUmask<<=1;
1100 FE_DMUmask = (FE_DMUmask & 0xFF) | ((FE_DMUmask & 0xF00)<<2);
1104 FE_DMUmask = ~FE_DMUmask & 0xFFFF;
1105 ROD_DMUmask = ~ROD_DMUmask & 0xFFFF;
1107 if (BCIDErr & 0
x2) {
1112 <<
" drw " << drwname(rawChannelCollection->identify())
1113 <<
" BCID in DMU1 is bad - skipping");
1117 <<
" suppressing further messages about drawer 0x"
1118 << std::hex << rawChannelCollection->identify() << std::dec <<
" being bad");
1120 someDQerrors =
true;
1126 if ( DSPBCID!=0xDEAD && DSPBCID!=
m_evtBCID ) {
1131 <<
" drw " << drwname(rawChannelCollection->identify())
1132 <<
" DSP BCID is wrong - skipping");
1136 <<
" suppressing further messages about drawer 0x"
1137 << std::hex << rawChannelCollection->identify() << std::dec <<
" being bad");
1139 someDQerrors =
true;
1145 uint32_t error = GlobalCRCErr | FE_DMUmask | ROD_DMUmask | BCIDErr | MemoryParityErr |
1146 HeaderFormatErr | HeaderParityErr | SampleFormatErr | SampleParityErr;
1151 <<
" drw " << drwname(rawChannelCollection->identify())
1152 <<
" whole drawer is bad - skipping");
1156 <<
" suppressing further messages about drawer 0x"
1157 << std::hex << rawChannelCollection->identify() << std::dec <<
" being bad");
1159 someDQerrors =
true;
1168 <<
" enabling messages about drawer 0x" << std::hex
1169 << rawChannelCollection->identify()
1170 << std::dec <<
" being bad after " <<
m_maxVerboseCnt <<
" good events");
1184 if (errMB & 0xF) ++nbadMB;
1188 if (nbadMB > nbadMBMax) {
1190 collMBMax = rawChannelCollection;
1199 if (emptyBad && nbadMB < 4) {
1209 int nbad = ((ebsp) ? nerr-5 : ((eb) ? nerr-4 : nerr));
1212 someDQerrors =
true;
1213 if (nbad > nbadMax) {
1215 collMax = rawChannelCollection;
1224 if (allowAmpCheck || emptyBad) {
1247 if (allowAmpCheck) {
1249 float amp = rawChannel->amplitude();
1250 float time = rawChannel->time();
1275 bool timeOk =
false;
1284 if (ampOk && timeOk) {
1288 <<
" ch_ene = " << amp <<
" ch_t = " <<
time);
1295 }
else if (amp >
chmax) {
1302 tminCh = rawChannel;
1304 else if (
time>tcmax) {
1306 tmaxCh = rawChannel;
1316 <<
" drw " << drwname(rawChannelCollection->identify())
1317 <<
" nBadMB = " << nbadMB
1318 <<
" nBadDMU = " << nbad
1320 <<
" DSPBCID = " << rawChannelCollection->getFragDSPBCID()
1321 <<
" GlobCRC = " << rawChannelCollection->getFragGlobalCRC() <<
" " << GlobalCRCErr
1322 <<
" error = 0x" << std::hex <<
error
1323 <<
" FE_CRC = 0x" << rawChannelCollection->getFragFEChipMask() <<
" 0x" << FE_DMUmask
1324 <<
" ROD_CRC = 0x" << rawChannelCollection->getFragRODChipMask() <<
" 0x" << ROD_DMUmask
1325 <<
" BCIDErr = 0x" << rawChannelCollection->getFragBCID() <<
" 0x" << BCIDErr
1326 <<
" MemPar = 0x" << rawChannelCollection->getFragMemoryPar()
1327 <<
" HeadForm = 0x"<< rawChannelCollection->getFragHeaderBit()
1328 <<
" HeadPar = 0x" << rawChannelCollection->getFragHeaderPar()
1329 <<
" SampForm = 0x"<< rawChannelCollection->getFragSampleBit()
1330 <<
" SampPar = 0x" << rawChannelCollection->getFragSamplePar()
1341 <<
" drw " << drwname((collMBMax) ? collMBMax->
identify() : 0)
1342 <<
" nBadMB = " << nbadMBMax
1349 <<
" drw " << drwname((collMax)?collMax->
identify():0)
1350 <<
" nBadDMU = " << nbadMax
1354 if (tminCh && tminCh != minCh && tminCh != maxCh) {
1358 <<
" tmin =" << tminCh->
time());
1361 if (tmaxCh && tmaxCh != minCh && tmaxCh != maxCh) {
1365 <<
" tmax = " << tmaxCh->
time());
1371 const char *
tit = (tminCh == minCh) ?
" tmin = ": ((tmaxCh == minCh) ?
" tmax = ":
" t = ");
1374 <<
" ch_emin = " <<
chmin
1381 const char *
tit = (tminCh == maxCh) ?
" tmin = ": ((tmaxCh == maxCh) ?
" tmax = ":
" t = ");
1384 <<
" ch_emax = " <<
chmax
1398 if (!digitsContainer.
isValid()) {
1399 ATH_MSG_WARNING(
"Unable to read TileDigitsContainer from EventStore, disable reading of this container");
1417 int frag = digitsCollection->identify();
1418 bool eb = (frag > 0x2ff);
1419 bool ebsp = (frag == 0x30e || frag == 0x411);
1421 int ros = frag >> 8;
1422 int drawer = frag & 0x3F;
1428 for (
int ch: {12,4,0}) {
1441 int nChDmu[16] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
1442 int nChBadDmu[16] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
1444 for (
const TileDigits* tile_digits : *digitsCollection) {
1456 bool isConnected = (chEmpty < 2);
1457 if (!isConnected) ++nChBadNC;
1459 const char *cellname =
"";
1468 }
else if (chEmpty > 0) {
1469 cellname =
" EMPTY";
1472 const char *badname =
"";
1480 badname =
" BADDCS";
1488 if (ch_type != 2) badname =
" BADQUAL";
1490 if (isConnected && ch_type!=2) {
1495 badname =
" BADUNKN";
1498 badname =
" BADDIGI";
1504 const char *enename =
" ene = ";
1505 const char *timename =
" time = ";
1506 const char *qualname =
" qual = ";
1507 if (badFromCell && badname[0] != 0) {
1508 enename =
" BAD = ";
1510 qualname =
" eDSP = ";
1514 timename =
" tDSP = ";
1520 sprintf(badnm,
" BADDIGIEX%s",badname);
1523 std::vector<float> samples = tile_digits->samples();
1524 int nSamp = samples.size();
1533 if (badname[0]==0) {
1535 if (isConnected ||
err != -2) {
1540 if (!isConnected) --nChBadNC;
1545 }
else if (
err < 36) {
1557 sprintf(badnm,
" warningE%d%s",
warn,badname);
1565 && (badname[0] == 0 || badname[1] ==
'w'
1600 bool someSampErrors =
false;
1607 float ped = samples[0];
1612 bool cnstPed =
true;
1613 bool cnstPedmax =
true;
1614 for (
int i = 1;
i < nSamp; ++
i) {
1615 float smp = samples[
i];
1616 float dped = smp -
ped;
1617 if (fabs(dped) < pedDelta) {
1626 cnstPedmax = cnstPed;
1634 }
else if (smp>dmax) {
1640 cnstPedmax = cnstPed;
1643 if (dmax - dmin >= jumpDelta) {
1646 bool accCnst =
false;
1647 bool accJump =
false;
1648 bool cnstMin =
true;
1649 bool cnstMax =
true;
1650 bool jumpNeg =
false;
1651 bool jumpPos =
false;
1652 bool jumpEnd =
false;
1653 bool jumpZer =
false;
1654 bool jumpOve =
false;
1655 bool narrowUp =
false;
1656 bool narrowDown =
false;
1665 float abovemin = dmax;
1666 float belowmax = dmin;
1667 for (
int i = 0;
i < nSamp; ++
i) {
1668 float smp = samples[
i];
1669 if (smp - dmin < pedDelta) {
1672 if (smp != dmin) cnstMin =
false;
1674 if (dmax - smp < pedDelta) {
1677 if (smp != dmax) cnstMax =
false;
1679 if (smp < abovemin && smp > dmin) {
1682 if (smp > belowmax && smp < dmax) {
1686 if (
nmax + nmin == nSamp) {
1687 if (
nmax > 1 && nmin > 1) {
1690 }
else if (
nmax == 1) {
1691 if (pmax < nSamp - 1) {
1697 if (pmax == 0 || pmax == nSamp - 1) {
1700 }
else if (nmin == 1) {
1705 if (pmin == 0 || pmin == nSamp - 1) {
1729 if (pmax > 0 && pmax < nSamp-1 &&
std::max(samples[pmax-1], samples[pmax+1]) < dmin+secondMax) {
1734 if (nmin +
nmax != nSamp) {
1740 if (pmin > 0 && pmin < nSamp - 1 &&
std::min(samples[pmin - 1], samples[pmin + 1]) > dmax - secondMax) {
1745 if (nmin +
nmax != nSamp) {
1752 if (accEmin || accEmax || accCnst || accJump) {
1753 someSampErrors =
true;
1757 <<
" " << samples[1] <<
" " << samples[2] <<
" " << samples[3]
1758 <<
" " << samples[4] <<
" " << samples[5] <<
" " << samples[6]
1761 << cellname << badname
1762 << ((accEmin) ?
" neg_e" :
"")
1763 << ((accEmax) ?
" pos_e" :
"")
1764 << ((accCnst) ?
" const" :
"")
1765 << ((accCnst&&cnstPedmax) ?
"Const" :
"")
1766 << ((accJump) ?
" jump" :
"")
1767 << ((accJump&&jumpZer) ?
"Zero" :
"")
1768 << ((accJump&&jumpOve) ?
"Over" :
"")
1769 << ((accJump&&jumpPos) ?
"SingleUp" : ((narrowUp) ?
"NarrowUp" :
"") )
1770 << ((accJump&&jumpNeg) ?
"SingleDown" : ((narrowDown) ?
"NarrowDown" :
"") )
1771 << ((accJump&&jumpEnd) ?
"AtEdge" :
"")
1772 << ((accJump&&cnstMin) ?
"ConstMin" :
"")
1773 << ((accJump&&cnstMax) ?
"ConstMax" :
"")
1774 <<
" " << dmax-dmin);
1779 if (someSampErrors) {
1785 bool jumpZer = (dmin < 0.01);
1789 <<
" " << samples[1] <<
" " << samples[2] <<
" " << samples[3]
1790 <<
" " << samples[4] <<
" " << samples[5] <<
" " << samples[6]
1793 << cellname << badname
1794 << ((accEmin) ?
" neg_e" :
"")
1795 << ((accEmax) ?
" pos_e" :
"")
1796 <<((jumpZer) ?
" underflow" :
"")
1797 <<((jumpOve) ?
" overflow" :
"") );
1802 if (
m_checkDMUs && nChBad > 1 && nChBad + nChBadDB + nChBadNC < nChTot) {
1810 for (
int dmu = 0; dmu < 16; ++dmu) {
1811 if (nChDmu[dmu] > 0) {
1813 if (nChBadDmu[dmu] > 0) {
1816 nChBad1 += nChBadDmu[dmu];
1819 nChBad2 += nChBadDmu[dmu];
1822 if (nChBadDmu[dmu] == 2 && nChDmu[dmu] == 3) has23 =
true;
1826 if (nDmuBad == 1 )
continue;
1827 if (nDmuBad == 2 && nChBad < 3)
continue;
1829 if (nDmuBad>2 || nChBad > 9 || nChTot > 19 || has23) {
1833 for (
const TileDigits* tile_digits : *digitsCollection) {
1839 std::vector<float> samples = tile_digits->samples();
1845 const char *cellname =
"";
1854 }
else if (chEmpty > 0) {
1855 cellname =
" EMPTY";
1857 const char *badname =
"";
1863 badname =
" BADDCS";
1866 if (ch_type != 2) badname =
" BADQUAL";
1869 badname =
" BADUNKN";
1872 badname =
" BADDIGI";
1876 sprintf(badnm,
" BADDIGIEX%s", badname);
1882 bool isConnected = (chEmpty < 2);
1883 if (isConnected ||
err != -2) {
1888 badnm[9] = 48 +
err;
1889 }
else if (
err < 36) {
1890 badnm[9] = 55 +
err;
1897 const char *enename =
" ene = ";
1898 const char *timename =
" time = ";
1899 const char *qualname =
" qual = ";
1900 if (badFromCell && badname[0] != 0) {
1901 enename =
" BAD = ";
1903 qualname =
" eDSP = ";
1907 timename =
" tDSP = ";
1915 bool jumpZer = (dmin < 0.01);
1920 <<
" " << samples[1] <<
" " << samples[2] <<
" " << samples[3]
1921 <<
" " << samples[4] <<
" " << samples[5] <<
" " << samples[6]
1924 << cellname << badname
1925 << ((accEmin) ?
" neg_e" :
"")
1926 << ((accEmax) ?
" pos_e" :
"")
1927 << ((jumpZer) ?
" underflow" :
"")
1928 << ((jumpOve) ?
" overflow" :
"") );
1934 std::ostringstream badstr;
1935 badstr <<
" ch: " << nChBad1 <<
" + " << nChBad2 <<
" = " << nChBad <<
" / " << nChTot <<
" = " << 100*nChBad/nChTot
1936 <<
" % dmu: " << nDmuBad1 <<
" + " << nDmuBad2 <<
" = " << nDmuBad <<
" / " << nDmuTot <<
" ";
1937 for (
int dmu=0; dmu<16; ++dmu) {
1938 if (nChDmu[dmu]>0) {
1939 badstr <<
" " << std::hex << dmu <<
"=" << nChBadDmu[dmu] <<
"/" << nChDmu[dmu];
1943 <<
" drw " << drwname(digitsCollection->identify()) << badstr.str());
1951 <<
" n_const_sample_errors = " << nConst
1958 <<
" n_jump_sample_errors = " << nJump
1965 <<
" n_overflow_LG = " << nOverLG
1972 <<
" n_overflow_HG = " << nOverHG
1979 <<
" n_underflow_LG = " << nUnderLG
1986 <<
" n_underflow_HG = " << nUnderHG
1993 <<
" n_DMU_errors = " << nDmuErr
2000 this->setFilterPassed (
false);
2002 this->setFilterPassed (statusOk);
2011 return StatusCode::SUCCESS;
2017 if (tile_cell==0)
return;
2021 int ros1 = 0, ros2 = 0;
2040 if (ros1 == 0) ros1=ros2;
2046 if (ros1 == 0)
return;
2106 return StatusCode::SUCCESS;
2112 bool allSaturated =
true;
2115 unsigned int nSamp = OptFilterDigits.size();
2117 float dmin = OptFilterDigits[0];
2120 for (
unsigned int i = 1;
i < nSamp; ++
i) {
2121 float dig = OptFilterDigits[
i];
2122 if (dig > dmax) dmax = dig;
2123 else if (dig < dmin) dmin = dig;
2129 const float epsilon = 4.1;
2130 const float delta[4] = {29.9, 29.9, 49.9, 99.9};
2131 const float level0 = 29.9;
2132 const float level1 = 99.9;
2133 const float level2 = 199.9;
2136 if (!allSaturated && (dmax - dmin) > delt) {
2137 float abovemin = dmax;
2138 float belowmax = dmin;
2139 unsigned int nmin = 0;
2140 unsigned int nmax = 0;
2141 unsigned int pmin = nSamp;
2142 unsigned int pmax = nSamp;
2143 for (
unsigned int i = 0;
i < nSamp; ++
i) {
2144 float smp = OptFilterDigits[
i];
2145 if (smp - dmin < epsilon) {
2149 if (dmax - smp < epsilon) {
2153 if (smp < abovemin && smp > dmin) {
2156 if (smp > belowmax && smp < dmax) {
2161 if (abovemin != dmax || belowmax != dmin) {
2167 }
else if (dmin < 0.01 && abovemin > level0 && nmin > 1) {
2171 }
else if (dmin>level2 && (
gain==0 || ch_type<2) ) {
2173 }
else if (
nmax+nmin==nSamp && (dmax-dmin) > delta[
gain]) {
2174 if (
nmax>1 && nmin>1) {
2176 }
else if (
nmax==1) {
2177 if (pmax>0 && pmax<nSamp-1) {
2180 }
else if (nmin==1) {
2184 if (!
error && (dmax - dmin) > delta[
gain]) {
2186 if (pmax > 0 && pmax < nSamp - 1
2187 &&
std::max(OptFilterDigits[pmax - 1], OptFilterDigits[pmax + 1]) < dmin + secondMax) {
2190 }
else if (pmin > 0 && pmin < nSamp - 1
2191 &&
std::min(OptFilterDigits[pmin - 1], OptFilterDigits[pmin + 1]) > dmax - secondMax) {