From fa7e1607f55a5de8a58de3a623dd2adb86395f8e Mon Sep 17 00:00:00 2001 From: Mattia Faggin Date: Tue, 15 Apr 2025 13:25:30 +0200 Subject: [PATCH 01/13] Add matching to Sc(2520) in candidate creator. --- .../DataModel/CandidateReconstructionTables.h | 4 +- .../candidateCreatorSigmac0plusplus.cxx | 60 +++++++++++++++++-- 2 files changed, 57 insertions(+), 7 deletions(-) diff --git a/PWGHF/DataModel/CandidateReconstructionTables.h b/PWGHF/DataModel/CandidateReconstructionTables.h index 7ee144ca397..e44feeefe84 100644 --- a/PWGHF/DataModel/CandidateReconstructionTables.h +++ b/PWGHF/DataModel/CandidateReconstructionTables.h @@ -2064,7 +2064,9 @@ DECLARE_SOA_COLUMN(OriginMcGen, originMcGen, int8_t); //! particle origin, // mapping of decay types enum DecayType { Sc0ToPKPiPi = 0, - ScplusplusToPKPiPi }; + ScplusplusToPKPiPi, + ScStar0ToPKPiPi, + ScStarPlusPlusToPKPiPi }; } // namespace hf_cand_sigmac // declare dedicated Σc0,++ decay candidate table diff --git a/PWGHF/TableProducer/candidateCreatorSigmac0plusplus.cxx b/PWGHF/TableProducer/candidateCreatorSigmac0plusplus.cxx index e882dcd2dba..a2fc9e0d478 100644 --- a/PWGHF/TableProducer/candidateCreatorSigmac0plusplus.cxx +++ b/PWGHF/TableProducer/candidateCreatorSigmac0plusplus.cxx @@ -459,20 +459,41 @@ struct HfCandidateSigmac0plusplusMc { /// 1. Σc0 → Λc+ π-,+ /// 2. Λc+ → pK-π+ direct (i) or Λc+ → resonant channel Λc± → p± K*, Λc± → Δ(1232)±± K∓ or Λc± → Λ(1520) π± (ii) /// 3. in case of (ii): resonant channel to pK-π+ + + /// look for Σc0(2455) indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, Pdg::kSigmaC0, std::array{+kProton, -kKPlus, +kPiPlus, -kPiPlus}, true, &sign, 3); if (indexRec > -1) { /// due to (*) no need to check anything for LambdaC flag = sign * (1 << aod::hf_cand_sigmac::DecayType::Sc0ToPKPiPi); } + + /// look for Σc0(2520) + if(flag == 0) { + indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, Pdg::kSigmaCStar0, std::array{+kProton, -kKPlus, +kPiPlus, -kPiPlus}, true, &sign, 3); + if (indexRec > -1) { /// due to (*) no need to check anything for LambdaC + flag = sign * (1 << aod::hf_cand_sigmac::DecayType::ScStar0ToPKPiPi); + } + } + } else if (std::abs(chargeSigmac) == 2) { /// candidate Σc++ /// 3 levels: /// 1. Σc0 → Λc+ π-,+ /// 2. Λc+ → pK-π+ direct (i) or Λc+ → resonant channel Λc± → p± K*, Λc± → Δ(1232)±± K∓ or Λc± → Λ(1520) π± (ii) /// 3. in case of (ii): resonant channel to pK-π+ + + /// look for Σc++(2455) indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, Pdg::kSigmaCPlusPlus, std::array{+kProton, -kKPlus, +kPiPlus, +kPiPlus}, true, &sign, 3); if (indexRec > -1) { /// due to (*) no need to check anything for LambdaC flag = sign * (1 << aod::hf_cand_sigmac::DecayType::ScplusplusToPKPiPi); } + + /// look for Σc++(2520) + if(flag == 0) { + indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, Pdg::kSigmaCStarPlusPlus, std::array{+kProton, -kKPlus, +kPiPlus, +kPiPlus}, true, &sign, 3); + if (indexRec > -1) { /// due to (*) no need to check anything for LambdaC + flag = sign * (1 << aod::hf_cand_sigmac::DecayType::ScStarPlusPlusToPKPiPi); + } + } } /// check the origin (prompt vs. non-prompt) @@ -507,14 +528,14 @@ struct HfCandidateSigmac0plusplusMc { /// 2. Λc+ → pK-π+ direct (i) or Λc+ → resonant channel Λc± → p± K*, Λc± → Δ(1232)±± K∓ or Λc± → Λ(1520) π± (ii) /// 3. in case of (ii): resonant channel to pK-π+ /// → here we check level 1. first, and then levels 2. and 3. are inherited by the Λc+ → pK-π+ MC matching in candidateCreator3Prong.cxx + + /// look for Σc0,++(2455) if (RecoDecay::isMatchedMCGen(mcParticles, particle, Pdg::kSigmaC0, std::array{static_cast(Pdg::kLambdaCPlus), static_cast(kPiMinus)}, true, &sign, 1)) { - // generated Σc0 - // for (const auto& daughter : particle.daughters_as()) { + // generated Σc0(2455) for (const auto& daughter : particle.daughters_as()) { // look for Λc+ daughter decaying in pK-π+ if (std::abs(daughter.pdgCode()) != Pdg::kLambdaCPlus) continue; - // if (std::abs(daughter.flagMcMatchGen()) == (1 << aod::hf_cand_3prong::DecayType::LcToPKPi)) { if (RecoDecay::isMatchedMCGen(mcParticles, daughter, Pdg::kLambdaCPlus, std::array{+kProton, -kKPlus, +kPiPlus}, true, &sign, 2)) { /// Λc+ daughter decaying in pK-π+ found! flag = sign * (1 << aod::hf_cand_sigmac::DecayType::Sc0ToPKPiPi); @@ -522,13 +543,11 @@ struct HfCandidateSigmac0plusplusMc { } } } else if (RecoDecay::isMatchedMCGen(mcParticles, particle, Pdg::kSigmaCPlusPlus, std::array{static_cast(Pdg::kLambdaCPlus), static_cast(kPiPlus)}, true, &sign, 1)) { - // generated Σc++ - // for (const auto& daughter : particle.daughters_as()) { + // generated Σc++(2455) for (const auto& daughter : particle.daughters_as()) { // look for Λc+ daughter decaying in pK-π+ if (std::abs(daughter.pdgCode()) != Pdg::kLambdaCPlus) continue; - // if (std::abs(daughter.flagMcMatchGen()) == (1 << aod::hf_cand_3prong::DecayType::LcToPKPi)) { if (RecoDecay::isMatchedMCGen(mcParticles, daughter, Pdg::kLambdaCPlus, std::array{+kProton, -kKPlus, +kPiPlus}, true, &sign, 2)) { /// Λc+ daughter decaying in pK-π+ found! flag = sign * (1 << aod::hf_cand_sigmac::DecayType::ScplusplusToPKPiPi); @@ -537,6 +556,35 @@ struct HfCandidateSigmac0plusplusMc { } } + /// look for Σc0,++(2520) + if (flag == 0) { + if (RecoDecay::isMatchedMCGen(mcParticles, particle, Pdg::kSigmaCStar0, std::array{static_cast(Pdg::kLambdaCPlus), static_cast(kPiMinus)}, true, &sign, 1)) { + // generated Σc0(2520) + for (const auto& daughter : particle.daughters_as()) { + // look for Λc+ daughter decaying in pK-π+ + if (std::abs(daughter.pdgCode()) != Pdg::kLambdaCPlus) + continue; + if (RecoDecay::isMatchedMCGen(mcParticles, daughter, Pdg::kLambdaCPlus, std::array{+kProton, -kKPlus, +kPiPlus}, true, &sign, 2)) { + /// Λc+ daughter decaying in pK-π+ found! + flag = sign * (1 << aod::hf_cand_sigmac::DecayType::ScStar0ToPKPiPi); + break; + } + } + } else if (RecoDecay::isMatchedMCGen(mcParticles, particle, Pdg::kSigmaCStarPlusPlus, std::array{static_cast(Pdg::kLambdaCPlus), static_cast(kPiPlus)}, true, &sign, 1)) { + // generated Σc++(2520) + for (const auto& daughter : particle.daughters_as()) { + // look for Λc+ daughter decaying in pK-π+ + if (std::abs(daughter.pdgCode()) != Pdg::kLambdaCPlus) + continue; + if (RecoDecay::isMatchedMCGen(mcParticles, daughter, Pdg::kLambdaCPlus, std::array{+kProton, -kKPlus, +kPiPlus}, true, &sign, 2)) { + /// Λc+ daughter decaying in pK-π+ found! + flag = sign * (1 << aod::hf_cand_sigmac::DecayType::ScStarPlusPlusToPKPiPi); + break; + } + } + } + } + /// check the origin (prompt vs. non-prompt) if (flag != 0) { origin = RecoDecay::getCharmHadronOrigin(mcParticles, particle, false, &idxBhadMothers); From 73bb196272282f70a202916168ec3ff300cebf79 Mon Sep 17 00:00:00 2001 From: Mattia Faggin Date: Tue, 15 Apr 2025 17:34:10 +0200 Subject: [PATCH 02/13] Add ev. sel. for generated Sc. --- PWGHF/D2H/Tasks/taskSigmac.cxx | 19 +++++-- .../candidateCreatorSigmac0plusplus.cxx | 53 +++++++++++++------ 2 files changed, 53 insertions(+), 19 deletions(-) diff --git a/PWGHF/D2H/Tasks/taskSigmac.cxx b/PWGHF/D2H/Tasks/taskSigmac.cxx index b7d77b1fea6..3b86ffa59ff 100644 --- a/PWGHF/D2H/Tasks/taskSigmac.cxx +++ b/PWGHF/D2H/Tasks/taskSigmac.cxx @@ -487,7 +487,7 @@ struct HfTaskSigmac { } } } /// end candidate Λc+ → π+K-p (and charge conjugate) - } /// end loop over the candidate Σc0,++ + } /// end loop over the candidate Σc0,++ /// THn for candidate Λc+ cut variation w/o Σc0,++ mass-window cut if (enableTHn) { @@ -534,7 +534,7 @@ struct HfTaskSigmac { } } } /// end THn for candidate Λc+ cut variation w/o Σc0,++ mass-window cut - }; /// end fillHistosData + }; /// end fillHistosData /// @brief function to fill the histograms needed in analysis (MC) /// @param candidatesSc are the reconstructed candidate Σc0,++ with MC info @@ -644,6 +644,13 @@ struct HfTaskSigmac { ptGenScBMother = mcParticlesSc.rawIteratorAt(particle.idxBhadMotherPart()).pt(); registry.fill(HIST("hnSigmaCGen"), ptGenSc, ptGenScBMother, origin, channel, ptGenLc, 0); } + + // debug -- uncomment if needed + // it should be solved after the implementation of ev. selection for generated SigmaC particles + // if(origin != RecoDecay::OriginType::Prompt && origin != RecoDecay::OriginType::NonPrompt) { + // LOG(info) << " --> (Sc0 gen) origin " << static_cast(origin) << ", particle.originMcGen() " << static_cast(particle.originMcGen()) << ", particle.flagMcMatchGen() " << static_cast(particle.flagMcMatchGen()) << ", pdg " << particle.pdgCode(); + //} + } else if (isScPlusPlusGen) { /// Generated Σc++ and Λc+ ← Σc++ signals registry.fill(HIST("MC/generated/hPtGenScPlusPlusSig"), ptGenSc, origin, channel); @@ -671,6 +678,12 @@ struct HfTaskSigmac { ptGenScBMother = mcParticlesSc.rawIteratorAt(particle.idxBhadMotherPart()).pt(); registry.fill(HIST("hnSigmaCGen"), ptGenSc, ptGenScBMother, origin, channel, ptGenLc, 2); } + + // debug -- uncomment if needed + // it should be solved after the implementation of ev. selection for generated SigmaC particles + // if(origin != RecoDecay::OriginType::Prompt && origin != RecoDecay::OriginType::NonPrompt) { + // LOG(info) << " --> (Sc++ gen) origin " << static_cast(origin) << ", particle.originMcGen() " << static_cast(particle.originMcGen()) << ", particle.flagMcMatchGen() " << static_cast(particle.flagMcMatchGen()) << ", pdg " << particle.pdgCode(); + //} } } /// end loop over Sc generated particles @@ -1063,7 +1076,7 @@ struct HfTaskSigmac { } } /// end candidate Λc+ → π+K-p (and charge conjugate) - } /// end reconstructed Σc++ signal + } /// end reconstructed Σc++ signal } /// end loop on reconstructed Σc0,++ diff --git a/PWGHF/TableProducer/candidateCreatorSigmac0plusplus.cxx b/PWGHF/TableProducer/candidateCreatorSigmac0plusplus.cxx index a2fc9e0d478..9f3cea9d8bc 100644 --- a/PWGHF/TableProducer/candidateCreatorSigmac0plusplus.cxx +++ b/PWGHF/TableProducer/candidateCreatorSigmac0plusplus.cxx @@ -39,6 +39,7 @@ #include "PWGHF/DataModel/CandidateReconstructionTables.h" #include "PWGHF/DataModel/CandidateSelectionTables.h" #include "PWGHF/Utils/utilsBfieldCCDB.h" // for dca recalculation +#include "PWGHF/Utils/utilsEvSelHf.h" using namespace o2; using namespace o2::analysis; @@ -387,26 +388,31 @@ struct HfCandidateSigmac0plusplusMc { Produces rowMCMatchScRec; Produces rowMCMatchScGen; + o2::hf_evsel::HfEventSelectionMc hfEvSelMc; // mc event selection and monitoring + + using BCsInfo = soa::Join; using LambdacMc = soa::Join; // using LambdacMcGen = soa::Join; + using McCollisionsNoCents = soa::Join; + + PresliceUnsorted colPerMcCollision = aod::mccollisionlabel::mcCollisionId; - float zPvPosMax{1000.f}; + HistogramRegistry registry{"registry"}; /// @brief init function void init(InitContext& initContext) { const auto& workflows = initContext.services().get(); for (const DeviceSpec& device : workflows.devices) { - if (device.name.compare("hf-candidate-creator-3prong") == 0) { // here we assume that the hf-candidate-creator-3prong is in the workflow - for (const auto& option : device.options) { - if (option.name.compare("hfEvSel.zPvPosMax") == 0) { - zPvPosMax = option.defaultValue.get(); - break; - } - } + // here we assume that the hf-candidate-creator-3prong is in the workflow + // configure the ev. sel from that workflow + if (device.name.compare("hf-candidate-creator-3prong") == 0) { + hfEvSelMc.configureFromDevice(device); break; } } + + hfEvSelMc.addHistograms(registry); // particles monitoring } /// @brief dummy process function, to be run on data @@ -419,7 +425,9 @@ struct HfCandidateSigmac0plusplusMc { void processMc(aod::McParticles const& mcParticles, aod::TracksWMc const& tracks, LambdacMc const& candsLc /*, const LambdacMcGen&*/, - aod::McCollisions const&) + McCollisionsNoCents const& collInfos, + aod::McCollisions const&, + BCsInfo const&) { // Match reconstructed candidates. @@ -459,15 +467,15 @@ struct HfCandidateSigmac0plusplusMc { /// 1. Σc0 → Λc+ π-,+ /// 2. Λc+ → pK-π+ direct (i) or Λc+ → resonant channel Λc± → p± K*, Λc± → Δ(1232)±± K∓ or Λc± → Λ(1520) π± (ii) /// 3. in case of (ii): resonant channel to pK-π+ - - /// look for Σc0(2455) + + /// look for Σc0(2455) indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, Pdg::kSigmaC0, std::array{+kProton, -kKPlus, +kPiPlus, -kPiPlus}, true, &sign, 3); if (indexRec > -1) { /// due to (*) no need to check anything for LambdaC flag = sign * (1 << aod::hf_cand_sigmac::DecayType::Sc0ToPKPiPi); } /// look for Σc0(2520) - if(flag == 0) { + if (flag == 0) { indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, Pdg::kSigmaCStar0, std::array{+kProton, -kKPlus, +kPiPlus, -kPiPlus}, true, &sign, 3); if (indexRec > -1) { /// due to (*) no need to check anything for LambdaC flag = sign * (1 << aod::hf_cand_sigmac::DecayType::ScStar0ToPKPiPi); @@ -481,14 +489,14 @@ struct HfCandidateSigmac0plusplusMc { /// 2. Λc+ → pK-π+ direct (i) or Λc+ → resonant channel Λc± → p± K*, Λc± → Δ(1232)±± K∓ or Λc± → Λ(1520) π± (ii) /// 3. in case of (ii): resonant channel to pK-π+ - /// look for Σc++(2455) + /// look for Σc++(2455) indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, Pdg::kSigmaCPlusPlus, std::array{+kProton, -kKPlus, +kPiPlus, +kPiPlus}, true, &sign, 3); if (indexRec > -1) { /// due to (*) no need to check anything for LambdaC flag = sign * (1 << aod::hf_cand_sigmac::DecayType::ScplusplusToPKPiPi); } /// look for Σc++(2520) - if(flag == 0) { + if (flag == 0) { indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, Pdg::kSigmaCStarPlusPlus, std::array{+kProton, -kKPlus, +kPiPlus, +kPiPlus}, true, &sign, 3); if (indexRec > -1) { /// due to (*) no need to check anything for LambdaC flag = sign * (1 << aod::hf_cand_sigmac::DecayType::ScStarPlusPlusToPKPiPi); @@ -516,9 +524,16 @@ struct HfCandidateSigmac0plusplusMc { origin = 0; std::vector idxBhadMothers{}; + /// MC ev. selection done w/o centrality estimator + /// In case of need, readapt the code templetizing the function auto mcCollision = particle.mcCollision(); - float zPv = mcCollision.posZ(); - if (zPv < -zPvPosMax || zPv > zPvPosMax) { // to avoid counting particles in collisions with Zvtx larger than the maximum, we do not match them + float centrality{-1.f}; + uint16_t rejectionMask{0}; + const auto collSlice = collInfos.sliceBy(colPerMcCollision, mcCollision.globalIndex()); + rejectionMask = hfEvSelMc.getHfMcCollisionRejectionMask(mcCollision, collSlice, centrality); + hfEvSelMc.fillHistograms(mcCollision, rejectionMask, 0); + if (rejectionMask != 0) { + // at least one event selection not satisfied --> reject gen particles from this collision rowMCMatchScGen(flag, origin, -1); continue; } @@ -595,6 +610,12 @@ struct HfCandidateSigmac0plusplusMc { } else { rowMCMatchScGen(flag, origin, -1); } + + // debug + // if(origin != RecoDecay::OriginType::Prompt && origin != RecoDecay::OriginType::NonPrompt) { + // LOG(info) << " --> origin " << static_cast(origin) << ", flag " << static_cast(flag); + //} + } /// end loop over mcParticles } /// end processMc PROCESS_SWITCH(HfCandidateSigmac0plusplusMc, processMc, "Process MC", false); From ec4cffeefb5a57c6bbe6b469561256a9592740d6 Mon Sep 17 00:00:00 2001 From: Mattia Faggin Date: Wed, 16 Apr 2025 11:56:31 +0200 Subject: [PATCH 03/13] Propagate modifications to task. --- PWGHF/D2H/Tasks/taskSigmac.cxx | 115 ++++++++++++++++++++++++--------- 1 file changed, 86 insertions(+), 29 deletions(-) diff --git a/PWGHF/D2H/Tasks/taskSigmac.cxx b/PWGHF/D2H/Tasks/taskSigmac.cxx index 3b86ffa59ff..95da8e5a4fe 100644 --- a/PWGHF/D2H/Tasks/taskSigmac.cxx +++ b/PWGHF/D2H/Tasks/taskSigmac.cxx @@ -28,6 +28,11 @@ using namespace o2; using namespace o2::analysis; using namespace o2::framework; +namespace o2::hf_sigmactask +{ + enum species : int {Sc2455 = 0, Sc2520, NSpecies}; +}; + struct HfTaskSigmac { /// One value of rapidity only /// Remember that in Run2 the distinction among GenLimAcc, GenAccMother, GenAcc was done, where: @@ -262,21 +267,22 @@ struct HfTaskSigmac { const AxisSpec thnAxisGenPtSigmaC{thnConfigAxisGenPt, "#it{p}_{T}^{gen}(#Sigma_{c}^{0,++}) (GeV/#it{c})"}; const AxisSpec thnAxisGenPtLambdaCBMother{thnConfigAxisGenPtB, "#it{p}_{T}^{gen}(#Lambda_{c}^{+} B mother) (GeV/#it{c})"}; const AxisSpec thnAxisGenPtSigmaCBMother{thnConfigAxisGenPtB, "#it{p}_{T}^{gen}(#Sigma_{c}^{0,++} B mother) (GeV/#it{c})"}; + const AxisSpec thnAxisGenSigmaCSpecies = {o2::hf_sigmactask::species::NSpecies, -0.5f, + o2::hf_sigmactask::species::NSpecies - 0.5f, "bin 1: #Sigma_{c}(2455), bin 2: #Sigma_{c}(2520)"}; std::vector axesLambdaCWithMl = {thnAxisPtLambdaC, thnAxisMassLambdaC, thnAxisBdtScoreLcBkg, thnAxisBdtScoreLcNonPrompt, thnAxisOriginMc, thnAxisChannel}; std::vector axesSigmaCWithMl = {thnAxisPtLambdaC, axisDeltaMassSigmaC, thnAxisBdtScoreLcBkg, thnAxisBdtScoreLcNonPrompt, thnAxisOriginMc, thnAxisChannel, thnAxisPtSigmaC, thnAxisChargeSigmaC}; std::vector axesLambdaCWoMl = {thnAxisPtLambdaC, thnAxisMassLambdaC, thnAxisDecLength, thnAxisDecLengthXY, thnAxisCPA, thnAxisCPAXY, thnAxisOriginMc, thnAxisChannel}; std::vector axesSigmaCWoMl = {thnAxisPtLambdaC, axisDeltaMassSigmaC, thnAxisDecLength, thnAxisDecLengthXY, thnAxisCPA, thnAxisCPAXY, thnAxisOriginMc, thnAxisChannel, thnAxisPtSigmaC, thnAxisChargeSigmaC}; if (isMc) { - registry.add("hnLambdaCGen", "THn for Lambdac gen", HistType::kTHnSparseF, {thnAxisGenPtLambdaC, thnAxisGenPtLambdaCBMother, thnAxisOriginMc, thnAxisChannel}); - registry.add("hnSigmaCGen", "THn for Sigmac gen", HistType::kTHnSparseF, {thnAxisGenPtSigmaC, thnAxisGenPtSigmaCBMother, thnAxisOriginMc, thnAxisChannel, thnAxisGenPtLambdaC, thnAxisChargeSigmaC}); + registry.add("MC/generated/hnLambdaCGen", "THn for Lambdac gen", HistType::kTHnSparseF, {thnAxisGenPtLambdaC, thnAxisGenPtLambdaCBMother, thnAxisOriginMc, thnAxisChannel}); + registry.add("MC/generated/hnSigmaCGen", "THn for Sigmac gen", HistType::kTHnSparseF, {thnAxisGenPtSigmaC, thnAxisGenPtSigmaCBMother, thnAxisOriginMc, thnAxisChannel, thnAxisGenPtLambdaC, thnAxisChargeSigmaC, thnAxisGenSigmaCSpecies}); if (doprocessMcWithMl) { axesLambdaCWithMl.push_back(thnAxisGenPtLambdaCBMother); - axesSigmaCWithMl.push_back(thnAxisGenPtSigmaCBMother); + axesSigmaCWithMl.push_back(thnAxisGenPtSigmaCBMother, thnAxisGenSigmaCSpecies); registry.add("hnLambdaC", "THn for Lambdac", HistType::kTHnSparseF, axesLambdaCWithMl); registry.add("hnSigmaC", "THn for Sigmac", HistType::kTHnSparseF, axesSigmaCWithMl); } else { axesLambdaCWoMl.push_back(thnAxisGenPtLambdaCBMother); - axesSigmaCWoMl.push_back(thnAxisGenPtSigmaCBMother); + axesSigmaCWoMl.push_back(thnAxisGenPtSigmaCBMother, thnAxisGenSigmaCSpecies); registry.add("hnLambdaC", "THn for Lambdac", HistType::kTHnSparseF, axesLambdaCWoMl); registry.add("hnSigmaC", "THn for Sigmac", HistType::kTHnSparseF, axesSigmaCWoMl); } @@ -326,6 +332,12 @@ struct HfTaskSigmac { /// loop over the candidate Σc0,++ for (const auto& candSc : candidatesSc) { + /// rapidity selection on Σc0,++ + /// NB: since in data we cannot tag Sc(2455) and Sc(2520), then we use only Sc(2455) for y selection on reconstructed signal + if (yCandRecoMax >= 0. && std::abs(hfHelper.ySc0(candSc)) > yCandRecoMax && std::abs(hfHelper.yScPlusPlus(candSc)) > yCandRecoMax) { + continue; + } + const int8_t chargeSc = candSc.charge(); // either Σc0 or Σc++ /// get the candidate Λc+ used to build the candidate Σc0,++ @@ -554,8 +566,10 @@ struct HfTaskSigmac { /// reject immediately particles different from Σc0,++ bool isSc0Gen = (std::abs(particle.flagMcMatchGen()) == (1 << aod::hf_cand_sigmac::DecayType::Sc0ToPKPiPi)); + bool isScStar0Gen = (std::abs(particle.flagMcMatchGen()) == (1 << aod::hf_cand_sigmac::DecayType::ScStar0ToPKPiPi)); bool isScPlusPlusGen = (std::abs(particle.flagMcMatchGen()) == (1 << aod::hf_cand_sigmac::DecayType::ScplusplusToPKPiPi)); - if (!isSc0Gen && !isScPlusPlusGen) + bool isScStarPlusPlusGen = (std::abs(particle.flagMcMatchGen()) == (1 << aod::hf_cand_sigmac::DecayType::ScStarPlusPlusToPKPiPi)); + if (!isSc0Gen && !isScPlusPlusGen && !isScStar0Gen && !isScStarPlusPlusGen) continue; /// look for generated particles in acceptance @@ -569,8 +583,20 @@ struct HfTaskSigmac { OR consider the new parametrization of the fiducial acceptance (to be seen for reco signal in MC) */ - if (yCandGenMax >= 0. && std::abs(RecoDecay::y(particle.pVector(), o2::constants::physics::MassSigmaC0)) > yCandGenMax) { - continue; + if (yCandGenMax >= 0.) { + double mass = -1; + if(isSc0Gen) { + mass = o2::constants::physics::MassSigmaC0; + } else if (isScPlusPlusGen) { + mass = o2::constants::physics::MassSigmaCPlusPlus; + } else if (isScStar0) { + mass = o2::constants::physics::MassSigmaCStar0; + } else if (isScStarPlusPlus) { + mass = o2::constants::physics::MassSigmaCStarPlusPlus; + } + if (mass > -1. && std::abs(RecoDecay::y(particle.pVector(), mass)) > yCandGenMax) { + continue; + } } /// Get the kinematic information of Σc0,++ and the daughters @@ -617,7 +643,13 @@ struct HfTaskSigmac { } /// Fill histograms - if (isSc0Gen) { + int sigmacSpecies = -1; + if(isSc0Gen || isScPlusPlusGen) { + sigmacSpecies = o2::hf_sigmactask::Sc2455; + } else if(isScStar0Gen || isScStarPlusPlusGen) { + sigmacSpecies = o2::hf_sigmactask::Sc2520; + } + if (isSc0Gen || isScStar0Gen) { /// Generated Σc0 and Λc+ ← Σc0 signals registry.fill(HIST("MC/generated/hPtGenSc0Sig"), ptGenSc, origin, channel); registry.fill(HIST("MC/generated/hEtaGenSc0Sig"), etaGenSc, origin, channel); @@ -639,10 +671,10 @@ struct HfTaskSigmac { registry.fill(HIST("MC/generated/hEtaGenLcFromSc0PlusPlusSig"), etaGenLc, origin, channel); registry.fill(HIST("MC/generated/hPhiGenLcFromSc0PlusPlusSig"), phiGenLc, origin, channel); /// Generated Λc+ ← Σc0,++ signal if (origin == RecoDecay::OriginType::Prompt) { - registry.fill(HIST("hnSigmaCGen"), ptGenSc, ptGenScBMother, origin, channel, ptGenLc, 0); + registry.fill(HIST("MC/generated/hnSigmaCGen"), ptGenSc, ptGenScBMother, origin, channel, ptGenLc, 0, sigmacSpecies); } else { ptGenScBMother = mcParticlesSc.rawIteratorAt(particle.idxBhadMotherPart()).pt(); - registry.fill(HIST("hnSigmaCGen"), ptGenSc, ptGenScBMother, origin, channel, ptGenLc, 0); + registry.fill(HIST("MC/generated/hnSigmaCGen"), ptGenSc, ptGenScBMother, origin, channel, ptGenLc, 0, sigmacSpecies); } // debug -- uncomment if needed @@ -651,7 +683,7 @@ struct HfTaskSigmac { // LOG(info) << " --> (Sc0 gen) origin " << static_cast(origin) << ", particle.originMcGen() " << static_cast(particle.originMcGen()) << ", particle.flagMcMatchGen() " << static_cast(particle.flagMcMatchGen()) << ", pdg " << particle.pdgCode(); //} - } else if (isScPlusPlusGen) { + } else if (isScPlusPlusGen || isScStarPlusPlusGen) { /// Generated Σc++ and Λc+ ← Σc++ signals registry.fill(HIST("MC/generated/hPtGenScPlusPlusSig"), ptGenSc, origin, channel); registry.fill(HIST("MC/generated/hEtaGenScPlusPlusSig"), etaGenSc, origin, channel); @@ -673,10 +705,10 @@ struct HfTaskSigmac { registry.fill(HIST("MC/generated/hEtaGenLcFromSc0PlusPlusSig"), etaGenLc, origin, channel); registry.fill(HIST("MC/generated/hPhiGenLcFromSc0PlusPlusSig"), phiGenLc, origin, channel); /// Generated Λc+ ← Σc0,++ signal if (origin == RecoDecay::OriginType::Prompt) { - registry.fill(HIST("hnSigmaCGen"), ptGenSc, ptGenScBMother, origin, channel, ptGenLc, 2); + registry.fill(HIST("MC/generated/hnSigmaCGen"), ptGenSc, ptGenScBMother, origin, channel, ptGenLc, 2, sigmacSpecies); } else { ptGenScBMother = mcParticlesSc.rawIteratorAt(particle.idxBhadMotherPart()).pt(); - registry.fill(HIST("hnSigmaCGen"), ptGenSc, ptGenScBMother, origin, channel, ptGenLc, 2); + registry.fill(HIST("MC/generated/hnSigmaCGen"), ptGenSc, ptGenScBMother, origin, channel, ptGenLc, 2, sigmacSpecies); } // debug -- uncomment if needed @@ -700,10 +732,10 @@ struct HfTaskSigmac { int origin = particle.originMcGen(); int channel = particle.flagMcDecayChanGen(); if (origin == RecoDecay::OriginType::Prompt) { - registry.fill(HIST("hnLambdaCGen"), ptGenLc, ptGenLcBMother, origin, channel); + registry.fill(HIST("MC/generated/hnLambdaCGen"), ptGenLc, ptGenLcBMother, origin, channel); } else { ptGenLcBMother = mcParticlesLc.rawIteratorAt(particle.idxBhadMotherPart()).pt(); - registry.fill(HIST("hnLambdaCGen"), ptGenLc, ptGenLcBMother, origin, channel); + registry.fill(HIST("MC/generated/hnLambdaCGen"), ptGenLc, ptGenLcBMother, origin, channel); } } /// end loop over Lc generated particles @@ -711,10 +743,12 @@ struct HfTaskSigmac { for (const auto& candSc : candidatesSc) { /// Candidate selected as Σc0 and/or Σc++ - if (!(candSc.hfflag() & 1 << aod::hf_cand_sigmac::DecayType::Sc0ToPKPiPi) && !(candSc.hfflag() & 1 << aod::hf_cand_sigmac::DecayType::ScplusplusToPKPiPi)) { + if (!(candSc.hfflag() & 1 << aod::hf_cand_sigmac::DecayType::Sc0ToPKPiPi) && !(candSc.hfflag() & 1 << aod::hf_cand_sigmac::DecayType::ScplusplusToPKPiPi) && // Σc0,++(2455) + !(candSc.hfflag() & 1 << aod::hf_cand_sigmac::DecayType::ScStar0ToPKPiPi) && !(candSc.hfflag() & 1 << aod::hf_cand_sigmac::DecayType::ScStarPlusPlusToPKPiPi)) { // Σc0,++(2520) continue; } /// rapidity selection on Σc0,++ + /// NB: since in data we cannot tag Sc(2455) and Sc(2520), then we use only Sc(2455) for y selection on reconstructed signal if (yCandRecoMax >= 0. && std::abs(hfHelper.ySc0(candSc)) > yCandRecoMax && std::abs(hfHelper.yScPlusPlus(candSc)) > yCandRecoMax) { continue; } @@ -729,10 +763,24 @@ struct HfTaskSigmac { // candidateLc.flagMcDecayChanRec(); - /// Reconstructed Σc0 signal - if (std::abs(candSc.flagMcMatchRec()) == 1 << aod::hf_cand_sigmac::DecayType::Sc0ToPKPiPi && (chargeSc == 0)) { + bool isTrueSc0Reco = std::abs(candSc.flagMcMatchRec()) == 1 << aod::hf_cand_sigmac::DecayType::Sc0ToPKPiPi; + bool isTrueScStar0Reco = std::abs(candSc.flagMcMatchRec()) == 1 << aod::hf_cand_sigmac::DecayType::ScStar0ToPKPiPi; + bool isTrueScPlusPlusReco = std::abs(candSc.flagMcMatchRec()) == 1 << aod::hf_cand_sigmac::DecayType::ScplusplusToPKPiPi; + bool isTrueScStarPlusPlusReco = std::abs(candSc.flagMcMatchRec()) == 1 << aod::hf_cand_sigmac::DecayType::ScStarPlusPlusToPKPiPi; + int sigmacSpecies = -1; + if ((isTrueSc0Reco || isTrueScStar0Reco) && (chargeSc == 0)) { + /// Reconstructed Σc0 signal // Get the corresponding MC particle for Sc, found as the mother of the soft pion - auto indexMcScRec = RecoDecay::getMother(mcParticles, candSc.prong1_as().mcParticle(), o2::constants::physics::Pdg::kSigmaC0, true); + int indexMcScRec = -1; + if(isTrueSc0Reco) { + // Σc0(2455) + indexMcScRec = RecoDecay::getMother(mcParticles, candSc.prong1_as().mcParticle(), o2::constants::physics::Pdg::kSigmaC0, true); + sigmacSpecies = o2::hf_sigmactask::Sc2455; + } else if (isTrueScStar0Reco) { + // Σc0(2520) + indexMcScRec = RecoDecay::getMother(mcParticles, candSc.prong1_as().mcParticle(), o2::constants::physics::Pdg::kSigmaCStar0, true); + sigmacSpecies = o2::hf_sigmactask::Sc2520; + } auto particleSc = mcParticles.rawIteratorAt(indexMcScRec); // Get the corresponding MC particle for Lc auto arrayDaughtersLc = std::array{candidateLc.template prong0_as(), candidateLc.template prong1_as(), candidateLc.template prong2_as()}; @@ -821,10 +869,10 @@ struct HfTaskSigmac { outputMl.at(0) = candidateLc.mlProbLcToPKPi()[0]; /// bkg score outputMl.at(1) = candidateLc.mlProbLcToPKPi()[2]; /// non-prompt score } - registry.get(HIST("hnSigmaC"))->Fill(ptLc, deltaMass, outputMl.at(0), outputMl.at(1), origin, channel, ptSc, std::abs(chargeSc), candSc.ptBhadMotherPart()); + registry.get(HIST("hnSigmaC"))->Fill(ptLc, deltaMass, outputMl.at(0), outputMl.at(1), origin, channel, ptSc, std::abs(chargeSc), candSc.ptBhadMotherPart(), sigmaSpecies); } else { /// fill w/o BDT information - registry.get(HIST("hnSigmaC"))->Fill(ptLc, deltaMass, decLengthLc, decLengthXYLc, cpaLc, cpaXYLc, origin, channel, ptSc, std::abs(chargeSc), candSc.ptBhadMotherPart()); + registry.get(HIST("hnSigmaC"))->Fill(ptLc, deltaMass, decLengthLc, decLengthXYLc, cpaLc, cpaXYLc, origin, channel, ptSc, std::abs(chargeSc), candSc.ptBhadMotherPart(), sigmaSpecies); } } @@ -895,19 +943,28 @@ struct HfTaskSigmac { outputMl.at(0) = candidateLc.mlProbLcToPiKP()[0]; /// bkg score outputMl.at(1) = candidateLc.mlProbLcToPiKP()[2]; /// non-prompt score } - registry.get(HIST("hnSigmaC"))->Fill(ptLc, deltaMass, outputMl.at(0), outputMl.at(1), origin, channel, ptSc, std::abs(chargeSc), candSc.ptBhadMotherPart()); + registry.get(HIST("hnSigmaC"))->Fill(ptLc, deltaMass, outputMl.at(0), outputMl.at(1), origin, channel, ptSc, std::abs(chargeSc), candSc.ptBhadMotherPart(), sigmacSpecies); } else { /// fill w/o BDT information - registry.get(HIST("hnSigmaC"))->Fill(ptLc, deltaMass, decLengthLc, decLengthXYLc, cpaLc, cpaXYLc, origin, channel, ptSc, std::abs(chargeSc), candSc.ptBhadMotherPart()); + registry.get(HIST("hnSigmaC"))->Fill(ptLc, deltaMass, decLengthLc, decLengthXYLc, cpaLc, cpaXYLc, origin, channel, ptSc, std::abs(chargeSc), candSc.ptBhadMotherPart(), sigmacSpecies); } } } /// end candidate Λc+ → π+K-p (and charge conjugate) /// end reconstructed Σc0 signal - } else if (std::abs(candSc.flagMcMatchRec()) == 1 << aod::hf_cand_sigmac::DecayType::ScplusplusToPKPiPi && (std::abs(chargeSc) == 2)) { + } else if ((isTrueScPlusPlusReco && isTrueScStarPlusPlusReco) && (std::abs(chargeSc) == 2)) { /// Reconstructed Σc++ signal // Get the corresponding MC particle for Sc, found as the mother of the soft pion - auto indexMcScRec = RecoDecay::getMother(mcParticles, candSc.prong1_as().mcParticle(), o2::constants::physics::Pdg::kSigmaCPlusPlus, true); + int indexMcScRec = -1; + if(isTrueSc0Reco) { + // Σc0(2455) + indexMcScRec = RecoDecay::getMother(mcParticles, candSc.prong1_as().mcParticle(), o2::constants::physics::Pdg::kSigmaCPlusPlus, true); + sigmacSpecies = o2::hf_sigmactask::Sc2455; + } else if (isTrueScStar0Reco) { + // Σc0(2520) + indexMcScRec = RecoDecay::getMother(mcParticles, candSc.prong1_as().mcParticle(), o2::constants::physics::Pdg::kSigmaCStarPlusPlus, true); + sigmacSpecies = o2::hf_sigmactask::Sc2520; + } auto particleSc = mcParticles.rawIteratorAt(indexMcScRec); // Get the corresponding MC particle for Lc auto arrayDaughtersLc = std::array{candidateLc.template prong0_as(), candidateLc.template prong1_as(), candidateLc.template prong2_as()}; @@ -996,10 +1053,10 @@ struct HfTaskSigmac { outputMl.at(0) = candidateLc.mlProbLcToPKPi()[0]; /// bkg score outputMl.at(1) = candidateLc.mlProbLcToPKPi()[2]; /// non-prompt score } - registry.get(HIST("hnSigmaC"))->Fill(ptLc, deltaMass, outputMl.at(0), outputMl.at(1), origin, channel, ptSc, std::abs(chargeSc), candSc.ptBhadMotherPart()); + registry.get(HIST("hnSigmaC"))->Fill(ptLc, deltaMass, outputMl.at(0), outputMl.at(1), origin, channel, ptSc, std::abs(chargeSc), candSc.ptBhadMotherPart(), sigmacSpecies); } else { /// fill w/o BDT information - registry.get(HIST("hnSigmaC"))->Fill(ptLc, deltaMass, decLengthLc, decLengthXYLc, cpaLc, cpaXYLc, origin, channel, ptSc, std::abs(chargeSc), candSc.ptBhadMotherPart()); + registry.get(HIST("hnSigmaC"))->Fill(ptLc, deltaMass, decLengthLc, decLengthXYLc, cpaLc, cpaXYLc, origin, channel, ptSc, std::abs(chargeSc), candSc.ptBhadMotherPart(), sigmacSpecies); } } @@ -1068,10 +1125,10 @@ struct HfTaskSigmac { outputMl.at(0) = candidateLc.mlProbLcToPiKP()[0]; /// bkg score outputMl.at(1) = candidateLc.mlProbLcToPiKP()[2]; /// non-prompt score } - registry.get(HIST("hnSigmaC"))->Fill(ptLc, deltaMass, outputMl.at(0), outputMl.at(1), origin, channel, ptSc, std::abs(chargeSc), candSc.ptBhadMotherPart()); + registry.get(HIST("hnSigmaC"))->Fill(ptLc, deltaMass, outputMl.at(0), outputMl.at(1), origin, channel, ptSc, std::abs(chargeSc), candSc.ptBhadMotherPart(), sigmacSpecies); } else { /// fill w/o BDT information - registry.get(HIST("hnSigmaC"))->Fill(ptLc, deltaMass, decLengthLc, decLengthXYLc, cpaLc, cpaXYLc, origin, channel, ptSc, std::abs(chargeSc), candSc.ptBhadMotherPart()); + registry.get(HIST("hnSigmaC"))->Fill(ptLc, deltaMass, decLengthLc, decLengthXYLc, cpaLc, cpaXYLc, origin, channel, ptSc, std::abs(chargeSc), candSc.ptBhadMotherPart(), sigmacSpecies); } } From 1d08ce1ef79091423cb814cfa9324611cc5ad515 Mon Sep 17 00:00:00 2001 From: Mattia Faggin Date: Wed, 16 Apr 2025 12:02:24 +0200 Subject: [PATCH 04/13] Some fixes. --- PWGHF/D2H/Tasks/taskSigmac.cxx | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/PWGHF/D2H/Tasks/taskSigmac.cxx b/PWGHF/D2H/Tasks/taskSigmac.cxx index 95da8e5a4fe..3d305684181 100644 --- a/PWGHF/D2H/Tasks/taskSigmac.cxx +++ b/PWGHF/D2H/Tasks/taskSigmac.cxx @@ -30,7 +30,9 @@ using namespace o2::framework; namespace o2::hf_sigmactask { - enum species : int {Sc2455 = 0, Sc2520, NSpecies}; +enum species : int { Sc2455 = 0, + Sc2520, + NSpecies }; }; struct HfTaskSigmac { @@ -267,7 +269,7 @@ struct HfTaskSigmac { const AxisSpec thnAxisGenPtSigmaC{thnConfigAxisGenPt, "#it{p}_{T}^{gen}(#Sigma_{c}^{0,++}) (GeV/#it{c})"}; const AxisSpec thnAxisGenPtLambdaCBMother{thnConfigAxisGenPtB, "#it{p}_{T}^{gen}(#Lambda_{c}^{+} B mother) (GeV/#it{c})"}; const AxisSpec thnAxisGenPtSigmaCBMother{thnConfigAxisGenPtB, "#it{p}_{T}^{gen}(#Sigma_{c}^{0,++} B mother) (GeV/#it{c})"}; - const AxisSpec thnAxisGenSigmaCSpecies = {o2::hf_sigmactask::species::NSpecies, -0.5f, + o2::hf_sigmactask::species::NSpecies - 0.5f, "bin 1: #Sigma_{c}(2455), bin 2: #Sigma_{c}(2520)"}; + const AxisSpec thnAxisGenSigmaCSpecies = {o2::hf_sigmactask::species::NSpecies, -0.5f, +o2::hf_sigmactask::species::NSpecies - 0.5f, "bin 1: #Sigma_{c}(2455), bin 2: #Sigma_{c}(2520)"}; std::vector axesLambdaCWithMl = {thnAxisPtLambdaC, thnAxisMassLambdaC, thnAxisBdtScoreLcBkg, thnAxisBdtScoreLcNonPrompt, thnAxisOriginMc, thnAxisChannel}; std::vector axesSigmaCWithMl = {thnAxisPtLambdaC, axisDeltaMassSigmaC, thnAxisBdtScoreLcBkg, thnAxisBdtScoreLcNonPrompt, thnAxisOriginMc, thnAxisChannel, thnAxisPtSigmaC, thnAxisChargeSigmaC}; std::vector axesLambdaCWoMl = {thnAxisPtLambdaC, thnAxisMassLambdaC, thnAxisDecLength, thnAxisDecLengthXY, thnAxisCPA, thnAxisCPAXY, thnAxisOriginMc, thnAxisChannel}; @@ -277,12 +279,14 @@ struct HfTaskSigmac { registry.add("MC/generated/hnSigmaCGen", "THn for Sigmac gen", HistType::kTHnSparseF, {thnAxisGenPtSigmaC, thnAxisGenPtSigmaCBMother, thnAxisOriginMc, thnAxisChannel, thnAxisGenPtLambdaC, thnAxisChargeSigmaC, thnAxisGenSigmaCSpecies}); if (doprocessMcWithMl) { axesLambdaCWithMl.push_back(thnAxisGenPtLambdaCBMother); - axesSigmaCWithMl.push_back(thnAxisGenPtSigmaCBMother, thnAxisGenSigmaCSpecies); + axesSigmaCWithMl.push_back(thnAxisGenPtSigmaCBMother); + axesSigmaCWithMl.push_back(thnAxisGenSigmaCSpecies); registry.add("hnLambdaC", "THn for Lambdac", HistType::kTHnSparseF, axesLambdaCWithMl); registry.add("hnSigmaC", "THn for Sigmac", HistType::kTHnSparseF, axesSigmaCWithMl); } else { axesLambdaCWoMl.push_back(thnAxisGenPtLambdaCBMother); - axesSigmaCWoMl.push_back(thnAxisGenPtSigmaCBMother, thnAxisGenSigmaCSpecies); + axesSigmaCWoMl.push_back(thnAxisGenPtSigmaCBMother); + axesSigmaCWoMl.push_back(thnAxisGenSigmaCSpecies); registry.add("hnLambdaC", "THn for Lambdac", HistType::kTHnSparseF, axesLambdaCWoMl); registry.add("hnSigmaC", "THn for Sigmac", HistType::kTHnSparseF, axesSigmaCWoMl); } @@ -585,13 +589,13 @@ struct HfTaskSigmac { */ if (yCandGenMax >= 0.) { double mass = -1; - if(isSc0Gen) { + if (isSc0Gen) { mass = o2::constants::physics::MassSigmaC0; } else if (isScPlusPlusGen) { mass = o2::constants::physics::MassSigmaCPlusPlus; - } else if (isScStar0) { + } else if (isScStar0Gen) { mass = o2::constants::physics::MassSigmaCStar0; - } else if (isScStarPlusPlus) { + } else if (isScStarPlusPlusGen) { mass = o2::constants::physics::MassSigmaCStarPlusPlus; } if (mass > -1. && std::abs(RecoDecay::y(particle.pVector(), mass)) > yCandGenMax) { @@ -644,9 +648,9 @@ struct HfTaskSigmac { /// Fill histograms int sigmacSpecies = -1; - if(isSc0Gen || isScPlusPlusGen) { + if (isSc0Gen || isScPlusPlusGen) { sigmacSpecies = o2::hf_sigmactask::Sc2455; - } else if(isScStar0Gen || isScStarPlusPlusGen) { + } else if (isScStar0Gen || isScStarPlusPlusGen) { sigmacSpecies = o2::hf_sigmactask::Sc2520; } if (isSc0Gen || isScStar0Gen) { @@ -743,8 +747,8 @@ struct HfTaskSigmac { for (const auto& candSc : candidatesSc) { /// Candidate selected as Σc0 and/or Σc++ - if (!(candSc.hfflag() & 1 << aod::hf_cand_sigmac::DecayType::Sc0ToPKPiPi) && !(candSc.hfflag() & 1 << aod::hf_cand_sigmac::DecayType::ScplusplusToPKPiPi) && // Σc0,++(2455) - !(candSc.hfflag() & 1 << aod::hf_cand_sigmac::DecayType::ScStar0ToPKPiPi) && !(candSc.hfflag() & 1 << aod::hf_cand_sigmac::DecayType::ScStarPlusPlusToPKPiPi)) { // Σc0,++(2520) + if (!(candSc.hfflag() & 1 << aod::hf_cand_sigmac::DecayType::Sc0ToPKPiPi) && !(candSc.hfflag() & 1 << aod::hf_cand_sigmac::DecayType::ScplusplusToPKPiPi) && // Σc0,++(2455) + !(candSc.hfflag() & 1 << aod::hf_cand_sigmac::DecayType::ScStar0ToPKPiPi) && !(candSc.hfflag() & 1 << aod::hf_cand_sigmac::DecayType::ScStarPlusPlusToPKPiPi)) { // Σc0,++(2520) continue; } /// rapidity selection on Σc0,++ @@ -772,7 +776,7 @@ struct HfTaskSigmac { /// Reconstructed Σc0 signal // Get the corresponding MC particle for Sc, found as the mother of the soft pion int indexMcScRec = -1; - if(isTrueSc0Reco) { + if (isTrueSc0Reco) { // Σc0(2455) indexMcScRec = RecoDecay::getMother(mcParticles, candSc.prong1_as().mcParticle(), o2::constants::physics::Pdg::kSigmaC0, true); sigmacSpecies = o2::hf_sigmactask::Sc2455; @@ -956,7 +960,7 @@ struct HfTaskSigmac { /// Reconstructed Σc++ signal // Get the corresponding MC particle for Sc, found as the mother of the soft pion int indexMcScRec = -1; - if(isTrueSc0Reco) { + if (isTrueSc0Reco) { // Σc0(2455) indexMcScRec = RecoDecay::getMother(mcParticles, candSc.prong1_as().mcParticle(), o2::constants::physics::Pdg::kSigmaCPlusPlus, true); sigmacSpecies = o2::hf_sigmactask::Sc2455; From 17ccb38288d881e47f0438cac83c40f48f9f4d36 Mon Sep 17 00:00:00 2001 From: Mattia Faggin Date: Tue, 22 Apr 2025 10:31:49 +0200 Subject: [PATCH 05/13] Fix typos. --- PWGHF/D2H/Tasks/taskSigmac.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PWGHF/D2H/Tasks/taskSigmac.cxx b/PWGHF/D2H/Tasks/taskSigmac.cxx index 3d305684181..d4626eacbbe 100644 --- a/PWGHF/D2H/Tasks/taskSigmac.cxx +++ b/PWGHF/D2H/Tasks/taskSigmac.cxx @@ -873,10 +873,10 @@ struct HfTaskSigmac { outputMl.at(0) = candidateLc.mlProbLcToPKPi()[0]; /// bkg score outputMl.at(1) = candidateLc.mlProbLcToPKPi()[2]; /// non-prompt score } - registry.get(HIST("hnSigmaC"))->Fill(ptLc, deltaMass, outputMl.at(0), outputMl.at(1), origin, channel, ptSc, std::abs(chargeSc), candSc.ptBhadMotherPart(), sigmaSpecies); + registry.get(HIST("hnSigmaC"))->Fill(ptLc, deltaMass, outputMl.at(0), outputMl.at(1), origin, channel, ptSc, std::abs(chargeSc), candSc.ptBhadMotherPart(), sigmacSpecies); } else { /// fill w/o BDT information - registry.get(HIST("hnSigmaC"))->Fill(ptLc, deltaMass, decLengthLc, decLengthXYLc, cpaLc, cpaXYLc, origin, channel, ptSc, std::abs(chargeSc), candSc.ptBhadMotherPart(), sigmaSpecies); + registry.get(HIST("hnSigmaC"))->Fill(ptLc, deltaMass, decLengthLc, decLengthXYLc, cpaLc, cpaXYLc, origin, channel, ptSc, std::abs(chargeSc), candSc.ptBhadMotherPart(), sigmacSpecies); } } From 5612f19fe34d53e6f2cca55f729c2c26f00e77b2 Mon Sep 17 00:00:00 2001 From: Mattia Faggin Date: Tue, 22 Apr 2025 10:46:13 +0200 Subject: [PATCH 06/13] Fix MC matching for C=2 states. --- PWGHF/D2H/Tasks/taskSigmac.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PWGHF/D2H/Tasks/taskSigmac.cxx b/PWGHF/D2H/Tasks/taskSigmac.cxx index d4626eacbbe..47240a424d0 100644 --- a/PWGHF/D2H/Tasks/taskSigmac.cxx +++ b/PWGHF/D2H/Tasks/taskSigmac.cxx @@ -960,11 +960,11 @@ struct HfTaskSigmac { /// Reconstructed Σc++ signal // Get the corresponding MC particle for Sc, found as the mother of the soft pion int indexMcScRec = -1; - if (isTrueSc0Reco) { + if (isTrueScPlusPlusReco) { // Σc0(2455) indexMcScRec = RecoDecay::getMother(mcParticles, candSc.prong1_as().mcParticle(), o2::constants::physics::Pdg::kSigmaCPlusPlus, true); sigmacSpecies = o2::hf_sigmactask::Sc2455; - } else if (isTrueScStar0Reco) { + } else if (isTrueScStarPlusPlusReco) { // Σc0(2520) indexMcScRec = RecoDecay::getMother(mcParticles, candSc.prong1_as().mcParticle(), o2::constants::physics::Pdg::kSigmaCStarPlusPlus, true); sigmacSpecies = o2::hf_sigmactask::Sc2520; From 79dbd1b8adcafefa39ec503b99d08234ac6ff582 Mon Sep 17 00:00:00 2001 From: Mattia Faggin Date: Tue, 22 Apr 2025 13:49:45 +0200 Subject: [PATCH 07/13] Further fix MC matching for q=2 states. --- PWGHF/D2H/Tasks/taskSigmac.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGHF/D2H/Tasks/taskSigmac.cxx b/PWGHF/D2H/Tasks/taskSigmac.cxx index 47240a424d0..c76e9dde36e 100644 --- a/PWGHF/D2H/Tasks/taskSigmac.cxx +++ b/PWGHF/D2H/Tasks/taskSigmac.cxx @@ -956,7 +956,7 @@ struct HfTaskSigmac { } /// end candidate Λc+ → π+K-p (and charge conjugate) /// end reconstructed Σc0 signal - } else if ((isTrueScPlusPlusReco && isTrueScStarPlusPlusReco) && (std::abs(chargeSc) == 2)) { + } else if ((isTrueScPlusPlusReco || isTrueScStarPlusPlusReco) && (std::abs(chargeSc) == 2)) { /// Reconstructed Σc++ signal // Get the corresponding MC particle for Sc, found as the mother of the soft pion int indexMcScRec = -1; From 75bb77ae49b13174d3ad4b223c9465609216b661 Mon Sep 17 00:00:00 2001 From: Mattia Faggin Date: Tue, 22 Apr 2025 15:50:20 +0200 Subject: [PATCH 08/13] Use bitmap to check pKpi and piKp decays. --- PWGHF/D2H/Tasks/taskSigmac.cxx | 31 ++++++++++++++++++------------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/PWGHF/D2H/Tasks/taskSigmac.cxx b/PWGHF/D2H/Tasks/taskSigmac.cxx index c76e9dde36e..de3432f0deb 100644 --- a/PWGHF/D2H/Tasks/taskSigmac.cxx +++ b/PWGHF/D2H/Tasks/taskSigmac.cxx @@ -24,6 +24,8 @@ #include "PWGHF/DataModel/CandidateReconstructionTables.h" #include "PWGHF/DataModel/CandidateSelectionTables.h" +#include + using namespace o2; using namespace o2::analysis; using namespace o2::framework; @@ -33,7 +35,10 @@ namespace o2::hf_sigmactask enum species : int { Sc2455 = 0, Sc2520, NSpecies }; -}; +enum decays : int { pkpi = 0, + pikp, + NDecays }; +}; // namespace o2::hf_sigmactask struct HfTaskSigmac { /// One value of rapidity only @@ -310,16 +315,16 @@ struct HfTaskSigmac { /// @param candSc Sc candidate /// @return 0: none; 1: only Λc+ → pK-π+ possible; 2: Λc+ → π+K-p possible; 3: both possible template - int isDecayToPKPiToPiKP(L& candidateLc, S& candSc) + int8_t isDecayToPKPiToPiKP(L& candidateLc, S& candSc) { - int channel = 0; + int8_t channel = 0; if ((candidateLc.isSelLcToPKPi() >= 1) && candSc.statusSpreadLcMinvPKPiFromPDG()) { // Λc+ → pK-π+ and within the requested mass to build the Σc0,++ - channel += 1; + SETBIT(channel, o2::hf_sigmactask::decays::pkpi); } if ((candidateLc.isSelLcToPiKP() >= 1) && candSc.statusSpreadLcMinvPiKPFromPDG()) { // Λc+ → π+K-p and within the requested mass to build the Σc0,++ - channel += 2; + SETBIT(channel, o2::hf_sigmactask::decays::pikp); } return channel; /// 0: none; 1: pK-π+ only; 2: π+K-p only; 3: both possible } @@ -349,7 +354,7 @@ struct HfTaskSigmac { const auto& candidateLc = candSc.prongLc_as(); // const int iscandidateLcpKpi = (candidateLc.isSelLcToPKPi() >= 1) && candSc.statusSpreadLcMinvPKPiFromPDG(); // Λc+ → pK-π+ and within the requested mass to build the Σc0,++ // const int iscandidateLcpiKp = (candidateLc.isSelLcToPiKP() >= 1) && candSc.statusSpreadLcMinvPiKPFromPDG(); // Λc+ → π+K-p and within the requested mass to build the Σc0,++ - const int isCandPKPiPiKP = isDecayToPKPiToPiKP(candidateLc, candSc); + const int8_t isCandPKPiPiKP = isDecayToPKPiToPiKP(candidateLc, candSc); double massSc(-1.), massLc(-1.), deltaMass(-1.); double ptSc(candSc.pt()), ptLc(candidateLc.pt()); double etaSc(candSc.eta()), etaLc(candidateLc.eta()); @@ -358,7 +363,7 @@ struct HfTaskSigmac { double decLengthLc(candidateLc.decayLength()), decLengthXYLc(candidateLc.decayLengthXY()); double cpaLc(candidateLc.cpa()), cpaXYLc(candidateLc.cpaXY()); /// candidate Λc+ → pK-π+ (and charge conjugate) within the range of M(pK-π+) chosen in the Σc0,++ builder - if (isCandPKPiPiKP == 1 || isCandPKPiPiKP == 3) { + if (TESTBIT(isCandPKPiPiKP, o2::hf_sigmactask::decays::pkpi)) { massSc = hfHelper.invMassScRecoLcToPKPi(candSc, candidateLc); massLc = hfHelper.invMassLcToPKPi(candidateLc); deltaMass = massSc - massLc; @@ -431,7 +436,7 @@ struct HfTaskSigmac { } } /// end candidate Λc+ → pK-π+ (and charge conjugate) /// candidate Λc+ → π+K-p (and charge conjugate) within the range of M(π+K-p) chosen in the Σc0,++ builder - if (isCandPKPiPiKP == 2 || isCandPKPiPiKP == 3) { + if (TESTBIT(isCandPKPiPiKP, o2::hf_sigmactask::decays::pikp)) { massSc = hfHelper.invMassScRecoLcToPiKP(candSc, candidateLc); massLc = hfHelper.invMassLcToPiKP(candidateLc); deltaMass = massSc - massLc; @@ -763,7 +768,7 @@ struct HfTaskSigmac { /// get the candidate Λc+ used to build the Σc0 /// and understand which mass hypotheses are possible const auto& candidateLc = candSc.prongLc_as(); - const int isCandPKPiPiKP = isDecayToPKPiToPiKP(candidateLc, candSc); + const int8_t isCandPKPiPiKP = isDecayToPKPiToPiKP(candidateLc, candSc); // candidateLc.flagMcDecayChanRec(); @@ -808,7 +813,7 @@ struct HfTaskSigmac { auto channel = candidateLc.flagMcDecayChanRec(); /// 0: direct; 1: Λc± → p± K*; 2: Λc± → Δ(1232)±± K∓; 3: Λc± → Λ(1520) π± /// candidate Λc+ → pK-π+ (and charge conjugate) within the range of M(pK-π+) chosen in the Σc0,++ builder - if ((isCandPKPiPiKP == 1 || isCandPKPiPiKP == 3) && std::abs(candidateLc.template prong0_as().mcParticle().pdgCode()) == kProton) { + if ((TESTBIT(isCandPKPiPiKP, o2::hf_sigmactask::decays::pkpi)) && std::abs(candidateLc.template prong0_as().mcParticle().pdgCode()) == kProton) { massSc = hfHelper.invMassScRecoLcToPKPi(candSc, candidateLc); massLc = hfHelper.invMassLcToPKPi(candidateLc); deltaMass = massSc - massLc; @@ -882,7 +887,7 @@ struct HfTaskSigmac { } /// end candidate Λc+ → pK-π+ (and charge conjugate) /// candidate Λc+ → π+K-p (and charge conjugate) within the range of M(π+K-p) chosen in the Σc0,++ builder - if ((isCandPKPiPiKP == 2 || isCandPKPiPiKP == 3) && std::abs(candidateLc.template prong0_as().mcParticle().pdgCode()) == kPiPlus) { + if ((TESTBIT(isCandPKPiPiKP, o2::hf_sigmactask::decays::pikp)) && std::abs(candidateLc.template prong0_as().mcParticle().pdgCode()) == kPiPlus) { massSc = hfHelper.invMassScRecoLcToPiKP(candSc, candidateLc); massLc = hfHelper.invMassLcToPiKP(candidateLc); deltaMass = massSc - massLc; @@ -992,7 +997,7 @@ struct HfTaskSigmac { auto channel = candidateLc.flagMcDecayChanRec(); /// 0: direct; 1: Λc± → p± K*; 2: Λc± → Δ(1232)±± K∓; 3: Λc± → Λ(1520) π± /// candidate Λc+ → pK-π+ (and charge conjugate) within the range of M(pK-π+) chosen in the Σc0,++ builder - if ((isCandPKPiPiKP == 1 || isCandPKPiPiKP == 3) && std::abs(candidateLc.template prong0_as().mcParticle().pdgCode()) == kProton) { + if ((TESTBIT(isCandPKPiPiKP, o2::hf_sigmactask::decays::pkpi)) && std::abs(candidateLc.template prong0_as().mcParticle().pdgCode()) == kProton) { massSc = hfHelper.invMassScRecoLcToPKPi(candSc, candidateLc); massLc = hfHelper.invMassLcToPKPi(candidateLc); deltaMass = massSc - massLc; @@ -1066,7 +1071,7 @@ struct HfTaskSigmac { } /// end candidate Λc+ → pK-π+ (and charge conjugate) /// candidate Λc+ → π+K-p (and charge conjugate) within the range of M(π+K-p) chosen in the Σc0,++ builder - if ((isCandPKPiPiKP == 2 || isCandPKPiPiKP == 3) && std::abs(candidateLc.template prong0_as().mcParticle().pdgCode()) == kPiPlus) { + if ((TESTBIT(isCandPKPiPiKP, o2::hf_sigmactask::decays::pikp)) && std::abs(candidateLc.template prong0_as().mcParticle().pdgCode()) == kPiPlus) { massSc = hfHelper.invMassScRecoLcToPiKP(candSc, candidateLc); massLc = hfHelper.invMassLcToPiKP(candidateLc); deltaMass = massSc - massLc; From 7f3a76ac6b0d2fb44b8358157933a269dfb86f1d Mon Sep 17 00:00:00 2001 From: Mattia Faggin Date: Tue, 22 Apr 2025 16:06:51 +0200 Subject: [PATCH 09/13] Try to fix O2 linter issues. --- PWGHF/D2H/Tasks/taskSigmac.cxx | 69 ++++++++++++++++++---------------- 1 file changed, 36 insertions(+), 33 deletions(-) diff --git a/PWGHF/D2H/Tasks/taskSigmac.cxx b/PWGHF/D2H/Tasks/taskSigmac.cxx index de3432f0deb..bfc09bb7230 100644 --- a/PWGHF/D2H/Tasks/taskSigmac.cxx +++ b/PWGHF/D2H/Tasks/taskSigmac.cxx @@ -32,12 +32,14 @@ using namespace o2::framework; namespace o2::hf_sigmactask { -enum species : int { Sc2455 = 0, +enum Species : int { Sc2455 = 0, Sc2520, NSpecies }; -enum decays : int { pkpi = 0, - pikp, +enum Decays : int { PKPi = 0, + PiKP, NDecays }; +const int chargeNull = 0; +const int chargePlusPlus = 2; }; // namespace o2::hf_sigmactask struct HfTaskSigmac { @@ -65,6 +67,23 @@ struct HfTaskSigmac { ConfigurableAxis configAxisDeltaMassSigmaC{"configAxisDeltaMassSigmaC", {200, 0.13, 0.23}, ""}; ConfigurableAxis thnConfigAxisBdtScoreLcBkg{"thnConfigAxisBdtScoreLcBkg", {100, 0., 1.}, ""}; ConfigurableAxis thnConfigAxisBdtScoreLcNonPrompt{"thnConfigAxisBdtScoreLcNonPrompt", {100, 0., 1.}, ""}; + const AxisSpec thnAxisMassLambdaC{configAxisMassLambdaC, "inv. mass (p K #pi) (GeV/#it{c}^{2})"}; + const AxisSpec thnAxisPtLambdaC{thnConfigAxisPt, "#it{p}_{T}(#Lambda_{c}^{+}) (GeV/#it{c})"}; + const AxisSpec thnAxisPtSigmaC{thnConfigAxisPt, "#it{p}_{T}(#Sigma_{c}^{0,++}) (GeV/#it{c})"}; + const AxisSpec thnAxisDecLength{thnConfigAxisDecLength, "decay length #Lambda_{c}^{+} (cm)"}; + const AxisSpec thnAxisDecLengthXY{thnConfigAxisDecLengthXY, "decay length XY #Lambda_{c}^{+} (cm)"}; + const AxisSpec thnAxisCPA{thnConfigAxisCPA, "cosine of pointing angle #Lambda_{c}^{+}"}; + const AxisSpec thnAxisCPAXY{thnConfigAxisCPAXY, "cosine of pointing angle XY #Lambda_{c}^{+}"}; + const AxisSpec thnAxisOriginMc{3, -0.5, 2.5, "0: none, 1: prompt, 2: non-prompt"}; + const AxisSpec thnAxisChargeSigmaC{3, -0.5, 2.5, "#Sigma_{c}-baryon charge"}; + const AxisSpec thnAxisChannel{4, -0.5, 3.5, "0: direct 1,2,3: resonant"}; + const AxisSpec thnAxisBdtScoreLcBkg{thnConfigAxisBdtScoreLcBkg, "BDT bkg score (Lc)"}; + const AxisSpec thnAxisBdtScoreLcNonPrompt{thnConfigAxisBdtScoreLcNonPrompt, "BDT non-prompt score (Lc)"}; + const AxisSpec thnAxisGenPtLambdaC{thnConfigAxisGenPt, "#it{p}_{T}^{gen}(#Lambda_{c}^{+}) (GeV/#it{c})"}; + const AxisSpec thnAxisGenPtSigmaC{thnConfigAxisGenPt, "#it{p}_{T}^{gen}(#Sigma_{c}^{0,++}) (GeV/#it{c})"}; + const AxisSpec thnAxisGenPtLambdaCBMother{thnConfigAxisGenPtB, "#it{p}_{T}^{gen}(#Lambda_{c}^{+} B mother) (GeV/#it{c})"}; + const AxisSpec thnAxisGenPtSigmaCBMother{thnConfigAxisGenPtB, "#it{p}_{T}^{gen}(#Sigma_{c}^{0,++} B mother) (GeV/#it{c})"}; + const AxisSpec thnAxisGenSigmaCSpecies = {o2::hf_sigmactask::Species::NSpecies, -0.5f, +o2::hf_sigmactask::Species::NSpecies - 0.5f, "bin 1: #Sigma_{c}(2455), bin 2: #Sigma_{c}(2520)"}; HfHelper hfHelper; @@ -258,23 +277,6 @@ struct HfTaskSigmac { /// THn for candidate Λc+ and Σc0,++ cut variation if (enableTHn) { - const AxisSpec thnAxisMassLambdaC{configAxisMassLambdaC, "inv. mass (p K #pi) (GeV/#it{c}^{2})"}; - const AxisSpec thnAxisPtLambdaC{thnConfigAxisPt, "#it{p}_{T}(#Lambda_{c}^{+}) (GeV/#it{c})"}; - const AxisSpec thnAxisPtSigmaC{thnConfigAxisPt, "#it{p}_{T}(#Sigma_{c}^{0,++}) (GeV/#it{c})"}; - const AxisSpec thnAxisDecLength{thnConfigAxisDecLength, "decay length #Lambda_{c}^{+} (cm)"}; - const AxisSpec thnAxisDecLengthXY{thnConfigAxisDecLengthXY, "decay length XY #Lambda_{c}^{+} (cm)"}; - const AxisSpec thnAxisCPA{thnConfigAxisCPA, "cosine of pointing angle #Lambda_{c}^{+}"}; - const AxisSpec thnAxisCPAXY{thnConfigAxisCPAXY, "cosine of pointing angle XY #Lambda_{c}^{+}"}; - const AxisSpec thnAxisOriginMc{3, -0.5, 2.5, "0: none, 1: prompt, 2: non-prompt"}; - const AxisSpec thnAxisChargeSigmaC{3, -0.5, 2.5, "#Sigma_{c}-baryon charge"}; - const AxisSpec thnAxisChannel{4, -0.5, 3.5, "0: direct 1,2,3: resonant"}; - const AxisSpec thnAxisBdtScoreLcBkg{thnConfigAxisBdtScoreLcBkg, "BDT bkg score (Lc)"}; - const AxisSpec thnAxisBdtScoreLcNonPrompt{thnConfigAxisBdtScoreLcNonPrompt, "BDT non-prompt score (Lc)"}; - const AxisSpec thnAxisGenPtLambdaC{thnConfigAxisGenPt, "#it{p}_{T}^{gen}(#Lambda_{c}^{+}) (GeV/#it{c})"}; - const AxisSpec thnAxisGenPtSigmaC{thnConfigAxisGenPt, "#it{p}_{T}^{gen}(#Sigma_{c}^{0,++}) (GeV/#it{c})"}; - const AxisSpec thnAxisGenPtLambdaCBMother{thnConfigAxisGenPtB, "#it{p}_{T}^{gen}(#Lambda_{c}^{+} B mother) (GeV/#it{c})"}; - const AxisSpec thnAxisGenPtSigmaCBMother{thnConfigAxisGenPtB, "#it{p}_{T}^{gen}(#Sigma_{c}^{0,++} B mother) (GeV/#it{c})"}; - const AxisSpec thnAxisGenSigmaCSpecies = {o2::hf_sigmactask::species::NSpecies, -0.5f, +o2::hf_sigmactask::species::NSpecies - 0.5f, "bin 1: #Sigma_{c}(2455), bin 2: #Sigma_{c}(2520)"}; std::vector axesLambdaCWithMl = {thnAxisPtLambdaC, thnAxisMassLambdaC, thnAxisBdtScoreLcBkg, thnAxisBdtScoreLcNonPrompt, thnAxisOriginMc, thnAxisChannel}; std::vector axesSigmaCWithMl = {thnAxisPtLambdaC, axisDeltaMassSigmaC, thnAxisBdtScoreLcBkg, thnAxisBdtScoreLcNonPrompt, thnAxisOriginMc, thnAxisChannel, thnAxisPtSigmaC, thnAxisChargeSigmaC}; std::vector axesLambdaCWoMl = {thnAxisPtLambdaC, thnAxisMassLambdaC, thnAxisDecLength, thnAxisDecLengthXY, thnAxisCPA, thnAxisCPAXY, thnAxisOriginMc, thnAxisChannel}; @@ -320,11 +322,11 @@ struct HfTaskSigmac { int8_t channel = 0; if ((candidateLc.isSelLcToPKPi() >= 1) && candSc.statusSpreadLcMinvPKPiFromPDG()) { // Λc+ → pK-π+ and within the requested mass to build the Σc0,++ - SETBIT(channel, o2::hf_sigmactask::decays::pkpi); + SETBIT(channel, o2::hf_sigmactask::Decays::PKPi); } if ((candidateLc.isSelLcToPiKP() >= 1) && candSc.statusSpreadLcMinvPiKPFromPDG()) { // Λc+ → π+K-p and within the requested mass to build the Σc0,++ - SETBIT(channel, o2::hf_sigmactask::decays::pikp); + SETBIT(channel, o2::hf_sigmactask::Decays::PiKP); } return channel; /// 0: none; 1: pK-π+ only; 2: π+K-p only; 3: both possible } @@ -363,12 +365,12 @@ struct HfTaskSigmac { double decLengthLc(candidateLc.decayLength()), decLengthXYLc(candidateLc.decayLengthXY()); double cpaLc(candidateLc.cpa()), cpaXYLc(candidateLc.cpaXY()); /// candidate Λc+ → pK-π+ (and charge conjugate) within the range of M(pK-π+) chosen in the Σc0,++ builder - if (TESTBIT(isCandPKPiPiKP, o2::hf_sigmactask::decays::pkpi)) { + if (TESTBIT(isCandPKPiPiKP, o2::hf_sigmactask::Decays::PKPi)) { massSc = hfHelper.invMassScRecoLcToPKPi(candSc, candidateLc); massLc = hfHelper.invMassLcToPKPi(candidateLc); deltaMass = massSc - massLc; /// fill the histograms - if (chargeSc == 0) { + if (chargeSc == o2::hf_sigmactask::chargeNull) { registry.fill(HIST("Data/hPtSc0"), ptSc); registry.fill(HIST("Data/hEtaSc0"), etaSc); registry.fill(HIST("Data/hPhiSc0"), phiSc); @@ -436,12 +438,12 @@ struct HfTaskSigmac { } } /// end candidate Λc+ → pK-π+ (and charge conjugate) /// candidate Λc+ → π+K-p (and charge conjugate) within the range of M(π+K-p) chosen in the Σc0,++ builder - if (TESTBIT(isCandPKPiPiKP, o2::hf_sigmactask::decays::pikp)) { + if (TESTBIT(isCandPKPiPiKP, o2::hf_sigmactask::Decays::PiKP)) { massSc = hfHelper.invMassScRecoLcToPiKP(candSc, candidateLc); massLc = hfHelper.invMassLcToPiKP(candidateLc); deltaMass = massSc - massLc; /// fill the histograms - if (chargeSc == 0) { + if (chargeSc == o2::hf_sigmactask::chargeNull) { registry.fill(HIST("Data/hPtSc0"), ptSc); registry.fill(HIST("Data/hEtaSc0"), etaSc); registry.fill(HIST("Data/hPhiSc0"), phiSc); @@ -614,7 +616,8 @@ struct HfTaskSigmac { double ptGenSc(particle.pt()), etaGenSc(particle.eta()), phiGenSc(particle.phi()); double ptGenScBMother(-1.); auto arrayDaughtersIds = particle.daughtersIds(); - if (arrayDaughtersIds.size() != 2) { + const int dauSize = 2; + if (arrayDaughtersIds.size() != dauSize) { /// This should never happen LOG(fatal) << "generated Σc0,++ has a number of daughter particles different than 2"; continue; @@ -777,7 +780,7 @@ struct HfTaskSigmac { bool isTrueScPlusPlusReco = std::abs(candSc.flagMcMatchRec()) == 1 << aod::hf_cand_sigmac::DecayType::ScplusplusToPKPiPi; bool isTrueScStarPlusPlusReco = std::abs(candSc.flagMcMatchRec()) == 1 << aod::hf_cand_sigmac::DecayType::ScStarPlusPlusToPKPiPi; int sigmacSpecies = -1; - if ((isTrueSc0Reco || isTrueScStar0Reco) && (chargeSc == 0)) { + if ((isTrueSc0Reco || isTrueScStar0Reco) && (chargeSc == o2::hf_sigmactask::chargeNull)) { /// Reconstructed Σc0 signal // Get the corresponding MC particle for Sc, found as the mother of the soft pion int indexMcScRec = -1; @@ -813,7 +816,7 @@ struct HfTaskSigmac { auto channel = candidateLc.flagMcDecayChanRec(); /// 0: direct; 1: Λc± → p± K*; 2: Λc± → Δ(1232)±± K∓; 3: Λc± → Λ(1520) π± /// candidate Λc+ → pK-π+ (and charge conjugate) within the range of M(pK-π+) chosen in the Σc0,++ builder - if ((TESTBIT(isCandPKPiPiKP, o2::hf_sigmactask::decays::pkpi)) && std::abs(candidateLc.template prong0_as().mcParticle().pdgCode()) == kProton) { + if ((TESTBIT(isCandPKPiPiKP, o2::hf_sigmactask::Decays::PKPi)) && std::abs(candidateLc.template prong0_as().mcParticle().pdgCode()) == kProton) { massSc = hfHelper.invMassScRecoLcToPKPi(candSc, candidateLc); massLc = hfHelper.invMassLcToPKPi(candidateLc); deltaMass = massSc - massLc; @@ -887,7 +890,7 @@ struct HfTaskSigmac { } /// end candidate Λc+ → pK-π+ (and charge conjugate) /// candidate Λc+ → π+K-p (and charge conjugate) within the range of M(π+K-p) chosen in the Σc0,++ builder - if ((TESTBIT(isCandPKPiPiKP, o2::hf_sigmactask::decays::pikp)) && std::abs(candidateLc.template prong0_as().mcParticle().pdgCode()) == kPiPlus) { + if ((TESTBIT(isCandPKPiPiKP, o2::hf_sigmactask::Decays::PiKP)) && std::abs(candidateLc.template prong0_as().mcParticle().pdgCode()) == kPiPlus) { massSc = hfHelper.invMassScRecoLcToPiKP(candSc, candidateLc); massLc = hfHelper.invMassLcToPiKP(candidateLc); deltaMass = massSc - massLc; @@ -961,7 +964,7 @@ struct HfTaskSigmac { } /// end candidate Λc+ → π+K-p (and charge conjugate) /// end reconstructed Σc0 signal - } else if ((isTrueScPlusPlusReco || isTrueScStarPlusPlusReco) && (std::abs(chargeSc) == 2)) { + } else if ((isTrueScPlusPlusReco || isTrueScStarPlusPlusReco) && (std::abs(chargeSc) == o2::hf_sigmactask::chargePlusPlus)) { /// Reconstructed Σc++ signal // Get the corresponding MC particle for Sc, found as the mother of the soft pion int indexMcScRec = -1; @@ -997,7 +1000,7 @@ struct HfTaskSigmac { auto channel = candidateLc.flagMcDecayChanRec(); /// 0: direct; 1: Λc± → p± K*; 2: Λc± → Δ(1232)±± K∓; 3: Λc± → Λ(1520) π± /// candidate Λc+ → pK-π+ (and charge conjugate) within the range of M(pK-π+) chosen in the Σc0,++ builder - if ((TESTBIT(isCandPKPiPiKP, o2::hf_sigmactask::decays::pkpi)) && std::abs(candidateLc.template prong0_as().mcParticle().pdgCode()) == kProton) { + if ((TESTBIT(isCandPKPiPiKP, o2::hf_sigmactask::Decays::PKPi)) && std::abs(candidateLc.template prong0_as().mcParticle().pdgCode()) == kProton) { massSc = hfHelper.invMassScRecoLcToPKPi(candSc, candidateLc); massLc = hfHelper.invMassLcToPKPi(candidateLc); deltaMass = massSc - massLc; @@ -1071,7 +1074,7 @@ struct HfTaskSigmac { } /// end candidate Λc+ → pK-π+ (and charge conjugate) /// candidate Λc+ → π+K-p (and charge conjugate) within the range of M(π+K-p) chosen in the Σc0,++ builder - if ((TESTBIT(isCandPKPiPiKP, o2::hf_sigmactask::decays::pikp)) && std::abs(candidateLc.template prong0_as().mcParticle().pdgCode()) == kPiPlus) { + if ((TESTBIT(isCandPKPiPiKP, o2::hf_sigmactask::Decays::PiKP)) && std::abs(candidateLc.template prong0_as().mcParticle().pdgCode()) == kPiPlus) { massSc = hfHelper.invMassScRecoLcToPiKP(candSc, candidateLc); massLc = hfHelper.invMassLcToPiKP(candidateLc); deltaMass = massSc - massLc; From 1d529c2ae4e5c6637457a0863d6bfdd3059fbc64 Mon Sep 17 00:00:00 2001 From: Mattia Faggin Date: Tue, 22 Apr 2025 16:15:30 +0200 Subject: [PATCH 10/13] Try to fix O2 linter issues (chapter 2). --- PWGHF/D2H/Tasks/taskSigmac.cxx | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/PWGHF/D2H/Tasks/taskSigmac.cxx b/PWGHF/D2H/Tasks/taskSigmac.cxx index bfc09bb7230..14d29c6e560 100644 --- a/PWGHF/D2H/Tasks/taskSigmac.cxx +++ b/PWGHF/D2H/Tasks/taskSigmac.cxx @@ -15,6 +15,8 @@ /// /// \author Mattia Faggin , University and INFN PADOVA +#include + #include "CommonConstants/PhysicsConstants.h" #include "Framework/AnalysisTask.h" #include "Framework/HistogramRegistry.h" @@ -24,8 +26,6 @@ #include "PWGHF/DataModel/CandidateReconstructionTables.h" #include "PWGHF/DataModel/CandidateSelectionTables.h" -#include - using namespace o2; using namespace o2::analysis; using namespace o2::framework; @@ -53,9 +53,14 @@ struct HfTaskSigmac { /// consider the new parametrization of the fiducial acceptance (to be seen for reco signal in MC) Configurable yCandGenMax{"yCandGenMax", -1, "Maximum generated Sc rapidity"}; Configurable yCandRecoMax{"yCandRecoMax", -1, "Maximum Sc candidate rapidity"}; + Configurable enableTHn{"enableTHn", false, "enable the usage of THn for Λc+ and Σc0,++"}; + + HfHelper hfHelper; + bool isMc; + + using RecoLc = soa::Join; /// THn for candidate Λc+ and Σc0,++ cut variation - Configurable enableTHn{"enableTHn", false, "enable the usage of THn for Λc+ and Σc0,++"}; ConfigurableAxis thnConfigAxisPt{"thnConfigAxisPt", {16, 0, 16}, ""}; ConfigurableAxis thnConfigAxisGenPt{"thnConfigAxisGenPt", {240, 0, 24}, "Gen pt prompt"}; ConfigurableAxis thnConfigAxisGenPtB{"thnConfigAxisGenPtB", {800, 0, 80}, "Gen pt non-prompt"}; @@ -85,8 +90,6 @@ struct HfTaskSigmac { const AxisSpec thnAxisGenPtSigmaCBMother{thnConfigAxisGenPtB, "#it{p}_{T}^{gen}(#Sigma_{c}^{0,++} B mother) (GeV/#it{c})"}; const AxisSpec thnAxisGenSigmaCSpecies = {o2::hf_sigmactask::Species::NSpecies, -0.5f, +o2::hf_sigmactask::Species::NSpecies - 0.5f, "bin 1: #Sigma_{c}(2455), bin 2: #Sigma_{c}(2520)"}; - HfHelper hfHelper; - /// analysis histograms HistogramRegistry registry{ "registry", @@ -130,10 +133,6 @@ struct HfTaskSigmac { {"Data/hPhiLcFromSc0PlusPlus", "#Lambda_{c}^{+} #leftarrow #Sigma_{c}^{0,++} candidates; #varphi(#Lambda_{c}^{+} #leftarrow #Sigma_{c}^{0,++}); entries;", {HistType::kTH1D, {{72, 0, constants::math::TwoPI}}}}}}; //{"Data/hDeltaMassLcFromSc0PlusPlus", "#Lambda_{c}^{+} #leftarrow #Sigma_{c}^{0,++} candidates; #it{M}(pK#pi#pi) - #it{M}(pK#pi) (GeV/#it{c}^{2}); #it{p}_{T}(#Lambda_{c}^{+} #leftarrow #Sigma_{c}^{0,++}) (GeV/#it{c});", {HistType::kTH2D, {axisDeltaMassSigmaC, {36, 0., 36.}}}}}}; - using RecoLc = soa::Join; - - bool isMc; - /// @brief init function, to define the additional analysis histograms /// @param void init(InitContext&) From 0cd576f8e40a79152d5a6ddad159664986bd29e2 Mon Sep 17 00:00:00 2001 From: Mattia Faggin Date: Tue, 22 Apr 2025 16:42:11 +0200 Subject: [PATCH 11/13] Try to fix O2 linter issues (chapter 3). --- PWGHF/D2H/Tasks/taskSigmac.cxx | 50 +++++++------------ .../DataModel/CandidateReconstructionTables.h | 12 ++++- .../candidateCreatorSigmac0plusplus.cxx | 9 ++-- 3 files changed, 34 insertions(+), 37 deletions(-) diff --git a/PWGHF/D2H/Tasks/taskSigmac.cxx b/PWGHF/D2H/Tasks/taskSigmac.cxx index 14d29c6e560..7e770883174 100644 --- a/PWGHF/D2H/Tasks/taskSigmac.cxx +++ b/PWGHF/D2H/Tasks/taskSigmac.cxx @@ -30,18 +30,6 @@ using namespace o2; using namespace o2::analysis; using namespace o2::framework; -namespace o2::hf_sigmactask -{ -enum Species : int { Sc2455 = 0, - Sc2520, - NSpecies }; -enum Decays : int { PKPi = 0, - PiKP, - NDecays }; -const int chargeNull = 0; -const int chargePlusPlus = 2; -}; // namespace o2::hf_sigmactask - struct HfTaskSigmac { /// One value of rapidity only /// Remember that in Run2 the distinction among GenLimAcc, GenAccMother, GenAcc was done, where: @@ -88,7 +76,7 @@ struct HfTaskSigmac { const AxisSpec thnAxisGenPtSigmaC{thnConfigAxisGenPt, "#it{p}_{T}^{gen}(#Sigma_{c}^{0,++}) (GeV/#it{c})"}; const AxisSpec thnAxisGenPtLambdaCBMother{thnConfigAxisGenPtB, "#it{p}_{T}^{gen}(#Lambda_{c}^{+} B mother) (GeV/#it{c})"}; const AxisSpec thnAxisGenPtSigmaCBMother{thnConfigAxisGenPtB, "#it{p}_{T}^{gen}(#Sigma_{c}^{0,++} B mother) (GeV/#it{c})"}; - const AxisSpec thnAxisGenSigmaCSpecies = {o2::hf_sigmactask::Species::NSpecies, -0.5f, +o2::hf_sigmactask::Species::NSpecies - 0.5f, "bin 1: #Sigma_{c}(2455), bin 2: #Sigma_{c}(2520)"}; + const AxisSpec thnAxisGenSigmaCSpecies = {o2::aod::hf_cand_sigmac::Species::NSpecies, -0.5f, +o2::aod::hf_cand_sigmac::Species::NSpecies - 0.5f, "bin 1: #Sigma_{c}(2455), bin 2: #Sigma_{c}(2520)"}; /// analysis histograms HistogramRegistry registry{ @@ -321,11 +309,11 @@ struct HfTaskSigmac { int8_t channel = 0; if ((candidateLc.isSelLcToPKPi() >= 1) && candSc.statusSpreadLcMinvPKPiFromPDG()) { // Λc+ → pK-π+ and within the requested mass to build the Σc0,++ - SETBIT(channel, o2::hf_sigmactask::Decays::PKPi); + SETBIT(channel, o2::aod::hf_cand_sigmac::Decays::PKPi); } if ((candidateLc.isSelLcToPiKP() >= 1) && candSc.statusSpreadLcMinvPiKPFromPDG()) { // Λc+ → π+K-p and within the requested mass to build the Σc0,++ - SETBIT(channel, o2::hf_sigmactask::Decays::PiKP); + SETBIT(channel, o2::aod::hf_cand_sigmac::Decays::PiKP); } return channel; /// 0: none; 1: pK-π+ only; 2: π+K-p only; 3: both possible } @@ -364,12 +352,12 @@ struct HfTaskSigmac { double decLengthLc(candidateLc.decayLength()), decLengthXYLc(candidateLc.decayLengthXY()); double cpaLc(candidateLc.cpa()), cpaXYLc(candidateLc.cpaXY()); /// candidate Λc+ → pK-π+ (and charge conjugate) within the range of M(pK-π+) chosen in the Σc0,++ builder - if (TESTBIT(isCandPKPiPiKP, o2::hf_sigmactask::Decays::PKPi)) { + if (TESTBIT(isCandPKPiPiKP, o2::aod::hf_cand_sigmac::Decays::PKPi)) { massSc = hfHelper.invMassScRecoLcToPKPi(candSc, candidateLc); massLc = hfHelper.invMassLcToPKPi(candidateLc); deltaMass = massSc - massLc; /// fill the histograms - if (chargeSc == o2::hf_sigmactask::chargeNull) { + if (chargeSc == o2::aod::hf_cand_sigmac::chargeNull) { registry.fill(HIST("Data/hPtSc0"), ptSc); registry.fill(HIST("Data/hEtaSc0"), etaSc); registry.fill(HIST("Data/hPhiSc0"), phiSc); @@ -437,12 +425,12 @@ struct HfTaskSigmac { } } /// end candidate Λc+ → pK-π+ (and charge conjugate) /// candidate Λc+ → π+K-p (and charge conjugate) within the range of M(π+K-p) chosen in the Σc0,++ builder - if (TESTBIT(isCandPKPiPiKP, o2::hf_sigmactask::Decays::PiKP)) { + if (TESTBIT(isCandPKPiPiKP, o2::aod::hf_cand_sigmac::Decays::PiKP)) { massSc = hfHelper.invMassScRecoLcToPiKP(candSc, candidateLc); massLc = hfHelper.invMassLcToPiKP(candidateLc); deltaMass = massSc - massLc; /// fill the histograms - if (chargeSc == o2::hf_sigmactask::chargeNull) { + if (chargeSc == o2::aod::hf_cand_sigmac::chargeNull) { registry.fill(HIST("Data/hPtSc0"), ptSc); registry.fill(HIST("Data/hEtaSc0"), etaSc); registry.fill(HIST("Data/hPhiSc0"), phiSc); @@ -656,9 +644,9 @@ struct HfTaskSigmac { /// Fill histograms int sigmacSpecies = -1; if (isSc0Gen || isScPlusPlusGen) { - sigmacSpecies = o2::hf_sigmactask::Sc2455; + sigmacSpecies = o2::aod::hf_cand_sigmac::Sc2455; } else if (isScStar0Gen || isScStarPlusPlusGen) { - sigmacSpecies = o2::hf_sigmactask::Sc2520; + sigmacSpecies = o2::aod::hf_cand_sigmac::Sc2520; } if (isSc0Gen || isScStar0Gen) { /// Generated Σc0 and Λc+ ← Σc0 signals @@ -779,18 +767,18 @@ struct HfTaskSigmac { bool isTrueScPlusPlusReco = std::abs(candSc.flagMcMatchRec()) == 1 << aod::hf_cand_sigmac::DecayType::ScplusplusToPKPiPi; bool isTrueScStarPlusPlusReco = std::abs(candSc.flagMcMatchRec()) == 1 << aod::hf_cand_sigmac::DecayType::ScStarPlusPlusToPKPiPi; int sigmacSpecies = -1; - if ((isTrueSc0Reco || isTrueScStar0Reco) && (chargeSc == o2::hf_sigmactask::chargeNull)) { + if ((isTrueSc0Reco || isTrueScStar0Reco) && (chargeSc == o2::aod::hf_cand_sigmac::chargeNull)) { /// Reconstructed Σc0 signal // Get the corresponding MC particle for Sc, found as the mother of the soft pion int indexMcScRec = -1; if (isTrueSc0Reco) { // Σc0(2455) indexMcScRec = RecoDecay::getMother(mcParticles, candSc.prong1_as().mcParticle(), o2::constants::physics::Pdg::kSigmaC0, true); - sigmacSpecies = o2::hf_sigmactask::Sc2455; + sigmacSpecies = o2::aod::hf_cand_sigmac::Sc2455; } else if (isTrueScStar0Reco) { // Σc0(2520) indexMcScRec = RecoDecay::getMother(mcParticles, candSc.prong1_as().mcParticle(), o2::constants::physics::Pdg::kSigmaCStar0, true); - sigmacSpecies = o2::hf_sigmactask::Sc2520; + sigmacSpecies = o2::aod::hf_cand_sigmac::Sc2520; } auto particleSc = mcParticles.rawIteratorAt(indexMcScRec); // Get the corresponding MC particle for Lc @@ -815,7 +803,7 @@ struct HfTaskSigmac { auto channel = candidateLc.flagMcDecayChanRec(); /// 0: direct; 1: Λc± → p± K*; 2: Λc± → Δ(1232)±± K∓; 3: Λc± → Λ(1520) π± /// candidate Λc+ → pK-π+ (and charge conjugate) within the range of M(pK-π+) chosen in the Σc0,++ builder - if ((TESTBIT(isCandPKPiPiKP, o2::hf_sigmactask::Decays::PKPi)) && std::abs(candidateLc.template prong0_as().mcParticle().pdgCode()) == kProton) { + if ((TESTBIT(isCandPKPiPiKP, o2::aod::hf_cand_sigmac::Decays::PKPi)) && std::abs(candidateLc.template prong0_as().mcParticle().pdgCode()) == kProton) { massSc = hfHelper.invMassScRecoLcToPKPi(candSc, candidateLc); massLc = hfHelper.invMassLcToPKPi(candidateLc); deltaMass = massSc - massLc; @@ -889,7 +877,7 @@ struct HfTaskSigmac { } /// end candidate Λc+ → pK-π+ (and charge conjugate) /// candidate Λc+ → π+K-p (and charge conjugate) within the range of M(π+K-p) chosen in the Σc0,++ builder - if ((TESTBIT(isCandPKPiPiKP, o2::hf_sigmactask::Decays::PiKP)) && std::abs(candidateLc.template prong0_as().mcParticle().pdgCode()) == kPiPlus) { + if ((TESTBIT(isCandPKPiPiKP, o2::aod::hf_cand_sigmac::Decays::PiKP)) && std::abs(candidateLc.template prong0_as().mcParticle().pdgCode()) == kPiPlus) { massSc = hfHelper.invMassScRecoLcToPiKP(candSc, candidateLc); massLc = hfHelper.invMassLcToPiKP(candidateLc); deltaMass = massSc - massLc; @@ -963,18 +951,18 @@ struct HfTaskSigmac { } /// end candidate Λc+ → π+K-p (and charge conjugate) /// end reconstructed Σc0 signal - } else if ((isTrueScPlusPlusReco || isTrueScStarPlusPlusReco) && (std::abs(chargeSc) == o2::hf_sigmactask::chargePlusPlus)) { + } else if ((isTrueScPlusPlusReco || isTrueScStarPlusPlusReco) && (std::abs(chargeSc) == o2::aod::hf_cand_sigmac::chargePlusPlus)) { /// Reconstructed Σc++ signal // Get the corresponding MC particle for Sc, found as the mother of the soft pion int indexMcScRec = -1; if (isTrueScPlusPlusReco) { // Σc0(2455) indexMcScRec = RecoDecay::getMother(mcParticles, candSc.prong1_as().mcParticle(), o2::constants::physics::Pdg::kSigmaCPlusPlus, true); - sigmacSpecies = o2::hf_sigmactask::Sc2455; + sigmacSpecies = o2::aod::hf_cand_sigmac::Sc2455; } else if (isTrueScStarPlusPlusReco) { // Σc0(2520) indexMcScRec = RecoDecay::getMother(mcParticles, candSc.prong1_as().mcParticle(), o2::constants::physics::Pdg::kSigmaCStarPlusPlus, true); - sigmacSpecies = o2::hf_sigmactask::Sc2520; + sigmacSpecies = o2::aod::hf_cand_sigmac::Sc2520; } auto particleSc = mcParticles.rawIteratorAt(indexMcScRec); // Get the corresponding MC particle for Lc @@ -999,7 +987,7 @@ struct HfTaskSigmac { auto channel = candidateLc.flagMcDecayChanRec(); /// 0: direct; 1: Λc± → p± K*; 2: Λc± → Δ(1232)±± K∓; 3: Λc± → Λ(1520) π± /// candidate Λc+ → pK-π+ (and charge conjugate) within the range of M(pK-π+) chosen in the Σc0,++ builder - if ((TESTBIT(isCandPKPiPiKP, o2::hf_sigmactask::Decays::PKPi)) && std::abs(candidateLc.template prong0_as().mcParticle().pdgCode()) == kProton) { + if ((TESTBIT(isCandPKPiPiKP, o2::aod::hf_cand_sigmac::Decays::PKPi)) && std::abs(candidateLc.template prong0_as().mcParticle().pdgCode()) == kProton) { massSc = hfHelper.invMassScRecoLcToPKPi(candSc, candidateLc); massLc = hfHelper.invMassLcToPKPi(candidateLc); deltaMass = massSc - massLc; @@ -1073,7 +1061,7 @@ struct HfTaskSigmac { } /// end candidate Λc+ → pK-π+ (and charge conjugate) /// candidate Λc+ → π+K-p (and charge conjugate) within the range of M(π+K-p) chosen in the Σc0,++ builder - if ((TESTBIT(isCandPKPiPiKP, o2::hf_sigmactask::Decays::PiKP)) && std::abs(candidateLc.template prong0_as().mcParticle().pdgCode()) == kPiPlus) { + if ((TESTBIT(isCandPKPiPiKP, o2::aod::hf_cand_sigmac::Decays::PiKP)) && std::abs(candidateLc.template prong0_as().mcParticle().pdgCode()) == kPiPlus) { massSc = hfHelper.invMassScRecoLcToPiKP(candSc, candidateLc); massLc = hfHelper.invMassLcToPiKP(candidateLc); deltaMass = massSc - massLc; diff --git a/PWGHF/DataModel/CandidateReconstructionTables.h b/PWGHF/DataModel/CandidateReconstructionTables.h index e44feeefe84..bff111b939e 100644 --- a/PWGHF/DataModel/CandidateReconstructionTables.h +++ b/PWGHF/DataModel/CandidateReconstructionTables.h @@ -2067,6 +2067,14 @@ enum DecayType { Sc0ToPKPiPi = 0, ScplusplusToPKPiPi, ScStar0ToPKPiPi, ScStarPlusPlusToPKPiPi }; +enum Species : int { Sc2455 = 0, + Sc2520, + NSpecies }; +enum Decays : int { PKPi = 0, + PiKP, + NDecays }; +const int chargeNull = 0; +const int chargePlusPlus = 2; } // namespace hf_cand_sigmac // declare dedicated Σc0,++ decay candidate table @@ -2295,8 +2303,8 @@ DECLARE_SOA_DYNAMIC_COLUMN(PtSoftPi, ptSoftPi, [](float pxSoftPi, float pySoftPi DECLARE_SOA_DYNAMIC_COLUMN(PVecSoftPi, pVecSoftPi, [](float px, float py, float pz) -> std::array { return std::array{px, py, pz}; }); // MC matching result: -DECLARE_SOA_COLUMN(FlagMcMatchRec, flagMcMatchRec, int8_t); //! reconstruction level -DECLARE_SOA_COLUMN(FlagMcMatchGen, flagMcMatchGen, int8_t); //! generator level +DECLARE_SOA_COLUMN(FlagMcMatchRec, flagMcMatchRec, int8_t); //! reconstruction level +DECLARE_SOA_COLUMN(FlagMcMatchGen, flagMcMatchGen, int8_t); //! generator level DECLARE_SOA_COLUMN(FlagMcMatchRecD0, flagMcMatchRecD0, int8_t); //! reconstruction level DECLARE_SOA_COLUMN(FlagMcMatchGenD0, flagMcMatchGenD0, int8_t); //! generator level diff --git a/PWGHF/TableProducer/candidateCreatorSigmac0plusplus.cxx b/PWGHF/TableProducer/candidateCreatorSigmac0plusplus.cxx index 9f3cea9d8bc..2c102b6aa2f 100644 --- a/PWGHF/TableProducer/candidateCreatorSigmac0plusplus.cxx +++ b/PWGHF/TableProducer/candidateCreatorSigmac0plusplus.cxx @@ -143,7 +143,8 @@ struct HfCandidateCreatorSigmac0plusplus { softPiCuts.SetMaxChi2PerClusterITS(softPiChi2Max); // ITS hitmap std::set setSoftPiItsHitMap; // = {}; - for (int idItsLayer = 0; idItsLayer < 7; idItsLayer++) { + const int itsLayers = 7; + for (int idItsLayer = 0; idItsLayer < itsLayers; idItsLayer++) { if (TESTBIT(softPiItsHitMap, idItsLayer)) { setSoftPiItsHitMap.insert(static_cast(idItsLayer)); } @@ -235,7 +236,7 @@ struct HfCandidateCreatorSigmac0plusplus { int chargeLc = candLc.template prong0_as().sign() + candLc.template prong1_as().sign() + candLc.template prong2_as().sign(); int chargeSoftPi = trackSoftPi.sign(); int8_t chargeSigmac = chargeLc + chargeSoftPi; - if (std::abs(chargeSigmac) != 0 && std::abs(chargeSigmac) != 2) { + if (std::abs(chargeSigmac) != o2::aod::hf_cand_sigmac::chargeNull && std::abs(chargeSigmac) != o2::aod::hf_cand_sigmac::chargePlusPlus) { /// this shall never happen LOG(fatal) << ">>> Sc candidate with charge +1 built, not possible! Charge Lc: " << chargeLc << ", charge soft pion: " << chargeSoftPi; } @@ -461,7 +462,7 @@ struct HfCandidateSigmac0plusplusMc { candLc.prong2_as(), candSigmac.prong1_as()}; chargeSigmac = candSigmac.charge(); - if (chargeSigmac == 0) { + if (chargeSigmac == o2::aod::hf_cand_sigmac::chargeNull) { /// candidate Σc0 /// 3 levels: /// 1. Σc0 → Λc+ π-,+ @@ -482,7 +483,7 @@ struct HfCandidateSigmac0plusplusMc { } } - } else if (std::abs(chargeSigmac) == 2) { + } else if (std::abs(chargeSigmac) == o2::aod::hf_cand_sigmac::chargePlusPlus) { /// candidate Σc++ /// 3 levels: /// 1. Σc0 → Λc+ π-,+ From a942f8c773b42168ca3b3c24227f0c14bda7fd6b Mon Sep 17 00:00:00 2001 From: Mattia Faggin Date: Wed, 23 Apr 2025 10:29:59 +0200 Subject: [PATCH 12/13] Address comments from Vit. --- PWGHF/D2H/Tasks/taskSigmac.cxx | 34 +++++++++---------- .../DataModel/CandidateReconstructionTables.h | 4 +-- .../candidateCreatorSigmac0plusplus.cxx | 30 ++++++++-------- 3 files changed, 34 insertions(+), 34 deletions(-) diff --git a/PWGHF/D2H/Tasks/taskSigmac.cxx b/PWGHF/D2H/Tasks/taskSigmac.cxx index 7e770883174..e7083d7283e 100644 --- a/PWGHF/D2H/Tasks/taskSigmac.cxx +++ b/PWGHF/D2H/Tasks/taskSigmac.cxx @@ -45,6 +45,7 @@ struct HfTaskSigmac { HfHelper hfHelper; bool isMc; + static constexpr std::size_t NDaughters{2u}; using RecoLc = soa::Join; @@ -357,7 +358,7 @@ struct HfTaskSigmac { massLc = hfHelper.invMassLcToPKPi(candidateLc); deltaMass = massSc - massLc; /// fill the histograms - if (chargeSc == o2::aod::hf_cand_sigmac::chargeNull) { + if (chargeSc == o2::aod::hf_cand_sigmac::ChargeNull) { registry.fill(HIST("Data/hPtSc0"), ptSc); registry.fill(HIST("Data/hEtaSc0"), etaSc); registry.fill(HIST("Data/hPhiSc0"), phiSc); @@ -430,7 +431,7 @@ struct HfTaskSigmac { massLc = hfHelper.invMassLcToPiKP(candidateLc); deltaMass = massSc - massLc; /// fill the histograms - if (chargeSc == o2::aod::hf_cand_sigmac::chargeNull) { + if (chargeSc == o2::aod::hf_cand_sigmac::ChargeNull) { registry.fill(HIST("Data/hPtSc0"), ptSc); registry.fill(HIST("Data/hEtaSc0"), etaSc); registry.fill(HIST("Data/hPhiSc0"), phiSc); @@ -563,10 +564,10 @@ struct HfTaskSigmac { for (const auto& particle : mcParticlesSc) { /// reject immediately particles different from Σc0,++ - bool isSc0Gen = (std::abs(particle.flagMcMatchGen()) == (1 << aod::hf_cand_sigmac::DecayType::Sc0ToPKPiPi)); - bool isScStar0Gen = (std::abs(particle.flagMcMatchGen()) == (1 << aod::hf_cand_sigmac::DecayType::ScStar0ToPKPiPi)); - bool isScPlusPlusGen = (std::abs(particle.flagMcMatchGen()) == (1 << aod::hf_cand_sigmac::DecayType::ScplusplusToPKPiPi)); - bool isScStarPlusPlusGen = (std::abs(particle.flagMcMatchGen()) == (1 << aod::hf_cand_sigmac::DecayType::ScStarPlusPlusToPKPiPi)); + bool isSc0Gen = (std::abs(particle.flagMcMatchGen()) == BIT(aod::hf_cand_sigmac::DecayType::Sc0ToPKPiPi)); + bool isScStar0Gen = (std::abs(particle.flagMcMatchGen()) == BIT(aod::hf_cand_sigmac::DecayType::ScStar0ToPKPiPi)); + bool isScPlusPlusGen = (std::abs(particle.flagMcMatchGen()) == BIT(aod::hf_cand_sigmac::DecayType::ScplusplusToPKPiPi)); + bool isScStarPlusPlusGen = (std::abs(particle.flagMcMatchGen()) == BIT(aod::hf_cand_sigmac::DecayType::ScStarPlusPlusToPKPiPi)); if (!isSc0Gen && !isScPlusPlusGen && !isScStar0Gen && !isScStarPlusPlusGen) continue; @@ -603,8 +604,7 @@ struct HfTaskSigmac { double ptGenSc(particle.pt()), etaGenSc(particle.eta()), phiGenSc(particle.phi()); double ptGenScBMother(-1.); auto arrayDaughtersIds = particle.daughtersIds(); - const int dauSize = 2; - if (arrayDaughtersIds.size() != dauSize) { + if (arrayDaughtersIds.size() != NDaughters) { /// This should never happen LOG(fatal) << "generated Σc0,++ has a number of daughter particles different than 2"; continue; @@ -721,7 +721,7 @@ struct HfTaskSigmac { /// loop over Lc generated particles for (const auto& particle : mcParticlesLc) { - if (std::abs(particle.flagMcMatchGen()) != 1 << aod::hf_cand_3prong::DecayType::LcToPKPi) { + if (std::abs(particle.flagMcMatchGen()) != BIT(aod::hf_cand_3prong::DecayType::LcToPKPi)) { continue; } if (yCandGenMax >= 0. && std::abs(RecoDecay::y(particle.pVector(), o2::constants::physics::MassLambdaCPlus)) > yCandGenMax) { @@ -742,8 +742,8 @@ struct HfTaskSigmac { for (const auto& candSc : candidatesSc) { /// Candidate selected as Σc0 and/or Σc++ - if (!(candSc.hfflag() & 1 << aod::hf_cand_sigmac::DecayType::Sc0ToPKPiPi) && !(candSc.hfflag() & 1 << aod::hf_cand_sigmac::DecayType::ScplusplusToPKPiPi) && // Σc0,++(2455) - !(candSc.hfflag() & 1 << aod::hf_cand_sigmac::DecayType::ScStar0ToPKPiPi) && !(candSc.hfflag() & 1 << aod::hf_cand_sigmac::DecayType::ScStarPlusPlusToPKPiPi)) { // Σc0,++(2520) + if (!(candSc.hfflag() & BIT(aod::hf_cand_sigmac::DecayType::Sc0ToPKPiPi)) && !(candSc.hfflag() & BIT(aod::hf_cand_sigmac::DecayType::ScplusplusToPKPiPi)) && // Σc0,++(2455) + !(candSc.hfflag() & BIT(aod::hf_cand_sigmac::DecayType::ScStar0ToPKPiPi)) && !(candSc.hfflag() & BIT(aod::hf_cand_sigmac::DecayType::ScStarPlusPlusToPKPiPi))) { // Σc0,++(2520) continue; } /// rapidity selection on Σc0,++ @@ -762,12 +762,12 @@ struct HfTaskSigmac { // candidateLc.flagMcDecayChanRec(); - bool isTrueSc0Reco = std::abs(candSc.flagMcMatchRec()) == 1 << aod::hf_cand_sigmac::DecayType::Sc0ToPKPiPi; - bool isTrueScStar0Reco = std::abs(candSc.flagMcMatchRec()) == 1 << aod::hf_cand_sigmac::DecayType::ScStar0ToPKPiPi; - bool isTrueScPlusPlusReco = std::abs(candSc.flagMcMatchRec()) == 1 << aod::hf_cand_sigmac::DecayType::ScplusplusToPKPiPi; - bool isTrueScStarPlusPlusReco = std::abs(candSc.flagMcMatchRec()) == 1 << aod::hf_cand_sigmac::DecayType::ScStarPlusPlusToPKPiPi; + bool isTrueSc0Reco = std::abs(candSc.flagMcMatchRec()) == BIT(aod::hf_cand_sigmac::DecayType::Sc0ToPKPiPi); + bool isTrueScStar0Reco = std::abs(candSc.flagMcMatchRec()) == BIT(aod::hf_cand_sigmac::DecayType::ScStar0ToPKPiPi); + bool isTrueScPlusPlusReco = std::abs(candSc.flagMcMatchRec()) == BIT(aod::hf_cand_sigmac::DecayType::ScplusplusToPKPiPi); + bool isTrueScStarPlusPlusReco = std::abs(candSc.flagMcMatchRec()) == BIT(aod::hf_cand_sigmac::DecayType::ScStarPlusPlusToPKPiPi); int sigmacSpecies = -1; - if ((isTrueSc0Reco || isTrueScStar0Reco) && (chargeSc == o2::aod::hf_cand_sigmac::chargeNull)) { + if ((isTrueSc0Reco || isTrueScStar0Reco) && (chargeSc == o2::aod::hf_cand_sigmac::ChargeNull)) { /// Reconstructed Σc0 signal // Get the corresponding MC particle for Sc, found as the mother of the soft pion int indexMcScRec = -1; @@ -951,7 +951,7 @@ struct HfTaskSigmac { } /// end candidate Λc+ → π+K-p (and charge conjugate) /// end reconstructed Σc0 signal - } else if ((isTrueScPlusPlusReco || isTrueScStarPlusPlusReco) && (std::abs(chargeSc) == o2::aod::hf_cand_sigmac::chargePlusPlus)) { + } else if ((isTrueScPlusPlusReco || isTrueScStarPlusPlusReco) && (std::abs(chargeSc) == o2::aod::hf_cand_sigmac::ChargePlusPlus)) { /// Reconstructed Σc++ signal // Get the corresponding MC particle for Sc, found as the mother of the soft pion int indexMcScRec = -1; diff --git a/PWGHF/DataModel/CandidateReconstructionTables.h b/PWGHF/DataModel/CandidateReconstructionTables.h index bff111b939e..754de37ec45 100644 --- a/PWGHF/DataModel/CandidateReconstructionTables.h +++ b/PWGHF/DataModel/CandidateReconstructionTables.h @@ -2073,8 +2073,8 @@ enum Species : int { Sc2455 = 0, enum Decays : int { PKPi = 0, PiKP, NDecays }; -const int chargeNull = 0; -const int chargePlusPlus = 2; +constexpr int ChargeNull = 0; +constexpr int ChargePlusPlus = 2; } // namespace hf_cand_sigmac // declare dedicated Σc0,++ decay candidate table diff --git a/PWGHF/TableProducer/candidateCreatorSigmac0plusplus.cxx b/PWGHF/TableProducer/candidateCreatorSigmac0plusplus.cxx index 2c102b6aa2f..c1e36b13119 100644 --- a/PWGHF/TableProducer/candidateCreatorSigmac0plusplus.cxx +++ b/PWGHF/TableProducer/candidateCreatorSigmac0plusplus.cxx @@ -143,8 +143,8 @@ struct HfCandidateCreatorSigmac0plusplus { softPiCuts.SetMaxChi2PerClusterITS(softPiChi2Max); // ITS hitmap std::set setSoftPiItsHitMap; // = {}; - const int itsLayers = 7; - for (int idItsLayer = 0; idItsLayer < itsLayers; idItsLayer++) { + constexpr std::size_t itsLayers = 7; + for (std::size_t idItsLayer = 0u; idItsLayer < itsLayers; idItsLayer++) { if (TESTBIT(softPiItsHitMap, idItsLayer)) { setSoftPiItsHitMap.insert(static_cast(idItsLayer)); } @@ -180,7 +180,7 @@ struct HfCandidateCreatorSigmac0plusplus { /// keep only the candidates flagged as possible Λc+ (and charge conj.) decaying into a charged pion, kaon and proton /// if not selected, skip it and go to the next one - if (!(candLc.hfflag() & 1 << aod::hf_cand_3prong::DecayType::LcToPKPi)) { + if (!(candLc.hfflag() & BIT(aod::hf_cand_3prong::DecayType::LcToPKPi))) { continue; } /// keep only the candidates Λc+ (and charge conj.) within the desired rapidity @@ -236,7 +236,7 @@ struct HfCandidateCreatorSigmac0plusplus { int chargeLc = candLc.template prong0_as().sign() + candLc.template prong1_as().sign() + candLc.template prong2_as().sign(); int chargeSoftPi = trackSoftPi.sign(); int8_t chargeSigmac = chargeLc + chargeSoftPi; - if (std::abs(chargeSigmac) != o2::aod::hf_cand_sigmac::chargeNull && std::abs(chargeSigmac) != o2::aod::hf_cand_sigmac::chargePlusPlus) { + if (std::abs(chargeSigmac) != o2::aod::hf_cand_sigmac::ChargeNull && std::abs(chargeSigmac) != o2::aod::hf_cand_sigmac::ChargePlusPlus) { /// this shall never happen LOG(fatal) << ">>> Sc candidate with charge +1 built, not possible! Charge Lc: " << chargeLc << ", charge soft pion: " << chargeSoftPi; } @@ -451,7 +451,7 @@ struct HfCandidateSigmac0plusplusMc { /// skip immediately the candidate Σc0,++ w/o a Λc+ matched to MC auto candLc = candSigmac.prongLc_as(); - if (!(std::abs(candLc.flagMcMatchRec()) == 1 << aod::hf_cand_3prong::DecayType::LcToPKPi)) { /// (*) + if (!(std::abs(candLc.flagMcMatchRec()) == BIT(aod::hf_cand_3prong::DecayType::LcToPKPi))) { /// (*) rowMCMatchScRec(flag, origin, -1.f, 0); continue; } @@ -462,7 +462,7 @@ struct HfCandidateSigmac0plusplusMc { candLc.prong2_as(), candSigmac.prong1_as()}; chargeSigmac = candSigmac.charge(); - if (chargeSigmac == o2::aod::hf_cand_sigmac::chargeNull) { + if (chargeSigmac == o2::aod::hf_cand_sigmac::ChargeNull) { /// candidate Σc0 /// 3 levels: /// 1. Σc0 → Λc+ π-,+ @@ -472,18 +472,18 @@ struct HfCandidateSigmac0plusplusMc { /// look for Σc0(2455) indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, Pdg::kSigmaC0, std::array{+kProton, -kKPlus, +kPiPlus, -kPiPlus}, true, &sign, 3); if (indexRec > -1) { /// due to (*) no need to check anything for LambdaC - flag = sign * (1 << aod::hf_cand_sigmac::DecayType::Sc0ToPKPiPi); + flag = sign * BIT(aod::hf_cand_sigmac::DecayType::Sc0ToPKPiPi); } /// look for Σc0(2520) if (flag == 0) { indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, Pdg::kSigmaCStar0, std::array{+kProton, -kKPlus, +kPiPlus, -kPiPlus}, true, &sign, 3); if (indexRec > -1) { /// due to (*) no need to check anything for LambdaC - flag = sign * (1 << aod::hf_cand_sigmac::DecayType::ScStar0ToPKPiPi); + flag = sign * BIT(aod::hf_cand_sigmac::DecayType::ScStar0ToPKPiPi); } } - } else if (std::abs(chargeSigmac) == o2::aod::hf_cand_sigmac::chargePlusPlus) { + } else if (std::abs(chargeSigmac) == o2::aod::hf_cand_sigmac::ChargePlusPlus) { /// candidate Σc++ /// 3 levels: /// 1. Σc0 → Λc+ π-,+ @@ -493,14 +493,14 @@ struct HfCandidateSigmac0plusplusMc { /// look for Σc++(2455) indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, Pdg::kSigmaCPlusPlus, std::array{+kProton, -kKPlus, +kPiPlus, +kPiPlus}, true, &sign, 3); if (indexRec > -1) { /// due to (*) no need to check anything for LambdaC - flag = sign * (1 << aod::hf_cand_sigmac::DecayType::ScplusplusToPKPiPi); + flag = sign * BIT(aod::hf_cand_sigmac::DecayType::ScplusplusToPKPiPi); } /// look for Σc++(2520) if (flag == 0) { indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, Pdg::kSigmaCStarPlusPlus, std::array{+kProton, -kKPlus, +kPiPlus, +kPiPlus}, true, &sign, 3); if (indexRec > -1) { /// due to (*) no need to check anything for LambdaC - flag = sign * (1 << aod::hf_cand_sigmac::DecayType::ScStarPlusPlusToPKPiPi); + flag = sign * BIT(aod::hf_cand_sigmac::DecayType::ScStarPlusPlusToPKPiPi); } } } @@ -554,7 +554,7 @@ struct HfCandidateSigmac0plusplusMc { continue; if (RecoDecay::isMatchedMCGen(mcParticles, daughter, Pdg::kLambdaCPlus, std::array{+kProton, -kKPlus, +kPiPlus}, true, &sign, 2)) { /// Λc+ daughter decaying in pK-π+ found! - flag = sign * (1 << aod::hf_cand_sigmac::DecayType::Sc0ToPKPiPi); + flag = sign * BIT(aod::hf_cand_sigmac::DecayType::Sc0ToPKPiPi); break; } } @@ -566,7 +566,7 @@ struct HfCandidateSigmac0plusplusMc { continue; if (RecoDecay::isMatchedMCGen(mcParticles, daughter, Pdg::kLambdaCPlus, std::array{+kProton, -kKPlus, +kPiPlus}, true, &sign, 2)) { /// Λc+ daughter decaying in pK-π+ found! - flag = sign * (1 << aod::hf_cand_sigmac::DecayType::ScplusplusToPKPiPi); + flag = sign * BIT(aod::hf_cand_sigmac::DecayType::ScplusplusToPKPiPi); break; } } @@ -582,7 +582,7 @@ struct HfCandidateSigmac0plusplusMc { continue; if (RecoDecay::isMatchedMCGen(mcParticles, daughter, Pdg::kLambdaCPlus, std::array{+kProton, -kKPlus, +kPiPlus}, true, &sign, 2)) { /// Λc+ daughter decaying in pK-π+ found! - flag = sign * (1 << aod::hf_cand_sigmac::DecayType::ScStar0ToPKPiPi); + flag = sign * BIT(aod::hf_cand_sigmac::DecayType::ScStar0ToPKPiPi); break; } } @@ -594,7 +594,7 @@ struct HfCandidateSigmac0plusplusMc { continue; if (RecoDecay::isMatchedMCGen(mcParticles, daughter, Pdg::kLambdaCPlus, std::array{+kProton, -kKPlus, +kPiPlus}, true, &sign, 2)) { /// Λc+ daughter decaying in pK-π+ found! - flag = sign * (1 << aod::hf_cand_sigmac::DecayType::ScStarPlusPlusToPKPiPi); + flag = sign * BIT(aod::hf_cand_sigmac::DecayType::ScStarPlusPlusToPKPiPi); break; } } From 1c68b885c72147f657dfbe6a6fe565068b10326e Mon Sep 17 00:00:00 2001 From: Mattia Faggin Date: Wed, 23 Apr 2025 10:36:19 +0200 Subject: [PATCH 13/13] Fix O2linter issue. --- PWGHF/TableProducer/candidateCreatorSigmac0plusplus.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PWGHF/TableProducer/candidateCreatorSigmac0plusplus.cxx b/PWGHF/TableProducer/candidateCreatorSigmac0plusplus.cxx index c1e36b13119..c3cfe2d6049 100644 --- a/PWGHF/TableProducer/candidateCreatorSigmac0plusplus.cxx +++ b/PWGHF/TableProducer/candidateCreatorSigmac0plusplus.cxx @@ -143,8 +143,8 @@ struct HfCandidateCreatorSigmac0plusplus { softPiCuts.SetMaxChi2PerClusterITS(softPiChi2Max); // ITS hitmap std::set setSoftPiItsHitMap; // = {}; - constexpr std::size_t itsLayers = 7; - for (std::size_t idItsLayer = 0u; idItsLayer < itsLayers; idItsLayer++) { + constexpr std::size_t NLayersIts = 7; + for (std::size_t idItsLayer = 0u; idItsLayer < NLayersIts; idItsLayer++) { if (TESTBIT(softPiItsHitMap, idItsLayer)) { setSoftPiItsHitMap.insert(static_cast(idItsLayer)); }