From e3d7512fb0b219bfa1f0e187c5299b7f9feac173 Mon Sep 17 00:00:00 2001 From: Anton Riedel Date: Thu, 21 May 2026 22:22:50 +0200 Subject: [PATCH] Feat: small fixes in V0 & cascade histogramming --- PWGCF/Femto/Core/cascadeHistManager.h | 39 +++++++++++++++++---------- PWGCF/Femto/Core/v0HistManager.h | 13 ++++++--- PWGCF/Femto/Tasks/femtoV0Qa.cxx | 4 +-- 3 files changed, 36 insertions(+), 20 deletions(-) diff --git a/PWGCF/Femto/Core/cascadeHistManager.h b/PWGCF/Femto/Core/cascadeHistManager.h index 9ee370b5c22..5180f60856e 100644 --- a/PWGCF/Femto/Core/cascadeHistManager.h +++ b/PWGCF/Femto/Core/cascadeHistManager.h @@ -48,6 +48,7 @@ enum CascadeHist { kPhi, kMass, kSign, + kPtVsMass, // nice to have during analysis // qa variables kMassXi, kMassOmega, @@ -109,6 +110,8 @@ template struct ConfCascadeQaBinning : o2::framework::ConfigurableGroup { std::string prefix = Prefix; o2::framework::Configurable plot2d{"plot2d", true, "Enable 2d Qa histograms"}; + o2::framework::Configurable plotOrigins{"plotOrigins", true, "MC ONLY: Plot pt vs cosPa for different particle origins"}; + o2::framework::Configurable> pdgCodesForMothersOfSecondary{"pdgCodesForMothersOfSecondary", {3312, 3334}, "MC ONLY: PDG codes of mothers of secondaries (Max 3 will be considered)"}; o2::framework::ConfigurableAxis cosPa{"cosPa", {{100, 0.9, 1}}, "Cosine of poiting angle"}; o2::framework::ConfigurableAxis dauDcaAtDecay{"dauDcaAtDecay", {{150, 0, 1.5}}, "Daughter DCA at decay vertex"}; o2::framework::ConfigurableAxis transRadius{"transRadius", {{100, 0, 100}}, "Transverse radius"}; @@ -123,8 +126,8 @@ struct ConfCascadeQaBinning : o2::framework::ConfigurableGroup { constexpr const char PrefixXiQaBinning[] = "XiQaBinning"; using ConfXiQaBinning = ConfCascadeQaBinning; -constexpr const char PrefixOmegatQaBinning[] = "OmegaQaBinning"; -using ConfOmegaQaBinning = ConfCascadeQaBinning; +constexpr const char PrefixOmegaQaBinning[] = "OmegaQaBinning"; +using ConfOmegaQaBinning = ConfCascadeQaBinning; // must be in sync with enum TrackVariables // the enum gives the correct index in the array @@ -134,6 +137,7 @@ constexpr std::array, kCascadeHistLast> HistT {kPhi, o2::framework::HistType::kTH1F, "hPhi", "Azimuthal angle; #varphi; Entries"}, {kMass, o2::framework::HistType::kTH1F, "hMass", "Invariant Mass; m_{Inv} (GeV/#it{c}^{2}); Entries"}, {kSign, o2::framework::HistType::kTH1F, "hSign", "Sign (-1 -> antiparticle, 0 -> self conjugate, +1 -> particle); sign; Entries"}, + {kPtVsMass, o2::framework::HistType::kTH2F, "hPtVsMass", "Transverse momentum vs invariant mass; p_{T} (GeV/#it{c}); m_{Inv} (GeV/#it{c}^{2})"}, {kMassXi, o2::framework::HistType::kTH1F, "hMassXi", "Mass #Xi; m_{#Lambda#pi} (GeV/#it{c}^{2}); Entries"}, {kMassOmega, o2::framework::HistType::kTH1F, "hMassOmega", "mass #Omega; m_{#LambdaK} (GeV/#it{c}^{2}); Entries"}, {kCosPa, o2::framework::HistType::kTH1F, "hCosPa", "Cosine of pointing angle; cos(#alpha); Entries"}, @@ -163,9 +167,9 @@ constexpr std::array, kCascadeHistLast> HistT {kFromMaterial, o2::framework::HistType::kTH2F, "hFromMaterial", "Particles from material; p_{T} (GeV/#it{c}); cos(#alpha)"}, {kMissidentified, o2::framework::HistType::kTH2F, "hMissidentified", "Missidentified particles (fake/wrong PDG code); p_{T} (GeV/#it{c}); cos(#alpha)"}, {kSecondary1, o2::framework::HistType::kTH2F, "hFromSecondary1", "Particles from secondary decay; p_{T} (GeV/#it{c}); cos(#alpha)"}, - {kSecondary2, o2::framework::HistType::kTH2F, "hFromSecondary2", "Particles from seconary decay; p_{T} (GeV/#it{c}); cos(#alpha)"}, - {kSecondary3, o2::framework::HistType::kTH2F, "hFromSecondary3", "Particles from seconary decay; p_{T} (GeV/#it{c}); cos(#alpha)"}, - {kSecondaryOther, o2::framework::HistType::kTH2F, "hFromSecondaryOther", "Particles from every other seconary decay; p_{T} (GeV/#it{c}); cos(#alpha)"}}, + {kSecondary2, o2::framework::HistType::kTH2F, "hFromSecondary2", "Particles from secondary decay; p_{T} (GeV/#it{c}); cos(#alpha)"}, + {kSecondary3, o2::framework::HistType::kTH2F, "hFromSecondary3", "Particles from secondary decay; p_{T} (GeV/#it{c}); cos(#alpha)"}, + {kSecondaryOther, o2::framework::HistType::kTH2F, "hFromSecondaryOther", "Particles from every other secondary decay; p_{T} (GeV/#it{c}); cos(#alpha)"}}, }; #define CASCADE_HIST_ANALYSIS_MAP(conf) \ @@ -173,7 +177,8 @@ constexpr std::array, kCascadeHistLast> HistT {kEta, {conf.eta}}, \ {kPhi, {conf.phi}}, \ {kMass, {conf.mass}}, \ - {kSign, {conf.sign}}, + {kSign, {conf.sign}}, \ + {kPtVsMass, {conf.pt, conf.mass}}, #define CASCADE_HIST_MC_MAP(conf) \ {kTruePtVsPt, {conf.pt, conf.pt}}, \ @@ -184,12 +189,7 @@ constexpr std::array, kCascadeHistLast> HistT {kPdgPartonicMother, {conf.pdgCodes}}, #define CASCADE_HIST_QA_MAP(confAnalysis, confQa) \ - {kPt, {confAnalysis.pt}}, \ - {kEta, {confAnalysis.eta}}, \ - {kPhi, {confAnalysis.phi}}, \ - {kMass, {confAnalysis.mass}}, \ - {kSign, {confAnalysis.sign}}, \ - {kCosPa, {confQa.cosPa}}, \ + {kCosPa, {confQa.cosPa}}, \ {kDecayDauDca, {confQa.dauDcaAtDecay}}, \ {kTransRadius, {confQa.transRadius}}, \ {kLambdaCosPa, {confQa.lambdaCosPa}}, \ @@ -349,9 +349,9 @@ class CascadeHistManager std::map> const& BachelorSpecs, T3 const& ConfBachelorQaBinning, std::map> const& PosDauSpecs, - T4& ConfPosDauQaBinning, + T4 const& ConfPosDauQaBinning, std::map> const& NegDauSpecs, - T5& ConfNegDauQaBinning) + T5 const& ConfNegDauQaBinning) { mHistogramRegistry = registry; mPdgCode = std::abs(ConfCascadeSelection.pdgCodeAbs.value); @@ -454,6 +454,15 @@ class CascadeHistManager void enableOptionalHistograms(T const& CascadeConfBinningQa) { mPlot2d = CascadeConfBinningQa.plot2d.value; + mPlotOrigins = CascadeConfBinningQa.plotOrigins.value; + mPlotNSecondaries = CascadeConfBinningQa.pdgCodesForMothersOfSecondary.value.size(); + for (std::size_t i = 0; i < MaxSecondary; i++) { + if (i < CascadeConfBinningQa.pdgCodesForMothersOfSecondary.value.size()) { + mPdgCodesSecondaryMother.at(i) = std::abs(CascadeConfBinningQa.pdgCodesForMothersOfSecondary.value.at(i)); + } else { + mPdgCodesSecondaryMother.at(i) = 0; + } + } } void initAnalysis(std::map> const& cascadeSpecs) @@ -464,6 +473,7 @@ class CascadeHistManager mHistogramRegistry->add(analysisDir + getHistNameV2(kPhi, HistTable), getHistDesc(kPhi, HistTable), getHistType(kPhi, HistTable), {cascadeSpecs.at(kPhi)}); mHistogramRegistry->add(analysisDir + getHistNameV2(kMass, HistTable), getHistDesc(kMass, HistTable), getHistType(kMass, HistTable), {cascadeSpecs.at(kMass)}); mHistogramRegistry->add(analysisDir + getHistNameV2(kSign, HistTable), getHistDesc(kSign, HistTable), getHistType(kSign, HistTable), {cascadeSpecs.at(kSign)}); + mHistogramRegistry->add(analysisDir + getHistNameV2(kPtVsMass, HistTable), getHistDesc(kPtVsMass, HistTable), getHistType(kPtVsMass, HistTable), {cascadeSpecs.at(kPtVsMass)}); } void initQa(std::map> const& cascadeSpecs) @@ -540,6 +550,7 @@ class CascadeHistManager mHistogramRegistry->fill(HIST(cascadePrefix) + HIST(AnalysisDir) + HIST(getHistName(kPhi, HistTable)), cascadeCandidate.phi()); mHistogramRegistry->fill(HIST(cascadePrefix) + HIST(AnalysisDir) + HIST(getHistName(kMass, HistTable)), cascadeCandidate.mass()); mHistogramRegistry->fill(HIST(cascadePrefix) + HIST(AnalysisDir) + HIST(getHistName(kSign, HistTable)), cascadeCandidate.sign()); + mHistogramRegistry->fill(HIST(cascadePrefix) + HIST(AnalysisDir) + HIST(getHistName(kPtVsMass, HistTable)), cascadeCandidate.pt(), cascadeCandidate.mass()); } template diff --git a/PWGCF/Femto/Core/v0HistManager.h b/PWGCF/Femto/Core/v0HistManager.h index 3b9faba0a70..cdb87a09e8d 100644 --- a/PWGCF/Femto/Core/v0HistManager.h +++ b/PWGCF/Femto/Core/v0HistManager.h @@ -48,6 +48,7 @@ enum V0Hist { kPhi, kMass, kSign, + kPtVsMass, // nice to have during analysis // qa variables kMassLambda, kMassAntiLambda, @@ -148,6 +149,7 @@ constexpr std::array, kV0HistLast> HistTable = { {kPhi, o2::framework::HistType::kTH1F, "hPhi", "Azimuthal angle; #varphi; Entries"}, {kMass, o2::framework::HistType::kTH1F, "hMass", "Invariant Mass; m_{Inv} (GeV/#it{c}^{2}); Entries"}, {kSign, o2::framework::HistType::kTH1F, "hSign", "Sign (-1 -> antiparticle, 0 -> self conjugate, +1 -> particle); sign; Entries"}, + {kPtVsMass, o2::framework::HistType::kTH2F, "hPtVsMass", "Transverse momentum vs invariant mass; p_{T} (GeV/#it{c}); m_{Inv} (GeV/#it{c}^{2})"}, {kMassLambda, o2::framework::HistType::kTH1F, "hMassLambda", "#Lambda mass; m_{p#pi^{-}} (GeV/#it{c}^{2}); Entries"}, {kMassAntiLambda, o2::framework::HistType::kTH1F, "hMassAntiLambda", "#bar{#Lambda} mass; m_{#bar{p}#pi^{+}} (GeV/#it{c}^{2}); Entries"}, {kMassK0short, o2::framework::HistType::kTH1F, "hMassK0short", "K^{0}_{s} mass; m_{#pi^{+}#pi^{-}} (GeV/#it{c}^{2}); Entries"}, @@ -181,9 +183,9 @@ constexpr std::array, kV0HistLast> HistTable = { {kFromMaterial, o2::framework::HistType::kTH2F, "hFromMaterial", "Particles from material; p_{T} (GeV/#it{c}); cos(#alpha)"}, {kMissidentified, o2::framework::HistType::kTH2F, "hMissidentified", "Missidentified particles (fake/wrong PDG code); p_{T} (GeV/#it{c}); cos(#alpha)"}, {kSecondary1, o2::framework::HistType::kTH2F, "hFromSecondary1", "Particles from secondary decay; p_{T} (GeV/#it{c}); cos(#alpha)"}, - {kSecondary2, o2::framework::HistType::kTH2F, "hFromSecondary2", "Particles from seconary decay; p_{T} (GeV/#it{c}); cos(#alpha)"}, - {kSecondary3, o2::framework::HistType::kTH2F, "hFromSecondary3", "Particles from seconary decay; p_{T} (GeV/#it{c}); cos(#alpha)"}, - {kSecondaryOther, o2::framework::HistType::kTH2F, "hFromSecondaryOther", "Particles from every other seconary decay; p_{T} (GeV/#it{c}); cos(#alpha)"}}, + {kSecondary2, o2::framework::HistType::kTH2F, "hFromSecondary2", "Particles from secondary decay; p_{T} (GeV/#it{c}); cos(#alpha)"}, + {kSecondary3, o2::framework::HistType::kTH2F, "hFromSecondary3", "Particles from secondary decay; p_{T} (GeV/#it{c}); cos(#alpha)"}, + {kSecondaryOther, o2::framework::HistType::kTH2F, "hFromSecondaryOther", "Particles from every other secondary decay; p_{T} (GeV/#it{c}); cos(#alpha)"}}, }; #define V0_HIST_ANALYSIS_MAP(conf) \ @@ -191,7 +193,8 @@ constexpr std::array, kV0HistLast> HistTable = { {kEta, {conf.eta}}, \ {kPhi, {conf.phi}}, \ {kMass, {conf.mass}}, \ - {kSign, {conf.sign}}, + {kSign, {conf.sign}}, \ + {kPtVsMass, {conf.pt, conf.mass}}, #define V0_HIST_MC_MAP(conf) \ {kTruePtVsPt, {conf.pt, conf.pt}}, \ @@ -451,6 +454,7 @@ class V0HistManager mHistogramRegistry->add(analysisDir + getHistNameV2(kPhi, HistTable), getHistDesc(kPhi, HistTable), getHistType(kPhi, HistTable), {V0Specs.at(kPhi)}); mHistogramRegistry->add(analysisDir + getHistNameV2(kMass, HistTable), getHistDesc(kMass, HistTable), getHistType(kMass, HistTable), {V0Specs.at(kMass)}); mHistogramRegistry->add(analysisDir + getHistNameV2(kSign, HistTable), getHistDesc(kSign, HistTable), getHistType(kSign, HistTable), {V0Specs.at(kSign)}); + mHistogramRegistry->add(analysisDir + getHistNameV2(kPtVsMass, HistTable), getHistDesc(kPtVsMass, HistTable), getHistType(kPtVsMass, HistTable), {V0Specs.at(kPtVsMass)}); } void initQa(std::map> const& V0Specs) @@ -531,6 +535,7 @@ class V0HistManager mHistogramRegistry->fill(HIST(v0Prefix) + HIST(AnalysisDir) + HIST(getHistName(kEta, HistTable)), v0candidate.eta()); mHistogramRegistry->fill(HIST(v0Prefix) + HIST(AnalysisDir) + HIST(getHistName(kPhi, HistTable)), v0candidate.phi()); mHistogramRegistry->fill(HIST(v0Prefix) + HIST(AnalysisDir) + HIST(getHistName(kMass, HistTable)), v0candidate.mass()); + mHistogramRegistry->fill(HIST(v0Prefix) + HIST(AnalysisDir) + HIST(getHistName(kPtVsMass, HistTable)), v0candidate.pt(), v0candidate.mass()); if constexpr (modes::isEqual(v0, modes::V0::kLambda) || modes::isEqual(v0, modes::V0::kAntiLambda)) { mHistogramRegistry->fill(HIST(v0Prefix) + HIST(AnalysisDir) + HIST(getHistName(kSign, HistTable)), v0candidate.sign()); diff --git a/PWGCF/Femto/Tasks/femtoV0Qa.cxx b/PWGCF/Femto/Tasks/femtoV0Qa.cxx index a8bf0fa91e5..9d8af3870bd 100644 --- a/PWGCF/Femto/Tasks/femtoV0Qa.cxx +++ b/PWGCF/Femto/Tasks/femtoV0Qa.cxx @@ -120,7 +120,7 @@ struct FemtoV0Qa { void init(o2::framework::InitContext&) { - if ((doprocessLambda + doprocessLambdaMc + doprocessK0short + doprocessK0shortMc) > 1) { + if ((doprocessLambda + doprocessLambdaMc + doprocessK0short + doprocessK0shortMc) != 1) { LOG(fatal) << "Only one process can be activated"; } bool processData = doprocessLambda || doprocessK0short; @@ -220,7 +220,7 @@ struct FemtoV0Qa { lambdaHistManager.fill(lambda, tracks, mcParticles, mcMothers, mcPartonicMothers); } } - PROCESS_SWITCH(FemtoV0Qa, processLambdaMc, "Process lambdas", false); + PROCESS_SWITCH(FemtoV0Qa, processLambdaMc, "Process lambdas with MC informaton", false); }; o2::framework::WorkflowSpec defineDataProcessing(o2::framework::ConfigContext const& cfgc)