@@ -252,6 +252,14 @@ struct CorrelationTask {
252252 return grpo->getNominalL3Field ();
253253 }
254254
255+ template <class p2typeIterator >
256+ bool passMLScore (const p2typeIterator& track)
257+ {
258+ auto it = std::lower_bound (cfgPtDepMLbkg->begin (), cfgPtDepMLbkg->end (), track.pt ());
259+ int idx = std::distance (cfgPtDepMLbkg->begin (), it) - 1 ;
260+ return !((track.decay () == 0 && track.mlProbD0 ()[0 ] > cfgPtCentDepMLbkgSel->at (idx)) || (track.decay () == 1 && track.mlProbD0bar ()[0 ] > cfgPtCentDepMLbkgSel->at (idx)));
261+ }
262+
255263 template <typename TCollision, typename TTracks>
256264 void fillQA (const TCollision& /* collision*/ , float multiplicity, const TTracks& tracks)
257265 {
@@ -274,12 +282,20 @@ struct CorrelationTask {
274282 if constexpr (std::experimental::is_detected<HasInvMass, typename TTracks1::iterator>::value && std::experimental::is_detected<HasDecay, typename TTracks1::iterator>::value) {
275283 if (cfgDecayParticleMask != 0 && (cfgDecayParticleMask & (1u << static_cast <uint32_t >(track1.decay ()))) == 0u )
276284 continue ;
285+ if constexpr (std::experimental::is_detected<HasMlProbD0, typename TTracks1::iterator>::value) {
286+ if (!passMLScore (track1))
287+ continue ;
288+ }
277289 registry.fill (HIST (" invMass" ), track1.invMass (), track1.pt (), multiplicity);
278290 for (const auto & track2 : tracks2) {
279291 if constexpr (std::experimental::is_detected<HasInvMass, typename TTracks2::iterator>::value && std::experimental::is_detected<HasDecay, typename TTracks2::iterator>::value) {
280292 if (doprocessSame2Prong2Prong || doprocessMixed2Prong2Prong || doprocessSame2Prong2ProngML || doprocessMixed2Prong2ProngML) {
281293 if (cfgDecayParticleMask != 0 && (cfgDecayParticleMask & (1u << static_cast <uint32_t >(track1.decay ()))) == 0u )
282294 continue ;
295+ if constexpr (std::experimental::is_detected<HasMlProbD0, typename TTracks2::iterator>::value) {
296+ if (!passMLScore (track2))
297+ continue ;
298+ }
283299
284300 if constexpr (std::experimental::is_detected<HasProng0Id, typename TTracks1::iterator>::value) {
285301 if constexpr (std::experimental::is_detected<HasProng0Id, typename TTracks2::iterator>::value) {
@@ -412,15 +428,8 @@ struct CorrelationTask {
412428 }
413429
414430 if constexpr (std::experimental::is_detected<HasMlProbD0, typename TTracks1::iterator>::value) {
415- if (doprocessSame2ProngDerivedML || doprocessSame2Prong2ProngML || doprocessMixed2ProngDerivedML || doprocessMixed2Prong2ProngML) {
416- auto it = std::lower_bound (cfgPtDepMLbkg->begin (), cfgPtDepMLbkg->end (), track1.pt ());
417- int idx = std::distance (cfgPtDepMLbkg->begin (), it) - 1 ;
418- if (track1.decay () == 0 && track1.mlProbD0 ()[0 ] > cfgPtCentDepMLbkgSel->at (idx)) {
419- continue ;
420- } else if (track1.decay () == 1 && track1.mlProbD0bar ()[0 ] > cfgPtCentDepMLbkgSel->at (idx)) {
421- continue ;
422- }
423- }
431+ if ((doprocessSame2ProngDerivedML || doprocessSame2Prong2ProngML || doprocessMixed2ProngDerivedML || doprocessMixed2Prong2ProngML) && !passMLScore (track1))
432+ continue ;
424433 } // ML selection
425434
426435 if (cfgMassAxis) {
@@ -536,15 +545,8 @@ struct CorrelationTask {
536545 float deltaPhi = RecoDecay::constrainAngle (track1.phi () - track2.phi (), -o2::constants::math::PIHalf);
537546
538547 if constexpr (std::experimental::is_detected<HasMlProbD0, typename TTracks2::iterator>::value) {
539- if (doprocessSame2ProngDerivedML || doprocessSame2Prong2ProngML || doprocessMixed2ProngDerivedML || doprocessMixed2Prong2ProngML) {
540- auto it = std::lower_bound (cfgPtDepMLbkg->begin (), cfgPtDepMLbkg->end (), track2.pt ());
541- int idx = std::distance (cfgPtDepMLbkg->begin (), it) - 1 ;
542- if (track2.decay () == 0 && track2.mlProbD0 ()[0 ] > cfgPtCentDepMLbkgSel->at (idx)) {
543- continue ;
544- } else if (track2.decay () == 1 && track2.mlProbD0bar ()[0 ] > cfgPtCentDepMLbkgSel->at (idx)) {
545- continue ;
546- }
547- }
548+ if ((doprocessSame2ProngDerivedML || doprocessSame2Prong2ProngML || doprocessMixed2ProngDerivedML || doprocessMixed2Prong2ProngML) && !passMLScore (track2))
549+ continue ;
548550 } // ML selection
549551
550552 // last param is the weight
0 commit comments