From 476c919f1db8c86a5b2c4050a0c6dbf770959531 Mon Sep 17 00:00:00 2001 From: nzardosh Date: Thu, 16 Jan 2025 16:28:09 +0100 Subject: [PATCH 1/7] Adding the possibility to run MCGen only for HF derived data --- PWGHF/Core/HfMcGenHelper.h | 232 ++++++++++++++++++ PWGHF/TableProducer/CMakeLists.txt | 6 + .../TableProducer/candidateCreator2Prong.cxx | 43 +--- .../TableProducer/candidateCreator3Prong.cxx | 92 +------ PWGHF/TableProducer/candidateCreatorB0.cxx | 16 +- PWGHF/TableProducer/candidateCreatorBplus.cxx | 27 +- .../candidateCreatorMcGenOnly.cxx | 82 +++++++ .../derivedDataCreatorBplusToD0Pi.cxx | 11 + .../derivedDataCreatorD0ToKPi.cxx | 11 + .../derivedDataCreatorLcToPKPi.cxx | 11 + 10 files changed, 361 insertions(+), 170 deletions(-) create mode 100644 PWGHF/Core/HfMcGenHelper.h create mode 100644 PWGHF/TableProducer/candidateCreatorMcGenOnly.cxx diff --git a/PWGHF/Core/HfMcGenHelper.h b/PWGHF/Core/HfMcGenHelper.h new file mode 100644 index 00000000000..fa258407737 --- /dev/null +++ b/PWGHF/Core/HfMcGenHelper.h @@ -0,0 +1,232 @@ +// Copyright 2019-2020 CERN and copyright holders of ALICE O2. +// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. +// All rights not expressly granted are reserved. +// +// This software is distributed under the terms of the GNU General Public +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". +// +// In applying this license CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. + +/// \file HfMcGenHelper.h +/// \brief helper functions for HF McGen workflows +/// +/// \author Nima Zardoshti, nima.zardoshti@cern.ch, CERN + +#ifndef PWGHF_CORE_HFMCGENHELPER_H_ +#define PWGHF_CORE_HFMCGENHELPER_H_ + +#include +#include "CommonConstants/PhysicsConstants.h" +#include "Common/Core/RecoDecay.h" +#include "PWGHF/DataModel/CandidateReconstructionTables.h" + +using namespace o2::constants::physics; + +namespace hf_mcgen_helper +{ + +template +void fill2ProngMcMatchGen(T const& mcParticles, U& rowMcMatchGen, bool rejectBackground) +{ + + // Match generated particles. + for (const auto& particle : mcParticles) { + int8_t flag = 0; + int8_t origin = 0; + int8_t sign = 0; + std::vector idxBhadMothers{}; + // Reject particles from background events + if (particle.fromBackgroundEvent() && rejectBackground) { + rowMcMatchGen(flag, origin, -1); + continue; + } + + // D0(bar) → π± K∓ + if (RecoDecay::isMatchedMCGen(mcParticles, particle, Pdg::kD0, std::array{+kPiPlus, -kKPlus}, true, &sign)) { + flag = sign * (1 << o2::aod::hf_cand_2prong::DecayType::D0ToPiK); + } + + // J/ψ → e+ e− + if (flag == 0) { + if (RecoDecay::isMatchedMCGen(mcParticles, particle, Pdg::kJPsi, std::array{+kElectron, -kElectron}, true)) { + flag = 1 << o2::aod::hf_cand_2prong::DecayType::JpsiToEE; + } + } + + // J/ψ → μ+ μ− + if (flag == 0) { + if (RecoDecay::isMatchedMCGen(mcParticles, particle, Pdg::kJPsi, std::array{+kMuonPlus, -kMuonPlus}, true)) { + flag = 1 << o2::aod::hf_cand_2prong::DecayType::JpsiToMuMu; + } + } + + // Check whether the particle is non-prompt (from a b quark). + if (flag != 0) { + origin = RecoDecay::getCharmHadronOrigin(mcParticles, particle, false, &idxBhadMothers); + } + if (origin == RecoDecay::OriginType::NonPrompt) { + rowMcMatchGen(flag, origin, idxBhadMothers[0]); + } else { + rowMcMatchGen(flag, origin, -1); + } + } +} + +template +void fill3ProngMcMatchGen(T const& mcParticles, U& rowMcMatchGen, bool rejectBackground, bool createDplus, bool createDs, bool createLc, bool createXic) +{ + + // Match generated particles. + for (const auto& particle : mcParticles) { + int8_t flag = 0; + int8_t origin = 0; + int8_t channel = 0; + int8_t sign = 0; + std::vector arrDaughIndex; + std::vector idxBhadMothers{}; + std::array arrPDGDaugh; + std::array arrPDGResonant1 = {kProton, 313}; // Λc± → p± K* + std::array arrPDGResonant2 = {2224, kKPlus}; // Λc± → Δ(1232)±± K∓ + std::array arrPDGResonant3 = {102134, kPiPlus}; // Λc± → Λ(1520) π± + std::array arrPDGResonantDPhiPi = {333, kPiPlus}; // Ds± → Phi π± and D± → Phi π± + std::array arrPDGResonantDKstarK = {313, kKPlus}; // Ds± → K*(892)0bar K± and D± → K*(892)0bar K± + // Reject particles from background events + if (particle.fromBackgroundEvent() && rejectBackground) { + rowMcMatchGen(flag, origin, channel, -1); + continue; + } + + // D± → π± K∓ π± + if (createDplus) { + if (RecoDecay::isMatchedMCGen(mcParticles, particle, Pdg::kDPlus, std::array{+kPiPlus, -kKPlus, +kPiPlus}, true, &sign, 2)) { + flag = sign * (1 << o2::aod::hf_cand_3prong::DecayType::DplusToPiKPi); + } + } + + // Ds± → K± K∓ π± and D± → K± K∓ π± + if (flag == 0 && createDs) { + bool isDplus = false; + if (RecoDecay::isMatchedMCGen(mcParticles, particle, Pdg::kDS, std::array{+kKPlus, -kKPlus, +kPiPlus}, true, &sign, 2)) { + // DecayType::DsToKKPi is used to flag both Ds± → K± K∓ π± and D± → K± K∓ π± + // TODO: move to different and explicit flags + flag = sign * (1 << o2::aod::hf_cand_3prong::DecayType::DsToKKPi); + } else if (RecoDecay::isMatchedMCGen(mcParticles, particle, Pdg::kDPlus, std::array{+kKPlus, -kKPlus, +kPiPlus}, true, &sign, 2)) { + // DecayType::DsToKKPi is used to flag both Ds± → K± K∓ π± and D± → K± K∓ π± + // TODO: move to different and explicit flags + flag = sign * (1 << o2::aod::hf_cand_3prong::DecayType::DsToKKPi); + isDplus = true; + } + if (flag != 0) { + RecoDecay::getDaughters(particle, &arrDaughIndex, std::array{0}, 1); + if (arrDaughIndex.size() == 2) { + for (auto jProng = 0u; jProng < arrDaughIndex.size(); ++jProng) { + auto daughJ = mcParticles.rawIteratorAt(arrDaughIndex[jProng]); + arrPDGDaugh[jProng] = std::abs(daughJ.pdgCode()); + } + if ((arrPDGDaugh[0] == arrPDGResonantDPhiPi[0] && arrPDGDaugh[1] == arrPDGResonantDPhiPi[1]) || (arrPDGDaugh[0] == arrPDGResonantDPhiPi[1] && arrPDGDaugh[1] == arrPDGResonantDPhiPi[0])) { + channel = isDplus ? o2::aod::hf_cand_3prong::DecayChannelDToKKPi::DplusToPhiPi : o2::aod::hf_cand_3prong::DecayChannelDToKKPi::DsToPhiPi; + } else if ((arrPDGDaugh[0] == arrPDGResonantDKstarK[0] && arrPDGDaugh[1] == arrPDGResonantDKstarK[1]) || (arrPDGDaugh[0] == arrPDGResonantDKstarK[1] && arrPDGDaugh[1] == arrPDGResonantDKstarK[0])) { + channel = isDplus ? o2::aod::hf_cand_3prong::DecayChannelDToKKPi::DplusToK0starK : o2::aod::hf_cand_3prong::DecayChannelDToKKPi::DsToK0starK; + } + } + } + } + + // Λc± → p± K∓ π± + if (flag == 0 && createLc) { + if (RecoDecay::isMatchedMCGen(mcParticles, particle, Pdg::kLambdaCPlus, std::array{+kProton, -kKPlus, +kPiPlus}, true, &sign, 2)) { + flag = sign * (1 << o2::aod::hf_cand_3prong::DecayType::LcToPKPi); + + // Flagging the different Λc± → p± K∓ π± decay channels + RecoDecay::getDaughters(particle, &arrDaughIndex, std::array{0}, 1); + if (arrDaughIndex.size() == 2) { + for (auto jProng = 0u; jProng < arrDaughIndex.size(); ++jProng) { + auto daughJ = mcParticles.rawIteratorAt(arrDaughIndex[jProng]); + arrPDGDaugh[jProng] = std::abs(daughJ.pdgCode()); + } + if ((arrPDGDaugh[0] == arrPDGResonant1[0] && arrPDGDaugh[1] == arrPDGResonant1[1]) || (arrPDGDaugh[0] == arrPDGResonant1[1] && arrPDGDaugh[1] == arrPDGResonant1[0])) { + channel = 1; + } else if ((arrPDGDaugh[0] == arrPDGResonant2[0] && arrPDGDaugh[1] == arrPDGResonant2[1]) || (arrPDGDaugh[0] == arrPDGResonant2[1] && arrPDGDaugh[1] == arrPDGResonant2[0])) { + channel = 2; + } else if ((arrPDGDaugh[0] == arrPDGResonant3[0] && arrPDGDaugh[1] == arrPDGResonant3[1]) || (arrPDGDaugh[0] == arrPDGResonant3[1] && arrPDGDaugh[1] == arrPDGResonant3[0])) { + channel = 3; + } + } + } + } + + // Ξc± → p± K∓ π± + if (flag == 0 && createXic) { + if (RecoDecay::isMatchedMCGen(mcParticles, particle, Pdg::kXiCPlus, std::array{+kProton, -kKPlus, +kPiPlus}, true, &sign, 2)) { + flag = sign * (1 << o2::aod::hf_cand_3prong::DecayType::XicToPKPi); + } + } + + // Check whether the particle is non-prompt (from a b quark). + if (flag != 0) { + origin = RecoDecay::getCharmHadronOrigin(mcParticles, particle, false, &idxBhadMothers); + } + if (origin == RecoDecay::OriginType::NonPrompt) { + rowMcMatchGen(flag, origin, channel, idxBhadMothers[0]); + } else { + rowMcMatchGen(flag, origin, channel, -1); + } + } +} + +template +void fillBplusMcMatchGen(T const& mcParticles, U& rowMcMatchGen) +{ + + // Match generated particles. + for (const auto& particle : mcParticles) { + int8_t flag = 0; + int8_t origin = 0; + int8_t signB = 0; + int8_t signD0 = 0; + int indexGenD0 = -1; + + // B± → D0bar(D0) π± → (K± π∓) π± + std::vector arrayDaughterB; + if (RecoDecay::isMatchedMCGen(mcParticles, particle, Pdg::kBPlus, std::array{-Pdg::kD0, +kPiPlus}, true, &signB, 1, &arrayDaughterB)) { + // D0(bar) → π± K∓ + for (auto iD : arrayDaughterB) { + auto candDaughterMC = mcParticles.rawIteratorAt(iD); + if (std::abs(candDaughterMC.pdgCode()) == Pdg::kD0) { + indexGenD0 = RecoDecay::isMatchedMCGen(mcParticles, candDaughterMC, Pdg::kD0, std::array{-kKPlus, +kPiPlus}, true, &signD0, 1); + } + } + if (indexGenD0 > -1) { + flag = signB * (1 << o2::aod::hf_cand_bplus::DecayType::BplusToD0Pi); + } + } + rowMcMatchGen(flag, origin); + } // B candidate +} + +template +void fillB0McMatchGen(T const& mcParticles, U& rowMcMatchGen) +{ + + // Match generated particles. + for (const auto& particle : mcParticles) { + int8_t flag = 0; + int8_t origin = 0; + int8_t sign = 0; + // B0 → D- π+ + if (RecoDecay::isMatchedMCGen(mcParticles, particle, Pdg::kB0, std::array{-static_cast(Pdg::kDPlus), +kPiPlus}, true)) { + // D- → π- K+ π- + auto candDMC = mcParticles.rawIteratorAt(particle.daughtersIds().front()); + if (RecoDecay::isMatchedMCGen(mcParticles, candDMC, -static_cast(Pdg::kDPlus), std::array{-kPiPlus, +kKPlus, -kPiPlus}, true, &sign)) { + flag = sign * BIT(o2::aod::hf_cand_b0::DecayType::B0ToDPi); + } + } + rowMcMatchGen(flag, origin); + } // gen +} + +} // namespace hf_mcgen_helper + +#endif // PWGHF_CORE_HFMCGENHELPER_H_ diff --git a/PWGHF/TableProducer/CMakeLists.txt b/PWGHF/TableProducer/CMakeLists.txt index b039c0b6fb7..2e9a0c11f52 100644 --- a/PWGHF/TableProducer/CMakeLists.txt +++ b/PWGHF/TableProducer/CMakeLists.txt @@ -100,6 +100,12 @@ o2physics_add_dpl_workflow(candidate-creator-xicc PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2::DCAFitter COMPONENT_NAME Analysis) + +o2physics_add_dpl_workflow(candidate-creator-mcgen-only + SOURCES candidateCreatorMcGenOnly.cxx + PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore + COMPONENT_NAME Analysis) + # Candidate selectors o2physics_add_dpl_workflow(candidate-selector-b0-to-d-pi diff --git a/PWGHF/TableProducer/candidateCreator2Prong.cxx b/PWGHF/TableProducer/candidateCreator2Prong.cxx index 7f148c31b2b..4c2b98cfb75 100644 --- a/PWGHF/TableProducer/candidateCreator2Prong.cxx +++ b/PWGHF/TableProducer/candidateCreator2Prong.cxx @@ -44,6 +44,7 @@ #include "Tools/KFparticle/KFUtilities.h" #include "PWGHF/Core/CentralityEstimation.h" +#include "PWGHF/Core/HfMcGenHelper.h" #include "PWGHF/DataModel/CandidateReconstructionTables.h" #include "PWGHF/Utils/utilsBfieldCCDB.h" #include "PWGHF/Utils/utilsEvSelHf.h" @@ -839,47 +840,7 @@ struct HfCandidateCreator2ProngExpressions { } continue; } - - // Match generated particles. - for (const auto& particle : mcParticlesPerMcColl) { - flag = 0; - origin = 0; - std::vector idxBhadMothers{}; - // Reject particles from background events - if (particle.fromBackgroundEvent() && rejectBackground) { - rowMcMatchGen(flag, origin, -1); - continue; - } - - // D0(bar) → π± K∓ - if (RecoDecay::isMatchedMCGen(mcParticles, particle, Pdg::kD0, std::array{+kPiPlus, -kKPlus}, true, &sign)) { - flag = sign * (1 << DecayType::D0ToPiK); - } - - // J/ψ → e+ e− - if (flag == 0) { - if (RecoDecay::isMatchedMCGen(mcParticles, particle, Pdg::kJPsi, std::array{+kElectron, -kElectron}, true)) { - flag = 1 << DecayType::JpsiToEE; - } - } - - // J/ψ → μ+ μ− - if (flag == 0) { - if (RecoDecay::isMatchedMCGen(mcParticles, particle, Pdg::kJPsi, std::array{+kMuonPlus, -kMuonPlus}, true)) { - flag = 1 << DecayType::JpsiToMuMu; - } - } - - // Check whether the particle is non-prompt (from a b quark). - if (flag != 0) { - origin = RecoDecay::getCharmHadronOrigin(mcParticles, particle, false, &idxBhadMothers); - } - if (origin == RecoDecay::OriginType::NonPrompt) { - rowMcMatchGen(flag, origin, idxBhadMothers[0]); - } else { - rowMcMatchGen(flag, origin, -1); - } - } + hf_mcgen_helper::fill2ProngMcMatchGen(mcParticlesPerMcColl, rowMcMatchGen, rejectBackground); } } diff --git a/PWGHF/TableProducer/candidateCreator3Prong.cxx b/PWGHF/TableProducer/candidateCreator3Prong.cxx index 8a4ae2396de..f7365529137 100644 --- a/PWGHF/TableProducer/candidateCreator3Prong.cxx +++ b/PWGHF/TableProducer/candidateCreator3Prong.cxx @@ -44,6 +44,7 @@ #include "Tools/KFparticle/KFUtilities.h" #include "PWGHF/Core/CentralityEstimation.h" +#include "PWGHF/Core/HfMcGenHelper.h" #include "PWGHF/DataModel/CandidateReconstructionTables.h" #include "PWGHF/Utils/utilsBfieldCCDB.h" #include "PWGHF/Utils/utilsEvSelHf.h" @@ -1048,96 +1049,7 @@ struct HfCandidateCreator3ProngExpressions { } continue; } - - // Match generated particles. - for (const auto& particle : mcParticlesPerMcColl) { - 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; - } - - // D± → π± K∓ π± - if (createDplus) { - if (RecoDecay::isMatchedMCGen(mcParticles, particle, Pdg::kDPlus, std::array{+kPiPlus, -kKPlus, +kPiPlus}, true, &sign, 2)) { - flag = sign * (1 << DecayType::DplusToPiKPi); - } - } - - // Ds± → K± K∓ π± and D± → K± K∓ π± - if (flag == 0 && createDs) { - bool isDplus = false; - if (RecoDecay::isMatchedMCGen(mcParticles, particle, Pdg::kDS, std::array{+kKPlus, -kKPlus, +kPiPlus}, true, &sign, 2)) { - // DecayType::DsToKKPi is used to flag both Ds± → K± K∓ π± and D± → K± K∓ π± - // TODO: move to different and explicit flags - flag = sign * (1 << DecayType::DsToKKPi); - } else if (RecoDecay::isMatchedMCGen(mcParticles, particle, Pdg::kDPlus, std::array{+kKPlus, -kKPlus, +kPiPlus}, true, &sign, 2)) { - // DecayType::DsToKKPi is used to flag both Ds± → K± K∓ π± and D± → K± K∓ π± - // TODO: move to different and explicit flags - flag = sign * (1 << DecayType::DsToKKPi); - isDplus = true; - } - if (flag != 0) { - RecoDecay::getDaughters(particle, &arrDaughIndex, std::array{0}, 1); - if (arrDaughIndex.size() == 2) { - for (auto jProng = 0u; jProng < arrDaughIndex.size(); ++jProng) { - auto daughJ = mcParticles.rawIteratorAt(arrDaughIndex[jProng]); - arrPDGDaugh[jProng] = std::abs(daughJ.pdgCode()); - } - if ((arrPDGDaugh[0] == arrPDGResonantDPhiPi[0] && arrPDGDaugh[1] == arrPDGResonantDPhiPi[1]) || (arrPDGDaugh[0] == arrPDGResonantDPhiPi[1] && arrPDGDaugh[1] == arrPDGResonantDPhiPi[0])) { - channel = isDplus ? DecayChannelDToKKPi::DplusToPhiPi : DecayChannelDToKKPi::DsToPhiPi; - } else if ((arrPDGDaugh[0] == arrPDGResonantDKstarK[0] && arrPDGDaugh[1] == arrPDGResonantDKstarK[1]) || (arrPDGDaugh[0] == arrPDGResonantDKstarK[1] && arrPDGDaugh[1] == arrPDGResonantDKstarK[0])) { - channel = isDplus ? DecayChannelDToKKPi::DplusToK0starK : DecayChannelDToKKPi::DsToK0starK; - } - } - } - } - - // Λc± → p± K∓ π± - if (flag == 0 && createLc) { - if (RecoDecay::isMatchedMCGen(mcParticles, particle, Pdg::kLambdaCPlus, std::array{+kProton, -kKPlus, +kPiPlus}, true, &sign, 2)) { - flag = sign * (1 << DecayType::LcToPKPi); - - // Flagging the different Λc± → p± K∓ π± decay channels - RecoDecay::getDaughters(particle, &arrDaughIndex, std::array{0}, 1); - if (arrDaughIndex.size() == 2) { - for (auto jProng = 0u; jProng < arrDaughIndex.size(); ++jProng) { - auto daughJ = mcParticles.rawIteratorAt(arrDaughIndex[jProng]); - arrPDGDaugh[jProng] = std::abs(daughJ.pdgCode()); - } - if ((arrPDGDaugh[0] == arrPDGResonant1[0] && arrPDGDaugh[1] == arrPDGResonant1[1]) || (arrPDGDaugh[0] == arrPDGResonant1[1] && arrPDGDaugh[1] == arrPDGResonant1[0])) { - channel = 1; - } else if ((arrPDGDaugh[0] == arrPDGResonant2[0] && arrPDGDaugh[1] == arrPDGResonant2[1]) || (arrPDGDaugh[0] == arrPDGResonant2[1] && arrPDGDaugh[1] == arrPDGResonant2[0])) { - channel = 2; - } else if ((arrPDGDaugh[0] == arrPDGResonant3[0] && arrPDGDaugh[1] == arrPDGResonant3[1]) || (arrPDGDaugh[0] == arrPDGResonant3[1] && arrPDGDaugh[1] == arrPDGResonant3[0])) { - channel = 3; - } - } - } - } - - // Ξc± → p± K∓ π± - if (flag == 0 && createXic) { - if (RecoDecay::isMatchedMCGen(mcParticles, particle, Pdg::kXiCPlus, std::array{+kProton, -kKPlus, +kPiPlus}, true, &sign, 2)) { - flag = sign * (1 << DecayType::XicToPKPi); - } - } - - // Check whether the particle is non-prompt (from a b quark). - if (flag != 0) { - origin = RecoDecay::getCharmHadronOrigin(mcParticles, particle, false, &idxBhadMothers); - } - if (origin == RecoDecay::OriginType::NonPrompt) { - rowMcMatchGen(flag, origin, channel, idxBhadMothers[0]); - } else { - rowMcMatchGen(flag, origin, channel, -1); - } - } + hf_mcgen_helper::fill3ProngMcMatchGen(mcParticlesPerMcColl, rowMcMatchGen, rejectBackground, createDplus, createDs, createLc, createXic); } } diff --git a/PWGHF/TableProducer/candidateCreatorB0.cxx b/PWGHF/TableProducer/candidateCreatorB0.cxx index 559734c7b12..9dc80a6cff2 100644 --- a/PWGHF/TableProducer/candidateCreatorB0.cxx +++ b/PWGHF/TableProducer/candidateCreatorB0.cxx @@ -26,6 +26,7 @@ #include "Common/DataModel/CollisionAssociationTables.h" #include "PWGHF/Core/HfHelper.h" +#include "PWGHF/Core/HfMcGenHelper.h" #include "PWGHF/DataModel/CandidateReconstructionTables.h" #include "PWGHF/DataModel/CandidateSelectionTables.h" #include "PWGHF/Utils/utilsBfieldCCDB.h" @@ -448,20 +449,7 @@ struct HfCandidateCreatorB0Expressions { rowMcMatchRec(flag, origin, debug); } // rec - // Match generated particles. - for (const auto& particle : mcParticles) { - flag = 0; - origin = 0; - // B0 → D- π+ - if (RecoDecay::isMatchedMCGen(mcParticles, particle, Pdg::kB0, std::array{-static_cast(Pdg::kDPlus), +kPiPlus}, true)) { - // D- → π- K+ π- - auto candDMC = mcParticles.rawIteratorAt(particle.daughtersIds().front()); - if (RecoDecay::isMatchedMCGen(mcParticles, candDMC, -static_cast(Pdg::kDPlus), std::array{-kPiPlus, +kKPlus, -kPiPlus}, true, &sign)) { - flag = sign * BIT(hf_cand_b0::DecayType::B0ToDPi); - } - } - rowMcMatchGen(flag, origin); - } // gen + hf_mcgen_helper::fillB0McMatchGen(mcParticles, rowMcMatchGen); // gen } // processMc PROCESS_SWITCH(HfCandidateCreatorB0Expressions, processMc, "Process MC", false); }; // struct diff --git a/PWGHF/TableProducer/candidateCreatorBplus.cxx b/PWGHF/TableProducer/candidateCreatorBplus.cxx index 0d4753c6c98..939d9786c5b 100644 --- a/PWGHF/TableProducer/candidateCreatorBplus.cxx +++ b/PWGHF/TableProducer/candidateCreatorBplus.cxx @@ -33,6 +33,7 @@ #include "Common/DataModel/CollisionAssociationTables.h" #include "PWGHF/Core/HfHelper.h" +#include "PWGHF/Core/HfMcGenHelper.h" #include "PWGHF/DataModel/CandidateReconstructionTables.h" #include "PWGHF/DataModel/CandidateSelectionTables.h" #include "PWGHF/Utils/utilsBfieldCCDB.h" @@ -386,31 +387,7 @@ struct HfCandidateCreatorBplusExpressions { } rowMcMatchRec(flag, origin); } - - // Match generated particles. - for (const auto& particle : mcParticles) { - flag = 0; - origin = 0; - signB = 0; - signD0 = 0; - int indexGenD0 = -1; - - // B± → D0bar(D0) π± → (K± π∓) π± - std::vector arrayDaughterB; - if (RecoDecay::isMatchedMCGen(mcParticles, particle, Pdg::kBPlus, std::array{-kD0pdg, +kPiPlus}, true, &signB, 1, &arrayDaughterB)) { - // D0(bar) → π± K∓ - for (auto iD : arrayDaughterB) { - auto candDaughterMC = mcParticles.rawIteratorAt(iD); - if (std::abs(candDaughterMC.pdgCode()) == kD0pdg) { - indexGenD0 = RecoDecay::isMatchedMCGen(mcParticles, candDaughterMC, Pdg::kD0, std::array{-kKPlus, +kPiPlus}, true, &signD0, 1); - } - } - if (indexGenD0 > -1) { - flag = signB * (1 << hf_cand_bplus::DecayType::BplusToD0Pi); - } - } - rowMcMatchGen(flag, origin); - } // B candidate + hf_mcgen_helper::fillBplusMcMatchGen(mcParticles, rowMcMatchGen); // gen } // process PROCESS_SWITCH(HfCandidateCreatorBplusExpressions, processMc, "Process MC", false); }; // struct diff --git a/PWGHF/TableProducer/candidateCreatorMcGenOnly.cxx b/PWGHF/TableProducer/candidateCreatorMcGenOnly.cxx new file mode 100644 index 00000000000..114e8928610 --- /dev/null +++ b/PWGHF/TableProducer/candidateCreatorMcGenOnly.cxx @@ -0,0 +1,82 @@ +// Copyright 2019-2020 CERN and copyright holders of ALICE O2. +// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. +// All rights not expressly granted are reserved. +// +// This software is distributed under the terms of the GNU General Public +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". +// +// In applying this license CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. + +/// \file candidateCreatorMcGenOnly.cxx +/// \brief McGen only selection of heavy-flavour particles +/// +/// \author Nima Zardoshti, nima.zardoshti@cern.ch, CERN + +#include +#include +#include + +#include + +#include "CommonConstants/PhysicsConstants.h" +#include "Framework/AnalysisTask.h" +#include "Framework/HistogramRegistry.h" +#include "Framework/runDataProcessing.h" +#include "Framework/RunningWorkflowInfo.h" + +#include "PWGHF/Core/HfMcGenHelper.h" +#include "PWGHF/DataModel/CandidateReconstructionTables.h" + +using namespace o2; +using namespace o2::analysis; +using namespace o2::framework; + +/// Reconstruction of heavy-flavour 2-prong decay candidates +struct HfCandidateCreatorMcGenOnly { + + Produces rowMcMatchGen2Prong; + Produces rowMcMatchGen3Prong; + Produces rowMcMatchGenBplus; + Produces rowMcMatchGenB0; + Configurable fill2Prong{"fill2Prong", false, "fill table for 2 prong candidates"}; + Configurable fill3Prong{"fill3Prong", false, "fill table for 3 prong candidates"}; + Configurable fillBplus{"fillBplus", false, "fill table for for B+ candidates"}; + Configurable fillB0{"fillB0", false, "fill table for B0 candidates"}; + Configurable rejectBackground2Prong{"rejectBackground2Prong", true, "Reject particles from background events for 2 prong candidates"}; + Configurable rejectBackground3Prong{"rejectBackground3Prong", true, "Reject particles from background events for 3 prong candidates"}; + Configurable rejectBackgroundBplus{"rejectBackgroundBplus", true, "Reject particles from background events for B+ candidates"}; + Configurable rejectBackgroundB0{"rejectBackgroundB0", true, "Reject particles from background events for B0 candidates"}; + Configurable createDplus{"createDplus", false, "Create D+ in 3 prong"}; + Configurable createDs{"createDs", false, "Create Ds in 3 prong"}; + Configurable createLc{"createLc", false, "Create Lc in 3 prong"}; + Configurable createXic{"createXic", false, "Create Xic in 3 prong"}; + Configurable minPosZ{"minPosZ", 10.0, "min z position of promary vertex"}; + + // Filter filterSelectMcCollisions = nabs(aod::mcCollision::posZ) < minPosZ; + + void process(aod::McCollision const&, + aod::McParticles const& mcParticles) + { + if (fill2Prong) { + hf_mcgen_helper::fill2ProngMcMatchGen(mcParticles, rowMcMatchGen2Prong, rejectBackground2Prong); + } + if (fill3Prong) { + hf_mcgen_helper::fill3ProngMcMatchGen(mcParticles, rowMcMatchGen3Prong, rejectBackground3Prong, createDplus, createDs, createLc, createXic); + } + if (fillBplus) { + hf_mcgen_helper::fillBplusMcMatchGen(mcParticles, rowMcMatchGenBplus); + } + if (fillB0) { + hf_mcgen_helper::fillB0McMatchGen(mcParticles, rowMcMatchGenB0); + } + } + PROCESS_SWITCH(HfCandidateCreatorMcGenOnly, process, "Process candidates", true); +}; + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + return WorkflowSpec{ + adaptAnalysisTask(cfgc, TaskName{"hf-candidate-creator-mcgen-only"})}; +} diff --git a/PWGHF/TableProducer/derivedDataCreatorBplusToD0Pi.cxx b/PWGHF/TableProducer/derivedDataCreatorBplusToD0Pi.cxx index c1fc262b0af..bba0272a237 100644 --- a/PWGHF/TableProducer/derivedDataCreatorBplusToD0Pi.cxx +++ b/PWGHF/TableProducer/derivedDataCreatorBplusToD0Pi.cxx @@ -119,6 +119,9 @@ struct HfDerivedDataCreatorBplusToD0Pi { if (std::accumulate(doprocess.begin(), doprocess.end(), 0) != 1) { LOGP(fatal, "Only one process function can be enabled at a time."); } + if (confDerData.fillMcRCollId && doprocessMcGenOnly) { + LOGP(fatal, "fillMcRCollId and processMcGenOnly cannot be enabled at the same time."); + } rowsCommon.init(confDerData); } @@ -419,6 +422,14 @@ struct HfDerivedDataCreatorBplusToD0Pi { rowsCommon.processMcParticles(mcCollisions, mcParticlesPerMcCollision, mcParticles, mass); } PROCESS_SWITCH(HfDerivedDataCreatorBplusToD0Pi, processMcMlAll, "Process MC with ML", false); + + void processMcGenOnly(TypeMcCollisions const& mcCollisions, + MatchedGenCandidatesMc const& mcParticles) + { + rowsCommon.preProcessMcCollisions(mcCollisions, mcParticlesPerMcCollision, mcParticles); + rowsCommon.processMcParticles(mcCollisions, mcParticlesPerMcCollision, mcParticles, mass); + } + PROCESS_SWITCH(HfDerivedDataCreatorBplusToD0Pi, processMcGenOnly, "Process MCGen only", false); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) diff --git a/PWGHF/TableProducer/derivedDataCreatorD0ToKPi.cxx b/PWGHF/TableProducer/derivedDataCreatorD0ToKPi.cxx index 92fdd9089b8..ca2e1c74e8b 100644 --- a/PWGHF/TableProducer/derivedDataCreatorD0ToKPi.cxx +++ b/PWGHF/TableProducer/derivedDataCreatorD0ToKPi.cxx @@ -131,6 +131,9 @@ struct HfDerivedDataCreatorD0ToKPi { if (std::accumulate(doprocess.begin(), doprocess.end(), 0) != 1) { LOGP(fatal, "Only one process function can be enabled at a time."); } + if (confDerData.fillMcRCollId && doprocessMcGenOnly) { + LOGP(fatal, "fillMcRCollId and processMcGenOnly cannot be enabled at the same time."); + } rowsCommon.init(confDerData); } @@ -516,6 +519,14 @@ struct HfDerivedDataCreatorD0ToKPi { rowsCommon.processMcParticles(mcCollisions, mcParticlesPerMcCollision, mcParticles, mass); } PROCESS_SWITCH(HfDerivedDataCreatorD0ToKPi, processMcWithKFParticleMlAll, "Process MC with KFParticle and ML", false); + + void processMcGenOnly(TypeMcCollisions const& mcCollisions, + MatchedGenCandidatesMc const& mcParticles) + { + rowsCommon.preProcessMcCollisions(mcCollisions, mcParticlesPerMcCollision, mcParticles); + rowsCommon.processMcParticles(mcCollisions, mcParticlesPerMcCollision, mcParticles, mass); + } + PROCESS_SWITCH(HfDerivedDataCreatorD0ToKPi, processMcGenOnly, "Process MCGen only", false); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) diff --git a/PWGHF/TableProducer/derivedDataCreatorLcToPKPi.cxx b/PWGHF/TableProducer/derivedDataCreatorLcToPKPi.cxx index c574611228d..63d27f89964 100644 --- a/PWGHF/TableProducer/derivedDataCreatorLcToPKPi.cxx +++ b/PWGHF/TableProducer/derivedDataCreatorLcToPKPi.cxx @@ -112,6 +112,9 @@ struct HfDerivedDataCreatorLcToPKPi { if (std::accumulate(doprocess.begin(), doprocess.end(), 0) != 1) { LOGP(fatal, "Only one process function can be enabled at a time."); } + if (confDerData.fillMcRCollId && doprocessMcGenOnly) { + LOGP(fatal, "fillMcRCollId and processMcGenOnly cannot be enabled at the same time."); + } rowsCommon.init(confDerData); } @@ -387,6 +390,14 @@ struct HfDerivedDataCreatorLcToPKPi { rowsCommon.processMcParticles(mcCollisions, mcParticlesPerMcCollision, mcParticles, mass); } PROCESS_SWITCH(HfDerivedDataCreatorLcToPKPi, processMcMlAll, "Process MC with ML", false); + + void processMcGenOnly(TypeMcCollisions const& mcCollisions, + MatchedGenCandidatesMc const& mcParticles) + { + rowsCommon.preProcessMcCollisions(mcCollisions, mcParticlesPerMcCollision, mcParticles); + rowsCommon.processMcParticles(mcCollisions, mcParticlesPerMcCollision, mcParticles, mass); + } + PROCESS_SWITCH(HfDerivedDataCreatorLcToPKPi, processMcGenOnly, "Process MCGen only", false); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) From 6bb7b732be932bee6cb4a8ce057a6c6e8aa7a623 Mon Sep 17 00:00:00 2001 From: nzardosh Date: Thu, 16 Jan 2025 18:40:43 +0100 Subject: [PATCH 2/7] Changing default configurable values --- PWGHF/TableProducer/candidateCreatorMcGenOnly.cxx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/PWGHF/TableProducer/candidateCreatorMcGenOnly.cxx b/PWGHF/TableProducer/candidateCreatorMcGenOnly.cxx index 114e8928610..5219dfaf8b5 100644 --- a/PWGHF/TableProducer/candidateCreatorMcGenOnly.cxx +++ b/PWGHF/TableProducer/candidateCreatorMcGenOnly.cxx @@ -44,10 +44,10 @@ struct HfCandidateCreatorMcGenOnly { Configurable fill3Prong{"fill3Prong", false, "fill table for 3 prong candidates"}; Configurable fillBplus{"fillBplus", false, "fill table for for B+ candidates"}; Configurable fillB0{"fillB0", false, "fill table for B0 candidates"}; - Configurable rejectBackground2Prong{"rejectBackground2Prong", true, "Reject particles from background events for 2 prong candidates"}; - Configurable rejectBackground3Prong{"rejectBackground3Prong", true, "Reject particles from background events for 3 prong candidates"}; - Configurable rejectBackgroundBplus{"rejectBackgroundBplus", true, "Reject particles from background events for B+ candidates"}; - Configurable rejectBackgroundB0{"rejectBackgroundB0", true, "Reject particles from background events for B0 candidates"}; + Configurable rejectBackground2Prong{"rejectBackground2Prong", false, "Reject particles from PbPb background for 2 prong candidates"}; + Configurable rejectBackground3Prong{"rejectBackground3Prong", false, "Reject particles from PbPb background for 3 prong candidates"}; + Configurable rejectBackgroundBplus{"rejectBackgroundBplus", false, "Reject particles from PbPb background for B+ candidates"}; + Configurable rejectBackgroundB0{"rejectBackgroundB0", false, "Reject particles from PbPb background for B0 candidates"}; Configurable createDplus{"createDplus", false, "Create D+ in 3 prong"}; Configurable createDs{"createDs", false, "Create Ds in 3 prong"}; Configurable createLc{"createLc", false, "Create Lc in 3 prong"}; From ad69a124bb90798648552e6570320b46d8daae31 Mon Sep 17 00:00:00 2001 From: nzardosh Date: Fri, 17 Jan 2025 10:32:01 +0100 Subject: [PATCH 3/7] Fixes from Vits review --- .../{HfMcGenHelper.h => HfMcGenUtility.h} | 22 +++++++++---------- PWGHF/TableProducer/CMakeLists.txt | 4 ++-- .../TableProducer/candidateCreator2Prong.cxx | 4 ++-- .../TableProducer/candidateCreator3Prong.cxx | 4 ++-- PWGHF/TableProducer/candidateCreatorB0.cxx | 4 ++-- PWGHF/TableProducer/candidateCreatorBplus.cxx | 5 ++--- ...cGenOnly.cxx => candidateCreatorMcGen.cxx} | 17 +++++++------- .../derivedDataCreatorBplusToD0Pi.cxx | 1 - .../derivedDataCreatorD0ToKPi.cxx | 1 - .../derivedDataCreatorLcToPKPi.cxx | 1 - 10 files changed, 29 insertions(+), 34 deletions(-) rename PWGHF/Core/{HfMcGenHelper.h => HfMcGenUtility.h} (94%) rename PWGHF/TableProducer/{candidateCreatorMcGenOnly.cxx => candidateCreatorMcGen.cxx} (81%) diff --git a/PWGHF/Core/HfMcGenHelper.h b/PWGHF/Core/HfMcGenUtility.h similarity index 94% rename from PWGHF/Core/HfMcGenHelper.h rename to PWGHF/Core/HfMcGenUtility.h index fa258407737..50bbe9789e3 100644 --- a/PWGHF/Core/HfMcGenHelper.h +++ b/PWGHF/Core/HfMcGenUtility.h @@ -9,13 +9,13 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. -/// \file HfMcGenHelper.h -/// \brief helper functions for HF McGen workflows +/// \file HfMcGenUtility.h +/// \brief utility functions for HF McGen workflows /// /// \author Nima Zardoshti, nima.zardoshti@cern.ch, CERN -#ifndef PWGHF_CORE_HFMCGENHELPER_H_ -#define PWGHF_CORE_HFMCGENHELPER_H_ +#ifndef PWGHF_CORE_HFMCGENUTILITY_H_ +#define PWGHF_CORE_HFMCGENUTILITY_H_ #include #include "CommonConstants/PhysicsConstants.h" @@ -24,11 +24,11 @@ using namespace o2::constants::physics; -namespace hf_mcgen_helper +namespace hf_mc_gen { template -void fill2ProngMcMatchGen(T const& mcParticles, U& rowMcMatchGen, bool rejectBackground) +void fillMcMatchGen2Prong(T const& mcParticles, U& rowMcMatchGen, bool rejectBackground) { // Match generated particles. @@ -75,7 +75,7 @@ void fill2ProngMcMatchGen(T const& mcParticles, U& rowMcMatchGen, bool rejectBac } template -void fill3ProngMcMatchGen(T const& mcParticles, U& rowMcMatchGen, bool rejectBackground, bool createDplus, bool createDs, bool createLc, bool createXic) +void fillMcMatchGen3Prong(T const& mcParticles, U& rowMcMatchGen, bool rejectBackground, bool createDplus, bool createDs, bool createLc, bool createXic) { // Match generated particles. @@ -177,7 +177,7 @@ void fill3ProngMcMatchGen(T const& mcParticles, U& rowMcMatchGen, bool rejectBac } template -void fillBplusMcMatchGen(T const& mcParticles, U& rowMcMatchGen) +void fillMcMatchGenBplus(T const& mcParticles, U& rowMcMatchGen) { // Match generated particles. @@ -207,7 +207,7 @@ void fillBplusMcMatchGen(T const& mcParticles, U& rowMcMatchGen) } template -void fillB0McMatchGen(T const& mcParticles, U& rowMcMatchGen) +void fillMcMatchGenB0(T const& mcParticles, U& rowMcMatchGen) { // Match generated particles. @@ -227,6 +227,6 @@ void fillB0McMatchGen(T const& mcParticles, U& rowMcMatchGen) } // gen } -} // namespace hf_mcgen_helper +} // namespace hf_mc_gen -#endif // PWGHF_CORE_HFMCGENHELPER_H_ +#endif // PWGHF_CORE_HFMCGENUTILITY_H_ diff --git a/PWGHF/TableProducer/CMakeLists.txt b/PWGHF/TableProducer/CMakeLists.txt index 2e9a0c11f52..ca97223ff17 100644 --- a/PWGHF/TableProducer/CMakeLists.txt +++ b/PWGHF/TableProducer/CMakeLists.txt @@ -101,8 +101,8 @@ o2physics_add_dpl_workflow(candidate-creator-xicc COMPONENT_NAME Analysis) -o2physics_add_dpl_workflow(candidate-creator-mcgen-only - SOURCES candidateCreatorMcGenOnly.cxx +o2physics_add_dpl_workflow(candidate-creator-mc-gen + SOURCES candidateCreatorMcGen.cxx PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore COMPONENT_NAME Analysis) diff --git a/PWGHF/TableProducer/candidateCreator2Prong.cxx b/PWGHF/TableProducer/candidateCreator2Prong.cxx index 4c2b98cfb75..2c7b47e58af 100644 --- a/PWGHF/TableProducer/candidateCreator2Prong.cxx +++ b/PWGHF/TableProducer/candidateCreator2Prong.cxx @@ -44,7 +44,7 @@ #include "Tools/KFparticle/KFUtilities.h" #include "PWGHF/Core/CentralityEstimation.h" -#include "PWGHF/Core/HfMcGenHelper.h" +#include "PWGHF/Core/HfMcGenUtility.h" #include "PWGHF/DataModel/CandidateReconstructionTables.h" #include "PWGHF/Utils/utilsBfieldCCDB.h" #include "PWGHF/Utils/utilsEvSelHf.h" @@ -840,7 +840,7 @@ struct HfCandidateCreator2ProngExpressions { } continue; } - hf_mcgen_helper::fill2ProngMcMatchGen(mcParticlesPerMcColl, rowMcMatchGen, rejectBackground); + hf_mc_gen::fillMcMatchGen2Prong(mcParticlesPerMcColl, rowMcMatchGen, rejectBackground); } } diff --git a/PWGHF/TableProducer/candidateCreator3Prong.cxx b/PWGHF/TableProducer/candidateCreator3Prong.cxx index f7365529137..6ec482d9260 100644 --- a/PWGHF/TableProducer/candidateCreator3Prong.cxx +++ b/PWGHF/TableProducer/candidateCreator3Prong.cxx @@ -44,7 +44,7 @@ #include "Tools/KFparticle/KFUtilities.h" #include "PWGHF/Core/CentralityEstimation.h" -#include "PWGHF/Core/HfMcGenHelper.h" +#include "PWGHF/Core/HfMcGenUtility.h" #include "PWGHF/DataModel/CandidateReconstructionTables.h" #include "PWGHF/Utils/utilsBfieldCCDB.h" #include "PWGHF/Utils/utilsEvSelHf.h" @@ -1049,7 +1049,7 @@ struct HfCandidateCreator3ProngExpressions { } continue; } - hf_mcgen_helper::fill3ProngMcMatchGen(mcParticlesPerMcColl, rowMcMatchGen, rejectBackground, createDplus, createDs, createLc, createXic); + hf_mc_gen::fillMcMatchGen3Prong(mcParticlesPerMcColl, rowMcMatchGen, rejectBackground, createDplus, createDs, createLc, createXic); } } diff --git a/PWGHF/TableProducer/candidateCreatorB0.cxx b/PWGHF/TableProducer/candidateCreatorB0.cxx index 9dc80a6cff2..34a437381c0 100644 --- a/PWGHF/TableProducer/candidateCreatorB0.cxx +++ b/PWGHF/TableProducer/candidateCreatorB0.cxx @@ -26,7 +26,7 @@ #include "Common/DataModel/CollisionAssociationTables.h" #include "PWGHF/Core/HfHelper.h" -#include "PWGHF/Core/HfMcGenHelper.h" +#include "PWGHF/Core/HfMcGenUtility.h" #include "PWGHF/DataModel/CandidateReconstructionTables.h" #include "PWGHF/DataModel/CandidateSelectionTables.h" #include "PWGHF/Utils/utilsBfieldCCDB.h" @@ -449,7 +449,7 @@ struct HfCandidateCreatorB0Expressions { rowMcMatchRec(flag, origin, debug); } // rec - hf_mcgen_helper::fillB0McMatchGen(mcParticles, rowMcMatchGen); // gen + hf_mc_gen::fillMcMatchGenB0(mcParticles, rowMcMatchGen); // gen } // processMc PROCESS_SWITCH(HfCandidateCreatorB0Expressions, processMc, "Process MC", false); }; // struct diff --git a/PWGHF/TableProducer/candidateCreatorBplus.cxx b/PWGHF/TableProducer/candidateCreatorBplus.cxx index 939d9786c5b..dd73286305a 100644 --- a/PWGHF/TableProducer/candidateCreatorBplus.cxx +++ b/PWGHF/TableProducer/candidateCreatorBplus.cxx @@ -33,7 +33,7 @@ #include "Common/DataModel/CollisionAssociationTables.h" #include "PWGHF/Core/HfHelper.h" -#include "PWGHF/Core/HfMcGenHelper.h" +#include "PWGHF/Core/HfMcGenUtility.h" #include "PWGHF/DataModel/CandidateReconstructionTables.h" #include "PWGHF/DataModel/CandidateSelectionTables.h" #include "PWGHF/Utils/utilsBfieldCCDB.h" @@ -366,7 +366,6 @@ struct HfCandidateCreatorBplusExpressions { int8_t signB = 0, signD0 = 0; int8_t flag = 0; int8_t origin = 0; - int kD0pdg = Pdg::kD0; // Match reconstructed candidates. // Spawned table can be used directly @@ -387,7 +386,7 @@ struct HfCandidateCreatorBplusExpressions { } rowMcMatchRec(flag, origin); } - hf_mcgen_helper::fillBplusMcMatchGen(mcParticles, rowMcMatchGen); // gen + hf_mc_gen::fillMcMatchGenBplus(mcParticles, rowMcMatchGen); // gen } // process PROCESS_SWITCH(HfCandidateCreatorBplusExpressions, processMc, "Process MC", false); }; // struct diff --git a/PWGHF/TableProducer/candidateCreatorMcGenOnly.cxx b/PWGHF/TableProducer/candidateCreatorMcGen.cxx similarity index 81% rename from PWGHF/TableProducer/candidateCreatorMcGenOnly.cxx rename to PWGHF/TableProducer/candidateCreatorMcGen.cxx index 5219dfaf8b5..215e02ecff9 100644 --- a/PWGHF/TableProducer/candidateCreatorMcGenOnly.cxx +++ b/PWGHF/TableProducer/candidateCreatorMcGen.cxx @@ -9,7 +9,7 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. -/// \file candidateCreatorMcGenOnly.cxx +/// \file candidateCreatorMcGen.cxx /// \brief McGen only selection of heavy-flavour particles /// /// \author Nima Zardoshti, nima.zardoshti@cern.ch, CERN @@ -26,7 +26,7 @@ #include "Framework/runDataProcessing.h" #include "Framework/RunningWorkflowInfo.h" -#include "PWGHF/Core/HfMcGenHelper.h" +#include "PWGHF/Core/HfMcGenUtility.h" #include "PWGHF/DataModel/CandidateReconstructionTables.h" using namespace o2; @@ -34,7 +34,7 @@ using namespace o2::analysis; using namespace o2::framework; /// Reconstruction of heavy-flavour 2-prong decay candidates -struct HfCandidateCreatorMcGenOnly { +struct HfCandidateCreatorMcGen { Produces rowMcMatchGen2Prong; Produces rowMcMatchGen3Prong; @@ -60,23 +60,22 @@ struct HfCandidateCreatorMcGenOnly { aod::McParticles const& mcParticles) { if (fill2Prong) { - hf_mcgen_helper::fill2ProngMcMatchGen(mcParticles, rowMcMatchGen2Prong, rejectBackground2Prong); + hf_mc_gen::fillMcMatchGen2Prong(mcParticles, rowMcMatchGen2Prong, rejectBackground2Prong); } if (fill3Prong) { - hf_mcgen_helper::fill3ProngMcMatchGen(mcParticles, rowMcMatchGen3Prong, rejectBackground3Prong, createDplus, createDs, createLc, createXic); + hf_mc_gen::fillMcMatchGen3Prong(mcParticles, rowMcMatchGen3Prong, rejectBackground3Prong, createDplus, createDs, createLc, createXic); } if (fillBplus) { - hf_mcgen_helper::fillBplusMcMatchGen(mcParticles, rowMcMatchGenBplus); + hf_mc_gen::fillMcMatchGenBplus(mcParticles, rowMcMatchGenBplus); } if (fillB0) { - hf_mcgen_helper::fillB0McMatchGen(mcParticles, rowMcMatchGenB0); + hf_mc_gen::fillMcMatchGenB0(mcParticles, rowMcMatchGenB0); } } - PROCESS_SWITCH(HfCandidateCreatorMcGenOnly, process, "Process candidates", true); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { return WorkflowSpec{ - adaptAnalysisTask(cfgc, TaskName{"hf-candidate-creator-mcgen-only"})}; + adaptAnalysisTask(cfgc)}; } diff --git a/PWGHF/TableProducer/derivedDataCreatorBplusToD0Pi.cxx b/PWGHF/TableProducer/derivedDataCreatorBplusToD0Pi.cxx index bba0272a237..7d6abd37987 100644 --- a/PWGHF/TableProducer/derivedDataCreatorBplusToD0Pi.cxx +++ b/PWGHF/TableProducer/derivedDataCreatorBplusToD0Pi.cxx @@ -426,7 +426,6 @@ struct HfDerivedDataCreatorBplusToD0Pi { void processMcGenOnly(TypeMcCollisions const& mcCollisions, MatchedGenCandidatesMc const& mcParticles) { - rowsCommon.preProcessMcCollisions(mcCollisions, mcParticlesPerMcCollision, mcParticles); rowsCommon.processMcParticles(mcCollisions, mcParticlesPerMcCollision, mcParticles, mass); } PROCESS_SWITCH(HfDerivedDataCreatorBplusToD0Pi, processMcGenOnly, "Process MCGen only", false); diff --git a/PWGHF/TableProducer/derivedDataCreatorD0ToKPi.cxx b/PWGHF/TableProducer/derivedDataCreatorD0ToKPi.cxx index ca2e1c74e8b..fbdd81828a5 100644 --- a/PWGHF/TableProducer/derivedDataCreatorD0ToKPi.cxx +++ b/PWGHF/TableProducer/derivedDataCreatorD0ToKPi.cxx @@ -523,7 +523,6 @@ struct HfDerivedDataCreatorD0ToKPi { void processMcGenOnly(TypeMcCollisions const& mcCollisions, MatchedGenCandidatesMc const& mcParticles) { - rowsCommon.preProcessMcCollisions(mcCollisions, mcParticlesPerMcCollision, mcParticles); rowsCommon.processMcParticles(mcCollisions, mcParticlesPerMcCollision, mcParticles, mass); } PROCESS_SWITCH(HfDerivedDataCreatorD0ToKPi, processMcGenOnly, "Process MCGen only", false); diff --git a/PWGHF/TableProducer/derivedDataCreatorLcToPKPi.cxx b/PWGHF/TableProducer/derivedDataCreatorLcToPKPi.cxx index 63d27f89964..1a6ad1a575c 100644 --- a/PWGHF/TableProducer/derivedDataCreatorLcToPKPi.cxx +++ b/PWGHF/TableProducer/derivedDataCreatorLcToPKPi.cxx @@ -394,7 +394,6 @@ struct HfDerivedDataCreatorLcToPKPi { void processMcGenOnly(TypeMcCollisions const& mcCollisions, MatchedGenCandidatesMc const& mcParticles) { - rowsCommon.preProcessMcCollisions(mcCollisions, mcParticlesPerMcCollision, mcParticles); rowsCommon.processMcParticles(mcCollisions, mcParticlesPerMcCollision, mcParticles, mass); } PROCESS_SWITCH(HfDerivedDataCreatorLcToPKPi, processMcGenOnly, "Process MCGen only", false); From 12b72d43147137249394bef33dad33d2cf9564d2 Mon Sep 17 00:00:00 2001 From: nzardosh Date: Sat, 18 Jan 2025 17:01:10 +0100 Subject: [PATCH 4/7] Addressing Vits comments 2 --- PWGHF/TableProducer/candidateCreator2Prong.cxx | 2 +- PWGHF/TableProducer/candidateCreator3Prong.cxx | 2 +- PWGHF/TableProducer/candidateCreatorB0.cxx | 2 +- PWGHF/TableProducer/candidateCreatorBplus.cxx | 2 +- PWGHF/TableProducer/candidateCreatorMcGen.cxx | 6 +----- PWGHF/TableProducer/derivedDataCreatorBplusToD0Pi.cxx | 3 --- PWGHF/TableProducer/derivedDataCreatorD0ToKPi.cxx | 3 --- PWGHF/TableProducer/derivedDataCreatorLcToPKPi.cxx | 3 --- PWGHF/{Core/HfMcGenUtility.h => Utils/utilsMcGen.h} | 10 +++++----- 9 files changed, 10 insertions(+), 23 deletions(-) rename PWGHF/{Core/HfMcGenUtility.h => Utils/utilsMcGen.h} (98%) diff --git a/PWGHF/TableProducer/candidateCreator2Prong.cxx b/PWGHF/TableProducer/candidateCreator2Prong.cxx index 2c7b47e58af..008a7132c8a 100644 --- a/PWGHF/TableProducer/candidateCreator2Prong.cxx +++ b/PWGHF/TableProducer/candidateCreator2Prong.cxx @@ -44,12 +44,12 @@ #include "Tools/KFparticle/KFUtilities.h" #include "PWGHF/Core/CentralityEstimation.h" -#include "PWGHF/Core/HfMcGenUtility.h" #include "PWGHF/DataModel/CandidateReconstructionTables.h" #include "PWGHF/Utils/utilsBfieldCCDB.h" #include "PWGHF/Utils/utilsEvSelHf.h" #include "PWGHF/Utils/utilsPid.h" #include "PWGHF/Utils/utilsTrkCandHf.h" +#include "PWGHF/Utils/utilsMcGen.h" using namespace o2; using namespace o2::analysis; diff --git a/PWGHF/TableProducer/candidateCreator3Prong.cxx b/PWGHF/TableProducer/candidateCreator3Prong.cxx index 6ec482d9260..5228b106098 100644 --- a/PWGHF/TableProducer/candidateCreator3Prong.cxx +++ b/PWGHF/TableProducer/candidateCreator3Prong.cxx @@ -44,11 +44,11 @@ #include "Tools/KFparticle/KFUtilities.h" #include "PWGHF/Core/CentralityEstimation.h" -#include "PWGHF/Core/HfMcGenUtility.h" #include "PWGHF/DataModel/CandidateReconstructionTables.h" #include "PWGHF/Utils/utilsBfieldCCDB.h" #include "PWGHF/Utils/utilsEvSelHf.h" #include "PWGHF/Utils/utilsTrkCandHf.h" +#include "PWGHF/Utils/utilsMcGen.h" using namespace o2; using namespace o2::analysis; diff --git a/PWGHF/TableProducer/candidateCreatorB0.cxx b/PWGHF/TableProducer/candidateCreatorB0.cxx index 34a437381c0..38cc4f32ec1 100644 --- a/PWGHF/TableProducer/candidateCreatorB0.cxx +++ b/PWGHF/TableProducer/candidateCreatorB0.cxx @@ -26,11 +26,11 @@ #include "Common/DataModel/CollisionAssociationTables.h" #include "PWGHF/Core/HfHelper.h" -#include "PWGHF/Core/HfMcGenUtility.h" #include "PWGHF/DataModel/CandidateReconstructionTables.h" #include "PWGHF/DataModel/CandidateSelectionTables.h" #include "PWGHF/Utils/utilsBfieldCCDB.h" #include "PWGHF/Utils/utilsTrkCandHf.h" +#include "PWGHF/Utils/utilsMcGen.h" using namespace o2; using namespace o2::analysis; diff --git a/PWGHF/TableProducer/candidateCreatorBplus.cxx b/PWGHF/TableProducer/candidateCreatorBplus.cxx index dd73286305a..4d98f65cdaa 100644 --- a/PWGHF/TableProducer/candidateCreatorBplus.cxx +++ b/PWGHF/TableProducer/candidateCreatorBplus.cxx @@ -33,11 +33,11 @@ #include "Common/DataModel/CollisionAssociationTables.h" #include "PWGHF/Core/HfHelper.h" -#include "PWGHF/Core/HfMcGenUtility.h" #include "PWGHF/DataModel/CandidateReconstructionTables.h" #include "PWGHF/DataModel/CandidateSelectionTables.h" #include "PWGHF/Utils/utilsBfieldCCDB.h" #include "PWGHF/Utils/utilsTrkCandHf.h" +#include "PWGHF/Utils/utilsMcGen.h" using namespace o2; using namespace o2::analysis; diff --git a/PWGHF/TableProducer/candidateCreatorMcGen.cxx b/PWGHF/TableProducer/candidateCreatorMcGen.cxx index 215e02ecff9..aa9ea26afa1 100644 --- a/PWGHF/TableProducer/candidateCreatorMcGen.cxx +++ b/PWGHF/TableProducer/candidateCreatorMcGen.cxx @@ -26,8 +26,8 @@ #include "Framework/runDataProcessing.h" #include "Framework/RunningWorkflowInfo.h" -#include "PWGHF/Core/HfMcGenUtility.h" #include "PWGHF/DataModel/CandidateReconstructionTables.h" +#include "PWGHF/Utils/utilsMcGen.h" using namespace o2; using namespace o2::analysis; @@ -46,16 +46,12 @@ struct HfCandidateCreatorMcGen { Configurable fillB0{"fillB0", false, "fill table for B0 candidates"}; Configurable rejectBackground2Prong{"rejectBackground2Prong", false, "Reject particles from PbPb background for 2 prong candidates"}; Configurable rejectBackground3Prong{"rejectBackground3Prong", false, "Reject particles from PbPb background for 3 prong candidates"}; - Configurable rejectBackgroundBplus{"rejectBackgroundBplus", false, "Reject particles from PbPb background for B+ candidates"}; - Configurable rejectBackgroundB0{"rejectBackgroundB0", false, "Reject particles from PbPb background for B0 candidates"}; Configurable createDplus{"createDplus", false, "Create D+ in 3 prong"}; Configurable createDs{"createDs", false, "Create Ds in 3 prong"}; Configurable createLc{"createLc", false, "Create Lc in 3 prong"}; Configurable createXic{"createXic", false, "Create Xic in 3 prong"}; Configurable minPosZ{"minPosZ", 10.0, "min z position of promary vertex"}; - // Filter filterSelectMcCollisions = nabs(aod::mcCollision::posZ) < minPosZ; - void process(aod::McCollision const&, aod::McParticles const& mcParticles) { diff --git a/PWGHF/TableProducer/derivedDataCreatorBplusToD0Pi.cxx b/PWGHF/TableProducer/derivedDataCreatorBplusToD0Pi.cxx index 7d6abd37987..62df410134a 100644 --- a/PWGHF/TableProducer/derivedDataCreatorBplusToD0Pi.cxx +++ b/PWGHF/TableProducer/derivedDataCreatorBplusToD0Pi.cxx @@ -119,9 +119,6 @@ struct HfDerivedDataCreatorBplusToD0Pi { if (std::accumulate(doprocess.begin(), doprocess.end(), 0) != 1) { LOGP(fatal, "Only one process function can be enabled at a time."); } - if (confDerData.fillMcRCollId && doprocessMcGenOnly) { - LOGP(fatal, "fillMcRCollId and processMcGenOnly cannot be enabled at the same time."); - } rowsCommon.init(confDerData); } diff --git a/PWGHF/TableProducer/derivedDataCreatorD0ToKPi.cxx b/PWGHF/TableProducer/derivedDataCreatorD0ToKPi.cxx index fbdd81828a5..e673aaa3ddd 100644 --- a/PWGHF/TableProducer/derivedDataCreatorD0ToKPi.cxx +++ b/PWGHF/TableProducer/derivedDataCreatorD0ToKPi.cxx @@ -131,9 +131,6 @@ struct HfDerivedDataCreatorD0ToKPi { if (std::accumulate(doprocess.begin(), doprocess.end(), 0) != 1) { LOGP(fatal, "Only one process function can be enabled at a time."); } - if (confDerData.fillMcRCollId && doprocessMcGenOnly) { - LOGP(fatal, "fillMcRCollId and processMcGenOnly cannot be enabled at the same time."); - } rowsCommon.init(confDerData); } diff --git a/PWGHF/TableProducer/derivedDataCreatorLcToPKPi.cxx b/PWGHF/TableProducer/derivedDataCreatorLcToPKPi.cxx index 1a6ad1a575c..6a264b2f92d 100644 --- a/PWGHF/TableProducer/derivedDataCreatorLcToPKPi.cxx +++ b/PWGHF/TableProducer/derivedDataCreatorLcToPKPi.cxx @@ -112,9 +112,6 @@ struct HfDerivedDataCreatorLcToPKPi { if (std::accumulate(doprocess.begin(), doprocess.end(), 0) != 1) { LOGP(fatal, "Only one process function can be enabled at a time."); } - if (confDerData.fillMcRCollId && doprocessMcGenOnly) { - LOGP(fatal, "fillMcRCollId and processMcGenOnly cannot be enabled at the same time."); - } rowsCommon.init(confDerData); } diff --git a/PWGHF/Core/HfMcGenUtility.h b/PWGHF/Utils/utilsMcGen.h similarity index 98% rename from PWGHF/Core/HfMcGenUtility.h rename to PWGHF/Utils/utilsMcGen.h index 50bbe9789e3..0c4f03bff88 100644 --- a/PWGHF/Core/HfMcGenUtility.h +++ b/PWGHF/Utils/utilsMcGen.h @@ -9,13 +9,13 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. -/// \file HfMcGenUtility.h +/// \file utilsMcGen.h /// \brief utility functions for HF McGen workflows /// /// \author Nima Zardoshti, nima.zardoshti@cern.ch, CERN -#ifndef PWGHF_CORE_HFMCGENUTILITY_H_ -#define PWGHF_CORE_HFMCGENUTILITY_H_ +#ifndef PWGHF_UTILS_UTILSMCGEN_H_ +#define PWGHF_UTILS_UTILSMCGEN_H_ #include #include "CommonConstants/PhysicsConstants.h" @@ -192,7 +192,7 @@ void fillMcMatchGenBplus(T const& mcParticles, U& rowMcMatchGen) std::vector arrayDaughterB; if (RecoDecay::isMatchedMCGen(mcParticles, particle, Pdg::kBPlus, std::array{-Pdg::kD0, +kPiPlus}, true, &signB, 1, &arrayDaughterB)) { // D0(bar) → π± K∓ - for (auto iD : arrayDaughterB) { + for (const auto iD : arrayDaughterB) { auto candDaughterMC = mcParticles.rawIteratorAt(iD); if (std::abs(candDaughterMC.pdgCode()) == Pdg::kD0) { indexGenD0 = RecoDecay::isMatchedMCGen(mcParticles, candDaughterMC, Pdg::kD0, std::array{-kKPlus, +kPiPlus}, true, &signD0, 1); @@ -229,4 +229,4 @@ void fillMcMatchGenB0(T const& mcParticles, U& rowMcMatchGen) } // namespace hf_mc_gen -#endif // PWGHF_CORE_HFMCGENUTILITY_H_ +#endif // PWGHF_UTILS_UTILSMCGEN_H_ From ac86b69b5e928f09d19bb61b4d6dbab0a667fc09 Mon Sep 17 00:00:00 2001 From: nzardosh Date: Wed, 22 Jan 2025 10:28:39 +0100 Subject: [PATCH 5/7] addressing vits comments 3 --- PWGHF/TableProducer/CMakeLists.txt | 1 - PWGHF/TableProducer/candidateCreatorMcGen.cxx | 1 - PWGHF/TableProducer/derivedDataCreatorBplusToD0Pi.cxx | 2 +- PWGHF/TableProducer/derivedDataCreatorD0ToKPi.cxx | 2 +- PWGHF/TableProducer/derivedDataCreatorLcToPKPi.cxx | 2 +- PWGHF/Utils/utilsMcGen.h | 11 ++++++++--- 6 files changed, 11 insertions(+), 8 deletions(-) diff --git a/PWGHF/TableProducer/CMakeLists.txt b/PWGHF/TableProducer/CMakeLists.txt index ca97223ff17..73330b41a74 100644 --- a/PWGHF/TableProducer/CMakeLists.txt +++ b/PWGHF/TableProducer/CMakeLists.txt @@ -100,7 +100,6 @@ o2physics_add_dpl_workflow(candidate-creator-xicc PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2::DCAFitter COMPONENT_NAME Analysis) - o2physics_add_dpl_workflow(candidate-creator-mc-gen SOURCES candidateCreatorMcGen.cxx PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore diff --git a/PWGHF/TableProducer/candidateCreatorMcGen.cxx b/PWGHF/TableProducer/candidateCreatorMcGen.cxx index aa9ea26afa1..a1ccbc8e920 100644 --- a/PWGHF/TableProducer/candidateCreatorMcGen.cxx +++ b/PWGHF/TableProducer/candidateCreatorMcGen.cxx @@ -50,7 +50,6 @@ struct HfCandidateCreatorMcGen { Configurable createDs{"createDs", false, "Create Ds in 3 prong"}; Configurable createLc{"createLc", false, "Create Lc in 3 prong"}; Configurable createXic{"createXic", false, "Create Xic in 3 prong"}; - Configurable minPosZ{"minPosZ", 10.0, "min z position of promary vertex"}; void process(aod::McCollision const&, aod::McParticles const& mcParticles) diff --git a/PWGHF/TableProducer/derivedDataCreatorBplusToD0Pi.cxx b/PWGHF/TableProducer/derivedDataCreatorBplusToD0Pi.cxx index 62df410134a..bedffe215b0 100644 --- a/PWGHF/TableProducer/derivedDataCreatorBplusToD0Pi.cxx +++ b/PWGHF/TableProducer/derivedDataCreatorBplusToD0Pi.cxx @@ -425,7 +425,7 @@ struct HfDerivedDataCreatorBplusToD0Pi { { rowsCommon.processMcParticles(mcCollisions, mcParticlesPerMcCollision, mcParticles, mass); } - PROCESS_SWITCH(HfDerivedDataCreatorBplusToD0Pi, processMcGenOnly, "Process MCGen only", false); + PROCESS_SWITCH(HfDerivedDataCreatorBplusToD0Pi, processMcGenOnly, "Process MC gen. only", false); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) diff --git a/PWGHF/TableProducer/derivedDataCreatorD0ToKPi.cxx b/PWGHF/TableProducer/derivedDataCreatorD0ToKPi.cxx index e673aaa3ddd..83f15ec5e80 100644 --- a/PWGHF/TableProducer/derivedDataCreatorD0ToKPi.cxx +++ b/PWGHF/TableProducer/derivedDataCreatorD0ToKPi.cxx @@ -522,7 +522,7 @@ struct HfDerivedDataCreatorD0ToKPi { { rowsCommon.processMcParticles(mcCollisions, mcParticlesPerMcCollision, mcParticles, mass); } - PROCESS_SWITCH(HfDerivedDataCreatorD0ToKPi, processMcGenOnly, "Process MCGen only", false); + PROCESS_SWITCH(HfDerivedDataCreatorD0ToKPi, processMcGenOnly, "Process MC gen. only", false); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) diff --git a/PWGHF/TableProducer/derivedDataCreatorLcToPKPi.cxx b/PWGHF/TableProducer/derivedDataCreatorLcToPKPi.cxx index 6a264b2f92d..9c9becea741 100644 --- a/PWGHF/TableProducer/derivedDataCreatorLcToPKPi.cxx +++ b/PWGHF/TableProducer/derivedDataCreatorLcToPKPi.cxx @@ -393,7 +393,7 @@ struct HfDerivedDataCreatorLcToPKPi { { rowsCommon.processMcParticles(mcCollisions, mcParticlesPerMcCollision, mcParticles, mass); } - PROCESS_SWITCH(HfDerivedDataCreatorLcToPKPi, processMcGenOnly, "Process MCGen only", false); + PROCESS_SWITCH(HfDerivedDataCreatorLcToPKPi, processMcGenOnly, "Process MC gen. only", false); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) diff --git a/PWGHF/Utils/utilsMcGen.h b/PWGHF/Utils/utilsMcGen.h index 0c4f03bff88..5df5b146009 100644 --- a/PWGHF/Utils/utilsMcGen.h +++ b/PWGHF/Utils/utilsMcGen.h @@ -10,7 +10,7 @@ // or submit itself to any jurisdiction. /// \file utilsMcGen.h -/// \brief utility functions for HF McGen workflows +/// \brief utility functions for HF Mc gen. workflows /// /// \author Nima Zardoshti, nima.zardoshti@cern.ch, CERN @@ -18,11 +18,12 @@ #define PWGHF_UTILS_UTILSMCGEN_H_ #include + #include "CommonConstants/PhysicsConstants.h" + #include "Common/Core/RecoDecay.h" -#include "PWGHF/DataModel/CandidateReconstructionTables.h" -using namespace o2::constants::physics; +#include "PWGHF/DataModel/CandidateReconstructionTables.h" namespace hf_mc_gen { @@ -30,6 +31,7 @@ namespace hf_mc_gen template void fillMcMatchGen2Prong(T const& mcParticles, U& rowMcMatchGen, bool rejectBackground) { + using namespace o2::constants::physics; // Match generated particles. for (const auto& particle : mcParticles) { @@ -77,6 +79,7 @@ void fillMcMatchGen2Prong(T const& mcParticles, U& rowMcMatchGen, bool rejectBac template void fillMcMatchGen3Prong(T const& mcParticles, U& rowMcMatchGen, bool rejectBackground, bool createDplus, bool createDs, bool createLc, bool createXic) { + using namespace o2::constants::physics; // Match generated particles. for (const auto& particle : mcParticles) { @@ -179,6 +182,7 @@ void fillMcMatchGen3Prong(T const& mcParticles, U& rowMcMatchGen, bool rejectBac template void fillMcMatchGenBplus(T const& mcParticles, U& rowMcMatchGen) { + using namespace o2::constants::physics; // Match generated particles. for (const auto& particle : mcParticles) { @@ -209,6 +213,7 @@ void fillMcMatchGenBplus(T const& mcParticles, U& rowMcMatchGen) template void fillMcMatchGenB0(T const& mcParticles, U& rowMcMatchGen) { + using namespace o2::constants::physics; // Match generated particles. for (const auto& particle : mcParticles) { From 19d3a314c47f2d1c6cb33b1249156c9c5a91573b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ku=C4=8Dera?= Date: Wed, 22 Jan 2025 22:08:34 +0900 Subject: [PATCH 6/7] Fix missing includes in candidateCreatorB0.cxx --- PWGHF/TableProducer/candidateCreatorB0.cxx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/PWGHF/TableProducer/candidateCreatorB0.cxx b/PWGHF/TableProducer/candidateCreatorB0.cxx index 38cc4f32ec1..27779e37ab5 100644 --- a/PWGHF/TableProducer/candidateCreatorB0.cxx +++ b/PWGHF/TableProducer/candidateCreatorB0.cxx @@ -15,6 +15,10 @@ /// /// \author Alexandre Bigot , IPHC Strasbourg +#include +#include +#include + #include "CommonConstants/PhysicsConstants.h" #include "DCAFitter/DCAFitterN.h" #include "Framework/AnalysisTask.h" From 206099bf4bf3bac3f52a27ad60dbfe5cbdd563d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ku=C4=8Dera?= Date: Wed, 22 Jan 2025 22:09:35 +0900 Subject: [PATCH 7/7] Fix missing includes in utilsMcGen.h --- PWGHF/Utils/utilsMcGen.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/PWGHF/Utils/utilsMcGen.h b/PWGHF/Utils/utilsMcGen.h index 5df5b146009..0129bf6d840 100644 --- a/PWGHF/Utils/utilsMcGen.h +++ b/PWGHF/Utils/utilsMcGen.h @@ -17,6 +17,8 @@ #ifndef PWGHF_UTILS_UTILSMCGEN_H_ #define PWGHF_UTILS_UTILSMCGEN_H_ +#include + #include #include "CommonConstants/PhysicsConstants.h"