@@ -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,9 +585,12 @@ 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
@@ -599,13 +603,7 @@ struct FemtoUniversePairTaskTrackV0Extended {
599603 // Lambda invariant mass cut for p2
600604 if (!invMLambda (p2.mLambda (), p2.mAntiLambda ()))
601605 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- }
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
@@ -646,29 +644,27 @@ struct FemtoUniversePairTaskTrackV0Extended {
646644 }
647645 }
648646
647+ if (confIsCPR.value ) {
648+ if (confRectV0V0CPR && pairCloseRejectionV0.isClosePair <true >(p1, p2, parts, magFieldTesla, femto_universe_container::EventType::same)) {
649+ return ;
650+ } else if (!confRectV0V0CPR && pairCloseRejectionV0.isClosePair <false >(p1, p2, parts, magFieldTesla, femto_universe_container::EventType::same)) {
651+ return ;
652+ }
653+ }
654+
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);
653659 };
654660
655661 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- }
662+ for (const auto & [p1, p2] : combinations (CombinationsStrictlyUpperIndexPolicy (groupPartsTwo, groupPartsTwo))) {
663+ pairDuplicateCheckFunc (p1, p2);
664+ }
665+ // / Now build the combinations for V0s
666+ for (const auto & [p1, p2] : combinations (CombinationsStrictlyUpperIndexPolicy (groupPartsTwo, groupPartsTwo))) {
667+ pairProcessFunc (p1, p2);
672668 }
673669 }
674670
0 commit comments