@@ -167,6 +167,7 @@ struct FemtoUniversePairTaskTrackV0Extended {
167167 EfficiencyCorrection effCorrection{&effCorConfGroup};
168168
169169 static constexpr unsigned int V0ChildTable[][2 ] = {{0 , 1 }, {1 , 0 }, {1 , 1 }}; // Table to select the V0 children
170+ static constexpr double v0InvMass[] = {1.115 , 1.115 , 0.497 }; // Table to select invariant mass of V0s
170171
171172 FemtoUniverseContainer<femto_universe_container::EventType::same, femto_universe_container::Observable::kstar> sameEventCont;
172173 FemtoUniverseContainer<femto_universe_container::EventType::mixed, femto_universe_container::Observable::kstar> mixedEventCont;
@@ -584,45 +585,42 @@ struct FemtoUniversePairTaskTrackV0Extended {
584585 return ;
585586 // track cleaning & checking for duplicate pairs
586587 if (!pairCleanerV0.isCleanPair (p1, p2, parts)) {
587- // mark for rejection the cascades that share a daughter with other cascades
588- v0Duplicates.insert (p1.globalIndex ());
589- v0Duplicates.insert (p2.globalIndex ());
588+ // mark for rejection the cascade that shares a daughter with another cascade and has an invariant mass further from default value
589+ if (std::abs (p1.mLambda () - v0InvMass[ConfV0Selection.confV0Type1 ]) < std::abs (p2.mLambda () - v0InvMass[ConfV0Selection.confV0Type2 ])) {
590+ v0Duplicates.insert (p2.globalIndex ());
591+ } else {
592+ v0Duplicates.insert (p1.globalIndex ());
593+ }
590594 }
591595 };
592596
593- auto pairProcessFunc = [&](auto & p1, auto & p2) -> void {
597+ auto pairProcessFunc = [&](auto & p1, auto & p2) -> bool {
594598 if (v0Duplicates.contains (p1.globalIndex ()) || v0Duplicates.contains (p2.globalIndex ()))
595- return ;
599+ return false ;
596600 // Lambda invariant mass cut for p1
597601 if (!invMLambda (p1.mLambda (), p1.mAntiLambda ()))
598- return ;
602+ return false ;
599603 // Lambda invariant mass cut for p2
600604 if (!invMLambda (p2.mLambda (), p2.mAntiLambda ()))
601- return ;
602- if (confIsCPR.value ) {
603- if (confRectV0V0CPR && pairCloseRejectionV0.isClosePair <true >(p1, p2, parts, magFieldTesla, femto_universe_container::EventType::same)) {
604- return ;
605- } else if (!confRectV0V0CPR && pairCloseRejectionV0.isClosePair <false >(p1, p2, parts, magFieldTesla, femto_universe_container::EventType::same)) {
606- return ;
607- }
608- }
605+ return false ;
606+
609607 const auto & posChild1 = parts.iteratorAt (p1.globalIndex () - 2 - parts.begin ().globalIndex ());
610608 const auto & negChild1 = parts.iteratorAt (p1.globalIndex () - 1 - parts.begin ().globalIndex ());
611609 // / p1 daughters that do not pass this condition are not selected
612610 if constexpr (std::experimental::is_detected<hasSigma, typename PartType::iterator>::value) {
613611 if (!isParticleTPC (posChild1, V0ChildTable[ConfV0Selection.confV0Type1 ][0 ]) || !isParticleTPC (negChild1, V0ChildTable[ConfV0Selection.confV0Type1 ][1 ]))
614- return ;
612+ return false ;
615613 if (!isParticleTOF (posChild1, V0ChildTable[ConfV0Selection.confV0Type1 ][0 ]) || !isParticleTOF (negChild1, V0ChildTable[ConfV0Selection.confV0Type1 ][1 ]))
616- return ;
614+ return false ;
617615 } else {
618616 if ((posChild1.pidCut () & (1u << V0ChildTable[ConfV0Selection.confV0Type1 ][0 ])) == 0 || (negChild1.pidCut () & (1u << V0ChildTable[ConfV0Selection.confV0Type1 ][1 ])) == 0 )
619- return ;
617+ return false ;
620618 if (ConfV0Selection.confUseStrangenessTOF ) {
621619 if (((ConfV0Selection.confV0Type1 == 0 ) && (p1.pidCut () & 3 ) != 3 ) || ((ConfV0Selection.confV0Type1 == 1 ) && (p1.pidCut () & 12 ) != 12 ) || ((ConfV0Selection.confV0Type1 == 2 ) && (p1.pidCut () & 48 ) != 48 ))
622- return ;
620+ return false ;
623621 } else {
624622 if ((posChild1.pidCut () & (8u << V0ChildTable[ConfV0Selection.confV0Type1 ][0 ])) == 0 || (negChild1.pidCut () & (8u << V0ChildTable[ConfV0Selection.confV0Type1 ][1 ])) == 0 )
625- return ;
623+ return false ;
626624 }
627625 }
628626
@@ -631,44 +629,44 @@ struct FemtoUniversePairTaskTrackV0Extended {
631629 // / p2 daughters that do not pass this condition are not selected
632630 if constexpr (std::experimental::is_detected<hasSigma, typename PartType::iterator>::value) {
633631 if (!isParticleTPC (posChild2, V0ChildTable[ConfV0Selection.confV0Type2 ][0 ]) || !isParticleTPC (negChild2, V0ChildTable[ConfV0Selection.confV0Type2 ][1 ]))
634- return ;
632+ return false ;
635633 if (!isParticleTOF (posChild2, V0ChildTable[ConfV0Selection.confV0Type2 ][0 ]) || !isParticleTOF (negChild2, V0ChildTable[ConfV0Selection.confV0Type2 ][1 ]))
636- return ;
634+ return false ;
637635 } else {
638636 if ((posChild2.pidCut () & (1u << V0ChildTable[ConfV0Selection.confV0Type2 ][0 ])) == 0 || (negChild2.pidCut () & (1u << V0ChildTable[ConfV0Selection.confV0Type2 ][1 ])) == 0 )
639- return ;
637+ return false ;
640638 if (ConfV0Selection.confUseStrangenessTOF ) {
641639 if (((ConfV0Selection.confV0Type2 == 0 ) && (p2.pidCut () & 3 ) != 3 ) || ((ConfV0Selection.confV0Type2 == 1 ) && (p2.pidCut () & 12 ) != 12 ) || ((ConfV0Selection.confV0Type2 == 2 ) && (p2.pidCut () & 48 ) != 48 ))
642- return ;
640+ return false ;
643641 } else {
644642 if ((posChild2.pidCut () & (8u << V0ChildTable[ConfV0Selection.confV0Type2 ][0 ])) == 0 || (negChild2.pidCut () & (8u << V0ChildTable[ConfV0Selection.confV0Type2 ][1 ])) == 0 )
645- return ;
643+ return false ;
644+ }
645+ }
646+
647+ if (confIsCPR.value ) {
648+ if (confRectV0V0CPR && pairCloseRejectionV0.isClosePair <true >(p1, p2, parts, magFieldTesla, femto_universe_container::EventType::same)) {
649+ return false ;
650+ } else if (!confRectV0V0CPR && pairCloseRejectionV0.isClosePair <false >(p1, p2, parts, magFieldTesla, femto_universe_container::EventType::same)) {
651+ return false ;
646652 }
647653 }
648654
649655 if constexpr (std::is_same<PartType, FemtoRecoParticles>::value)
650656 sameEventCont.setPair <true >(p1, p2, multCol, confUse3D);
651657 else
652658 sameEventCont.setPair <false >(p1, p2, multCol, confUse3D);
659+ return true ;
653660 };
654661
655662 v0Duplicates.clear ();
656- if (ConfV0Selection.confV0Type1 == ConfV0Selection.confV0Type2 ) {
657- for (const auto & [p1, p2] : combinations (CombinationsStrictlyUpperIndexPolicy (groupPartsTwo, groupPartsTwo))) {
658- pairDuplicateCheckFunc (p1, p2);
659- }
660- // / Now build the combinations for identical V0s
661- for (const auto & [p1, p2] : combinations (CombinationsStrictlyUpperIndexPolicy (groupPartsTwo, groupPartsTwo))) {
662- pairProcessFunc (p1, p2);
663- }
664- } else {
665- for (const auto & [p1, p2] : combinations (CombinationsFullIndexPolicy (groupPartsTwo, groupPartsTwo))) {
666- pairDuplicateCheckFunc (p1, p2);
667- }
668- // / Now build the combinations for non-identical V0s
669- for (const auto & [p1, p2] : combinations (CombinationsFullIndexPolicy (groupPartsTwo, groupPartsTwo))) {
670- pairProcessFunc (p1, p2);
671- }
663+ for (const auto & [p1, p2] : combinations (CombinationsStrictlyUpperIndexPolicy (groupPartsTwo, groupPartsTwo))) {
664+ pairDuplicateCheckFunc (p1, p2);
665+ }
666+ // / Now build the combinations for V0s
667+ for (const auto & [p1, p2] : combinations (CombinationsStrictlyUpperIndexPolicy (groupPartsTwo, groupPartsTwo))) {
668+ if (!pairProcessFunc (p1, p2))
669+ pairProcessFunc (p2, p1);
672670 }
673671 }
674672
0 commit comments