@@ -295,7 +295,7 @@ int RawDataDecoder::decodeRaw(o2::framework::InputRecord& inputs, std::vector<o2
295295 if (mDoDigits & mDecodeInps ) {
296296 uint64_t trgclassmask = 0xffffffffffffffff ;
297297 if (mCTPConfig .getRunNumber () != 0 ) {
298- trgclassmask = mCTPConfig .getTriggerClassMask ();
298+ trgclassmask = mCTPConfig .getTriggerClassMaskOnlywInputs ();
299299 }
300300 // std::cout << "trgclassmask:" << std::hex << trgclassmask << std::dec << std::endl;
301301 ret = shiftInputs (digitsMap, digits, mTFOrbit , trgclassmask);
@@ -530,12 +530,6 @@ int RawDataDecoder::shiftNew(const o2::InteractionRecord& irin, uint32_t TFOrbit
530530int RawDataDecoder::shiftInputs (std::map<o2::InteractionRecord, CTPDigit>& digitsMap, o2::pmr::vector<CTPDigit>& digits, uint32_t TFOrbit, uint64_t trgclassmask)
531531{
532532 // int nClasswoInp = 0; // counting classes without input which should never happen
533- int nLM = 0 ;
534- int nL0 = 0 ;
535- int nL1 = 0 ;
536- int nTwI = 0 ;
537- int nTwoI = 0 ;
538- int nTwoIlost = 0 ;
539533 std::map<o2::InteractionRecord, CTPDigit> digitsMapShifted;
540534 auto L0shift = o2::ctp::TriggerOffsetsParam::Instance ().LM_L0 ;
541535 auto L1shift = L0shift + o2::ctp::TriggerOffsetsParam::Instance ().L0_L1 ;
@@ -593,60 +587,35 @@ int RawDataDecoder::shiftInputs(std::map<o2::InteractionRecord, CTPDigit>& digit
593587 }
594588 }
595589 for (auto const & dig : digitsMapShifted) {
596- auto d = dig.second ;
597- if ((d.CTPInputMask & LMMASKInputs).count ()) {
598- nLM++;
599- }
600- if ((d.CTPInputMask & L0MASKInputs).count ()) {
601- nL0++;
602- }
603- if ((d.CTPInputMask & L1MASKInputs).count ()) {
604- nL1++;
605- }
606- if ((d.CTPClassMask ).to_ulong () & trgclassmask) {
607- if (d.CTPInputMask .count ()) {
608- nTwI++;
609- } else {
610- if (d.intRecord .bc == (o2::constants::lhc::LHCMaxBunches - L1shift)) { // input can be lost because latency class-l1input = 1
611- nTwoIlost++;
612- } else {
613- // LOG(error) << d.intRecord << " " << d.CTPClassMask << " " << d.CTPInputMask;
614- // std::cout << "ERROR:" << std::hex << d.CTPClassMask << " " << d.CTPInputMask << std::dec << std::endl;
615- nTwoI++;
616- }
617- }
618- }
619590 digits.push_back (dig.second );
620591 }
621- int ret = 0 ;
622- if (nTwoI) { // Trigger class wo Input
623- LOG (error) << " LM:" << nLM << " L0:" << nL0 << " L1:" << nL1 << " TwI:" << nTwI << " Trigger classes wo input:" << nTwoI;
624- ret = 64 ;
625- }
626- if (nTwoIlost) {
627- LOG (warn) << " Trigger classes wo input from diff latency 1:" << nTwoIlost;
628- }
629- return ret;
592+ return 0 ;
630593}
631594//
632595int RawDataDecoder::checkReadoutConsistentncy (o2::pmr::vector<CTPDigit>& digits, uint64_t trgclassmask)
633596{
634597 int ret = 0 ;
635598 int lost = 0 ;
599+ static int nerror = 0 ;
636600 for (auto const & digit : digits) {
637601 // if class mask => inps
638602 for (int i = 0 ; i < digit.CTPClassMask .size (); i++) {
639603 if (digit.CTPClassMask [i] & trgclassmask) {
640604 const CTPClass* cls = mCTPConfig .getCTPClassFromHWIndex (i);
641605 if (cls == nullptr ) {
642- LOG (error) << " Class mask index not found in CTP config:" << i;
606+ if (nerror < mErrorMax )
607+ LOG (error) << " Class mask index not found in CTP config:" << i;
643608 ret = 128 ;
644609 continue ;
645610 }
646611 uint64_t clsinpmask = cls->descriptor ->getInputsMask ();
647612 uint64_t diginpmask = digit.CTPInputMask .to_ullong ();
648613 if (!((clsinpmask & diginpmask) == clsinpmask)) {
649- LOG (error) << " CTP class:" << cls->name << " inpmask:" << clsinpmask << " not compatible with inputs mask:" << diginpmask;
614+ if (nerror < mErrorMax )
615+ LOG (error) << " CTP class:" << cls->name << " inpmask:" << clsinpmask << " not compatible with inputs mask:" << diginpmask;
616+ auto result = mClassErrors .insert ({cls->getIndex (),1 });
617+ if (!result.second )
618+ mClassErrors [cls->getIndex ()]++;
650619 ret = 128 ;
651620 }
652621 }
@@ -662,7 +631,11 @@ int RawDataDecoder::checkReadoutConsistentncy(o2::pmr::vector<CTPDigit>& digits,
662631 int32_t offset = BCShiftCorrection + o2::ctp::TriggerOffsetsParam::Instance ().LM_L0 + o2::ctp::TriggerOffsetsParam::Instance ().L0_L1_classes - 1 ;
663632 offset = o2::constants::lhc::LHCMaxBunches - offset;
664633 if (digit.intRecord .bc < offset) {
665- LOG (error) << " CTP class:" << cls.name << " inpmask:" << clsinpmask << " cls mask:" << cls.classMask << " not found in digit:" << digit;
634+ if (nerror < mErrorMax )
635+ LOG (error) << " CTP class:" << cls.name << " inpmask:" << clsinpmask << " cls mask:" << cls.classMask << " not found in digit:" << digit;
636+ auto result = mInpErrors .insert ({diginpmask,1 });
637+ if (!result.second )
638+ mInpErrors [diginpmask]++;
666639 ret = 256 ;
667640 } else {
668641 lost++;
0 commit comments