@@ -210,10 +210,24 @@ struct FemtoUniversePairTaskTrackV0Extended {
210210
211211 bool isNSigmaCombined (float mom, float nsigmaTPCParticle, float nsigmaTOFParticle, bool hasTOF)
212212 {
213- if (mom <= confmom || hasTOF == 0 ) {
213+ if (mom <= confmom) {
214214 return (std::abs (nsigmaTPCParticle) < confNsigmaTPCParticle);
215- } else {
215+ } else if (hasTOF == 1 ) {
216216 return (std::hypot (nsigmaTOFParticle, nsigmaTPCParticle) < confNsigmaCombinedParticle);
217+ } else {
218+ return false ;
219+ }
220+ }
221+
222+ template <typename T>
223+ bool isNSigmaCombinedBitmask (float mom, const T& part)
224+ {
225+ if (mom <= confmom) {
226+ return ((part.pidCut () & (1u << ConfTrkSelection.confTrackChoicePartOne )) != 0 );
227+ } else if ((part.pidCut () & 512u ) != 0 ) {
228+ return ((part.pidCut () & (64u << ConfTrkSelection.confTrackChoicePartOne )) != 0 );
229+ } else {
230+ return false ;
217231 }
218232 }
219233
@@ -488,12 +502,8 @@ struct FemtoUniversePairTaskTrackV0Extended {
488502 trackHistoPartOneNeg.fillQA <false , false >(part);
489503 }
490504 } else {
491- if ((part.pidCut () & 512u ) != 0 ) {
492- if ((part.pidCut () & (64u << ConfTrkSelection.confTrackChoicePartOne )) == 0 )
493- continue ;
494- } else if ((part.pidCut () & (1u << ConfTrkSelection.confTrackChoicePartOne )) == 0 ) {
505+ if (!isNSigmaCombinedBitmask (part.p (), part))
495506 continue ;
496- }
497507 if (ConfTrkSelection.confChargePart1 > 0 )
498508 trackHistoPartOnePos.fillQA <false , false >(part);
499509 if (ConfTrkSelection.confChargePart1 < 0 )
@@ -511,12 +521,8 @@ struct FemtoUniversePairTaskTrackV0Extended {
511521 if (!isParticleCombined (p1, ConfTrkSelection.confTrackChoicePartOne ))
512522 continue ;
513523 } else {
514- if ((p1.pidCut () & 512u ) != 0 ) {
515- if ((p1.pidCut () & (64u << ConfTrkSelection.confTrackChoicePartOne )) == 0 )
516- continue ;
517- } else if ((p1.pidCut () & (1u << ConfTrkSelection.confTrackChoicePartOne )) == 0 ) {
524+ if (!isNSigmaCombinedBitmask (p1.p (), p1))
518525 continue ;
519- }
520526 }
521527 // track cleaning
522528 if (!pairCleaner.isCleanPair (p1, p2, parts)) {
@@ -986,12 +992,8 @@ struct FemtoUniversePairTaskTrackV0Extended {
986992 if (!isParticleCombined (p1, ConfTrkSelection.confTrackChoicePartOne ))
987993 continue ;
988994 } else {
989- if ((p1.pidCut () & 512u ) != 0 ) {
990- if ((p1.pidCut () & (64u << ConfTrkSelection.confTrackChoicePartOne )) == 0 )
991- continue ;
992- } else if ((p1.pidCut () & (1u << ConfTrkSelection.confTrackChoicePartOne )) == 0 ) {
995+ if (!isNSigmaCombinedBitmask (p1.p (), p1))
993996 continue ;
994- }
995997 }
996998
997999 const auto & posChild = parts.iteratorAt (p2.globalIndex () - 2 - parts.begin ().globalIndex ());
@@ -1684,12 +1686,8 @@ struct FemtoUniversePairTaskTrackV0Extended {
16841686 if (!isNSigmaCombined (part.p (), aod::pidtpc_tiny::binning::unPackInTable (part.tpcNSigmaStorePr ()), aod::pidtof_tiny::binning::unPackInTable (part.tofNSigmaStorePr ()), (part.pidCut () & 512u ) != 0 ))
16851687 continue ;
16861688 } else {
1687- if ((part.pidCut () & 512u ) != 0 ) {
1688- if ((part.pidCut () & 64u ) == 0 ) // 64 for proton combined
1689- continue ;
1690- } else if ((part.pidCut () & 1u ) == 0 ) {
1689+ if (!isNSigmaCombinedBitmask (part.p (), part))
16911690 continue ;
1692- }
16931691 }
16941692 registryMCreco.fill (HIST (" plus/MCrecoPr" ), mcpart.pt (), mcpart.eta ());
16951693 registryMCreco.fill (HIST (" plus/MCrecoPrPt" ), mcpart.pt ());
@@ -1715,12 +1713,8 @@ struct FemtoUniversePairTaskTrackV0Extended {
17151713 if (!isNSigmaCombined (part.p (), aod::pidtpc_tiny::binning::unPackInTable (part.tpcNSigmaStorePr ()), aod::pidtof_tiny::binning::unPackInTable (part.tofNSigmaStorePr ()), (part.pidCut () & 512u ) != 0 ))
17161714 continue ;
17171715 } else {
1718- if ((part.pidCut () & 512u ) != 0 ) {
1719- if ((part.pidCut () & 64u ) == 0 ) // 64 for proton combined
1720- continue ;
1721- } else if ((part.pidCut () & 1u ) == 0 ) {
1716+ if (!isNSigmaCombinedBitmask (part.p (), part))
17221717 continue ;
1723- }
17241718 }
17251719 registryMCreco.fill (HIST (" minus/MCrecoPr" ), mcpart.pt (), mcpart.eta ());
17261720 registryMCreco.fill (HIST (" minus/MCrecoPrPt" ), mcpart.pt ());
0 commit comments