From 61c76c66accc7c5fd8b5f12f797add860194b137 Mon Sep 17 00:00:00 2001 From: stefanopolitano Date: Wed, 24 Jul 2024 10:35:04 +0200 Subject: [PATCH 1/5] PWGHF: fix generated candidate flagging in cand. creator --- PWGHF/TableProducer/candidateCreator2Prong.cxx | 8 ++++---- PWGHF/TableProducer/candidateCreator3Prong.cxx | 9 +++++---- PWGHF/TableProducer/candidateCreatorCascade.cxx | 5 +++-- PWGHF/TableProducer/candidateCreatorDstar.cxx | 10 ++++++---- .../candidateCreatorXic0Omegac0.cxx | 17 +++++++++++++---- 5 files changed, 31 insertions(+), 18 deletions(-) diff --git a/PWGHF/TableProducer/candidateCreator2Prong.cxx b/PWGHF/TableProducer/candidateCreator2Prong.cxx index 127314390ab..d13f257eeaf 100644 --- a/PWGHF/TableProducer/candidateCreator2Prong.cxx +++ b/PWGHF/TableProducer/candidateCreator2Prong.cxx @@ -752,15 +752,15 @@ struct HfCandidateCreator2ProngExpressions { // Match generated particles. for (const auto& particle : mcParticles) { + flag = 0; + origin = 0; + std::vector idxBhadMothers{}; // Reject particles from background events if (particle.fromBackgroundEvent() && rejectBackground) { + rowMcMatchGen(flag, origin, -1); continue; } - flag = 0; - origin = 0; - std::vector idxBhadMothers{}; - // Slice the collisions table to get the collision info for the current MC collision auto mcCollision = particle.mcCollision(); float centrality{-1.f}; diff --git a/PWGHF/TableProducer/candidateCreator3Prong.cxx b/PWGHF/TableProducer/candidateCreator3Prong.cxx index 21ccc12d94e..27f72807b36 100644 --- a/PWGHF/TableProducer/candidateCreator3Prong.cxx +++ b/PWGHF/TableProducer/candidateCreator3Prong.cxx @@ -638,15 +638,16 @@ struct HfCandidateCreator3ProngExpressions { // Match generated particles. for (const auto& particle : mcParticles) { - // Reject particles from background events - if (particle.fromBackgroundEvent() && rejectBackground) { - continue; - } flag = 0; origin = 0; channel = 0; arrDaughIndex.clear(); std::vector idxBhadMothers{}; + // Reject particles from background events + if (particle.fromBackgroundEvent() && rejectBackground) { + rowMcMatchGen(flag, origin, channel, -1); + continue; + } // Slice the collisions table to get the collision info for the current MC collision auto mcCollision = particle.mcCollision(); diff --git a/PWGHF/TableProducer/candidateCreatorCascade.cxx b/PWGHF/TableProducer/candidateCreatorCascade.cxx index a3fa03fe781..6464f42de30 100644 --- a/PWGHF/TableProducer/candidateCreatorCascade.cxx +++ b/PWGHF/TableProducer/candidateCreatorCascade.cxx @@ -518,12 +518,13 @@ struct HfCandidateCreatorCascadeMc { // Match generated particles. for (const auto& particle : mcParticles) { + origin = 0; + std::vector idxBhadMothers{}; // Reject particles from background events if (particle.fromBackgroundEvent() && rejectBackground) { + rowMcMatchGen(sign, origin, -1); continue; } - origin = 0; - std::vector idxBhadMothers{}; // Slice the collisions table to get the collision info for the current MC collision auto mcCollision = particle.mcCollision(); diff --git a/PWGHF/TableProducer/candidateCreatorDstar.cxx b/PWGHF/TableProducer/candidateCreatorDstar.cxx index 93f99226152..7aef2b90d5a 100644 --- a/PWGHF/TableProducer/candidateCreatorDstar.cxx +++ b/PWGHF/TableProducer/candidateCreatorDstar.cxx @@ -605,15 +605,17 @@ struct HfCandidateCreatorDstarExpressions { // Match generated particles. for (const auto& particle : mcParticles) { - // Reject particles from background events - if (particle.fromBackgroundEvent() && rejectBackground) { - continue; - } flagDstar = 0; flagD0 = 0; originDstar = 0; originD0 = 0; std::vector idxBhadMothers{}; + // Reject particles from background events + if (particle.fromBackgroundEvent() && rejectBackground) { + rowsMcMatchGenDstar(flagDstar, originDstar, -1); + rowsMcMatchGenD0(flagD0, originD0, -1); + continue; + } // Slice the collisions table to get the collision info for the current MC collision auto mcCollision = particle.mcCollision(); diff --git a/PWGHF/TableProducer/candidateCreatorXic0Omegac0.cxx b/PWGHF/TableProducer/candidateCreatorXic0Omegac0.cxx index 65b98b9ab10..f71d3f7435d 100644 --- a/PWGHF/TableProducer/candidateCreatorXic0Omegac0.cxx +++ b/PWGHF/TableProducer/candidateCreatorXic0Omegac0.cxx @@ -914,10 +914,6 @@ struct HfCandidateCreatorXic0Omegac0Mc { // Match generated particles. for (const auto& particle : mcParticles) { - // Reject particles from background events - if (particle.fromBackgroundEvent() && rejectBackground) { - continue; - } ptCharmBaryonGen = -999.; rapidityCharmBaryonGen = -999.; flag = 0; @@ -928,6 +924,19 @@ struct HfCandidateCreatorXic0Omegac0Mc { origin = RecoDecay::OriginType::None; std::vector idxBhadMothers{}; + // Reject particles from background events + if (particle.fromBackgroundEvent() && rejectBackground) { + if constexpr (decayChannel == aod::hf_cand_xic0_omegac0::DecayType::XiczeroToXiPi) { + rowMCMatchGenXicToXiPi(flag, debugGenCharmBar, debugGenCasc, debugGenLambda, ptCharmBaryonGen, rapidityCharmBaryonGen, origin, -1); + } else if constexpr (decayChannel == aod::hf_cand_xic0_omegac0::DecayType::OmegaczeroToXiPi) { + rowMCMatchGenOmegacToXiPi(flag, debugGenCharmBar, debugGenCasc, debugGenLambda, ptCharmBaryonGen, rapidityCharmBaryonGen, origin, -1); + } else if constexpr (decayChannel == aod::hf_cand_xic0_omegac0::DecayType::OmegaczeroToOmegaPi) { + rowMCMatchGenToOmegaPi(flag, debugGenCharmBar, debugGenCasc, debugGenLambda, ptCharmBaryonGen, rapidityCharmBaryonGen, origin, -1); + } else if constexpr (decayChannel == aod::hf_cand_xic0_omegac0::DecayType::OmegaczeroToOmegaK) { + rowMCMatchGenToOmegaK(flag, debugGenCharmBar, debugGenCasc, debugGenLambda, ptCharmBaryonGen, rapidityCharmBaryonGen, origin, -1); + } + continue; + } // Slice the collisions table to get the collision info for the current MC collision auto mcCollision = particle.mcCollision(); float centrality{-1.f}; From c26103ea6de723ad7dd5b148a10c8f1adecf7476 Mon Sep 17 00:00:00 2001 From: stefanopolitano Date: Wed, 24 Jul 2024 11:22:40 +0200 Subject: [PATCH 2/5] PWGHF: adding MC process function in candidate crator w/o centrality selection --- .../TableProducer/candidateCreator2Prong.cxx | 10 ++++ .../TableProducer/candidateCreator3Prong.cxx | 10 ++++ .../TableProducer/candidateCreatorCascade.cxx | 10 ++++ PWGHF/TableProducer/candidateCreatorDstar.cxx | 10 ++++ .../candidateCreatorXic0Omegac0.cxx | 48 +++++++++++++++++ PWGHF/Utils/utilsEvSelHf.h | 53 +++++++++---------- 6 files changed, 113 insertions(+), 28 deletions(-) diff --git a/PWGHF/TableProducer/candidateCreator2Prong.cxx b/PWGHF/TableProducer/candidateCreator2Prong.cxx index d13f257eeaf..983125c052b 100644 --- a/PWGHF/TableProducer/candidateCreator2Prong.cxx +++ b/PWGHF/TableProducer/candidateCreator2Prong.cxx @@ -810,6 +810,16 @@ struct HfCandidateCreator2ProngExpressions { } } + void processMc(aod::TracksWMc const& tracks, + aod::McParticles const& mcParticles, + McCollisionsFT0Cs const& collInfos, + aod::McCollisions const& mcCollisions, + BCsInfo const& BCsInfo) + { + runCreator2ProngMc(tracks, mcParticles, collInfos, mcCollisions, BCsInfo); + } + PROCESS_SWITCH(HfCandidateCreator2ProngExpressions, processMc, "Process MC - no centrality", false); + void processMcCentFT0C(aod::TracksWMc const& tracks, aod::McParticles const& mcParticles, McCollisionsFT0Cs const& collInfos, diff --git a/PWGHF/TableProducer/candidateCreator3Prong.cxx b/PWGHF/TableProducer/candidateCreator3Prong.cxx index 27f72807b36..d02184a9659 100644 --- a/PWGHF/TableProducer/candidateCreator3Prong.cxx +++ b/PWGHF/TableProducer/candidateCreator3Prong.cxx @@ -745,6 +745,16 @@ struct HfCandidateCreator3ProngExpressions { } } + void processMc(aod::TracksWMc const& tracks, + aod::McParticles const& mcParticles, + McCollisionsFT0Cs const& collInfos, + aod::McCollisions const& mcCollisions, + BCsInfo const& BCsInfo) + { + runCreator3ProngMc(tracks, mcParticles, collInfos, mcCollisions, BCsInfo); + } + PROCESS_SWITCH(HfCandidateCreator3ProngExpressions, processMc, "Process MC - no centrality", false); + void processMcCentFT0C(aod::TracksWMc const& tracks, aod::McParticles const& mcParticles, McCollisionsFT0Cs const& collInfos, diff --git a/PWGHF/TableProducer/candidateCreatorCascade.cxx b/PWGHF/TableProducer/candidateCreatorCascade.cxx index 6464f42de30..3a34d8b3b30 100644 --- a/PWGHF/TableProducer/candidateCreatorCascade.cxx +++ b/PWGHF/TableProducer/candidateCreatorCascade.cxx @@ -578,6 +578,16 @@ struct HfCandidateCreatorCascadeMc { } } + void processMc(MyTracksWMc const& tracks, + aod::McParticles const& mcParticles, + McCollisionsFT0Cs const& collInfos, + aod::McCollisions const& mcCollisions, + BCsInfo const& BCsInfo) + { + runCreatorCascMc(tracks, mcParticles, collInfos, mcCollisions, BCsInfo); + } + PROCESS_SWITCH(HfCandidateCreatorCascadeMc, processMc, "Process MC - no centrality", false); + void processMcCentFT0C(MyTracksWMc const& tracks, aod::McParticles const& mcParticles, McCollisionsFT0Cs const& collInfos, diff --git a/PWGHF/TableProducer/candidateCreatorDstar.cxx b/PWGHF/TableProducer/candidateCreatorDstar.cxx index 7aef2b90d5a..5b16ac42d18 100644 --- a/PWGHF/TableProducer/candidateCreatorDstar.cxx +++ b/PWGHF/TableProducer/candidateCreatorDstar.cxx @@ -662,6 +662,16 @@ struct HfCandidateCreatorDstarExpressions { } } + void processMc(aod::TracksWMc const& tracks, + aod::McParticles const& mcParticles, + McCollisionsFT0Cs const& collInfos, + aod::McCollisions const& mcCollisions, + BCsInfo const& BCsInfo) + { + runCreatorDstarMc(tracks, mcParticles, collInfos, mcCollisions, BCsInfo); + } + PROCESS_SWITCH(HfCandidateCreatorDstarExpressions, processMc, "Process MC - no centrality", false); + void processMcCentFT0C(aod::TracksWMc const& tracks, aod::McParticles const& mcParticles, McCollisionsFT0Cs const& collInfos, diff --git a/PWGHF/TableProducer/candidateCreatorXic0Omegac0.cxx b/PWGHF/TableProducer/candidateCreatorXic0Omegac0.cxx index f71d3f7435d..4c244f6421b 100644 --- a/PWGHF/TableProducer/candidateCreatorXic0Omegac0.cxx +++ b/PWGHF/TableProducer/candidateCreatorXic0Omegac0.cxx @@ -1116,6 +1116,18 @@ struct HfCandidateCreatorXic0Omegac0Mc { } PROCESS_SWITCH(HfCandidateCreatorXic0Omegac0Mc, processDoNoMc, "Do not run any MC process function", true); + void processMcXicToXiPi(aod::HfCandToXiPi const& candidates, + aod::TracksWMc const& tracks, + aod::McParticles const& mcParticles, + aod::McCollisions const& mcColls, + aod::McCollisionLabels const& mcLabels, + McCollisionsFT0Ms const& collInfos, + BCsInfo const& bcs) + { + runXic0Omegac0Mc(candidates, tracks, mcParticles, collInfos, mcColls, mcLabels, bcs); + } + PROCESS_SWITCH(HfCandidateCreatorXic0Omegac0Mc, processMcXicToXiPi, "Run Xic0 to xi pi MC process function - no centrality", false); + void processMcXicToXiPiFT0m(aod::HfCandToXiPi const& candidates, aod::TracksWMc const& tracks, aod::McParticles const& mcParticles, @@ -1140,6 +1152,18 @@ struct HfCandidateCreatorXic0Omegac0Mc { } PROCESS_SWITCH(HfCandidateCreatorXic0Omegac0Mc, processMcXicToXiPiFT0c, "Run Xic0 to xi pi MC process function - FT0C", false); + void processMcOmegacToXiPi(aod::HfCandToXiPi const& candidates, + aod::TracksWMc const& tracks, + aod::McParticles const& mcParticles, + aod::McCollisions const& mcColls, + aod::McCollisionLabels const& mcLabels, + McCollisionsFT0Ms const& collInfos, + BCsInfo const& bcs) + { + runXic0Omegac0Mc(candidates, tracks, mcParticles, collInfos, mcColls, mcLabels, bcs); + } + PROCESS_SWITCH(HfCandidateCreatorXic0Omegac0Mc, processMcOmegacToXiPi, "Run Omegac0 to xi pi MC process function - FT0M", false); + void processMcOmegacToXiPiFT0m(aod::HfCandToXiPi const& candidates, aod::TracksWMc const& tracks, aod::McParticles const& mcParticles, @@ -1164,6 +1188,18 @@ struct HfCandidateCreatorXic0Omegac0Mc { } PROCESS_SWITCH(HfCandidateCreatorXic0Omegac0Mc, processMcOmegacToXiPiFT0c, "Run Omegac0 to xi pi MC process function - FT0C", false); + void processMcOmegacToOmegaPi(aod::HfCandToOmegaPi const& candidates, + aod::TracksWMc const& tracks, + aod::McParticles const& mcParticles, + aod::McCollisions const& mcColls, + aod::McCollisionLabels const& mcLabels, + McCollisionsFT0Ms const& collInfos, + BCsInfo const& bcs) + { + runXic0Omegac0Mc(candidates, tracks, mcParticles, collInfos, mcColls, mcLabels, bcs); + } + PROCESS_SWITCH(HfCandidateCreatorXic0Omegac0Mc, processMcOmegacToOmegaPi, "Run Omegac0 to omega pi MC process function - no centrality", false); + void processMcOmegacToOmegaPiFT0m(aod::HfCandToOmegaPi const& candidates, aod::TracksWMc const& tracks, aod::McParticles const& mcParticles, @@ -1188,6 +1224,18 @@ struct HfCandidateCreatorXic0Omegac0Mc { } PROCESS_SWITCH(HfCandidateCreatorXic0Omegac0Mc, processMcOmegacToOmegaPiFT0c, "Run Omegac0 to omega pi MC process function - FT0C", false); + void processMcOmegacToOmegaKF(aod::HfCandToOmegaK const& candidates, + aod::TracksWMc const& tracks, + aod::McParticles const& mcParticles, + aod::McCollisions const& mcColls, + aod::McCollisionLabels const& mcLabels, + McCollisionsFT0Ms const& collInfos, + BCsInfo const& bcs) + { + runXic0Omegac0Mc(candidates, tracks, mcParticles, collInfos, mcColls, mcLabels, bcs); + } + PROCESS_SWITCH(HfCandidateCreatorXic0Omegac0Mc, processMcOmegacToOmegaKF, "Run Omegac0 to omega K MC process function - no centrality", false); + void processMcOmegacToOmegaKFT0m(aod::HfCandToOmegaK const& candidates, aod::TracksWMc const& tracks, aod::McParticles const& mcParticles, diff --git a/PWGHF/Utils/utilsEvSelHf.h b/PWGHF/Utils/utilsEvSelHf.h index 13c53158903..19c1936aebc 100644 --- a/PWGHF/Utils/utilsEvSelHf.h +++ b/PWGHF/Utils/utilsEvSelHf.h @@ -302,35 +302,32 @@ struct HfEventSelectionMc { float zPv = mcCollision.posZ(); auto bc = mcCollision.template bc_as(); - float multiplicity{0.f}; - for (const auto& collision : collSlice) { - float collCent{0.f}; - float collMult{0.f}; - if constexpr (centEstimator != o2::hf_centrality::CentralityEstimator::None) { - if constexpr (centEstimator == o2::hf_centrality::CentralityEstimator::FT0A) { - collCent = collision.centFT0A(); - } else if constexpr (centEstimator == o2::hf_centrality::CentralityEstimator::FT0C) { - collCent = collision.centFT0C(); - } else if constexpr (centEstimator == o2::hf_centrality::CentralityEstimator::FT0M) { - collCent = collision.centFT0M(); - } else if constexpr (centEstimator == o2::hf_centrality::CentralityEstimator::FV0A) { - collCent = collision.centFV0A(); - } else { - LOGP(fatal, "Unsupported centrality estimator!"); - } - collMult = collision.numContrib(); - if (collMult > multiplicity) { - centrality = collCent; - multiplicity = collMult; - } - } else { - LOGP(fatal, "Unsupported centrality estimator!"); + if constexpr (centEstimator != o2::hf_centrality::CentralityEstimator::None) { + float multiplicity{0.f}; + for (const auto& collision : collSlice) { + float collCent{0.f}; + float collMult{0.f}; + if constexpr (centEstimator == o2::hf_centrality::CentralityEstimator::FT0A) { + collCent = collision.centFT0A(); + } else if constexpr (centEstimator == o2::hf_centrality::CentralityEstimator::FT0C) { + collCent = collision.centFT0C(); + } else if constexpr (centEstimator == o2::hf_centrality::CentralityEstimator::FT0M) { + collCent = collision.centFT0M(); + } else if constexpr (centEstimator == o2::hf_centrality::CentralityEstimator::FV0A) { + collCent = collision.centFV0A(); + } else { + LOGP(fatal, "Unsupported centrality estimator!"); + } + collMult = collision.numContrib(); + if (collMult > multiplicity) { + centrality = collCent; + multiplicity = collMult; + } + } + /// centrality selection + if (centrality < centralityMin || centrality > centralityMax) { + SETBIT(rejectionMask, EventRejection::Centrality); } - } - - /// centrality selection - if (centrality < centralityMin || centrality > centralityMax) { - SETBIT(rejectionMask, EventRejection::Centrality); } /// Sel8 trigger selection if (useSel8Trigger && (!bc.selection_bit(o2::aod::evsel::kIsTriggerTVX) || !bc.selection_bit(o2::aod::evsel::kNoTimeFrameBorder) || !bc.selection_bit(o2::aod::evsel::kNoITSROFrameBorder))) { From 8f84d16599658094c82230ad14d4530c861959ca Mon Sep 17 00:00:00 2001 From: ALICE Action Bot Date: Wed, 24 Jul 2024 11:36:10 +0000 Subject: [PATCH 3/5] Please consider the following formatting changes --- .../candidateCreatorXic0Omegac0.cxx | 14 ++++---- PWGHF/Utils/utilsEvSelHf.h | 32 +++++++++---------- 2 files changed, 23 insertions(+), 23 deletions(-) diff --git a/PWGHF/TableProducer/candidateCreatorXic0Omegac0.cxx b/PWGHF/TableProducer/candidateCreatorXic0Omegac0.cxx index 4c244f6421b..f34a6af4f4b 100644 --- a/PWGHF/TableProducer/candidateCreatorXic0Omegac0.cxx +++ b/PWGHF/TableProducer/candidateCreatorXic0Omegac0.cxx @@ -1127,7 +1127,7 @@ struct HfCandidateCreatorXic0Omegac0Mc { runXic0Omegac0Mc(candidates, tracks, mcParticles, collInfos, mcColls, mcLabels, bcs); } PROCESS_SWITCH(HfCandidateCreatorXic0Omegac0Mc, processMcXicToXiPi, "Run Xic0 to xi pi MC process function - no centrality", false); - + void processMcXicToXiPiFT0m(aod::HfCandToXiPi const& candidates, aod::TracksWMc const& tracks, aod::McParticles const& mcParticles, @@ -1225,12 +1225,12 @@ struct HfCandidateCreatorXic0Omegac0Mc { PROCESS_SWITCH(HfCandidateCreatorXic0Omegac0Mc, processMcOmegacToOmegaPiFT0c, "Run Omegac0 to omega pi MC process function - FT0C", false); void processMcOmegacToOmegaKF(aod::HfCandToOmegaK const& candidates, - aod::TracksWMc const& tracks, - aod::McParticles const& mcParticles, - aod::McCollisions const& mcColls, - aod::McCollisionLabels const& mcLabels, - McCollisionsFT0Ms const& collInfos, - BCsInfo const& bcs) + aod::TracksWMc const& tracks, + aod::McParticles const& mcParticles, + aod::McCollisions const& mcColls, + aod::McCollisionLabels const& mcLabels, + McCollisionsFT0Ms const& collInfos, + BCsInfo const& bcs) { runXic0Omegac0Mc(candidates, tracks, mcParticles, collInfos, mcColls, mcLabels, bcs); } diff --git a/PWGHF/Utils/utilsEvSelHf.h b/PWGHF/Utils/utilsEvSelHf.h index 19c1936aebc..2e7bd098f09 100644 --- a/PWGHF/Utils/utilsEvSelHf.h +++ b/PWGHF/Utils/utilsEvSelHf.h @@ -307,22 +307,22 @@ struct HfEventSelectionMc { for (const auto& collision : collSlice) { float collCent{0.f}; float collMult{0.f}; - if constexpr (centEstimator == o2::hf_centrality::CentralityEstimator::FT0A) { - collCent = collision.centFT0A(); - } else if constexpr (centEstimator == o2::hf_centrality::CentralityEstimator::FT0C) { - collCent = collision.centFT0C(); - } else if constexpr (centEstimator == o2::hf_centrality::CentralityEstimator::FT0M) { - collCent = collision.centFT0M(); - } else if constexpr (centEstimator == o2::hf_centrality::CentralityEstimator::FV0A) { - collCent = collision.centFV0A(); - } else { - LOGP(fatal, "Unsupported centrality estimator!"); - } - collMult = collision.numContrib(); - if (collMult > multiplicity) { - centrality = collCent; - multiplicity = collMult; - } + if constexpr (centEstimator == o2::hf_centrality::CentralityEstimator::FT0A) { + collCent = collision.centFT0A(); + } else if constexpr (centEstimator == o2::hf_centrality::CentralityEstimator::FT0C) { + collCent = collision.centFT0C(); + } else if constexpr (centEstimator == o2::hf_centrality::CentralityEstimator::FT0M) { + collCent = collision.centFT0M(); + } else if constexpr (centEstimator == o2::hf_centrality::CentralityEstimator::FV0A) { + collCent = collision.centFV0A(); + } else { + LOGP(fatal, "Unsupported centrality estimator!"); + } + collMult = collision.numContrib(); + if (collMult > multiplicity) { + centrality = collCent; + multiplicity = collMult; + } } /// centrality selection if (centrality < centralityMin || centrality > centralityMax) { From 6906bd55d182e2428b673781e09f249f4de15e0b Mon Sep 17 00:00:00 2001 From: stefanopolitano Date: Wed, 24 Jul 2024 14:47:05 +0200 Subject: [PATCH 4/5] PWGHF: addressing comments, adding init protection and enabling default process function --- .../TableProducer/candidateCreator2Prong.cxx | 7 ++++- .../TableProducer/candidateCreator3Prong.cxx | 6 +++- .../TableProducer/candidateCreatorCascade.cxx | 7 ++++- PWGHF/TableProducer/candidateCreatorDstar.cxx | 7 ++++- .../candidateCreatorXic0Omegac0.cxx | 28 +++++++++++++++---- 5 files changed, 46 insertions(+), 9 deletions(-) diff --git a/PWGHF/TableProducer/candidateCreator2Prong.cxx b/PWGHF/TableProducer/candidateCreator2Prong.cxx index 983125c052b..2a87b8cc941 100644 --- a/PWGHF/TableProducer/candidateCreator2Prong.cxx +++ b/PWGHF/TableProducer/candidateCreator2Prong.cxx @@ -669,6 +669,11 @@ struct HfCandidateCreator2ProngExpressions { // inspect for which zPvPosMax cut was set for reconstructed void init(InitContext& initContext) { + std::array procCollisions = {doprocessMc, doprocessMcCentFT0C, doprocessMcCentFT0M}; + if (std::accumulate(procCollisions.begin(), procCollisions.end(), 0) > 1) { + LOGP(fatal, "At most one process function for collision study can be enabled at a time."); + } + const auto& workflows = initContext.services().get(); for (const DeviceSpec& device : workflows.devices) { if (device.name.compare("hf-candidate-creator-2prong") == 0) { @@ -818,7 +823,7 @@ struct HfCandidateCreator2ProngExpressions { { runCreator2ProngMc(tracks, mcParticles, collInfos, mcCollisions, BCsInfo); } - PROCESS_SWITCH(HfCandidateCreator2ProngExpressions, processMc, "Process MC - no centrality", false); + PROCESS_SWITCH(HfCandidateCreator2ProngExpressions, processMc, "Process MC - no centrality", true); void processMcCentFT0C(aod::TracksWMc const& tracks, aod::McParticles const& mcParticles, diff --git a/PWGHF/TableProducer/candidateCreator3Prong.cxx b/PWGHF/TableProducer/candidateCreator3Prong.cxx index d02184a9659..161802a950c 100644 --- a/PWGHF/TableProducer/candidateCreator3Prong.cxx +++ b/PWGHF/TableProducer/candidateCreator3Prong.cxx @@ -472,6 +472,10 @@ struct HfCandidateCreator3ProngExpressions { void init(InitContext& initContext) { + std::array procCollisions = {doprocessMc, doprocessMcCentFT0C, doprocessMcCentFT0M}; + if (std::accumulate(procCollisions.begin(), procCollisions.end(), 0) > 1) { + LOGP(fatal, "At most one process function for collision study can be enabled at a time."); + } // inspect for which particle species the candidates were created and which zPvPosMax cut was set for reconstructed const auto& workflows = initContext.services().get(); @@ -753,7 +757,7 @@ struct HfCandidateCreator3ProngExpressions { { runCreator3ProngMc(tracks, mcParticles, collInfos, mcCollisions, BCsInfo); } - PROCESS_SWITCH(HfCandidateCreator3ProngExpressions, processMc, "Process MC - no centrality", false); + PROCESS_SWITCH(HfCandidateCreator3ProngExpressions, processMc, "Process MC - no centrality", true); void processMcCentFT0C(aod::TracksWMc const& tracks, aod::McParticles const& mcParticles, diff --git a/PWGHF/TableProducer/candidateCreatorCascade.cxx b/PWGHF/TableProducer/candidateCreatorCascade.cxx index 3a34d8b3b30..9c4f1d136c1 100644 --- a/PWGHF/TableProducer/candidateCreatorCascade.cxx +++ b/PWGHF/TableProducer/candidateCreatorCascade.cxx @@ -447,6 +447,11 @@ struct HfCandidateCreatorCascadeMc { // inspect for which zPvPosMax cut was set for reconstructed void init(InitContext& initContext) { + std::array procCollisions = {doprocessMc, doprocessMcCentFT0C, doprocessMcCentFT0M}; + if (std::accumulate(procCollisions.begin(), procCollisions.end(), 0) > 1) { + LOGP(fatal, "At most one process function for collision study can be enabled at a time."); + } + const auto& workflows = initContext.services().get(); for (const DeviceSpec& device : workflows.devices) { if (device.name.compare("hf-candidate-creator-cascade") == 0) { @@ -586,7 +591,7 @@ struct HfCandidateCreatorCascadeMc { { runCreatorCascMc(tracks, mcParticles, collInfos, mcCollisions, BCsInfo); } - PROCESS_SWITCH(HfCandidateCreatorCascadeMc, processMc, "Process MC - no centrality", false); + PROCESS_SWITCH(HfCandidateCreatorCascadeMc, processMc, "Process MC - no centrality", true); void processMcCentFT0C(MyTracksWMc const& tracks, aod::McParticles const& mcParticles, diff --git a/PWGHF/TableProducer/candidateCreatorDstar.cxx b/PWGHF/TableProducer/candidateCreatorDstar.cxx index 5b16ac42d18..775860690e7 100644 --- a/PWGHF/TableProducer/candidateCreatorDstar.cxx +++ b/PWGHF/TableProducer/candidateCreatorDstar.cxx @@ -519,6 +519,11 @@ struct HfCandidateCreatorDstarExpressions { // inspect for which zPvPosMax cut was set for reconstructed void init(InitContext& initContext) { + std::array procCollisions = {doprocessMc, doprocessMcCentFT0C, doprocessMcCentFT0M}; + if (std::accumulate(procCollisions.begin(), procCollisions.end(), 0) > 1) { + LOGP(fatal, "At most one process function for collision study can be enabled at a time."); + } + const auto& workflows = initContext.services().get(); for (const DeviceSpec& device : workflows.devices) { if (device.name.compare("hf-candidate-creator-dstar") == 0) { @@ -670,7 +675,7 @@ struct HfCandidateCreatorDstarExpressions { { runCreatorDstarMc(tracks, mcParticles, collInfos, mcCollisions, BCsInfo); } - PROCESS_SWITCH(HfCandidateCreatorDstarExpressions, processMc, "Process MC - no centrality", false); + PROCESS_SWITCH(HfCandidateCreatorDstarExpressions, processMc, "Process MC - no centrality", true); void processMcCentFT0C(aod::TracksWMc const& tracks, aod::McParticles const& mcParticles, diff --git a/PWGHF/TableProducer/candidateCreatorXic0Omegac0.cxx b/PWGHF/TableProducer/candidateCreatorXic0Omegac0.cxx index f34a6af4f4b..8b308d04e27 100644 --- a/PWGHF/TableProducer/candidateCreatorXic0Omegac0.cxx +++ b/PWGHF/TableProducer/candidateCreatorXic0Omegac0.cxx @@ -676,6 +676,24 @@ struct HfCandidateCreatorXic0Omegac0Mc { // inspect for which zPvPosMax cut was set for reconstructed void init(InitContext& initContext) { + std::array procCollisionsXicToXiPi{doprocessMcXicToXiPi, doprocessMcXicToXiPiFT0m, doprocessMcXicToXiPiFT0c}; + if (std::accumulate(procCollisionsXicToXiPi.begin(), procCollisionsXicToXiPi.end(), 0) > 1) { + LOGP(fatal, "At most one process function for XicToXiPi collision study can be enabled at a time."); + } + std::array procCollisionsOmegacToXiPi{doprocessMcOmegacToXiPi, doprocessMcOmegacToXiPiFT0m, doprocessMcOmegacToXiPiFT0c}; + if (std::accumulate(procCollisionsOmegacToXiPi.begin(), procCollisionsOmegacToXiPi.end(), 0) > 1) { + LOGP(fatal, "At most one process function for OmegacToXiPi collision study can be enabled at a time."); + } + std::array procCollisionsOmegacToOmegaPi{doprocessMcOmegacToOmegaPi, doprocessMcOmegacToOmegaPiFT0m, doprocessMcOmegacToOmegaPiFT0c}; + if (std::accumulate(procCollisionsOmegacToOmegaPi.begin(), procCollisionsOmegacToOmegaPi.end(), 0) > 1) { + LOGP(fatal, "At most one process function for OmegacToOmegaPi collision study can be enabled at a time."); + } + std::array procCollisionsOmegacToOmegaK{doprocessMcOmegacToOmegaK, doprocessMcOmegacToOmegaKFT0m, doprocessMcOmegacToOmegaKFT0c}; + if (std::accumulate(procCollisionsOmegacToOmegaK.begin(), procCollisionsOmegacToOmegaK.end(), 0) > 1) { + LOGP(fatal, "At most one process function for OmegacToOmegaK collision study can be enabled at a time."); + } + + const auto& workflows = initContext.services().get(); for (const DeviceSpec& device : workflows.devices) { if (device.name.compare("hf-candidate-creator-xic0-omegac0") == 0) { @@ -1126,7 +1144,7 @@ struct HfCandidateCreatorXic0Omegac0Mc { { runXic0Omegac0Mc(candidates, tracks, mcParticles, collInfos, mcColls, mcLabels, bcs); } - PROCESS_SWITCH(HfCandidateCreatorXic0Omegac0Mc, processMcXicToXiPi, "Run Xic0 to xi pi MC process function - no centrality", false); + PROCESS_SWITCH(HfCandidateCreatorXic0Omegac0Mc, processMcXicToXiPi, "Run Xic0 to xi pi MC process function - no centrality", true); void processMcXicToXiPiFT0m(aod::HfCandToXiPi const& candidates, aod::TracksWMc const& tracks, @@ -1162,7 +1180,7 @@ struct HfCandidateCreatorXic0Omegac0Mc { { runXic0Omegac0Mc(candidates, tracks, mcParticles, collInfos, mcColls, mcLabels, bcs); } - PROCESS_SWITCH(HfCandidateCreatorXic0Omegac0Mc, processMcOmegacToXiPi, "Run Omegac0 to xi pi MC process function - FT0M", false); + PROCESS_SWITCH(HfCandidateCreatorXic0Omegac0Mc, processMcOmegacToXiPi, "Run Omegac0 to xi pi MC process function - FT0M", true); void processMcOmegacToXiPiFT0m(aod::HfCandToXiPi const& candidates, aod::TracksWMc const& tracks, @@ -1198,7 +1216,7 @@ struct HfCandidateCreatorXic0Omegac0Mc { { runXic0Omegac0Mc(candidates, tracks, mcParticles, collInfos, mcColls, mcLabels, bcs); } - PROCESS_SWITCH(HfCandidateCreatorXic0Omegac0Mc, processMcOmegacToOmegaPi, "Run Omegac0 to omega pi MC process function - no centrality", false); + PROCESS_SWITCH(HfCandidateCreatorXic0Omegac0Mc, processMcOmegacToOmegaPi, "Run Omegac0 to omega pi MC process function - no centrality", true); void processMcOmegacToOmegaPiFT0m(aod::HfCandToOmegaPi const& candidates, aod::TracksWMc const& tracks, @@ -1224,7 +1242,7 @@ struct HfCandidateCreatorXic0Omegac0Mc { } PROCESS_SWITCH(HfCandidateCreatorXic0Omegac0Mc, processMcOmegacToOmegaPiFT0c, "Run Omegac0 to omega pi MC process function - FT0C", false); - void processMcOmegacToOmegaKF(aod::HfCandToOmegaK const& candidates, + void processMcOmegacToOmegaK(aod::HfCandToOmegaK const& candidates, aod::TracksWMc const& tracks, aod::McParticles const& mcParticles, aod::McCollisions const& mcColls, @@ -1234,7 +1252,7 @@ struct HfCandidateCreatorXic0Omegac0Mc { { runXic0Omegac0Mc(candidates, tracks, mcParticles, collInfos, mcColls, mcLabels, bcs); } - PROCESS_SWITCH(HfCandidateCreatorXic0Omegac0Mc, processMcOmegacToOmegaKF, "Run Omegac0 to omega K MC process function - no centrality", false); + PROCESS_SWITCH(HfCandidateCreatorXic0Omegac0Mc, processMcOmegacToOmegaK, "Run Omegac0 to omega K MC process function - no centrality", true); void processMcOmegacToOmegaKFT0m(aod::HfCandToOmegaK const& candidates, aod::TracksWMc const& tracks, From b644867654cbee37f55028830b0ca4e62ccdef33 Mon Sep 17 00:00:00 2001 From: ALICE Action Bot Date: Wed, 24 Jul 2024 13:09:36 +0000 Subject: [PATCH 5/5] Please consider the following formatting changes --- PWGHF/TableProducer/candidateCreatorXic0Omegac0.cxx | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/PWGHF/TableProducer/candidateCreatorXic0Omegac0.cxx b/PWGHF/TableProducer/candidateCreatorXic0Omegac0.cxx index 8b308d04e27..0e80ff91110 100644 --- a/PWGHF/TableProducer/candidateCreatorXic0Omegac0.cxx +++ b/PWGHF/TableProducer/candidateCreatorXic0Omegac0.cxx @@ -693,7 +693,6 @@ struct HfCandidateCreatorXic0Omegac0Mc { LOGP(fatal, "At most one process function for OmegacToOmegaK collision study can be enabled at a time."); } - const auto& workflows = initContext.services().get(); for (const DeviceSpec& device : workflows.devices) { if (device.name.compare("hf-candidate-creator-xic0-omegac0") == 0) { @@ -1243,12 +1242,12 @@ struct HfCandidateCreatorXic0Omegac0Mc { PROCESS_SWITCH(HfCandidateCreatorXic0Omegac0Mc, processMcOmegacToOmegaPiFT0c, "Run Omegac0 to omega pi MC process function - FT0C", false); void processMcOmegacToOmegaK(aod::HfCandToOmegaK const& candidates, - aod::TracksWMc const& tracks, - aod::McParticles const& mcParticles, - aod::McCollisions const& mcColls, - aod::McCollisionLabels const& mcLabels, - McCollisionsFT0Ms const& collInfos, - BCsInfo const& bcs) + aod::TracksWMc const& tracks, + aod::McParticles const& mcParticles, + aod::McCollisions const& mcColls, + aod::McCollisionLabels const& mcLabels, + McCollisionsFT0Ms const& collInfos, + BCsInfo const& bcs) { runXic0Omegac0Mc(candidates, tracks, mcParticles, collInfos, mcColls, mcLabels, bcs); }