@@ -58,6 +58,8 @@ struct FemtoUniversePairTaskTrackV0Extended {
5858 using FemtoRecoParticles = soa::Join<aod::FDParticles, aod::FDExtParticles, aod::FDMCLabels, aod::FDExtMCParticles>;
5959 Preslice<FemtoRecoParticles> perColMC = aod::femtouniverseparticle::fdCollisionId;
6060
61+ using FemtoBasicParticles = soa::Join<aod::FDParticles, aod::FDMCLabels>;
62+
6163 // / To apply narrow cut
6264 Configurable<float > confZVertexCut{" confZVertexCut" , 10 .f , " Event sel: Maximum z-Vertex (cm)" };
6365 Configurable<float > confEta{" confEta" , 0.8 , " Eta cut for the global track" };
@@ -1598,7 +1600,8 @@ struct FemtoUniversePairTaskTrackV0Extended {
15981600 }
15991601 PROCESS_SWITCH (FemtoUniversePairTaskTrackV0Extended, processPairFractionsMCTruthV0, " Process MC data to obtain pair fractions for V0V0 MC truth pairs" , false );
16001602
1601- void processMCReco (FemtoRecoParticles const & parts, aod::FdMCParticles const & mcparts)
1603+ template <class PartType >
1604+ void doMCReco (PartType const & parts, aod::FdMCParticles const & mcparts)
16021605 {
16031606 for (const auto & part : parts) {
16041607 auto mcPartId = part.fdMCParticleId ();
@@ -1607,55 +1610,104 @@ struct FemtoUniversePairTaskTrackV0Extended {
16071610 const auto & mcpart = mcparts.iteratorAt (mcPartId);
16081611 //
16091612 if (part.partType () == aod::femtouniverseparticle::ParticleType::kV0 ) {
1613+ if (!invMLambda (part.mLambda (), part.mAntiLambda ()))
1614+ continue ;
16101615 if (mcpart.pdgMCTruth () == kLambda0 ) {
1611- const auto & posChild = parts.iteratorAt (part.globalIndex () - 2 );
1612- const auto & negChild = parts.iteratorAt (part.globalIndex () - 1 );
1613- // / Daughters that do not pass this condition are not selected
1614- if (isParticleTPC (posChild, 0 ) && isParticleTPC (negChild, 1 )) {
1615- registryMCreco.fill (HIST (" plus/MCrecoLambda" ), mcpart.pt (), mcpart.eta ()); // lambda
1616- if (auto mcpartIdChild = posChild.fdMCParticleId (); mcpartIdChild != -1 ) {
1617- const auto & mcpartChild = mcparts.iteratorAt (mcpartIdChild);
1618- registryMCreco.fill (HIST (" plus/MCrecoLambdaChildPr" ), mcpartChild.pt (), mcpartChild.eta ()); // lambda proton child
1619- }
1620- if (auto mcpartIdChild = negChild.fdMCParticleId (); mcpartIdChild != -1 ) {
1621- const auto & mcpartChild = mcparts.iteratorAt (mcpartIdChild);
1622- registryMCreco.fill (HIST (" plus/MCrecoLambdaChildPi" ), mcpartChild.pt (), mcpartChild.eta ()); // lambda pion child
1616+ const auto & posChild = parts.iteratorAt (part.globalIndex () - 2 - parts.begin ().globalIndex ());
1617+ const auto & negChild = parts.iteratorAt (part.globalIndex () - 1 - parts.begin ().globalIndex ());
1618+ if constexpr (std::experimental::is_detected<hasSigma, typename PartType::iterator>::value) {
1619+ // / Daughters that do not pass this condition are not selected
1620+ if (!isParticleTPC (posChild, 0 ) || !isParticleTPC (negChild, 1 ))
1621+ continue ;
1622+
1623+ if (!isParticleTOF (posChild, 0 ) || !isParticleTOF (negChild, 1 ))
1624+ continue ;
1625+
1626+ } else {
1627+ if ((posChild.pidCut () & (1u << 0 )) == 0 || (negChild.pidCut () & (1u << 1 )) == 0 )
1628+ continue ;
1629+
1630+ if (ConfV0Selection.confUseStrangenessTOF ) {
1631+ if ((part.pidCut () & 3 ) != 3 )
1632+ continue ;
1633+ } else {
1634+ if ((posChild.pidCut () & (8u << 0 )) == 0 || (negChild.pidCut () & (8u << 1 )) == 0 )
1635+ continue ;
16231636 }
16241637 }
1638+ registryMCreco.fill (HIST (" plus/MCrecoLambda" ), mcpart.pt (), mcpart.eta ()); // lambda
1639+
16251640 } else if (mcpart.pdgMCTruth () == kLambda0Bar ) {
1626- const auto & posChild = parts.iteratorAt (part.globalIndex () - 2 );
1627- const auto & negChild = parts.iteratorAt (part.globalIndex () - 1 );
1628- // / Daughters that do not pass this condition are not selected
1629- if (isParticleTPC (posChild, 1 ) && isParticleTPC (negChild, 0 )) {
1630- registryMCreco.fill (HIST (" minus/MCrecoLambda" ), mcpart.pt (), mcpart.eta ()); // anti-lambda
1631- if (auto mcpartIdChild = posChild.fdMCParticleId (); mcpartIdChild != -1 ) {
1632- const auto & mcpartChild = mcparts.iteratorAt (mcpartIdChild);
1633- registryMCreco.fill (HIST (" minus/MCrecoLambdaChildPi" ), mcpartChild.pt (), mcpartChild.eta ()); // anti-lambda pion child
1634- }
1635- if (auto mcpartIdChild = negChild.fdMCParticleId (); mcpartIdChild != -1 ) {
1636- const auto & mcpartChild = mcparts.iteratorAt (mcpartIdChild);
1637- registryMCreco.fill (HIST (" minus/MCrecoLambdaChildPr" ), mcpartChild.pt (), mcpartChild.eta ()); // anti-lambda proton child
1641+ const auto & posChild = parts.iteratorAt (part.globalIndex () - 2 - parts.begin ().globalIndex ());
1642+ const auto & negChild = parts.iteratorAt (part.globalIndex () - 1 - parts.begin ().globalIndex ());
1643+ if constexpr (std::experimental::is_detected<hasSigma, typename PartType::iterator>::value) {
1644+ // / Daughters that do not pass this condition are not selected
1645+ if (!isParticleTPC (posChild, 1 ) || !isParticleTPC (negChild, 0 ))
1646+ continue ;
1647+
1648+ if (!isParticleTOF (posChild, 1 ) || !isParticleTOF (negChild, 0 ))
1649+ continue ;
1650+
1651+ } else {
1652+ if ((posChild.pidCut () & (1u << 1 )) == 0 || (negChild.pidCut () & (1u << 0 )) == 0 )
1653+ continue ;
1654+
1655+ if (ConfV0Selection.confUseStrangenessTOF ) {
1656+ if ((part.pidCut () & 12 ) != 12 )
1657+ continue ;
1658+ } else {
1659+ if ((posChild.pidCut () & (8u << 1 )) == 0 || (negChild.pidCut () & (8u << 0 )) == 0 )
1660+ continue ;
16381661 }
16391662 }
1663+ registryMCreco.fill (HIST (" minus/MCrecoLambda" ), mcpart.pt (), mcpart.eta ()); // anti-lambda
16401664 }
16411665 } else if (part.partType () == aod::femtouniverseparticle::ParticleType::kTrack ) {
1642- if (part.sign () > 0 ) {
1666+ if (part.mAntiLambda () > 0 ) { // mAntiLambda is the sign here
16431667 registryMCreco.fill (HIST (" plus/MCrecoAllPt" ), mcpart.pt ());
1644- if (mcpart.pdgMCTruth () == kPiPlus && isNSigmaCombined (part.p (), aod::pidtpc_tiny::binning::unPackInTable (part.tpcNSigmaStorePi ()), aod::pidtof_tiny::binning::unPackInTable (part.tofNSigmaStorePi ()))) {
1668+ if (mcpart.pdgMCTruth () == kPiPlus ) {
1669+ if constexpr (std::experimental::is_detected<hasSigma, typename PartType::iterator>::value) {
1670+ if (!isNSigmaCombined (part.p (), aod::pidtpc_tiny::binning::unPackInTable (part.tpcNSigmaStorePi ()), aod::pidtof_tiny::binning::unPackInTable (part.tofNSigmaStorePi ())))
1671+ continue ;
1672+ } else {
1673+ if ((part.pidCut () & 128u ) == 0 ) // 128 for pion combined
1674+ continue ;
1675+ }
16451676 registryMCreco.fill (HIST (" plus/MCrecoPi" ), mcpart.pt (), mcpart.eta ());
16461677 registryMCreco.fill (HIST (" plus/MCrecoPiPt" ), mcpart.pt ());
1647- } else if (mcpart.pdgMCTruth () == kProton && isNSigmaCombined (part.p (), aod::pidtpc_tiny::binning::unPackInTable (part.tpcNSigmaStorePr ()), aod::pidtof_tiny::binning::unPackInTable (part.tofNSigmaStorePr ()))) {
1678+ } else if (mcpart.pdgMCTruth () == kProton ) {
1679+ if constexpr (std::experimental::is_detected<hasSigma, typename PartType::iterator>::value) {
1680+ if (!isNSigmaCombined (part.p (), aod::pidtpc_tiny::binning::unPackInTable (part.tpcNSigmaStorePr ()), aod::pidtof_tiny::binning::unPackInTable (part.tofNSigmaStorePr ())))
1681+ continue ;
1682+ } else {
1683+ if ((part.pidCut () & 64u ) == 0 ) // 64 for proton combined
1684+ continue ;
1685+ }
16481686 registryMCreco.fill (HIST (" plus/MCrecoPr" ), mcpart.pt (), mcpart.eta ());
16491687 registryMCreco.fill (HIST (" plus/MCrecoPrPt" ), mcpart.pt ());
16501688 }
16511689 }
16521690
1653- if (part.sign () < 0 ) {
1691+ else if (part.mAntiLambda () < 0 ) {
16541692 registryMCreco.fill (HIST (" minus/MCrecoAllPt" ), mcpart.pt ());
1655- if (mcpart.pdgMCTruth () == kPiMinus && isNSigmaCombined (part.p (), aod::pidtpc_tiny::binning::unPackInTable (part.tpcNSigmaStorePi ()), aod::pidtof_tiny::binning::unPackInTable (part.tofNSigmaStorePi ()))) {
1693+ if (mcpart.pdgMCTruth () == kPiMinus ) {
1694+ if constexpr (std::experimental::is_detected<hasSigma, typename PartType::iterator>::value) {
1695+ if (!isNSigmaCombined (part.p (), aod::pidtpc_tiny::binning::unPackInTable (part.tpcNSigmaStorePi ()), aod::pidtof_tiny::binning::unPackInTable (part.tofNSigmaStorePi ())))
1696+ continue ;
1697+ } else {
1698+ if ((part.pidCut () & 128u ) == 0 ) // 128 for pion combined
1699+ continue ;
1700+ }
16561701 registryMCreco.fill (HIST (" minus/MCrecoPi" ), mcpart.pt (), mcpart.eta ());
16571702 registryMCreco.fill (HIST (" minus/MCrecoPiPt" ), mcpart.pt ());
1658- } else if (mcpart.pdgMCTruth () == kProtonBar && isNSigmaCombined (part.p (), aod::pidtpc_tiny::binning::unPackInTable (part.tpcNSigmaStorePr ()), aod::pidtof_tiny::binning::unPackInTable (part.tofNSigmaStorePr ()))) {
1703+ } else if (mcpart.pdgMCTruth () == kProtonBar ) {
1704+ if constexpr (std::experimental::is_detected<hasSigma, typename PartType::iterator>::value) {
1705+ if (!isNSigmaCombined (part.p (), aod::pidtpc_tiny::binning::unPackInTable (part.tpcNSigmaStorePr ()), aod::pidtof_tiny::binning::unPackInTable (part.tofNSigmaStorePr ())))
1706+ continue ;
1707+ } else {
1708+ if ((part.pidCut () & 64u ) == 0 ) // 64 for proton combined
1709+ continue ;
1710+ }
16591711 registryMCreco.fill (HIST (" minus/MCrecoPr" ), mcpart.pt (), mcpart.eta ());
16601712 registryMCreco.fill (HIST (" minus/MCrecoPrPt" ), mcpart.pt ());
16611713 }
@@ -1664,7 +1716,17 @@ struct FemtoUniversePairTaskTrackV0Extended {
16641716 }
16651717 }
16661718
1719+ void processMCReco (FemtoRecoParticles const & parts, aod::FdMCParticles const & mcparts)
1720+ {
1721+ doMCReco (parts, mcparts);
1722+ }
16671723 PROCESS_SWITCH (FemtoUniversePairTaskTrackV0Extended, processMCReco, " Process MC reco data" , false );
1724+
1725+ void processMCRecoBitmask (FemtoBasicParticles const & parts, aod::FdMCParticles const & mcparts)
1726+ {
1727+ doMCReco (parts, mcparts);
1728+ }
1729+ PROCESS_SWITCH (FemtoUniversePairTaskTrackV0Extended, processMCRecoBitmask, " Process MC reco data using bitmask for PID" , false );
16681730};
16691731
16701732WorkflowSpec defineDataProcessing (ConfigContext const & cfgc)
0 commit comments