From 159008e256d61169a8d9e2a670ad672db0d2a8b9 Mon Sep 17 00:00:00 2001 From: Alicja Plachta Date: Mon, 19 Aug 2024 17:58:01 +0200 Subject: [PATCH] Add option to create debug histograms, change some arguments names --- .../Tasks/femtoUniverseEfficiencyBase.cxx | 156 ++++++++++-------- 1 file changed, 89 insertions(+), 67 deletions(-) diff --git a/PWGCF/FemtoUniverse/Tasks/femtoUniverseEfficiencyBase.cxx b/PWGCF/FemtoUniverse/Tasks/femtoUniverseEfficiencyBase.cxx index 322cf2042c0..19b0a1242d7 100644 --- a/PWGCF/FemtoUniverse/Tasks/femtoUniverseEfficiencyBase.cxx +++ b/PWGCF/FemtoUniverse/Tasks/femtoUniverseEfficiencyBase.cxx @@ -35,6 +35,8 @@ struct femtoUniverseEfficiencyBase { using FemtoFullParticles = soa::Join; Preslice perCol = aod::femtouniverseparticle::fdCollisionId; + Configurable ConfIsDebug{"ConfIsDebug", true, "Enable debug histograms"}; + // Collisions Configurable ConfZVertex{"ConfZVertex", 10.f, "Event sel: Maximum z-Vertex (cm)"}; @@ -55,8 +57,8 @@ struct femtoUniverseEfficiencyBase { Configurable ConfMomPion{"ConfMomPion", 0.75, "Momentum threshold for pion identification using TOF"}; Configurable ConfNsigmaCombinedProton{"ConfNsigmaCombinedProton", 3.0, "TPC and TOF Proton Sigma (combined) for momentum > ConfMomProton"}; Configurable ConfNsigmaTPCProton{"ConfNsigmaTPCProton", 3.0, "TPC Proton Sigma for momentum < ConfMomProton"}; - Configurable ConfNsigmaCombinedPion{"ConfNsigmaCombinedPion", 3.0, "TPC and TOF Pion Sigma (combined) for momentum > 0.5"}; - Configurable ConfNsigmaTPCPion{"ConfNsigmaTPCPion", 3.0, "TPC Pion Sigma for momentum < 0.5"}; + Configurable ConfNsigmaCombinedPion{"ConfNsigmaCombinedPion", 3.0, "TPC and TOF Pion Sigma (combined) for momentum > ConfMomPion"}; + Configurable ConfNsigmaTPCPion{"ConfNsigmaTPCPion", 3.0, "TPC Pion Sigma for momentum < ConfMomPion"}; } ConfBothTracks; // Lambda cuts @@ -119,13 +121,13 @@ struct femtoUniverseEfficiencyBase { eventHisto.init(&qaRegistry); trackHistoPartOneGen.init(&qaRegistry, ConfTempFitVarpTBins, ConfTempFitVarPDGBins, 0, ConfPDGCodePartOne, false); - trackHistoPartOneRec.init(&qaRegistry, ConfTempFitVarpTBins, ConfTempFitVarDCABins, 0, ConfPDGCodePartOne, false); + trackHistoPartOneRec.init(&qaRegistry, ConfTempFitVarpTBins, ConfTempFitVarDCABins, 0, ConfPDGCodePartOne, ConfIsDebug); registryMCOrigin.add("part1/hPt", " ;#it{p}_{T} (GeV/c); Entries", {HistType::kTH1F, {{240, 0, 6}}}); registryPDG.add("part1/PDGvspT", "PDG;#it{p}_{T} (GeV/c); PDG", {HistType::kTH2F, {{500, 0, 5}, {16001, -8000.5, 8000.5}}}); if (ConfParticleTypePartOne == uint8_t(aod::femtouniverseparticle::ParticleType::kV0)) { - trackHistoV0OneRec.init(&qaRegistry, ConfTempFitVarpTBins, ConfTempFitVarCPABins, 0, ConfPDGCodePartOne, true); - trackHistoV0OneChildPosRec.init(&qaRegistry, ConfTempFitVarpTBins, ConfTempFitVarDCABins, 0, 0, true, "posChildV0_1"); - trackHistoV0OneChildNegRec.init(&qaRegistry, ConfTempFitVarpTBins, ConfTempFitVarDCABins, 0, 0, true, "negChildV0_1"); + trackHistoV0OneRec.init(&qaRegistry, ConfTempFitVarpTBins, ConfTempFitVarCPABins, 0, ConfPDGCodePartOne, ConfIsDebug); + trackHistoV0OneChildPosRec.init(&qaRegistry, ConfTempFitVarpTBins, ConfTempFitVarDCABins, 0, 0, ConfIsDebug, "posChildV0_1"); + trackHistoV0OneChildNegRec.init(&qaRegistry, ConfTempFitVarpTBins, ConfTempFitVarDCABins, 0, 0, ConfIsDebug, "negChildV0_1"); registryPDG.add("part1/dpositive/PDGvspT", "PDG;#it{p}_{T} (GeV/c); PDG", {HistType::kTH2F, {{500, 0, 5}, {16001, -8000.5, 8000.5}}}); registryPDG.add("part1/dnegative/PDGvspT", "PDG;#it{p}_{T} (GeV/c); PDG", {HistType::kTH2F, {{500, 0, 5}, {16001, -8000.5, 8000.5}}}); } @@ -133,12 +135,12 @@ struct femtoUniverseEfficiencyBase { registryPDG.add("part2/PDGvspT", "PDG;#it{p}_{T} (GeV/c); PDG", {HistType::kTH2F, {{500, 0, 5}, {16001, -8000.5, 8000.5}}}); if (!ConfIsSame) { trackHistoPartTwoGen.init(&qaRegistry, ConfTempFitVarpTBins, ConfTempFitVarPDGBins, 0, ConfPDGCodePartTwo, false); - trackHistoPartTwoRec.init(&qaRegistry, ConfTempFitVarpTBins, ConfTempFitVarDCABins, 0, ConfPDGCodePartTwo, false); + trackHistoPartTwoRec.init(&qaRegistry, ConfTempFitVarpTBins, ConfTempFitVarDCABins, 0, ConfPDGCodePartTwo, ConfIsDebug); registryMCOrigin.add("part2/hPt", " ;#it{p}_{T} (GeV/c); Entries", {HistType::kTH1F, {{240, 0, 6}}}); if (ConfParticleTypePartTwo == uint8_t(aod::femtouniverseparticle::ParticleType::kV0)) { - trackHistoV0TwoRec.init(&qaRegistry, ConfTempFitVarpTBins, ConfTempFitVarCPABins, 0, ConfPDGCodePartTwo, true); - trackHistoV0TwoChildPosRec.init(&qaRegistry, ConfTempFitVarpTBins, ConfTempFitVarDCABins, 0, 0, true, "posChildV0_2"); - trackHistoV0TwoChildNegRec.init(&qaRegistry, ConfTempFitVarpTBins, ConfTempFitVarDCABins, 0, 0, true, "negChildV0_2"); + trackHistoV0TwoRec.init(&qaRegistry, ConfTempFitVarpTBins, ConfTempFitVarCPABins, 0, ConfPDGCodePartTwo, ConfIsDebug); + trackHistoV0TwoChildPosRec.init(&qaRegistry, ConfTempFitVarpTBins, ConfTempFitVarDCABins, 0, 0, ConfIsDebug, "posChildV0_2"); + trackHistoV0TwoChildNegRec.init(&qaRegistry, ConfTempFitVarpTBins, ConfTempFitVarDCABins, 0, 0, ConfIsDebug, "negChildV0_2"); registryPDG.add("part2/dpositive/PDGvspT", "PDG;#it{p}_{T} (GeV/c); PDG", {HistType::kTH2F, {{500, 0, 5}, {16001, -8000.5, 8000.5}}}); registryPDG.add("part2/dnegative/PDGvspT", "PDG;#it{p}_{T} (GeV/c); PDG", {HistType::kTH2F, {{500, 0, 5}, {16001, -8000.5, 8000.5}}}); } @@ -258,9 +260,9 @@ struct femtoUniverseEfficiencyBase { /// @tparam PartitionType /// @tparam isMC: enables Monte Carlo truth specific histograms /// @param grouppartsOneMCGen partition for the first particle passed by the process function - /// @param grouppartsTwoGen partition for the second particle passed by the process function + /// @param grouppartsTwoMCGen partition for the second particle passed by the process function template - void doMCGen(PartitionType grouppartsOneMCGen, PartitionType grouppartsTwoGen) + void doMCGen(PartitionType grouppartsOneMCGen, PartitionType grouppartsTwoMCGen) { /// Histogramming same event for (auto& part : grouppartsOneMCGen) { @@ -271,7 +273,7 @@ struct femtoUniverseEfficiencyBase { } if (!ConfIsSame) { - for (auto& part : grouppartsTwoGen) { + for (auto& part : grouppartsTwoMCGen) { if (!ConfNoPDGPartTwo && part.pidcut() != ConfPDGCodePartTwo) { continue; } @@ -283,17 +285,18 @@ struct femtoUniverseEfficiencyBase { /// This function processes the same event and takes care of all the histogramming /// @tparam PartitionType /// @tparam isMC: enables Monte Carlo truth specific histograms - /// @param grouppartsOneMCGen partition for the first particle passed by the process function - /// @param grouppartsTwoGen partition for the second particle passed by the process function - template - void doMCRecTrackTrack(PartitionType grouppartsOneMCGen, PartitionType grouppartsTwoGen) + /// @tparam isDebug: enables debug histograms + /// @param grouppartsOneMCRec partition for the first particle passed by the process function + /// @param grouppartsTwoMCRec partition for the second particle passed by the process function + template + void doMCRecTrackTrack(PartitionType grouppartsOneMCRec, PartitionType grouppartsTwoMCRec) { /// Histogramming same event - for (auto& part : grouppartsOneMCGen) { + for (auto& part : grouppartsOneMCRec) { if (part.partType() != ConfParticleTypePartOne || part.sign() != ConfChargePart1 || !IsParticleNSigma(ConfPDGCodePartOne, 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))) { continue; } - trackHistoPartOneRec.fillQA(part); + trackHistoPartOneRec.fillQA(part); if (!part.has_fdMCParticle()) { continue; @@ -305,12 +308,12 @@ struct femtoUniverseEfficiencyBase { } if (!ConfIsSame) { - for (auto& part : grouppartsTwoGen) { + for (auto& part : grouppartsTwoMCRec) { if (part.partType() != ConfParticleTypePartTwo || part.sign() != ConfChargePart2 || !IsParticleNSigma(ConfPDGCodePartTwo, 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))) { continue; } - trackHistoPartTwoRec.fillQA(part); + trackHistoPartTwoRec.fillQA(part); if (!part.has_fdMCParticle()) { continue; @@ -326,17 +329,18 @@ struct femtoUniverseEfficiencyBase { /// This function processes the same event and takes care of all the histogramming /// @tparam PartitionType /// @tparam isMC: enables Monte Carlo truth specific histograms - /// @param grouppartsOneMCGen partition for the first particle passed by the process function - /// @param grouppartsTwoGen partition for the second particle passed by the process function - template - void doMCRecTrackPhi(PartitionType grouppartsOneMCGen, PartitionType grouppartsTwoGen) + /// @tparam isDebug: enables debug histograms + /// @param grouppartsOneMCRec partition for the first particle passed by the process function + /// @param grouppartsTwoMCRec partition for the second particle passed by the process function + template + void doMCRecTrackPhi(PartitionType grouppartsOneMCRec, PartitionType grouppartsTwoMCRec) { // part1 is track and part2 is Phi - for (auto& part : grouppartsOneMCGen) { + for (auto& part : grouppartsOneMCRec) { if (part.partType() != ConfParticleTypePartOne || part.sign() != ConfChargePart1 || !IsParticleNSigma(ConfPDGCodePartOne, 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))) { continue; } - trackHistoPartOneRec.fillQA(part); + trackHistoPartOneRec.fillQA(part); if (!part.has_fdMCParticle()) { continue; @@ -348,12 +352,12 @@ struct femtoUniverseEfficiencyBase { } if (!ConfIsSame) { - for (auto& part : grouppartsTwoGen) { + for (auto& part : grouppartsTwoMCRec) { if (part.partType() != ConfParticleTypePartTwo || part.sign() != ConfChargePart2) { continue; } - trackHistoPartTwoRec.fillQA(part); + trackHistoPartTwoRec.fillQA(part); if (!part.has_fdMCParticle()) { continue; @@ -370,14 +374,15 @@ struct femtoUniverseEfficiencyBase { /// @tparam PartitionType /// @tparam ParticlesType /// @tparam isMC: enables Monte Carlo truth specific histograms - /// @param grouppartsOneMCGen partition for the first particle passed by the process function - /// @param grouppartsTwoGen partition for the second particle passed by the process function + /// @tparam isDebug: enables debug histograms + /// @param grouppartsOneMCRec partition for the first particle passed by the process function + /// @param grouppartsTwoMCRec partition for the second particle passed by the process function /// @param parts all tracks - template - void doMCRecV0V0(PartitionType grouppartsOneMCGen, PartitionType grouppartsTwoGen, ParticlesType parts) + template + void doMCRecV0V0(PartitionType grouppartsOneMCRec, PartitionType grouppartsTwoMCRec, ParticlesType parts) { /// Histogramming same event - for (auto& part : grouppartsOneMCGen) { + for (auto& part : grouppartsOneMCRec) { if (part.partType() != ConfParticleTypePartOne || !invMLambda(part.mLambda(), part.mAntiLambda())) { continue; @@ -393,9 +398,9 @@ struct femtoUniverseEfficiencyBase { continue; } - trackHistoV0OneRec.fillQA(part); - trackHistoV0OneChildPosRec.fillQABase(posChild, HIST("posChildV0_1")); - trackHistoV0OneChildNegRec.fillQABase(negChild, HIST("negChildV0_1")); + trackHistoV0OneRec.fillQA(part); + trackHistoV0OneChildPosRec.fillQABase(posChild, HIST("posChildV0_1")); + trackHistoV0OneChildNegRec.fillQABase(negChild, HIST("negChildV0_1")); if (!posChild.has_fdMCParticle() || !negChild.has_fdMCParticle() || !part.has_fdMCParticle()) { continue; @@ -411,7 +416,7 @@ struct femtoUniverseEfficiencyBase { } if (!ConfIsSame) { - for (auto& part : grouppartsTwoGen) { + for (auto& part : grouppartsTwoMCRec) { if (part.partType() != ConfParticleTypePartTwo || !invMLambda(part.mLambda(), part.mAntiLambda())) { continue; @@ -427,9 +432,9 @@ struct femtoUniverseEfficiencyBase { continue; } - trackHistoV0TwoRec.fillQA(part); - trackHistoV0TwoChildPosRec.fillQABase(posChild, HIST("posChildV0_2")); - trackHistoV0TwoChildNegRec.fillQABase(negChild, HIST("negChildV0_2")); + trackHistoV0TwoRec.fillQA(part); + trackHistoV0TwoChildPosRec.fillQABase(posChild, HIST("posChildV0_2")); + trackHistoV0TwoChildNegRec.fillQABase(negChild, HIST("negChildV0_2")); if (!posChild.has_fdMCParticle() || !negChild.has_fdMCParticle() || !part.has_fdMCParticle()) { continue; @@ -450,20 +455,21 @@ struct femtoUniverseEfficiencyBase { /// @tparam PartitionType /// @tparam ParticlesType /// @tparam isMC: enables Monte Carlo truth specific histograms - /// @param grouppartsOneMCGen partition for the first particle passed by the process function - /// @param grouppartsTwoGen partition for the second particle passed by the process function + /// @tparam isDebug: enables debug histograms + /// @param grouppartsOneMCRec partition for the first particle passed by the process function + /// @param grouppartsTwoMCRec partition for the second particle passed by the process function /// @param parts all tracks - template - void doMCRecTrackV0(PartitionType grouppartsOneMCGen, PartitionType grouppartsTwoGen, ParticlesType const& parts) + template + void doMCRecTrackV0(PartitionType grouppartsOneMCRec, PartitionType grouppartsTwoMCRec, ParticlesType const& parts) { // part1 is track and part2 is V0 /// Histogramming same event - for (auto& part : grouppartsOneMCGen) { + for (auto& part : grouppartsOneMCRec) { if (part.partType() != ConfParticleTypePartOne || part.sign() != ConfChargePart1 || !IsParticleNSigma(ConfPDGCodePartOne, 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))) { continue; } - trackHistoPartOneRec.fillQA(part); + trackHistoPartOneRec.fillQA(part); if (!part.has_fdMCParticle()) continue; @@ -473,7 +479,7 @@ struct femtoUniverseEfficiencyBase { } if (!ConfIsSame) { - for (auto& part : grouppartsTwoGen) { + for (auto& part : grouppartsTwoMCRec) { if (part.partType() != ConfParticleTypePartTwo || !invMLambda(part.mLambda(), part.mAntiLambda())) { continue; @@ -488,9 +494,9 @@ struct femtoUniverseEfficiencyBase { continue; } - trackHistoV0TwoRec.fillQA(part); - trackHistoV0TwoChildPosRec.fillQABase(posChild, HIST("posChildV0_2")); - trackHistoV0TwoChildNegRec.fillQABase(negChild, HIST("negChildV0_2")); + trackHistoV0TwoRec.fillQA(part); + trackHistoV0TwoChildPosRec.fillQABase(posChild, HIST("posChildV0_2")); + trackHistoV0TwoChildNegRec.fillQABase(negChild, HIST("negChildV0_2")); if (!posChild.has_fdMCParticle() || !negChild.has_fdMCParticle() || !part.has_fdMCParticle()) { continue; @@ -515,12 +521,16 @@ struct femtoUniverseEfficiencyBase { fillCollision(col); // MCGen auto thegrouppartsOneMCGen = partsOneMCGen->sliceByCached(aod::femtouniverseparticle::fdCollisionId, col.globalIndex(), cache); - auto thegrouppartsTwoGen = partsTwoGen->sliceByCached(aod::femtouniverseparticle::fdCollisionId, col.globalIndex(), cache); - doMCGen(thegrouppartsOneMCGen, thegrouppartsTwoGen); + auto thegrouppartsTwoMCGen = partsTwoGen->sliceByCached(aod::femtouniverseparticle::fdCollisionId, col.globalIndex(), cache); + doMCGen(thegrouppartsOneMCGen, thegrouppartsTwoMCGen); // MCRec auto thegroupPartsTrackOneRec = partsTrackOneMCReco->sliceByCached(aod::femtouniverseparticle::fdCollisionId, col.globalIndex(), cache); - auto thegroupPartsTrackTwoReco = partsTrackTwoMCReco->sliceByCached(aod::femtouniverseparticle::fdCollisionId, col.globalIndex(), cache); - doMCRecTrackTrack(thegroupPartsTrackOneRec, thegroupPartsTrackTwoReco); + auto thegroupPartsTrackTwoRec = partsTrackTwoMCReco->sliceByCached(aod::femtouniverseparticle::fdCollisionId, col.globalIndex(), cache); + if (ConfIsDebug) { + doMCRecTrackTrack(thegroupPartsTrackOneRec, thegroupPartsTrackTwoRec); + } else { + doMCRecTrackTrack(thegroupPartsTrackOneRec, thegroupPartsTrackTwoRec); + } } PROCESS_SWITCH(femtoUniverseEfficiencyBase, processTrackTrack, "Enable processing track-track efficiency task", true); @@ -532,12 +542,16 @@ struct femtoUniverseEfficiencyBase { fillCollision(col); // MCGen auto thegrouppartsOneMCGen = partsOneMCGen->sliceByCached(aod::femtouniverseparticle::fdCollisionId, col.globalIndex(), cache); - auto thegrouppartsTwoGen = partsTwoGen->sliceByCached(aod::femtouniverseparticle::fdCollisionId, col.globalIndex(), cache); - doMCGen(thegrouppartsOneMCGen, thegrouppartsTwoGen); + auto thegrouppartsTwoMCGen = partsTwoGen->sliceByCached(aod::femtouniverseparticle::fdCollisionId, col.globalIndex(), cache); + doMCGen(thegrouppartsOneMCGen, thegrouppartsTwoMCGen); // MCRec auto thegroupPartsTrackOneRec = partsTrackOneMCReco->sliceByCached(aod::femtouniverseparticle::fdCollisionId, col.globalIndex(), cache); - auto thegroupPartsTrackTwoReco = partsTrackTwoMCReco->sliceByCached(aod::femtouniverseparticle::fdCollisionId, col.globalIndex(), cache); - doMCRecTrackPhi(thegroupPartsTrackOneRec, thegroupPartsTrackTwoReco); + auto thegroupPartsTrackTwoRec = partsTrackTwoMCReco->sliceByCached(aod::femtouniverseparticle::fdCollisionId, col.globalIndex(), cache); + if (ConfIsDebug) { + doMCRecTrackPhi(thegroupPartsTrackOneRec, thegroupPartsTrackTwoRec); + } else { + doMCRecTrackPhi(thegroupPartsTrackOneRec, thegroupPartsTrackTwoRec); + } } PROCESS_SWITCH(femtoUniverseEfficiencyBase, processTrackPhi, "Enable processing track-phi efficiency task", false); @@ -550,13 +564,17 @@ struct femtoUniverseEfficiencyBase { fillCollision(col); // MCGen auto thegrouppartsOneMCGen = partsOneMCGen->sliceByCached(aod::femtouniverseparticle::fdCollisionId, col.globalIndex(), cache); - auto thegrouppartsTwoGen = partsTwoGen->sliceByCached(aod::femtouniverseparticle::fdCollisionId, col.globalIndex(), cache); - doMCGen(thegrouppartsOneMCGen, thegrouppartsTwoGen); + auto thegrouppartsTwoMCGen = partsTwoGen->sliceByCached(aod::femtouniverseparticle::fdCollisionId, col.globalIndex(), cache); + doMCGen(thegrouppartsOneMCGen, thegrouppartsTwoMCGen); // MCRec auto thegroupPartsTrackOneRec = partsTrackOneMCReco->sliceByCached(aod::femtouniverseparticle::fdCollisionId, col.globalIndex(), cache); - auto thegroupPartsTrackTwoReco = partsTrackTwoMCReco->sliceByCached(aod::femtouniverseparticle::fdCollisionId, col.globalIndex(), cache); - doMCRecV0V0(thegroupPartsTrackOneRec, thegroupPartsTrackTwoReco, parts); + auto thegroupPartsTrackTwoRec = partsTrackTwoMCReco->sliceByCached(aod::femtouniverseparticle::fdCollisionId, col.globalIndex(), cache); + if (ConfIsDebug) { + doMCRecV0V0(thegroupPartsTrackOneRec, thegroupPartsTrackTwoRec, parts); + } else { + doMCRecV0V0(thegroupPartsTrackOneRec, thegroupPartsTrackTwoRec, parts); + } } PROCESS_SWITCH(femtoUniverseEfficiencyBase, processV0V0, "Enable processing V0-V0 efficiency task", false); @@ -569,12 +587,16 @@ struct femtoUniverseEfficiencyBase { fillCollision(col); // MCGen auto thegrouppartsOneMCGen = partsOneMCGen->sliceByCached(aod::femtouniverseparticle::fdCollisionId, col.globalIndex(), cache); - auto thegrouppartsTwoGen = partsTwoGen->sliceByCached(aod::femtouniverseparticle::fdCollisionId, col.globalIndex(), cache); - doMCGen(thegrouppartsOneMCGen, thegrouppartsTwoGen); + auto thegrouppartsTwoMCGen = partsTwoGen->sliceByCached(aod::femtouniverseparticle::fdCollisionId, col.globalIndex(), cache); + doMCGen(thegrouppartsOneMCGen, thegrouppartsTwoMCGen); // MCRec auto thegroupPartsTrackOneRec = partsTrackOneMCReco->sliceByCached(aod::femtouniverseparticle::fdCollisionId, col.globalIndex(), cache); - auto thegroupPartsTrackTwoReco = partsTrackTwoMCReco->sliceByCached(aod::femtouniverseparticle::fdCollisionId, col.globalIndex(), cache); - doMCRecTrackV0(thegroupPartsTrackOneRec, thegroupPartsTrackTwoReco, parts); + auto thegroupPartsTrackTwoRec = partsTrackTwoMCReco->sliceByCached(aod::femtouniverseparticle::fdCollisionId, col.globalIndex(), cache); + if (ConfIsDebug) { + doMCRecTrackV0(thegroupPartsTrackOneRec, thegroupPartsTrackTwoRec, parts); + } else { + doMCRecTrackV0(thegroupPartsTrackOneRec, thegroupPartsTrackTwoRec, parts); + } } PROCESS_SWITCH(femtoUniverseEfficiencyBase, processTrackV0, "Enable processing track-V0 efficiency task", false); };