diff --git a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackSpherHarMultKtExtended.cxx b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackSpherHarMultKtExtended.cxx index 4c6e9091fac..6aacb4070c7 100644 --- a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackSpherHarMultKtExtended.cxx +++ b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackSpherHarMultKtExtended.cxx @@ -56,6 +56,12 @@ static const float cutsTable[nPart][nCuts]{ {4.05f, 1.f, 3.f, 3.f, 100.f}}; } // namespace +enum PairType { + PlusMinus, + PlusPlus, + MinusMinus +}; + struct femtoUniversePairTaskTrackTrackSpherHarMultKtExtended { Service pdg; @@ -495,11 +501,10 @@ struct femtoUniversePairTaskTrackTrackSpherHarMultKtExtended { /// @param magFieldTesla magnetic field of the collision /// @param multCol multiplicity of the collision template - void doSameEvent(PartitionType groupPartsOne, PartitionType groupPartsTwo, PartType parts, float magFieldTesla, int multCol, int ContType, bool fillQA) + void doSameEvent(PartitionType groupPartsOne, PartitionType groupPartsTwo, PartType parts, float magFieldTesla, int multCol, PairType contType, bool fillQA) { - /// Histogramming same event - if ((ContType == 1 || ContType == 2) && fillQA) { + if ((contType == PairType::PlusMinus || contType == PairType::PlusPlus) && fillQA) { for (const auto& part : groupPartsOne) { if (!IsParticleNSigma((int8_t)1, part.p(), trackCuts.getNsigmaTPC(part, o2::track::PID::Proton), trackCuts.getNsigmaTOF(part, o2::track::PID::Proton), trackCuts.getNsigmaTPC(part, o2::track::PID::Pion), trackCuts.getNsigmaTOF(part, o2::track::PID::Pion), trackCuts.getNsigmaTPC(part, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(part, o2::track::PID::Kaon), trackCuts.getNsigmaTPC(part, o2::track::PID::Electron))) { continue; @@ -509,7 +514,7 @@ struct femtoUniversePairTaskTrackTrackSpherHarMultKtExtended { } } - if ((ContType == 1 || ContType == 3) && fillQA) { + if ((contType == PairType::PlusMinus || contType == PairType::MinusMinus) && fillQA) { for (const auto& part : groupPartsTwo) { if (!IsParticleNSigma((int8_t)2, part.p(), trackCuts.getNsigmaTPC(part, o2::track::PID::Proton), trackCuts.getNsigmaTOF(part, o2::track::PID::Proton), trackCuts.getNsigmaTPC(part, o2::track::PID::Pion), trackCuts.getNsigmaTOF(part, o2::track::PID::Pion), trackCuts.getNsigmaTPC(part, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(part, o2::track::PID::Kaon), trackCuts.getNsigmaTPC(part, o2::track::PID::Electron))) { continue; @@ -518,7 +523,7 @@ struct femtoUniversePairTaskTrackTrackSpherHarMultKtExtended { } } - if (ContType == 1) { + if (contType == PairType::PlusMinus) { /// Now build the combinations for non-identical particle pairs for (const auto& [p1, p2] : combinations(CombinationsFullIndexPolicy(groupPartsOne, groupPartsTwo))) { @@ -618,8 +623,8 @@ struct femtoUniversePairTaskTrackTrackSpherHarMultKtExtended { double kv; float outsideref = 0.0; float qTmin = 0.0; - switch (ContType) { - case 2: { + switch (contType) { + case PairType::PlusPlus: { f3d = FemtoUniverseMath::newpairfunc(part1, mass1, part2, mass2, twotracksconfigs.confIsIden); qTmin = std::sqrt(f3d[1] * f3d[1] + f3d[2] * f3d[2]); if (!twotracksconfigs.confUseCCImCut) { @@ -652,7 +657,7 @@ struct femtoUniversePairTaskTrackTrackSpherHarMultKtExtended { break; } - case 3: { + case PairType::MinusMinus: { f3d = FemtoUniverseMath::newpairfunc(part1, mass1, part2, mass2, twotracksconfigs.confIsIden); qTmin = std::sqrt(f3d[1] * f3d[1] + f3d[2] * f3d[2]); if (!twotracksconfigs.confUseCCImCut) { @@ -707,23 +712,23 @@ struct femtoUniversePairTaskTrackTrackSpherHarMultKtExtended { if (confIsCent) { if (cfgProcessPM) { - doSameEvent(thegroupPartsOne, thegroupPartsTwo, parts, col.magField(), col.multV0M(), 1, fillQA); + doSameEvent(thegroupPartsOne, thegroupPartsTwo, parts, col.magField(), col.multV0M(), PairType::PlusMinus, fillQA); } if (cfgProcessPP) { - doSameEvent(thegroupPartsOne, thegroupPartsOne, parts, col.magField(), col.multV0M(), 2, fillQA); + doSameEvent(thegroupPartsOne, thegroupPartsOne, parts, col.magField(), col.multV0M(), PairType::PlusPlus, fillQA); } if (cfgProcessMM) { - doSameEvent(thegroupPartsTwo, thegroupPartsTwo, parts, col.magField(), col.multV0M(), 3, fillQA); + doSameEvent(thegroupPartsTwo, thegroupPartsTwo, parts, col.magField(), col.multV0M(), PairType::MinusMinus, fillQA); } } else { if (cfgProcessPM) { - doSameEvent(thegroupPartsOne, thegroupPartsTwo, parts, col.magField(), col.multNtr(), 1, fillQA); + doSameEvent(thegroupPartsOne, thegroupPartsTwo, parts, col.magField(), col.multNtr(), PairType::PlusMinus, fillQA); } if (cfgProcessPP) { - doSameEvent(thegroupPartsOne, thegroupPartsOne, parts, col.magField(), col.multNtr(), 2, fillQA); + doSameEvent(thegroupPartsOne, thegroupPartsOne, parts, col.magField(), col.multNtr(), PairType::PlusPlus, fillQA); } if (cfgProcessMM) { - doSameEvent(thegroupPartsTwo, thegroupPartsTwo, parts, col.magField(), col.multNtr(), 3, fillQA); + doSameEvent(thegroupPartsTwo, thegroupPartsTwo, parts, col.magField(), col.multNtr(), PairType::MinusMinus, fillQA); } } delete randgen; @@ -747,23 +752,23 @@ struct femtoUniversePairTaskTrackTrackSpherHarMultKtExtended { if (confIsCent) { if (cfgProcessPM) { - doSameEvent(thegroupPartsOne, thegroupPartsTwo, parts, col.magField(), col.multV0M(), 1, fillQA); + doSameEvent(thegroupPartsOne, thegroupPartsTwo, parts, col.magField(), col.multV0M(), PairType::PlusMinus, fillQA); } if (cfgProcessPP) { - doSameEvent(thegroupPartsOne, thegroupPartsOne, parts, col.magField(), col.multV0M(), 2, fillQA); + doSameEvent(thegroupPartsOne, thegroupPartsOne, parts, col.magField(), col.multV0M(), PairType::PlusPlus, fillQA); } if (cfgProcessMM) { - doSameEvent(thegroupPartsTwo, thegroupPartsTwo, parts, col.magField(), col.multV0M(), 3, fillQA); + doSameEvent(thegroupPartsTwo, thegroupPartsTwo, parts, col.magField(), col.multV0M(), PairType::MinusMinus, fillQA); } } else { if (cfgProcessPM) { - doSameEvent(thegroupPartsOne, thegroupPartsTwo, parts, col.magField(), col.multNtr(), 1, fillQA); + doSameEvent(thegroupPartsOne, thegroupPartsTwo, parts, col.magField(), col.multNtr(), PairType::PlusMinus, fillQA); } if (cfgProcessPP) { - doSameEvent(thegroupPartsOne, thegroupPartsOne, parts, col.magField(), col.multNtr(), 2, fillQA); + doSameEvent(thegroupPartsOne, thegroupPartsOne, parts, col.magField(), col.multNtr(), PairType::PlusPlus, fillQA); } if (cfgProcessMM) { - doSameEvent(thegroupPartsTwo, thegroupPartsTwo, parts, col.magField(), col.multNtr(), 3, fillQA); + doSameEvent(thegroupPartsTwo, thegroupPartsTwo, parts, col.magField(), col.multNtr(), PairType::MinusMinus, fillQA); } } delete randgen; @@ -781,7 +786,7 @@ struct femtoUniversePairTaskTrackTrackSpherHarMultKtExtended { /// @param magFieldTesla magnetic field of the collision /// @param multCol multiplicity of the collision template - void doSameEventMCTruth(PartitionType groupPartsOne, PartitionType groupPartsTwo, int multCol, int ContType, bool fillQA) + void doSameEventMCTruth(PartitionType groupPartsOne, PartitionType groupPartsTwo, int multCol, PairType contType, bool fillQA) { randgen = new TRandom2(0); @@ -846,8 +851,8 @@ struct femtoUniversePairTaskTrackTrackSpherHarMultKtExtended { part2 = p1; } - switch (ContType) { - case 2: { + switch (contType) { + case PairType::PlusPlus: { if (twotracksconfigs.confIs1D) { f3d = FemtoUniverseMath::newpairfunc(part1, mass1, part2, mass2, twotracksconfigs.confIsIden, twotracksconfigs.confIsWeight); float weight = f3d[5]; @@ -858,7 +863,7 @@ struct femtoUniversePairTaskTrackTrackSpherHarMultKtExtended { break; } - case 3: { + case PairType::MinusMinus: { if (twotracksconfigs.confIs1D) { f3d = FemtoUniverseMath::newpairfunc(part1, mass1, part2, mass2, twotracksconfigs.confIsIden, twotracksconfigs.confIsWeight); float weight = f3d[5]; @@ -890,13 +895,13 @@ struct femtoUniversePairTaskTrackTrackSpherHarMultKtExtended { auto thegroupPartsTwo = partsTwoMCTruth->sliceByCached(aod::femtouniverseparticle::fdCollisionId, col.globalIndex(), cache); bool fillQA = true; - int pairType = 0; + PairType pairType = PairType::PlusMinus; if (cfgProcessPM) { - pairType = 1; + pairType = PairType::PlusMinus; } else if (cfgProcessPP) { - pairType = 2; + pairType = PairType::PlusPlus; } else if (cfgProcessMM) { - pairType = 3; + pairType = PairType::MinusMinus; } if (confIsCent) { @@ -934,7 +939,7 @@ struct femtoUniversePairTaskTrackTrackSpherHarMultKtExtended { /// \param magFieldTesla magnetic field of the collision /// \param multCol multiplicity of the collision template - void doMixedEvent(PartitionType groupPartsOne, PartitionType groupPartsTwo, float magFieldTesla, int multCol, int ContType) + void doMixedEvent(PartitionType groupPartsOne, PartitionType groupPartsTwo, float magFieldTesla, int multCol, PairType contType) { for (const auto& [p1, p2] : combinations(CombinationsFullIndexPolicy(groupPartsOne, groupPartsTwo))) { @@ -987,13 +992,13 @@ struct femtoUniversePairTaskTrackTrackSpherHarMultKtExtended { float outsideref = 0.0; float qTmin = 0.0; - switch (ContType) { - case 1: { + switch (contType) { + case PairType::PlusMinus: { mixedEventMultCont.fillMultNumDen(part1, part2, femto_universe_sh_container::EventType::mixed, 2, multCol, kT, twotracksconfigs.confIsIden); break; } - case 2: { + case PairType::PlusPlus: { f3d = FemtoUniverseMath::newpairfunc(part1, mass1, part2, mass2, twotracksconfigs.confIsIden); qTmin = std::sqrt(f3d[1] * f3d[1] + f3d[2] * f3d[2]); if (!twotracksconfigs.confUseCCImCut) { @@ -1027,7 +1032,7 @@ struct femtoUniversePairTaskTrackTrackSpherHarMultKtExtended { break; } - case 3: { + case PairType::MinusMinus: { f3d = FemtoUniverseMath::newpairfunc(part1, mass1, part2, mass2, twotracksconfigs.confIsIden); qTmin = std::sqrt(f3d[1] * f3d[1] + f3d[2] * f3d[2]); if (!twotracksconfigs.confUseCCImCut) { @@ -1073,6 +1078,14 @@ struct femtoUniversePairTaskTrackTrackSpherHarMultKtExtended { FilteredFemtoFullParticles const&) { randgen = new TRandom2(0); + PairType pairType = PairType::PlusMinus; + if (cfgProcessPM) { + pairType = PairType::PlusMinus; + } else if (cfgProcessPP) { + pairType = PairType::PlusPlus; + } else if (cfgProcessMM) { + pairType = PairType::MinusMinus; + } for (const auto& [collision1, collision2] : soa::selfCombinations(colBinningCent, confNEventsMix, -1, cols, cols)) { @@ -1089,17 +1102,17 @@ struct femtoUniversePairTaskTrackTrackSpherHarMultKtExtended { if (cfgProcessPM) { auto groupPartsOne = partsOne->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision1.globalIndex(), cache); auto groupPartsTwo = partsTwo->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision2.globalIndex(), cache); - doMixedEvent(groupPartsOne, groupPartsTwo, magFieldTesla1, multiplicityCol, 1); + doMixedEvent(groupPartsOne, groupPartsTwo, magFieldTesla1, multiplicityCol, pairType); } if (cfgProcessPP) { auto groupPartsOne = partsOne->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision1.globalIndex(), cache); auto groupPartsTwo = partsOne->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision2.globalIndex(), cache); - doMixedEvent(groupPartsOne, groupPartsTwo, magFieldTesla1, multiplicityCol, 2); + doMixedEvent(groupPartsOne, groupPartsTwo, magFieldTesla1, multiplicityCol, pairType); } if (cfgProcessMM) { auto groupPartsOne = partsTwo->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision1.globalIndex(), cache); auto groupPartsTwo = partsTwo->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision2.globalIndex(), cache); - doMixedEvent(groupPartsOne, groupPartsTwo, magFieldTesla1, multiplicityCol, 3); + doMixedEvent(groupPartsOne, groupPartsTwo, magFieldTesla1, multiplicityCol, pairType); } } delete randgen; @@ -1113,6 +1126,14 @@ struct femtoUniversePairTaskTrackTrackSpherHarMultKtExtended { FilteredFemtoFullParticles const&) { randgen = new TRandom2(0); + PairType pairType = PairType::PlusMinus; + if (cfgProcessPM) { + pairType = PairType::PlusMinus; + } else if (cfgProcessPP) { + pairType = PairType::PlusPlus; + } else if (cfgProcessMM) { + pairType = PairType::MinusMinus; + } for (const auto& [collision1, collision2] : soa::selfCombinations(colBinningNtr, confNEventsMix, -1, cols, cols)) { @@ -1129,17 +1150,17 @@ struct femtoUniversePairTaskTrackTrackSpherHarMultKtExtended { if (cfgProcessPM) { auto groupPartsOne = partsOne->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision1.globalIndex(), cache); auto groupPartsTwo = partsTwo->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision2.globalIndex(), cache); - doMixedEvent(groupPartsOne, groupPartsTwo, magFieldTesla1, multiplicityCol, 1); + doMixedEvent(groupPartsOne, groupPartsTwo, magFieldTesla1, multiplicityCol, pairType); } if (cfgProcessPP) { auto groupPartsOne = partsOne->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision1.globalIndex(), cache); auto groupPartsTwo = partsOne->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision2.globalIndex(), cache); - doMixedEvent(groupPartsOne, groupPartsTwo, magFieldTesla1, multiplicityCol, 2); + doMixedEvent(groupPartsOne, groupPartsTwo, magFieldTesla1, multiplicityCol, pairType); } if (cfgProcessMM) { auto groupPartsOne = partsTwo->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision1.globalIndex(), cache); auto groupPartsTwo = partsTwo->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision2.globalIndex(), cache); - doMixedEvent(groupPartsOne, groupPartsTwo, magFieldTesla1, multiplicityCol, 3); + doMixedEvent(groupPartsOne, groupPartsTwo, magFieldTesla1, multiplicityCol, pairType); } } delete randgen; @@ -1155,6 +1176,14 @@ struct femtoUniversePairTaskTrackTrackSpherHarMultKtExtended { o2::aod::FdMCParticles const&) { randgen = new TRandom2(0); + PairType pairType = PairType::PlusMinus; + if (cfgProcessPM) { + pairType = PairType::PlusMinus; + } else if (cfgProcessPP) { + pairType = PairType::PlusPlus; + } else if (cfgProcessMM) { + pairType = PairType::MinusMinus; + } for (const auto& [collision1, collision2] : soa::selfCombinations(colBinningCent, confNEventsMix, -1, cols, cols)) { @@ -1173,17 +1202,17 @@ struct femtoUniversePairTaskTrackTrackSpherHarMultKtExtended { if (cfgProcessPM) { auto groupPartsOne = partsOneMC->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision1.globalIndex(), cache); auto groupPartsTwo = partsTwoMC->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision2.globalIndex(), cache); - doMixedEvent(groupPartsOne, groupPartsTwo, magFieldTesla1, multiplicityCol, 1); + doMixedEvent(groupPartsOne, groupPartsTwo, magFieldTesla1, multiplicityCol, pairType); } if (cfgProcessPP) { auto groupPartsOne = partsOneMC->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision1.globalIndex(), cache); auto groupPartsTwo = partsOneMC->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision2.globalIndex(), cache); - doMixedEvent(groupPartsOne, groupPartsTwo, magFieldTesla1, multiplicityCol, 2); + doMixedEvent(groupPartsOne, groupPartsTwo, magFieldTesla1, multiplicityCol, pairType); } if (cfgProcessMM) { auto groupPartsOne = partsTwoMC->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision1.globalIndex(), cache); auto groupPartsTwo = partsTwoMC->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision2.globalIndex(), cache); - doMixedEvent(groupPartsOne, groupPartsTwo, magFieldTesla1, multiplicityCol, 3); + doMixedEvent(groupPartsOne, groupPartsTwo, magFieldTesla1, multiplicityCol, pairType); } } delete randgen; @@ -1199,6 +1228,14 @@ struct femtoUniversePairTaskTrackTrackSpherHarMultKtExtended { o2::aod::FdMCParticles const&) { randgen = new TRandom2(0); + PairType pairType = PairType::PlusMinus; + if (cfgProcessPM) { + pairType = PairType::PlusMinus; + } else if (cfgProcessPP) { + pairType = PairType::PlusPlus; + } else if (cfgProcessMM) { + pairType = PairType::MinusMinus; + } for (const auto& [collision1, collision2] : soa::selfCombinations(colBinningNtr, confNEventsMix, -1, cols, cols)) { @@ -1217,17 +1254,17 @@ struct femtoUniversePairTaskTrackTrackSpherHarMultKtExtended { if (cfgProcessPM) { auto groupPartsOne = partsOneMC->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision1.globalIndex(), cache); auto groupPartsTwo = partsTwoMC->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision2.globalIndex(), cache); - doMixedEvent(groupPartsOne, groupPartsTwo, magFieldTesla1, multiplicityCol, 1); + doMixedEvent(groupPartsOne, groupPartsTwo, magFieldTesla1, multiplicityCol, pairType); } if (cfgProcessPP) { auto groupPartsOne = partsOneMC->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision1.globalIndex(), cache); auto groupPartsTwo = partsOneMC->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision2.globalIndex(), cache); - doMixedEvent(groupPartsOne, groupPartsTwo, magFieldTesla1, multiplicityCol, 2); + doMixedEvent(groupPartsOne, groupPartsTwo, magFieldTesla1, multiplicityCol, pairType); } if (cfgProcessMM) { auto groupPartsOne = partsTwoMC->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision1.globalIndex(), cache); auto groupPartsTwo = partsTwoMC->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision2.globalIndex(), cache); - doMixedEvent(groupPartsOne, groupPartsTwo, magFieldTesla1, multiplicityCol, 3); + doMixedEvent(groupPartsOne, groupPartsTwo, magFieldTesla1, multiplicityCol, pairType); } } delete randgen; @@ -1245,7 +1282,7 @@ struct femtoUniversePairTaskTrackTrackSpherHarMultKtExtended { /// \param magFieldTesla magnetic field of the collision /// \param multCol multiplicity of the collision template - void doMixedEventMCTruth(PartitionType groupPartsOne, PartitionType groupPartsTwo, int multCol, int ContType) + void doMixedEventMCTruth(PartitionType groupPartsOne, PartitionType groupPartsTwo, int multCol, PairType contType) { randgen = new TRandom2(0); for (const auto& [p1, p2] : combinations(CombinationsFullIndexPolicy(groupPartsOne, groupPartsTwo))) { @@ -1269,13 +1306,13 @@ struct femtoUniversePairTaskTrackTrackSpherHarMultKtExtended { part1 = p2; part2 = p1; } - switch (ContType) { - case 1: { + switch (contType) { + case PairType::PlusMinus: { mixedEventMultCont.fillMultNumDen(part1, part2, femto_universe_sh_container::EventType::mixed, 2, multCol, kT, twotracksconfigs.confIsIden); break; } - case 2: { + case PairType::PlusPlus: { if (twotracksconfigs.confIs1D) { float weight = 1.0; mixedEventCont1D_PP.setPair(part1, part2, multCol, twotracksconfigs.confUse3D, weight, twotracksconfigs.confIsIden); @@ -1285,7 +1322,7 @@ struct femtoUniversePairTaskTrackTrackSpherHarMultKtExtended { break; } - case 3: { + case PairType::MinusMinus: { if (twotracksconfigs.confIs1D) { float weight = 1.0; mixedEventCont1D_MM.setPair(part1, part2, multCol, twotracksconfigs.confUse3D, weight, twotracksconfigs.confIsIden); @@ -1308,13 +1345,13 @@ struct femtoUniversePairTaskTrackTrackSpherHarMultKtExtended { void processMixedEventNtrMCTruth(o2::aod::FdCollisions const& cols, FemtoTruthParticles const&) { - int pairType = 0; + PairType pairType = PairType::PlusMinus; if (cfgProcessPM) { - pairType = 1; + pairType = PairType::PlusMinus; } else if (cfgProcessPP) { - pairType = 2; + pairType = PairType::PlusPlus; } else if (cfgProcessMM) { - pairType = 3; + pairType = PairType::MinusMinus; } for (const auto& [collision1, collision2] : soa::selfCombinations(colBinningNtr, confNEventsMix, -1, cols, cols)) { @@ -1340,6 +1377,45 @@ struct femtoUniversePairTaskTrackTrackSpherHarMultKtExtended { } } PROCESS_SWITCH(femtoUniversePairTaskTrackTrackSpherHarMultKtExtended, processMixedEventNtrMCTruth, "Enable processing MC Truth mixed events for multiplicity", false); + + /// process function for to call doMixedEvent with Data + /// @param cols subscribe to the collisions table (Data) + /// @param parts subscribe to the femtoUniverseParticleTable + void processMixedEventCentMCTruth(o2::aod::FdCollisions const& cols, + FemtoTruthParticles const&) + { + PairType pairType = PairType::PlusMinus; + if (cfgProcessPM) { + pairType = PairType::PlusMinus; + } else if (cfgProcessPP) { + pairType = PairType::PlusPlus; + } else if (cfgProcessMM) { + pairType = PairType::MinusMinus; + } + + for (const auto& [collision1, collision2] : soa::selfCombinations(colBinningCent, confNEventsMix, -1, cols, cols)) { + + const int multiplicityCol = collision1.multV0M(); + MixQaRegistry.fill(HIST("MixingQA/hMECollisionBins"), colBinningNtr.getBin({collision1.posZ(), multiplicityCol})); + + if (cfgProcessPM) { + auto groupPartsOne = partsOneMCTruth->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision1.globalIndex(), cache); + auto groupPartsTwo = partsTwoMCTruth->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision2.globalIndex(), cache); + doMixedEventMCTruth(groupPartsOne, groupPartsTwo, multiplicityCol, pairType); + } + if (cfgProcessPP) { + auto groupPartsOne = partsOneMCTruth->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision1.globalIndex(), cache); + auto groupPartsTwo = partsOneMCTruth->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision2.globalIndex(), cache); + doMixedEventMCTruth(groupPartsOne, groupPartsTwo, multiplicityCol, pairType); + } + if (cfgProcessMM) { + auto groupPartsOne = partsTwoMCTruth->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision1.globalIndex(), cache); + auto groupPartsTwo = partsTwoMCTruth->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision2.globalIndex(), cache); + doMixedEventMCTruth(groupPartsOne, groupPartsTwo, multiplicityCol, pairType); + } + } + } + PROCESS_SWITCH(femtoUniversePairTaskTrackTrackSpherHarMultKtExtended, processMixedEventCentMCTruth, "Enable processing MC Truth mixed events for multiplicity", false); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)