@@ -2114,13 +2114,20 @@ void AODProducerWorkflowDPL::run(ProcessingContext& pc)
21142114 fillStrangenessTrackingTables (recoData, trackedV0Cursor, trackedCascadeCursor, tracked3BodyCurs);
21152115
21162116 // helper map for fast search of a corresponding class mask for a bc
2117+ auto emcalIncomplete = filterEMCALIncomplete (recoData.getEMCALTriggers ());
21172118 std::unordered_map<uint64_t , std::pair<uint64_t , uint64_t >> bcToClassMask;
21182119 if (mInputSources [GID::CTP]) {
21192120 LOG (debug) << " CTP input available" ;
21202121 for (auto & ctpDigit : ctpDigits) {
21212122 uint64_t bc = ctpDigit.intRecord .toLong ();
21222123 uint64_t classMask = ctpDigit.CTPClassMask .to_ulong ();
21232124 uint64_t inputMask = ctpDigit.CTPInputMask .to_ulong ();
2125+ if (emcalIncomplete.find (bc) != emcalIncomplete.end ()) {
2126+ // reject EMCAL triggers as BC was rejected as incomplete at readout level
2127+ auto classMaskOrig = classMask;
2128+ classMask = classMask & ~mEMCALTrgClassMask ;
2129+ LOG (debug) << " Found EMCAL incomplete event, mask before " << std::bitset<64 >(classMaskOrig) << " , after " << std::bitset<64 >(classMask);
2130+ }
21242131 bcToClassMask[bc] = {classMask, inputMask};
21252132 // LOG(debug) << Form("classmask:0x%llx", classMask);
21262133 }
@@ -2518,6 +2525,18 @@ void AODProducerWorkflowDPL::extrapolateToCalorimeters(TrackExtraInfo& extraInfo
25182525 //
25192526}
25202527
2528+ std::set<uint64_t > AODProducerWorkflowDPL::filterEMCALIncomplete (const gsl::span<const o2::emcal::TriggerRecord> triggers)
2529+ {
2530+ std::set<uint64_t > emcalIncompletes;
2531+ for (const auto & trg : triggers) {
2532+ if (trg.getTriggerBits () & o2::emcal::triggerbits::Inc) {
2533+ // trigger record masked at incomplete at readout level
2534+ emcalIncompletes.insert (trg.getBCData ().toLong ());
2535+ }
2536+ }
2537+ return emcalIncompletes;
2538+ }
2539+
25212540void AODProducerWorkflowDPL::updateTimeDependentParams (ProcessingContext& pc)
25222541{
25232542 o2::base::GRPGeomHelper::instance ().checkUpdates (pc);
@@ -2550,6 +2569,8 @@ void AODProducerWorkflowDPL::updateTimeDependentParams(ProcessingContext& pc)
25502569 mNSigmaTimeTrack = pvParams.nSigmaTimeTrack ;
25512570 mTimeMarginTrackTime = pvParams.timeMarginTrackTime * 1 .e3 ;
25522571 mFieldON = std::abs (o2::base::Propagator::Instance ()->getNominalBz ()) > 0.01 ;
2572+
2573+ pc.inputs ().get <o2::ctp::CTPConfiguration*>(" ctpconfig" );
25532574 }
25542575 if (mPropTracks ) {
25552576 pc.inputs ().get <o2::dataformats::MeanVertexObject*>(" meanvtx" );
@@ -2583,6 +2604,17 @@ void AODProducerWorkflowDPL::finaliseCCDB(ConcreteDataMatcher& matcher, void* ob
25832604 mVtx = *(const o2::dataformats::MeanVertexObject*)obj;
25842605 return ;
25852606 }
2607+ if (matcher == ConcreteDataMatcher (" CTP" , " CTPCONFIG" , 0 )) {
2608+ // construct mask with EMCAL trigger classes for rejection of incomplete triggers
2609+ auto ctpconfig = *(const o2::ctp::CTPConfiguration*)obj;
2610+ mEMCALTrgClassMask = 0 ;
2611+ for (const auto & trgclass : ctpconfig.getCTPClasses ()) {
2612+ if (trgclass.cluster ->maskCluster [o2::detectors::DetID::EMC]) {
2613+ mEMCALTrgClassMask |= trgclass.classMask ;
2614+ }
2615+ }
2616+ LOG (info) << " Loaded EMCAL trigger class mask: " << std::bitset<64 >(mEMCALTrgClassMask );
2617+ }
25862618}
25872619
25882620void AODProducerWorkflowDPL::addRefGlobalBCsForTOF (const o2::dataformats::VtxTrackRef& trackRef, const gsl::span<const GIndex>& GIndices,
0 commit comments