From 81f66fa683a9b79ff3a9b4cebad6e6c036b1e721 Mon Sep 17 00:00:00 2001 From: luagliet Date: Thu, 18 Apr 2024 09:02:48 +0200 Subject: [PATCH 01/13] merged changes to Dplus task on master --- .../candidateCreatorCharmResoReduced.cxx | 4 + PWGHF/D2H/Tasks/taskDplus.cxx | 241 +++++++++++------- 2 files changed, 146 insertions(+), 99 deletions(-) diff --git a/PWGHF/D2H/TableProducer/candidateCreatorCharmResoReduced.cxx b/PWGHF/D2H/TableProducer/candidateCreatorCharmResoReduced.cxx index 83dcb620172..181cd1d1ddb 100644 --- a/PWGHF/D2H/TableProducer/candidateCreatorCharmResoReduced.cxx +++ b/PWGHF/D2H/TableProducer/candidateCreatorCharmResoReduced.cxx @@ -61,6 +61,8 @@ auto vecBins = std::vector{binsPt, binsPt + nBins + 1}; struct HfCandidateCreatorCharmResoReduced { // Produces: Tables with resonance info Produces rowCandidateReso; + // Optional D daughter ML scores table + Produces mlScores; // Configurables Configurable invMassWindowD{"invMassWindowD", 0.5, "invariant-mass window for D candidates (GeV/c2)"}; @@ -70,6 +72,8 @@ struct HfCandidateCreatorCharmResoReduced { // Hist Axis Configurable> binsPt{"binsPt", std::vector{vecBins}, "pT bin limits"}; + using reducedDWithMl = soa::Join; + // Partition of V0 candidates based on v0Type Partition candidatesK0s = aod::hf_reso_cand_reduced::v0Type == (uint8_t)1 || aod::hf_reso_cand_reduced::v0Type == (uint8_t)3 || aod::hf_reso_cand_reduced::v0Type == (uint8_t)5; Partition candidatesLambda = aod::hf_reso_cand_reduced::v0Type == (uint8_t)2 || aod::hf_reso_cand_reduced::v0Type == (uint8_t)4; diff --git a/PWGHF/D2H/Tasks/taskDplus.cxx b/PWGHF/D2H/Tasks/taskDplus.cxx index 3911bfa53da..9f45a7139b9 100644 --- a/PWGHF/D2H/Tasks/taskDplus.cxx +++ b/PWGHF/D2H/Tasks/taskDplus.cxx @@ -16,6 +16,7 @@ /// \author Fabio Catalano , Politecnico and INFN Torino /// \author Vít Kučera , CERN /// \author Luca Aglietta , University and INFN Torino +/// \author Luca Aglietta , University and INFN Torino #include "CommonConstants/PhysicsConstants.h" #include "Framework/AnalysisTask.h" @@ -41,30 +42,22 @@ struct HfTaskDplus { ConfigurableAxis axisMlScore0{"axisMlScore0", {100, 0., 1.}, "axis for ML output score 0"}; ConfigurableAxis axisMlScore1{"axisMlScore1", {100, 0., 1.}, "axis for ML output score 1"}; ConfigurableAxis axisMlScore2{"axisMlScore2", {100, 0., 1.}, "axis for ML output score 2"}; + Configurable> classMl{"classMl", {0, 1, 2}, "Indexes of ML scores to be stored. Three indexes max."}; + ConfigurableAxis axisMlScore0{"axisMlScore0", {100, 0., 1.}, "axis for ML output score 0"}; + ConfigurableAxis axisMlScore1{"axisMlScore1", {100, 0., 1.}, "axis for ML output score 1"}; + ConfigurableAxis axisMlScore2{"axisMlScore2", {100, 0., 1.}, "axis for ML output score 2"}; HfHelper hfHelper; - using CandDplusData = soa::Filtered>; - using CandDplusDataWithMl = soa::Filtered>; - using CandDplusMcReco = soa::Filtered>; - using CandDplusMcRecoWithMl = soa::Filtered>; - using McParticles = soa::Join; - - Filter filterDplusFlag = (o2::aod::hf_track_index::hfflag & static_cast(BIT(aod::hf_cand_3prong::DecayType::DplusToPiKPi))) != static_cast(0); - - // data + using CandDplusData = soa::Join; + using CandDplusDataWithMl = soa::Join; + using CandDplusMcReco = soa::Join; + using CandDplusMcRecoWithMl = soa::Join; + Partition selectedDPlusCandidates = aod::hf_sel_candidate_dplus::isSelDplusToPiKPi >= selectionFlagDplus; Partition selectedDPlusCandidatesWithMl = aod::hf_sel_candidate_dplus::isSelDplusToPiKPi >= selectionFlagDplus; - - // Matched MC - Partition recoDPlusCandidates = nabs(aod::hf_cand_3prong::flagMcMatchRec) == static_cast(BIT(aod::hf_cand_3prong::DecayType::DplusToPiKPi)) && aod::hf_sel_candidate_dplus::isSelDplusToPiKPi >= selectionFlagDplus; - Partition recoDPlusCandidatesWithMl = nabs(aod::hf_cand_3prong::flagMcMatchRec) == static_cast(BIT(aod::hf_cand_3prong::DecayType::DplusToPiKPi)) && aod::hf_sel_candidate_dplus::isSelDplusToPiKPi >= selectionFlagDplus; - - // MC Bkg - Partition recoBkgCandidates = nabs(aod::hf_cand_3prong::flagMcMatchRec) != static_cast(BIT(aod::hf_cand_3prong::DecayType::DplusToPiKPi)) && aod::hf_sel_candidate_dplus::isSelDplusToPiKPi >= selectionFlagDplus; - Partition recoBkgCandidatesWithMl = nabs(aod::hf_cand_3prong::flagMcMatchRec) != static_cast(BIT(aod::hf_cand_3prong::DecayType::DplusToPiKPi)) && aod::hf_sel_candidate_dplus::isSelDplusToPiKPi >= selectionFlagDplus; - - // Generated particles + Partition recoFlagDPlusCandidates = aod::hf_sel_candidate_dplus::isSelDplusToPiKPi >= selectionFlagDplus; + Partition recoFlagDPlusCandidatesWithMl = aod::hf_sel_candidate_dplus::isSelDplusToPiKPi >= selectionFlagDplus; HistogramRegistry registry{ "registry", @@ -82,11 +75,13 @@ struct HfTaskDplus { { std::array doprocess{doprocessData, doprocessDataWithMl, doprocessMc, doprocessMcWithMl}; if ((std::accumulate(doprocess.begin(), doprocess.end(), 0)) != 1) { - LOGP(fatal, "Only one process function should be enabled! Please check your configuration!"); + LOGP(fatal, "no or more than one process function enabled! Please check your configuration!"); } auto vbins = (std::vector)binsPt; AxisSpec ptbins = {vbins, "#it{p}_{T} (GeV/#it{c})"}; AxisSpec massbins = {600, 1.67, 2.27, "inv. mass (K#pi#pi) (GeV/#it{c}^{2})"}; + AxisSpec ptbins = {vbins, "#it{p}_{T} (GeV/#it{c})"}; + AxisSpec massbins = {600, 1.67, 2.27, "inv. mass (K#pi#pi) (GeV/#it{c}^{2})"}; registry.add("hMass", "3-prong candidates;inv. mass (#pi K #pi) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{350, 1.7, 2.05}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); registry.add("hEta", "3-prong candidates;candidate #it{#eta};entries", {HistType::kTH2F, {{100, -2., 2.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); registry.add("hCt", "3-prong candidates;proper lifetime (D^{#pm}) * #it{c} (cm);entries", {HistType::kTH2F, {{120, -20., 100.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); @@ -139,110 +134,133 @@ struct HfTaskDplus { template void fillHisto(const T1& candidate) { - float pt = candidate.pt(); - registry.fill(HIST("hMass"), hfHelper.invMassDplusToPiKPi(candidate), pt); - registry.fill(HIST("hPt"), pt); - registry.fill(HIST("hEta"), candidate.eta(), pt); - registry.fill(HIST("hCt"), hfHelper.ctDplus(candidate), pt); - registry.fill(HIST("hDecayLength"), candidate.decayLength(), pt); - registry.fill(HIST("hDecayLengthXY"), candidate.decayLengthXY(), pt); - registry.fill(HIST("hNormalisedDecayLengthXY"), candidate.decayLengthXYNormalised(), pt); - registry.fill(HIST("hCPA"), candidate.cpa(), pt); - registry.fill(HIST("hCPAxy"), candidate.cpaXY(), pt); - registry.fill(HIST("hImpactParameterXY"), candidate.impactParameterXY(), pt); - registry.fill(HIST("hMaxNormalisedDeltaIP"), candidate.maxNormalisedDeltaIP(), pt); - registry.fill(HIST("hImpactParameterProngSqSum"), candidate.impactParameterProngSqSum(), pt); - registry.fill(HIST("hDecayLengthError"), candidate.errorDecayLength(), pt); - registry.fill(HIST("hDecayLengthXYError"), candidate.errorDecayLengthXY(), pt); - registry.fill(HIST("hImpactParameterError"), candidate.errorImpactParameter0(), pt); - registry.fill(HIST("hImpactParameterError"), candidate.errorImpactParameter1(), pt); - registry.fill(HIST("hImpactParameterError"), candidate.errorImpactParameter2(), pt); - registry.fill(HIST("hPtProng0"), candidate.ptProng0()); - registry.fill(HIST("hPtProng1"), candidate.ptProng1()); - registry.fill(HIST("hPtProng2"), candidate.ptProng2()); - registry.fill(HIST("hd0Prong0"), candidate.impactParameter0(), pt); - registry.fill(HIST("hd0Prong1"), candidate.impactParameter1(), pt); - registry.fill(HIST("hd0Prong2"), candidate.impactParameter2(), pt); + // not possible in Filter since expressions do not support binary operators + if (!(candidate.hfflag() & 1 << aod::hf_cand_3prong::DecayType::DplusToPiKPi)) { + return; + } + if (yCandRecoMax >= 0. && std::abs(hfHelper.yDplus(candidate)) > yCandRecoMax) { + return; + } + float pt = candidate.pt(); + registry.fill(HIST("hMass"), hfHelper.invMassDplusToPiKPi(candidate), pt); + registry.fill(HIST("hPt"), pt); + registry.fill(HIST("hEta"), candidate.eta(), pt); + registry.fill(HIST("hCt"), hfHelper.ctDplus(candidate), pt); + registry.fill(HIST("hDecayLength"), candidate.decayLength(), pt); + registry.fill(HIST("hDecayLengthXY"), candidate.decayLengthXY(), pt); + registry.fill(HIST("hNormalisedDecayLengthXY"), candidate.decayLengthXYNormalised(), pt); + registry.fill(HIST("hCPA"), candidate.cpa(), pt); + registry.fill(HIST("hCPAxy"), candidate.cpaXY(), pt); + registry.fill(HIST("hImpactParameterXY"), candidate.impactParameterXY(), pt); + registry.fill(HIST("hMaxNormalisedDeltaIP"), candidate.maxNormalisedDeltaIP(), pt); + registry.fill(HIST("hImpactParameterProngSqSum"), candidate.impactParameterProngSqSum(), pt); + registry.fill(HIST("hDecayLengthError"), candidate.errorDecayLength(), pt); + registry.fill(HIST("hDecayLengthXYError"), candidate.errorDecayLengthXY(), pt); + registry.fill(HIST("hImpactParameterError"), candidate.errorImpactParameter0(), pt); + registry.fill(HIST("hImpactParameterError"), candidate.errorImpactParameter1(), pt); + registry.fill(HIST("hImpactParameterError"), candidate.errorImpactParameter2(), pt); + registry.fill(HIST("hPtProng0"), candidate.ptProng0()); + registry.fill(HIST("hPtProng1"), candidate.ptProng1()); + registry.fill(HIST("hPtProng2"), candidate.ptProng2()); + registry.fill(HIST("hd0Prong0"), candidate.impactParameter0(), pt); + registry.fill(HIST("hd0Prong1"), candidate.impactParameter1(), pt); + registry.fill(HIST("hd0Prong2"), candidate.impactParameter2(), pt); } - // Fill THnSparses for the ML analysis + // Fill THnSparses for the reconstructed Dplus candidates ML analysis for the reconstructed Dplus candidates /// \param candidate is a particle candidate - template - void fillSparseML(const T1& candidate) + template + void fillSparseML (const T1& candidate) { + if (!(candidate.hfflag() & 1 << aod::hf_cand_3prong::DecayType::DplusToPiKPi) || (yCandRecoMax >= 0. && std::abs(hfHelper.yDplus(candidate)) > yCandRecoMax)) { + return; + } std::vector outputMl = {-999., -999., -999.}; - for (unsigned int iclass = 0; iclass < classMl->size(); iclass++) { + for (unsigned int iclass = 0; iclass < classMl->size(); iclass++) { outputMl[iclass] = candidate.mlProbDplusToPiKPi()[classMl->at(iclass)]; } - if constexpr (isMc) { - if constexpr (isMatched) { + if constexpr(isMc){ + if (std::abs(candidate.flagMcMatchRec()) == 1 << aod::hf_cand_3prong::DecayType::DplusToPiKPi) { if (candidate.originMcRec() == RecoDecay::OriginType::Prompt) { registry.fill(HIST("hSparseMassPrompt"), hfHelper.invMassDplusToPiKPi(candidate), candidate.pt(), outputMl[0], outputMl[1], outputMl[2]); - } else if (candidate.originMcRec() == RecoDecay::OriginType::NonPrompt) { + } + if (candidate.originMcRec() == RecoDecay::OriginType::NonPrompt) { registry.fill(HIST("hSparseMassFD"), hfHelper.invMassDplusToPiKPi(candidate), candidate.pt(), outputMl[0], outputMl[1], outputMl[2]); } - } else { - registry.fill(HIST("hSparseMassBkg"), hfHelper.invMassDplusToPiKPi(candidate), candidate.pt(), outputMl[0], outputMl[1], outputMl[2]); - } + } else{ + registry.fill(HIST("hSparseMassBkg"), hfHelper.invMassDplusToPiKPi(candidate), candidate.pt(), outputMl[0], outputMl[1], outputMl[2]); + } } else { registry.fill(HIST("hSparseMass"), hfHelper.invMassDplusToPiKPi(candidate), candidate.pt(), outputMl[0], outputMl[1], outputMl[2]); } } - // Fill histograms of quantities for the reconstructed Dplus candidates with MC matching + // Fill histograms of quantities for the reconstructed Dplus candidates, with MC matching /// \param candidate is candidate - template - void fillHistoMCRec(const T1& candidate) + /// \param mcParticles are particles with MC information + template + void fillHistoMCRec(const T1& candidate, const T2& mcParticles) { - if constexpr (isMatched) { - auto ptRec = candidate.pt(); - auto yRec = hfHelper.yDplus(candidate); - registry.fill(HIST("hPtVsYRecSig_RecoSkim"), ptRec, yRec); - if (TESTBIT(candidate.isSelDplusToPiKPi(), aod::SelectionStep::RecoTopol)) { - registry.fill(HIST("hPtVsYRecSigRecoTopol"), ptRec, yRec); - } - if (TESTBIT(candidate.isSelDplusToPiKPi(), aod::SelectionStep::RecoPID)) { - registry.fill(HIST("hPtVsYRecSig_RecoPID"), ptRec, yRec); + // not possible in Filter since expressions do not support binary operators + if (!(candidate.hfflag() & 1 << aod::hf_cand_3prong::DecayType::DplusToPiKPi)) { + return; } - if (candidate.isSelDplusToPiKPi() >= selectionFlagDplus) { - registry.fill(HIST("hPtRecSig"), ptRec); // rec. level pT + if (yCandRecoMax >= 0. && std::abs(hfHelper.yDplus(candidate)) > yCandRecoMax) { + return; } - if (candidate.originMcRec() == RecoDecay::OriginType::Prompt) { - registry.fill(HIST("hPtVsYRecSigPrompt_RecoSkim"), ptRec, yRec); + if (std::abs(candidate.flagMcMatchRec()) == 1 << aod::hf_cand_3prong::DecayType::DplusToPiKPi) { + // Get the corresponding MC particle. + auto indexMother = RecoDecay::getMother(mcParticles, candidate.template prong0_as().template mcParticle_as>(), o2::constants::physics::Pdg::kDPlus, true); + auto particleMother = mcParticles.rawIteratorAt(indexMother); + registry.fill(HIST("hPtGenSig"), particleMother.pt()); // gen. level pT + auto ptRec = candidate.pt(); + auto yRec = hfHelper.yDplus(candidate); + registry.fill(HIST("hPtVsYRecSig_RecoSkim"), ptRec, yRec); if (TESTBIT(candidate.isSelDplusToPiKPi(), aod::SelectionStep::RecoTopol)) { - registry.fill(HIST("hPtVsYRecSigPromptRecoTopol"), ptRec, yRec); + registry.fill(HIST("hPtVsYRecSigRecoTopol"), ptRec, yRec); } if (TESTBIT(candidate.isSelDplusToPiKPi(), aod::SelectionStep::RecoPID)) { - registry.fill(HIST("hPtVsYRecSigPromptRecoPID"), ptRec, yRec); + registry.fill(HIST("hPtVsYRecSig_RecoPID"), ptRec, yRec); } if (candidate.isSelDplusToPiKPi() >= selectionFlagDplus) { - registry.fill(HIST("hPtRecSigPrompt"), ptRec); // rec. level pT, prompt - } - } else { - registry.fill(HIST("hPtVsYRecSigNonPrompt_RecoSkim"), ptRec, yRec); - if (TESTBIT(candidate.isSelDplusToPiKPi(), aod::SelectionStep::RecoTopol)) { - registry.fill(HIST("hPtVsYRecSigNonPromptRecoTopol"), ptRec, yRec); - } - if (TESTBIT(candidate.isSelDplusToPiKPi(), aod::SelectionStep::RecoPID)) { - registry.fill(HIST("hPtVsYRecSigNonPromptRecoPID"), ptRec, yRec); + registry.fill(HIST("hPtRecSig"), ptRec); // rec. level pT } - if (candidate.isSelDplusToPiKPi() >= selectionFlagDplus) { - registry.fill(HIST("hPtRecSigNonPrompt"), ptRec); // rec. level pT, non-prompt + if (candidate.originMcRec() == RecoDecay::OriginType::Prompt) { + registry.fill(HIST("hPtVsYRecSigPrompt_RecoSkim"), ptRec, yRec); + if (TESTBIT(candidate.isSelDplusToPiKPi(), aod::SelectionStep::RecoTopol)) { + registry.fill(HIST("hPtVsYRecSigPromptRecoTopol"), ptRec, yRec); + } + if (TESTBIT(candidate.isSelDplusToPiKPi(), aod::SelectionStep::RecoPID)) { + registry.fill(HIST("hPtVsYRecSigPromptRecoPID"), ptRec, yRec); + } + if (candidate.isSelDplusToPiKPi() >= selectionFlagDplus) { + registry.fill(HIST("hPtRecSigPrompt"), ptRec); // rec. level pT, prompt + } + } else { + registry.fill(HIST("hPtVsYRecSigNonPrompt_RecoSkim"), ptRec, yRec); + if (TESTBIT(candidate.isSelDplusToPiKPi(), aod::SelectionStep::RecoTopol)) { + registry.fill(HIST("hPtVsYRecSigNonPromptRecoTopol"), ptRec, yRec); + } + if (TESTBIT(candidate.isSelDplusToPiKPi(), aod::SelectionStep::RecoPID)) { + registry.fill(HIST("hPtVsYRecSigNonPromptRecoPID"), ptRec, yRec); + } + if (candidate.isSelDplusToPiKPi() >= selectionFlagDplus) { + registry.fill(HIST("hPtRecSigNonPrompt"), ptRec); // rec. level pT, non-prompt + } } + registry.fill(HIST("hCPARecSig"), candidate.cpa()); + registry.fill(HIST("hEtaRecSig"), candidate.eta()); + } else { + registry.fill(HIST("hPtRecBg"), candidate.pt()); + registry.fill(HIST("hCPARecBg"), candidate.cpa()); + registry.fill(HIST("hEtaRecBg"), candidate.eta()); } - registry.fill(HIST("hCPARecSig"), candidate.cpa()); - registry.fill(HIST("hEtaRecSig"), candidate.eta()); - } else { - registry.fill(HIST("hPtRecBg"), candidate.pt()); - registry.fill(HIST("hCPARecBg"), candidate.cpa()); - registry.fill(HIST("hEtaRecBg"), candidate.eta()); - } } - + // Fill histograms of quantities for generated Dplus particles /// \param particle is a particle with MC information - template - void fillHistoMCGen(const T2& particle) + template + void fillHistoMCGen(const T3& particle) { auto ptGen = particle.pt(); auto yGen = RecoDecay::y(std::array{particle.px(), particle.py(), particle.pz()}, o2::constants::physics::MassDPlus); @@ -333,27 +351,52 @@ struct HfTaskDplus { // process functions void processData(CandDplusData const& candidates) { - runDataAnalysis(candidates); + for (const auto& candidate : selectedDPlusCandidates) { + fillHisto(candidate); + } } PROCESS_SWITCH(HfTaskDplus, processData, "Process data w/o ML", true); void processDataWithMl(CandDplusDataWithMl const& candidates) { - runDataAnalysis(candidates); + for (const auto& candidate : selectedDPlusCandidatesWithMl) { + fillHisto(candidate); + fillSparseML(candidate); + } } PROCESS_SWITCH(HfTaskDplus, processDataWithMl, "Process data with ML", false); void processMc(CandDplusMcReco const& candidates, - McParticles const& mcParticles) + soa::Join const& mcParticles, + aod::TracksWMc const& tracks) { - runMCAnalysis(candidates, mcParticles); + // MC rec. + for (const auto& candidate : recoFlagDPlusCandidates) { + fillHisto(candidate); + fillHistoMCRec(candidate, mcParticles); + } + // MC gen. + for (const auto& particle : mcParticles) { + fillHistoMCGen(particle); + } } PROCESS_SWITCH(HfTaskDplus, processMc, "Process MC w/o ML", false); void processMcWithMl(CandDplusMcRecoWithMl const& candidates, - McParticles const& mcParticles) + soa::Join const& mcParticles, + aod::TracksWMc const& tracks) { - runMCAnalysis(candidates, mcParticles); + // MC rec. + for (const auto& candidate : recoFlagDPlusCandidatesWithMl) { + fillHisto(candidate); + fillHistoMCRec(candidate, mcParticles); + fillSparseML(candidate); + + } + // MC gen. + for (const auto& particle : mcParticles) { + fillHistoMCGen(particle); + } } PROCESS_SWITCH(HfTaskDplus, processMcWithMl, "Process MC with ML", false); }; From a4ec2e6b38e274c24b5f4e6a70a12eecf60c66c1 Mon Sep 17 00:00:00 2001 From: luagliet Date: Wed, 3 Apr 2024 15:52:31 +0200 Subject: [PATCH 02/13] marginal change --- PWGHF/D2H/Tasks/taskDplus.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGHF/D2H/Tasks/taskDplus.cxx b/PWGHF/D2H/Tasks/taskDplus.cxx index 9f45a7139b9..2f67798a85c 100644 --- a/PWGHF/D2H/Tasks/taskDplus.cxx +++ b/PWGHF/D2H/Tasks/taskDplus.cxx @@ -195,7 +195,7 @@ struct HfTaskDplus { } } - // Fill histograms of quantities for the reconstructed Dplus candidates, with MC matching + // Fill histograms of quantities for the reconstructed Dplus candidates with MC matching /// \param candidate is candidate /// \param mcParticles are particles with MC information template From 024f2fe1de5b70480985ee23e993081646a13628 Mon Sep 17 00:00:00 2001 From: ALICE Action Bot Date: Wed, 3 Apr 2024 13:57:46 +0000 Subject: [PATCH 03/13] Please consider the following formatting changes --- PWGHF/D2H/Tasks/taskDplus.cxx | 35 +++++++++++++++++------------------ 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/PWGHF/D2H/Tasks/taskDplus.cxx b/PWGHF/D2H/Tasks/taskDplus.cxx index 2f67798a85c..10b0f8e6ef1 100644 --- a/PWGHF/D2H/Tasks/taskDplus.cxx +++ b/PWGHF/D2H/Tasks/taskDplus.cxx @@ -53,7 +53,7 @@ struct HfTaskDplus { using CandDplusDataWithMl = soa::Join; using CandDplusMcReco = soa::Join; using CandDplusMcRecoWithMl = soa::Join; - + Partition selectedDPlusCandidates = aod::hf_sel_candidate_dplus::isSelDplusToPiKPi >= selectionFlagDplus; Partition selectedDPlusCandidatesWithMl = aod::hf_sel_candidate_dplus::isSelDplusToPiKPi >= selectionFlagDplus; Partition recoFlagDPlusCandidates = aod::hf_sel_candidate_dplus::isSelDplusToPiKPi >= selectionFlagDplus; @@ -135,8 +135,8 @@ struct HfTaskDplus { void fillHisto(const T1& candidate) { // not possible in Filter since expressions do not support binary operators - if (!(candidate.hfflag() & 1 << aod::hf_cand_3prong::DecayType::DplusToPiKPi)) { - return; + if (!(candidate.hfflag() & 1 << aod::hf_cand_3prong::DecayType::DplusToPiKPi)) { + return; } if (yCandRecoMax >= 0. && std::abs(hfHelper.yDplus(candidate)) > yCandRecoMax) { return; @@ -167,43 +167,43 @@ struct HfTaskDplus { registry.fill(HIST("hd0Prong2"), candidate.impactParameter2(), pt); } - // Fill THnSparses for the reconstructed Dplus candidates ML analysis for the reconstructed Dplus candidates + // Fill THnSparses for the reconstructed Dplus candidates ML analysis for the reconstructed Dplus candidates /// \param candidate is a particle candidate template - void fillSparseML (const T1& candidate) + void fillSparseML(const T1& candidate) { if (!(candidate.hfflag() & 1 << aod::hf_cand_3prong::DecayType::DplusToPiKPi) || (yCandRecoMax >= 0. && std::abs(hfHelper.yDplus(candidate)) > yCandRecoMax)) { return; } std::vector outputMl = {-999., -999., -999.}; - for (unsigned int iclass = 0; iclass < classMl->size(); iclass++) { + for (unsigned int iclass = 0; iclass < classMl->size(); iclass++) { outputMl[iclass] = candidate.mlProbDplusToPiKPi()[classMl->at(iclass)]; } - if constexpr(isMc){ + if constexpr (isMc) { if (std::abs(candidate.flagMcMatchRec()) == 1 << aod::hf_cand_3prong::DecayType::DplusToPiKPi) { if (candidate.originMcRec() == RecoDecay::OriginType::Prompt) { registry.fill(HIST("hSparseMassPrompt"), hfHelper.invMassDplusToPiKPi(candidate), candidate.pt(), outputMl[0], outputMl[1], outputMl[2]); - } + } if (candidate.originMcRec() == RecoDecay::OriginType::NonPrompt) { registry.fill(HIST("hSparseMassFD"), hfHelper.invMassDplusToPiKPi(candidate), candidate.pt(), outputMl[0], outputMl[1], outputMl[2]); } - } else{ - registry.fill(HIST("hSparseMassBkg"), hfHelper.invMassDplusToPiKPi(candidate), candidate.pt(), outputMl[0], outputMl[1], outputMl[2]); - } + } else { + registry.fill(HIST("hSparseMassBkg"), hfHelper.invMassDplusToPiKPi(candidate), candidate.pt(), outputMl[0], outputMl[1], outputMl[2]); + } } else { registry.fill(HIST("hSparseMass"), hfHelper.invMassDplusToPiKPi(candidate), candidate.pt(), outputMl[0], outputMl[1], outputMl[2]); } } - // Fill histograms of quantities for the reconstructed Dplus candidates with MC matching + // Fill histograms of quantities for the reconstructed Dplus candidates with MC matching /// \param candidate is candidate /// \param mcParticles are particles with MC information template void fillHistoMCRec(const T1& candidate, const T2& mcParticles) { // not possible in Filter since expressions do not support binary operators - if (!(candidate.hfflag() & 1 << aod::hf_cand_3prong::DecayType::DplusToPiKPi)) { - return; + if (!(candidate.hfflag() & 1 << aod::hf_cand_3prong::DecayType::DplusToPiKPi)) { + return; } if (yCandRecoMax >= 0. && std::abs(hfHelper.yDplus(candidate)) > yCandRecoMax) { return; @@ -256,7 +256,7 @@ struct HfTaskDplus { registry.fill(HIST("hEtaRecBg"), candidate.eta()); } } - + // Fill histograms of quantities for generated Dplus particles /// \param particle is a particle with MC information template @@ -383,15 +383,14 @@ struct HfTaskDplus { PROCESS_SWITCH(HfTaskDplus, processMc, "Process MC w/o ML", false); void processMcWithMl(CandDplusMcRecoWithMl const& candidates, - soa::Join const& mcParticles, - aod::TracksWMc const& tracks) + soa::Join const& mcParticles, + aod::TracksWMc const& tracks) { // MC rec. for (const auto& candidate : recoFlagDPlusCandidatesWithMl) { fillHisto(candidate); fillHistoMCRec(candidate, mcParticles); fillSparseML(candidate); - } // MC gen. for (const auto& particle : mcParticles) { From e00cbe2e95a56f7b0272d96510b52c82a3967fd3 Mon Sep 17 00:00:00 2001 From: ALICE Action Bot Date: Wed, 3 Apr 2024 13:59:35 +0000 Subject: [PATCH 04/13] Please consider the following formatting changes --- PWGHF/D2H/Tasks/taskDplus.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PWGHF/D2H/Tasks/taskDplus.cxx b/PWGHF/D2H/Tasks/taskDplus.cxx index 10b0f8e6ef1..005c4d88981 100644 --- a/PWGHF/D2H/Tasks/taskDplus.cxx +++ b/PWGHF/D2H/Tasks/taskDplus.cxx @@ -137,7 +137,7 @@ struct HfTaskDplus { // not possible in Filter since expressions do not support binary operators if (!(candidate.hfflag() & 1 << aod::hf_cand_3prong::DecayType::DplusToPiKPi)) { return; - } + } if (yCandRecoMax >= 0. && std::abs(hfHelper.yDplus(candidate)) > yCandRecoMax) { return; } @@ -204,7 +204,7 @@ struct HfTaskDplus { // not possible in Filter since expressions do not support binary operators if (!(candidate.hfflag() & 1 << aod::hf_cand_3prong::DecayType::DplusToPiKPi)) { return; - } + } if (yCandRecoMax >= 0. && std::abs(hfHelper.yDplus(candidate)) > yCandRecoMax) { return; } From 440a99869e9681072aaad5e349bc998c82b57d95 Mon Sep 17 00:00:00 2001 From: ALICE Action Bot Date: Wed, 3 Apr 2024 14:03:08 +0000 Subject: [PATCH 05/13] Please consider the following formatting changes --- PWGHF/D2H/Tasks/taskDplus.cxx | 82 +++++++++++++++++------------------ 1 file changed, 41 insertions(+), 41 deletions(-) diff --git a/PWGHF/D2H/Tasks/taskDplus.cxx b/PWGHF/D2H/Tasks/taskDplus.cxx index 005c4d88981..4d9c7f340a5 100644 --- a/PWGHF/D2H/Tasks/taskDplus.cxx +++ b/PWGHF/D2H/Tasks/taskDplus.cxx @@ -205,56 +205,56 @@ struct HfTaskDplus { if (!(candidate.hfflag() & 1 << aod::hf_cand_3prong::DecayType::DplusToPiKPi)) { return; } - if (yCandRecoMax >= 0. && std::abs(hfHelper.yDplus(candidate)) > yCandRecoMax) { - return; + if (yCandRecoMax >= 0. && std::abs(hfHelper.yDplus(candidate)) > yCandRecoMax) { + return; + } + if (std::abs(candidate.flagMcMatchRec()) == 1 << aod::hf_cand_3prong::DecayType::DplusToPiKPi) { + // Get the corresponding MC particle. + auto indexMother = RecoDecay::getMother(mcParticles, candidate.template prong0_as().template mcParticle_as>(), o2::constants::physics::Pdg::kDPlus, true); + auto particleMother = mcParticles.rawIteratorAt(indexMother); + registry.fill(HIST("hPtGenSig"), particleMother.pt()); // gen. level pT + auto ptRec = candidate.pt(); + auto yRec = hfHelper.yDplus(candidate); + registry.fill(HIST("hPtVsYRecSig_RecoSkim"), ptRec, yRec); + if (TESTBIT(candidate.isSelDplusToPiKPi(), aod::SelectionStep::RecoTopol)) { + registry.fill(HIST("hPtVsYRecSigRecoTopol"), ptRec, yRec); } - if (std::abs(candidate.flagMcMatchRec()) == 1 << aod::hf_cand_3prong::DecayType::DplusToPiKPi) { - // Get the corresponding MC particle. - auto indexMother = RecoDecay::getMother(mcParticles, candidate.template prong0_as().template mcParticle_as>(), o2::constants::physics::Pdg::kDPlus, true); - auto particleMother = mcParticles.rawIteratorAt(indexMother); - registry.fill(HIST("hPtGenSig"), particleMother.pt()); // gen. level pT - auto ptRec = candidate.pt(); - auto yRec = hfHelper.yDplus(candidate); - registry.fill(HIST("hPtVsYRecSig_RecoSkim"), ptRec, yRec); + if (TESTBIT(candidate.isSelDplusToPiKPi(), aod::SelectionStep::RecoPID)) { + registry.fill(HIST("hPtVsYRecSig_RecoPID"), ptRec, yRec); + } + if (candidate.isSelDplusToPiKPi() >= selectionFlagDplus) { + registry.fill(HIST("hPtRecSig"), ptRec); // rec. level pT + } + if (candidate.originMcRec() == RecoDecay::OriginType::Prompt) { + registry.fill(HIST("hPtVsYRecSigPrompt_RecoSkim"), ptRec, yRec); if (TESTBIT(candidate.isSelDplusToPiKPi(), aod::SelectionStep::RecoTopol)) { - registry.fill(HIST("hPtVsYRecSigRecoTopol"), ptRec, yRec); + registry.fill(HIST("hPtVsYRecSigPromptRecoTopol"), ptRec, yRec); } if (TESTBIT(candidate.isSelDplusToPiKPi(), aod::SelectionStep::RecoPID)) { - registry.fill(HIST("hPtVsYRecSig_RecoPID"), ptRec, yRec); + registry.fill(HIST("hPtVsYRecSigPromptRecoPID"), ptRec, yRec); } if (candidate.isSelDplusToPiKPi() >= selectionFlagDplus) { - registry.fill(HIST("hPtRecSig"), ptRec); // rec. level pT - } - if (candidate.originMcRec() == RecoDecay::OriginType::Prompt) { - registry.fill(HIST("hPtVsYRecSigPrompt_RecoSkim"), ptRec, yRec); - if (TESTBIT(candidate.isSelDplusToPiKPi(), aod::SelectionStep::RecoTopol)) { - registry.fill(HIST("hPtVsYRecSigPromptRecoTopol"), ptRec, yRec); - } - if (TESTBIT(candidate.isSelDplusToPiKPi(), aod::SelectionStep::RecoPID)) { - registry.fill(HIST("hPtVsYRecSigPromptRecoPID"), ptRec, yRec); - } - if (candidate.isSelDplusToPiKPi() >= selectionFlagDplus) { - registry.fill(HIST("hPtRecSigPrompt"), ptRec); // rec. level pT, prompt - } - } else { - registry.fill(HIST("hPtVsYRecSigNonPrompt_RecoSkim"), ptRec, yRec); - if (TESTBIT(candidate.isSelDplusToPiKPi(), aod::SelectionStep::RecoTopol)) { - registry.fill(HIST("hPtVsYRecSigNonPromptRecoTopol"), ptRec, yRec); - } - if (TESTBIT(candidate.isSelDplusToPiKPi(), aod::SelectionStep::RecoPID)) { - registry.fill(HIST("hPtVsYRecSigNonPromptRecoPID"), ptRec, yRec); - } - if (candidate.isSelDplusToPiKPi() >= selectionFlagDplus) { - registry.fill(HIST("hPtRecSigNonPrompt"), ptRec); // rec. level pT, non-prompt - } + registry.fill(HIST("hPtRecSigPrompt"), ptRec); // rec. level pT, prompt } - registry.fill(HIST("hCPARecSig"), candidate.cpa()); - registry.fill(HIST("hEtaRecSig"), candidate.eta()); } else { - registry.fill(HIST("hPtRecBg"), candidate.pt()); - registry.fill(HIST("hCPARecBg"), candidate.cpa()); - registry.fill(HIST("hEtaRecBg"), candidate.eta()); + registry.fill(HIST("hPtVsYRecSigNonPrompt_RecoSkim"), ptRec, yRec); + if (TESTBIT(candidate.isSelDplusToPiKPi(), aod::SelectionStep::RecoTopol)) { + registry.fill(HIST("hPtVsYRecSigNonPromptRecoTopol"), ptRec, yRec); + } + if (TESTBIT(candidate.isSelDplusToPiKPi(), aod::SelectionStep::RecoPID)) { + registry.fill(HIST("hPtVsYRecSigNonPromptRecoPID"), ptRec, yRec); + } + if (candidate.isSelDplusToPiKPi() >= selectionFlagDplus) { + registry.fill(HIST("hPtRecSigNonPrompt"), ptRec); // rec. level pT, non-prompt + } } + registry.fill(HIST("hCPARecSig"), candidate.cpa()); + registry.fill(HIST("hEtaRecSig"), candidate.eta()); + } else { + registry.fill(HIST("hPtRecBg"), candidate.pt()); + registry.fill(HIST("hCPARecBg"), candidate.cpa()); + registry.fill(HIST("hEtaRecBg"), candidate.eta()); + } } // Fill histograms of quantities for generated Dplus particles From e797a81883d05c17d41dcb67f25235fb6dadd876 Mon Sep 17 00:00:00 2001 From: luagliet Date: Thu, 18 Apr 2024 09:06:51 +0200 Subject: [PATCH 06/13] try2 --- PWGHF/D2H/Tasks/taskDplus.cxx | 164 ++++++++++++++-------------------- 1 file changed, 65 insertions(+), 99 deletions(-) diff --git a/PWGHF/D2H/Tasks/taskDplus.cxx b/PWGHF/D2H/Tasks/taskDplus.cxx index 4d9c7f340a5..fb692ff59ba 100644 --- a/PWGHF/D2H/Tasks/taskDplus.cxx +++ b/PWGHF/D2H/Tasks/taskDplus.cxx @@ -49,15 +49,28 @@ struct HfTaskDplus { HfHelper hfHelper; - using CandDplusData = soa::Join; - using CandDplusDataWithMl = soa::Join; - using CandDplusMcReco = soa::Join; - using CandDplusMcRecoWithMl = soa::Join; + using CandDplusData = soa::Filtered>; + using CandDplusDataWithMl = soa::Filtered>; + using CandDplusMcReco = soa::Filtered>; + using CandDplusMcRecoWithMl = soa::Filtered>; + using McParticles = soa::Join; + Filter filterDplusFlag = (o2::aod::hf_track_index::hfflag & static_cast(BIT(aod::hf_cand_3prong::DecayType::DplusToPiKPi))) != static_cast(0); + + //data Partition selectedDPlusCandidates = aod::hf_sel_candidate_dplus::isSelDplusToPiKPi >= selectionFlagDplus; Partition selectedDPlusCandidatesWithMl = aod::hf_sel_candidate_dplus::isSelDplusToPiKPi >= selectionFlagDplus; - Partition recoFlagDPlusCandidates = aod::hf_sel_candidate_dplus::isSelDplusToPiKPi >= selectionFlagDplus; - Partition recoFlagDPlusCandidatesWithMl = aod::hf_sel_candidate_dplus::isSelDplusToPiKPi >= selectionFlagDplus; + + //Matched MC + Partition recoDPlusCandidates = nabs(aod::hf_cand_3prong::flagMcMatchRec) == static_cast(BIT(aod::hf_cand_3prong::DecayType::DplusToPiKPi)) && aod::hf_sel_candidate_dplus::isSelDplusToPiKPi >= selectionFlagDplus; + Partition recoDPlusCandidatesWithMl = nabs(aod::hf_cand_3prong::flagMcMatchRec) == static_cast(BIT(aod::hf_cand_3prong::DecayType::DplusToPiKPi)) && aod::hf_sel_candidate_dplus::isSelDplusToPiKPi >= selectionFlagDplus; + + //MC Bkg + Partition recoBkgCandidates = nabs(aod::hf_cand_3prong::flagMcMatchRec) != static_cast(BIT(aod::hf_cand_3prong::DecayType::DplusToPiKPi)) && aod::hf_sel_candidate_dplus::isSelDplusToPiKPi >= selectionFlagDplus; + Partition recoBkgCandidatesWithMl = nabs(aod::hf_cand_3prong::flagMcMatchRec) != static_cast(BIT(aod::hf_cand_3prong::DecayType::DplusToPiKPi)) && aod::hf_sel_candidate_dplus::isSelDplusToPiKPi >= selectionFlagDplus; + + //Generated particles + HistogramRegistry registry{ "registry", @@ -75,7 +88,7 @@ struct HfTaskDplus { { std::array doprocess{doprocessData, doprocessDataWithMl, doprocessMc, doprocessMcWithMl}; if ((std::accumulate(doprocess.begin(), doprocess.end(), 0)) != 1) { - LOGP(fatal, "no or more than one process function enabled! Please check your configuration!"); + LOGP(fatal, "Only one process function should be enabled! Please check your configuration!"); } auto vbins = (std::vector)binsPt; AxisSpec ptbins = {vbins, "#it{p}_{T} (GeV/#it{c})"}; @@ -134,62 +147,51 @@ struct HfTaskDplus { template void fillHisto(const T1& candidate) { - // not possible in Filter since expressions do not support binary operators - if (!(candidate.hfflag() & 1 << aod::hf_cand_3prong::DecayType::DplusToPiKPi)) { - return; - } - if (yCandRecoMax >= 0. && std::abs(hfHelper.yDplus(candidate)) > yCandRecoMax) { - return; - } - float pt = candidate.pt(); - registry.fill(HIST("hMass"), hfHelper.invMassDplusToPiKPi(candidate), pt); - registry.fill(HIST("hPt"), pt); - registry.fill(HIST("hEta"), candidate.eta(), pt); - registry.fill(HIST("hCt"), hfHelper.ctDplus(candidate), pt); - registry.fill(HIST("hDecayLength"), candidate.decayLength(), pt); - registry.fill(HIST("hDecayLengthXY"), candidate.decayLengthXY(), pt); - registry.fill(HIST("hNormalisedDecayLengthXY"), candidate.decayLengthXYNormalised(), pt); - registry.fill(HIST("hCPA"), candidate.cpa(), pt); - registry.fill(HIST("hCPAxy"), candidate.cpaXY(), pt); - registry.fill(HIST("hImpactParameterXY"), candidate.impactParameterXY(), pt); - registry.fill(HIST("hMaxNormalisedDeltaIP"), candidate.maxNormalisedDeltaIP(), pt); - registry.fill(HIST("hImpactParameterProngSqSum"), candidate.impactParameterProngSqSum(), pt); - registry.fill(HIST("hDecayLengthError"), candidate.errorDecayLength(), pt); - registry.fill(HIST("hDecayLengthXYError"), candidate.errorDecayLengthXY(), pt); - registry.fill(HIST("hImpactParameterError"), candidate.errorImpactParameter0(), pt); - registry.fill(HIST("hImpactParameterError"), candidate.errorImpactParameter1(), pt); - registry.fill(HIST("hImpactParameterError"), candidate.errorImpactParameter2(), pt); - registry.fill(HIST("hPtProng0"), candidate.ptProng0()); - registry.fill(HIST("hPtProng1"), candidate.ptProng1()); - registry.fill(HIST("hPtProng2"), candidate.ptProng2()); - registry.fill(HIST("hd0Prong0"), candidate.impactParameter0(), pt); - registry.fill(HIST("hd0Prong1"), candidate.impactParameter1(), pt); - registry.fill(HIST("hd0Prong2"), candidate.impactParameter2(), pt); + float pt = candidate.pt(); + registry.fill(HIST("hMass"), hfHelper.invMassDplusToPiKPi(candidate), pt); + registry.fill(HIST("hPt"), pt); + registry.fill(HIST("hEta"), candidate.eta(), pt); + registry.fill(HIST("hCt"), hfHelper.ctDplus(candidate), pt); + registry.fill(HIST("hDecayLength"), candidate.decayLength(), pt); + registry.fill(HIST("hDecayLengthXY"), candidate.decayLengthXY(), pt); + registry.fill(HIST("hNormalisedDecayLengthXY"), candidate.decayLengthXYNormalised(), pt); + registry.fill(HIST("hCPA"), candidate.cpa(), pt); + registry.fill(HIST("hCPAxy"), candidate.cpaXY(), pt); + registry.fill(HIST("hImpactParameterXY"), candidate.impactParameterXY(), pt); + registry.fill(HIST("hMaxNormalisedDeltaIP"), candidate.maxNormalisedDeltaIP(), pt); + registry.fill(HIST("hImpactParameterProngSqSum"), candidate.impactParameterProngSqSum(), pt); + registry.fill(HIST("hDecayLengthError"), candidate.errorDecayLength(), pt); + registry.fill(HIST("hDecayLengthXYError"), candidate.errorDecayLengthXY(), pt); + registry.fill(HIST("hImpactParameterError"), candidate.errorImpactParameter0(), pt); + registry.fill(HIST("hImpactParameterError"), candidate.errorImpactParameter1(), pt); + registry.fill(HIST("hImpactParameterError"), candidate.errorImpactParameter2(), pt); + registry.fill(HIST("hPtProng0"), candidate.ptProng0()); + registry.fill(HIST("hPtProng1"), candidate.ptProng1()); + registry.fill(HIST("hPtProng2"), candidate.ptProng2()); + registry.fill(HIST("hd0Prong0"), candidate.impactParameter0(), pt); + registry.fill(HIST("hd0Prong1"), candidate.impactParameter1(), pt); + registry.fill(HIST("hd0Prong2"), candidate.impactParameter2(), pt); } - // Fill THnSparses for the reconstructed Dplus candidates ML analysis for the reconstructed Dplus candidates + // Fill THnSparses for the ML analysis /// \param candidate is a particle candidate - template - void fillSparseML(const T1& candidate) + template + void fillSparseML (const T1& candidate) { - if (!(candidate.hfflag() & 1 << aod::hf_cand_3prong::DecayType::DplusToPiKPi) || (yCandRecoMax >= 0. && std::abs(hfHelper.yDplus(candidate)) > yCandRecoMax)) { - return; - } std::vector outputMl = {-999., -999., -999.}; for (unsigned int iclass = 0; iclass < classMl->size(); iclass++) { outputMl[iclass] = candidate.mlProbDplusToPiKPi()[classMl->at(iclass)]; } - if constexpr (isMc) { - if (std::abs(candidate.flagMcMatchRec()) == 1 << aod::hf_cand_3prong::DecayType::DplusToPiKPi) { + if constexpr(isMc){ + if constexpr(isMatched){ if (candidate.originMcRec() == RecoDecay::OriginType::Prompt) { registry.fill(HIST("hSparseMassPrompt"), hfHelper.invMassDplusToPiKPi(candidate), candidate.pt(), outputMl[0], outputMl[1], outputMl[2]); - } - if (candidate.originMcRec() == RecoDecay::OriginType::NonPrompt) { + } else if (candidate.originMcRec() == RecoDecay::OriginType::NonPrompt) { registry.fill(HIST("hSparseMassFD"), hfHelper.invMassDplusToPiKPi(candidate), candidate.pt(), outputMl[0], outputMl[1], outputMl[2]); - } - } else { + } + }else{ registry.fill(HIST("hSparseMassBkg"), hfHelper.invMassDplusToPiKPi(candidate), candidate.pt(), outputMl[0], outputMl[1], outputMl[2]); - } + } } else { registry.fill(HIST("hSparseMass"), hfHelper.invMassDplusToPiKPi(candidate), candidate.pt(), outputMl[0], outputMl[1], outputMl[2]); } @@ -197,22 +199,10 @@ struct HfTaskDplus { // Fill histograms of quantities for the reconstructed Dplus candidates with MC matching /// \param candidate is candidate - /// \param mcParticles are particles with MC information - template - void fillHistoMCRec(const T1& candidate, const T2& mcParticles) - { - // not possible in Filter since expressions do not support binary operators - if (!(candidate.hfflag() & 1 << aod::hf_cand_3prong::DecayType::DplusToPiKPi)) { - return; - } - if (yCandRecoMax >= 0. && std::abs(hfHelper.yDplus(candidate)) > yCandRecoMax) { - return; - } - if (std::abs(candidate.flagMcMatchRec()) == 1 << aod::hf_cand_3prong::DecayType::DplusToPiKPi) { - // Get the corresponding MC particle. - auto indexMother = RecoDecay::getMother(mcParticles, candidate.template prong0_as().template mcParticle_as>(), o2::constants::physics::Pdg::kDPlus, true); - auto particleMother = mcParticles.rawIteratorAt(indexMother); - registry.fill(HIST("hPtGenSig"), particleMother.pt()); // gen. level pT + template + void fillHistoMCRec(const T1& candidate) + { + if constexpr (isMatched){ auto ptRec = candidate.pt(); auto yRec = hfHelper.yDplus(candidate); registry.fill(HIST("hPtVsYRecSig_RecoSkim"), ptRec, yRec); @@ -259,8 +249,8 @@ struct HfTaskDplus { // Fill histograms of quantities for generated Dplus particles /// \param particle is a particle with MC information - template - void fillHistoMCGen(const T3& particle) + template + void fillHistoMCGen(const T2& particle) { auto ptGen = particle.pt(); auto yGen = RecoDecay::y(std::array{particle.px(), particle.py(), particle.pz()}, o2::constants::physics::MassDPlus); @@ -351,51 +341,27 @@ struct HfTaskDplus { // process functions void processData(CandDplusData const& candidates) { - for (const auto& candidate : selectedDPlusCandidates) { - fillHisto(candidate); - } + runDataAnalysis(candidates); } PROCESS_SWITCH(HfTaskDplus, processData, "Process data w/o ML", true); void processDataWithMl(CandDplusDataWithMl const& candidates) { - for (const auto& candidate : selectedDPlusCandidatesWithMl) { - fillHisto(candidate); - fillSparseML(candidate); - } + runDataAnalysis(candidates); } PROCESS_SWITCH(HfTaskDplus, processDataWithMl, "Process data with ML", false); void processMc(CandDplusMcReco const& candidates, - soa::Join const& mcParticles, - aod::TracksWMc const& tracks) + McParticles const& mcParticles) { - // MC rec. - for (const auto& candidate : recoFlagDPlusCandidates) { - fillHisto(candidate); - fillHistoMCRec(candidate, mcParticles); - } - // MC gen. - for (const auto& particle : mcParticles) { - fillHistoMCGen(particle); - } + runMCAnalysis(candidates, mcParticles); } PROCESS_SWITCH(HfTaskDplus, processMc, "Process MC w/o ML", false); void processMcWithMl(CandDplusMcRecoWithMl const& candidates, - soa::Join const& mcParticles, - aod::TracksWMc const& tracks) + McParticles const& mcParticles) { - // MC rec. - for (const auto& candidate : recoFlagDPlusCandidatesWithMl) { - fillHisto(candidate); - fillHistoMCRec(candidate, mcParticles); - fillSparseML(candidate); - } - // MC gen. - for (const auto& particle : mcParticles) { - fillHistoMCGen(particle); - } + runMCAnalysis(candidates, mcParticles); } PROCESS_SWITCH(HfTaskDplus, processMcWithMl, "Process MC with ML", false); }; From b04f0df72d4fad8652327b9697738738307d7f1c Mon Sep 17 00:00:00 2001 From: luagliet Date: Wed, 10 Apr 2024 15:50:28 +0200 Subject: [PATCH 07/13] first draft for addition of ML tables to Charm Reso analysis --- .../dataCreatorCharmResoReduced.cxx | 54 +++++++++++++++++-- 1 file changed, 50 insertions(+), 4 deletions(-) diff --git a/PWGHF/D2H/TableProducer/dataCreatorCharmResoReduced.cxx b/PWGHF/D2H/TableProducer/dataCreatorCharmResoReduced.cxx index a06e69b824c..51c11d2926d 100644 --- a/PWGHF/D2H/TableProducer/dataCreatorCharmResoReduced.cxx +++ b/PWGHF/D2H/TableProducer/dataCreatorCharmResoReduced.cxx @@ -69,13 +69,17 @@ enum DType : uint8_t { /// Creation of D-V0 pairs struct HfDataCreatorCharmResoReduced { + // Produces AOD tables to store track information Produces hfReducedCollision; // Defined in PWGHF/D2H/DataModel/ReducedDataModel.h Produces hfCollisionCounter; // Defined in PWGHF/D2H/DataModel/ReducedDataModel.h - + //V0 and D candidates reduced tables Produces hfCandV0; // Defined in PWGHF/D2H/DataModel/ReducedDataModel.h Produces hfCandD; // Defined in PWGHF/D2H/DataModel/ReducedDataModel.h + //ML optional Tables + Produces hfCandDMl; // Defined in PWGHF/D2H/DataModel/ReducedDataModel.h + // CCDB configuration o2::ccdb::CcdbApi ccdbApi; Service ccdb; @@ -106,14 +110,18 @@ struct HfDataCreatorCharmResoReduced { bool isHfCandResoConfigFilled = false; using CandsDplusFiltered = soa::Filtered>; + using CandsDplusFilteredWithMl = soa::Filtered>; using CandDstarFiltered = soa::Filtered>; + using CandDstarFilteredWithMl = soa::Filtered>; using BigTracksPID = soa::Join; Filter filterSelectDplus = (aod::hf_sel_candidate_dplus::isSelDplusToPiKPi >= selectionFlagDplus); Filter filterSelectedCandDstar = (aod::hf_sel_candidate_dstar::isSelDstarToD0Pi == selectionFlagDstarToD0Pi); Preslice candsDplusPerCollision = aod::track_association::collisionId; + Preslice candsDplusPerCollisionWithMl = aod::track_association::collisionId; Preslice candsDstarPerCollision = aod::track_association::collisionId; + Preslice candsDstarPerCollisionWithMl = aod::track_association::collisionId; Preslice trackIndicesPerCollision = aod::track_association::collisionId; Preslice candsV0PerCollision = aod::track_association::collisionId; @@ -206,7 +214,7 @@ struct HfDataCreatorCharmResoReduced { return selMap; } - template + template void runDataCreation(aod::Collision const& collision, CCands const& candsD, aod::V0Datas const& V0s, @@ -380,11 +388,30 @@ struct HfDataCreatorCharmResoReduced { auto thisCollId = collision.globalIndex(); auto candsDThisColl = candsDplus.sliceBy(candsDplusPerCollision, thisCollId); auto V0sThisColl = V0s.sliceBy(candsV0PerCollision, thisCollId); - runDataCreation(collision, candsDThisColl, V0sThisColl, tracks, bcs); + runDataCreation(collision, candsDThisColl, V0sThisColl, tracks, bcs); } } PROCESS_SWITCH(HfDataCreatorCharmResoReduced, processDplusV0, "Process Dplus candidates without MC info and without ML info", true); + void processDplusV0WithMl(aod::Collisions const& collisions, + CandsDplusFilteredWithMl const& candsDplus, + aod::TrackAssoc const& trackIndices, + aod::V0Datas const& V0s, + BigTracksPID const& tracks, + aod::BCsWithTimestamps const& bcs) + { + // handle normalization by the right number of collisions + hfCollisionCounter(collisions.tableSize()); + + for (const auto& collision : collisions) { + auto thisCollId = collision.globalIndex(); + auto candsDThisColl = candsDplus.sliceBy(candsDplusPerCollision, thisCollId); + auto V0sThisColl = V0s.sliceBy(candsV0PerCollision, thisCollId); + runDataCreation(collision, candsDThisColl, V0sThisColl, tracks, bcs); + } + } + PROCESS_SWITCH(HfDataCreatorCharmResoReduced, processDplusV0, "Process Dplus candidates with ML info", false); + void processDstarV0(aod::Collisions const& collisions, CandDstarFiltered const& candsDstar, aod::TrackAssoc const&, @@ -399,10 +426,29 @@ struct HfDataCreatorCharmResoReduced { auto thisCollId = collision.globalIndex(); auto candsDThisColl = candsDstar.sliceBy(candsDstarPerCollision, thisCollId); auto V0sThisColl = V0s.sliceBy(candsV0PerCollision, thisCollId); - runDataCreation(collision, candsDThisColl, V0sThisColl, tracks, bcs); + runDataCreation(collision, candsDThisColl, V0sThisColl, tracks, bcs); } } PROCESS_SWITCH(HfDataCreatorCharmResoReduced, processDstarV0, "Process DStar candidates without MC info and without ML info", false); + + void processDstarV0WithMl(aod::Collisions const& collisions, + CandDstarFilteredWithMl const& candsDstar, + aod::TrackAssoc const& trackIndices, + aod::V0Datas const& V0s, + BigTracksPID const& tracks, + aod::BCsWithTimestamps const& bcs) + { + // handle normalization by the right number of collisions + hfCollisionCounter(collisions.tableSize()); + + for (const auto& collision : collisions) { + auto thisCollId = collision.globalIndex(); + auto candsDThisColl = candsDstar.sliceBy(candsDstarPerCollision, thisCollId); + auto V0sThisColl = V0s.sliceBy(candsV0PerCollision, thisCollId); + runDataCreation(collision, candsDThisColl, V0sThisColl, tracks, bcs); + } + } + PROCESS_SWITCH(HfDataCreatorCharmResoReduced, processDstarV0, "Process DStar candidates with ML info", false); }; // struct WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) From 35563288e5bb2b8be29c45d082b21eacae426ed5 Mon Sep 17 00:00:00 2001 From: luagliet Date: Fri, 12 Apr 2024 11:06:31 +0200 Subject: [PATCH 08/13] first draft of data creator --- .../dataCreatorCharmResoReduced.cxx | 32 ++++++++++++------- 1 file changed, 21 insertions(+), 11 deletions(-) diff --git a/PWGHF/D2H/TableProducer/dataCreatorCharmResoReduced.cxx b/PWGHF/D2H/TableProducer/dataCreatorCharmResoReduced.cxx index 51c11d2926d..cc60a4bb739 100644 --- a/PWGHF/D2H/TableProducer/dataCreatorCharmResoReduced.cxx +++ b/PWGHF/D2H/TableProducer/dataCreatorCharmResoReduced.cxx @@ -214,7 +214,7 @@ struct HfDataCreatorCharmResoReduced { return selMap; } - template + template void runDataCreation(aod::Collision const& collision, CCands const& candsD, aod::V0Datas const& V0s, @@ -241,7 +241,8 @@ struct HfDataCreatorCharmResoReduced { std::array prongIdsD; uint8_t v0type; int8_t dtype; - if constexpr (std::is_same::value) { + std::array bdtScores; + if constexpr (DecayChannel == DecayChannel::DstarV0) { if (candD.signSoftPi() > 0) invMassD = candD.invMassDstar(); else @@ -255,7 +256,10 @@ struct HfDataCreatorCharmResoReduced { prongIdsD[1] = candD.prong1Id(); prongIdsD[2] = candD.prongPiId(); dtype = candD.signSoftPi() * DType::Dstar; - } else if constexpr (std::is_same::value) { + if constexpr(withMl){ + std::copy(candD.mlProbDstarToD0Pi().begin(), candD.mlProbDstarToD0Pi().end(), bdtScores.begin()); + } + } else if constexpr (DecayChannel == DecayChannel::DplusV0) { auto prong0 = candD.template prong0_as(); invMassD = hfHelper.invMassDplusToPiKPi(candD); massD = MassDPlus; @@ -267,6 +271,9 @@ struct HfDataCreatorCharmResoReduced { prongIdsD[1] = candD.prong1Id(); prongIdsD[2] = candD.prong2Id(); dtype = static_cast(prong0.sign() * DType::Dplus); + if constexpr(withMl){ + std::copy(candD.mlProbDplusToPiKPi().begin(), candD.mlProbDplusToPiKPi().end(), bdtScores.begin()); + } } // else if // Loop on V0 candidates @@ -348,6 +355,9 @@ struct HfDataCreatorCharmResoReduced { invMassD, pVecD[0], pVecD[1], pVecD[2], dtype); + if constexpr (withMl) { + hfCandDMl(bdtScores[0], bdtScores[1], bdtScores[2]); + } fillHfReducedCollision = true; switch (DecayChannel) { case DecayChannel::DstarV0: @@ -388,7 +398,7 @@ struct HfDataCreatorCharmResoReduced { auto thisCollId = collision.globalIndex(); auto candsDThisColl = candsDplus.sliceBy(candsDplusPerCollision, thisCollId); auto V0sThisColl = V0s.sliceBy(candsV0PerCollision, thisCollId); - runDataCreation(collision, candsDThisColl, V0sThisColl, tracks, bcs); + runDataCreation(collision, candsDThisColl, V0sThisColl, tracks, bcs); } } PROCESS_SWITCH(HfDataCreatorCharmResoReduced, processDplusV0, "Process Dplus candidates without MC info and without ML info", true); @@ -405,12 +415,12 @@ struct HfDataCreatorCharmResoReduced { for (const auto& collision : collisions) { auto thisCollId = collision.globalIndex(); - auto candsDThisColl = candsDplus.sliceBy(candsDplusPerCollision, thisCollId); + auto candsDThisColl = candsDplus.sliceBy(candsDplusPerCollisionWithMl, thisCollId); auto V0sThisColl = V0s.sliceBy(candsV0PerCollision, thisCollId); - runDataCreation(collision, candsDThisColl, V0sThisColl, tracks, bcs); + runDataCreation(collision, candsDThisColl, V0sThisColl, tracks, bcs); } } - PROCESS_SWITCH(HfDataCreatorCharmResoReduced, processDplusV0, "Process Dplus candidates with ML info", false); + PROCESS_SWITCH(HfDataCreatorCharmResoReduced, processDplusV0WithMl, "Process Dplus candidates with ML info", false); void processDstarV0(aod::Collisions const& collisions, CandDstarFiltered const& candsDstar, @@ -426,7 +436,7 @@ struct HfDataCreatorCharmResoReduced { auto thisCollId = collision.globalIndex(); auto candsDThisColl = candsDstar.sliceBy(candsDstarPerCollision, thisCollId); auto V0sThisColl = V0s.sliceBy(candsV0PerCollision, thisCollId); - runDataCreation(collision, candsDThisColl, V0sThisColl, tracks, bcs); + runDataCreation(collision, candsDThisColl, V0sThisColl, tracks, bcs); } } PROCESS_SWITCH(HfDataCreatorCharmResoReduced, processDstarV0, "Process DStar candidates without MC info and without ML info", false); @@ -443,12 +453,12 @@ struct HfDataCreatorCharmResoReduced { for (const auto& collision : collisions) { auto thisCollId = collision.globalIndex(); - auto candsDThisColl = candsDstar.sliceBy(candsDstarPerCollision, thisCollId); + auto candsDThisColl = candsDstar.sliceBy(candsDstarPerCollisionWithMl, thisCollId); auto V0sThisColl = V0s.sliceBy(candsV0PerCollision, thisCollId); - runDataCreation(collision, candsDThisColl, V0sThisColl, tracks, bcs); + runDataCreation(collision, candsDThisColl, V0sThisColl, tracks, bcs); } } - PROCESS_SWITCH(HfDataCreatorCharmResoReduced, processDstarV0, "Process DStar candidates with ML info", false); + PROCESS_SWITCH(HfDataCreatorCharmResoReduced, processDstarV0WithMl, "Process DStar candidates with ML info", false); }; // struct WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) From fad0e5a9c86d81457bc3197519bf553e27eaebc0 Mon Sep 17 00:00:00 2001 From: luagliet Date: Fri, 12 Apr 2024 11:12:51 +0200 Subject: [PATCH 09/13] sync Dplus Task --- PWGHF/D2H/Tasks/taskDplus.cxx | 42 ++++++++++++++--------------------- 1 file changed, 17 insertions(+), 25 deletions(-) diff --git a/PWGHF/D2H/Tasks/taskDplus.cxx b/PWGHF/D2H/Tasks/taskDplus.cxx index fb692ff59ba..e52e88d3c78 100644 --- a/PWGHF/D2H/Tasks/taskDplus.cxx +++ b/PWGHF/D2H/Tasks/taskDplus.cxx @@ -16,7 +16,6 @@ /// \author Fabio Catalano , Politecnico and INFN Torino /// \author Vít Kučera , CERN /// \author Luca Aglietta , University and INFN Torino -/// \author Luca Aglietta , University and INFN Torino #include "CommonConstants/PhysicsConstants.h" #include "Framework/AnalysisTask.h" @@ -42,10 +41,6 @@ struct HfTaskDplus { ConfigurableAxis axisMlScore0{"axisMlScore0", {100, 0., 1.}, "axis for ML output score 0"}; ConfigurableAxis axisMlScore1{"axisMlScore1", {100, 0., 1.}, "axis for ML output score 1"}; ConfigurableAxis axisMlScore2{"axisMlScore2", {100, 0., 1.}, "axis for ML output score 2"}; - Configurable> classMl{"classMl", {0, 1, 2}, "Indexes of ML scores to be stored. Three indexes max."}; - ConfigurableAxis axisMlScore0{"axisMlScore0", {100, 0., 1.}, "axis for ML output score 0"}; - ConfigurableAxis axisMlScore1{"axisMlScore1", {100, 0., 1.}, "axis for ML output score 1"}; - ConfigurableAxis axisMlScore2{"axisMlScore2", {100, 0., 1.}, "axis for ML output score 2"}; HfHelper hfHelper; @@ -57,20 +52,19 @@ struct HfTaskDplus { Filter filterDplusFlag = (o2::aod::hf_track_index::hfflag & static_cast(BIT(aod::hf_cand_3prong::DecayType::DplusToPiKPi))) != static_cast(0); - //data + // data Partition selectedDPlusCandidates = aod::hf_sel_candidate_dplus::isSelDplusToPiKPi >= selectionFlagDplus; Partition selectedDPlusCandidatesWithMl = aod::hf_sel_candidate_dplus::isSelDplusToPiKPi >= selectionFlagDplus; - - //Matched MC + + // Matched MC Partition recoDPlusCandidates = nabs(aod::hf_cand_3prong::flagMcMatchRec) == static_cast(BIT(aod::hf_cand_3prong::DecayType::DplusToPiKPi)) && aod::hf_sel_candidate_dplus::isSelDplusToPiKPi >= selectionFlagDplus; Partition recoDPlusCandidatesWithMl = nabs(aod::hf_cand_3prong::flagMcMatchRec) == static_cast(BIT(aod::hf_cand_3prong::DecayType::DplusToPiKPi)) && aod::hf_sel_candidate_dplus::isSelDplusToPiKPi >= selectionFlagDplus; - - //MC Bkg + + // MC Bkg Partition recoBkgCandidates = nabs(aod::hf_cand_3prong::flagMcMatchRec) != static_cast(BIT(aod::hf_cand_3prong::DecayType::DplusToPiKPi)) && aod::hf_sel_candidate_dplus::isSelDplusToPiKPi >= selectionFlagDplus; Partition recoBkgCandidatesWithMl = nabs(aod::hf_cand_3prong::flagMcMatchRec) != static_cast(BIT(aod::hf_cand_3prong::DecayType::DplusToPiKPi)) && aod::hf_sel_candidate_dplus::isSelDplusToPiKPi >= selectionFlagDplus; - //Generated particles - + // Generated particles HistogramRegistry registry{ "registry", @@ -93,8 +87,6 @@ struct HfTaskDplus { auto vbins = (std::vector)binsPt; AxisSpec ptbins = {vbins, "#it{p}_{T} (GeV/#it{c})"}; AxisSpec massbins = {600, 1.67, 2.27, "inv. mass (K#pi#pi) (GeV/#it{c}^{2})"}; - AxisSpec ptbins = {vbins, "#it{p}_{T} (GeV/#it{c})"}; - AxisSpec massbins = {600, 1.67, 2.27, "inv. mass (K#pi#pi) (GeV/#it{c}^{2})"}; registry.add("hMass", "3-prong candidates;inv. mass (#pi K #pi) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{350, 1.7, 2.05}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); registry.add("hEta", "3-prong candidates;candidate #it{#eta};entries", {HistType::kTH2F, {{100, -2., 2.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); registry.add("hCt", "3-prong candidates;proper lifetime (D^{#pm}) * #it{c} (cm);entries", {HistType::kTH2F, {{120, -20., 100.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); @@ -176,22 +168,22 @@ struct HfTaskDplus { // Fill THnSparses for the ML analysis /// \param candidate is a particle candidate template - void fillSparseML (const T1& candidate) + void fillSparseML(const T1& candidate) { std::vector outputMl = {-999., -999., -999.}; for (unsigned int iclass = 0; iclass < classMl->size(); iclass++) { outputMl[iclass] = candidate.mlProbDplusToPiKPi()[classMl->at(iclass)]; } - if constexpr(isMc){ - if constexpr(isMatched){ + if constexpr (isMc) { + if constexpr (isMatched) { if (candidate.originMcRec() == RecoDecay::OriginType::Prompt) { registry.fill(HIST("hSparseMassPrompt"), hfHelper.invMassDplusToPiKPi(candidate), candidate.pt(), outputMl[0], outputMl[1], outputMl[2]); } else if (candidate.originMcRec() == RecoDecay::OriginType::NonPrompt) { registry.fill(HIST("hSparseMassFD"), hfHelper.invMassDplusToPiKPi(candidate), candidate.pt(), outputMl[0], outputMl[1], outputMl[2]); - } - }else{ + } + } else { registry.fill(HIST("hSparseMassBkg"), hfHelper.invMassDplusToPiKPi(candidate), candidate.pt(), outputMl[0], outputMl[1], outputMl[2]); - } + } } else { registry.fill(HIST("hSparseMass"), hfHelper.invMassDplusToPiKPi(candidate), candidate.pt(), outputMl[0], outputMl[1], outputMl[2]); } @@ -201,8 +193,8 @@ struct HfTaskDplus { /// \param candidate is candidate template void fillHistoMCRec(const T1& candidate) - { - if constexpr (isMatched){ + { + if constexpr (isMatched) { auto ptRec = candidate.pt(); auto yRec = hfHelper.yDplus(candidate); registry.fill(HIST("hPtVsYRecSig_RecoSkim"), ptRec, yRec); @@ -359,9 +351,9 @@ struct HfTaskDplus { PROCESS_SWITCH(HfTaskDplus, processMc, "Process MC w/o ML", false); void processMcWithMl(CandDplusMcRecoWithMl const& candidates, - McParticles const& mcParticles) + McParticles const& mcParticles) { - runMCAnalysis(candidates, mcParticles); + runMCAnalysis(candidates, mcParticles); } PROCESS_SWITCH(HfTaskDplus, processMcWithMl, "Process MC with ML", false); }; @@ -369,4 +361,4 @@ struct HfTaskDplus { WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { return WorkflowSpec{adaptAnalysisTask(cfgc)}; -} +} \ No newline at end of file From c3e78b70109e3f5c987f6b10b780d8cf7a6a02e8 Mon Sep 17 00:00:00 2001 From: luagliet Date: Mon, 15 Apr 2024 15:23:05 +0200 Subject: [PATCH 10/13] added ML scores table to ReducedDataModel.h --- PWGHF/D2H/DataModel/ReducedDataModel.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/PWGHF/D2H/DataModel/ReducedDataModel.h b/PWGHF/D2H/DataModel/ReducedDataModel.h index 6e3f2da1da7..414e49dd806 100644 --- a/PWGHF/D2H/DataModel/ReducedDataModel.h +++ b/PWGHF/D2H/DataModel/ReducedDataModel.h @@ -399,7 +399,9 @@ DECLARE_SOA_COLUMN(PtProng0, ptProng0, float); //! Pt of D daughter in DECLARE_SOA_COLUMN(PtProng1, ptProng1, float); //! Pt of V0 daughter in GeV/c DECLARE_SOA_COLUMN(InvMassProng0, invMassProng0, float); //! Invariant Mass of D daughter in GeV/c DECLARE_SOA_COLUMN(InvMassProng1, invMassProng1, float); //! Invariant Mass of V0 daughter in GeV/c - +DECLARE_SOA_COLUMN(MlScoreBkgProng0, mlScoreBkgProng0, float); //! Bkg ML score of the D daughter +DECLARE_SOA_COLUMN(MlScorePromptProng0, mlScorePromptProng0, float); //! Prompt ML score of the D daughter +DECLARE_SOA_COLUMN(MlScoreNonpromptProng0, mlScoreNonpromptProng0, float); //! Nonprompt ML score of the D daughter } // namespace hf_reso_cand_reduced DECLARE_SOA_TABLE(HfRedVzeros, "AOD", "HFREDVZERO", //! Table with V0 candidate information for resonances reduced workflow @@ -439,6 +441,12 @@ DECLARE_SOA_TABLE(HfCandCharmReso, "AOD", "HFCANDCHARMRESO", //! Table with Reso hf_reso_cand_reduced::Cpa, hf_reso_cand_reduced::Dca, hf_reso_cand_reduced::Radius); + +DECLARE_SOA_TABLE(HfCharmResoMLs, "AOD", "HFCHARMRESOML", //! Table with ML scores for the D daughter + hf_reso_cand_reduced::MlScoreBkgProng0, + hf_reso_cand_reduced::MlScorePromptProng0, + hf_reso_cand_reduced::MlScoreNonpromptProng0, + o2::soa::Marker<1>); } // namespace aod namespace soa From a0e583e0dabeb093ef7ae0591f94b0bfc2e180ac Mon Sep 17 00:00:00 2001 From: luagliet Date: Thu, 18 Apr 2024 17:11:04 +0200 Subject: [PATCH 11/13] added BDT scores to Reso candidate creator and added Z impact parameter to Dplus tree creator --- .../candidateCreatorCharmResoReduced.cxx | 105 ++++++++++++++---- .../TableProducer/treeCreatorDplusToPiKPi.cxx | 18 +++ 2 files changed, 104 insertions(+), 19 deletions(-) diff --git a/PWGHF/D2H/TableProducer/candidateCreatorCharmResoReduced.cxx b/PWGHF/D2H/TableProducer/candidateCreatorCharmResoReduced.cxx index 181cd1d1ddb..6e6d8e02596 100644 --- a/PWGHF/D2H/TableProducer/candidateCreatorCharmResoReduced.cxx +++ b/PWGHF/D2H/TableProducer/candidateCreatorCharmResoReduced.cxx @@ -39,7 +39,8 @@ enum Selections : uint8_t { enum DecayChannel : uint8_t { Ds1ToDstarK0s = 0, Ds2StarToDplusK0s, - XcToDplusLambda + XcToDplusLambda, + LambdaDminus }; enum V0Type : uint8_t { K0s = 0, @@ -89,14 +90,17 @@ struct HfCandidateCreatorCharmResoReduced { void init(InitContext const&) { - for (const auto& value : vecBins) { - LOGF(info, "bin limit %f", value); + // check that only one process function is enabled + std::array doprocess{doprocessDs2StarToDplusK0s, doprocessDs2StarToDplusK0sWithMl, doprocessDs1ToDstarK0s, doprocessDs1ToDstarK0sWithMl, doprocessXcToDplusLambda, doprocessXcToDplusLambdaWithMl, doprocessLambdaDminus, doprocessLambdaDminusWithMl}; + if ((std::accumulate(doprocess.begin(), doprocess.end(), 0)) != 1) { + LOGP(fatal, "Only one process function should be enabled! Please check your configuration!"); } + // histograms const AxisSpec axisPt{(std::vector)vecBins, "#it{p}_{T} (GeV/#it{c})"}; - // histograms - registry.add("hMassDs1", "Ds1 candidates;m_{Ds1} - m_{D^{*}} (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{100, 2.4, 2.7}, {(std::vector)binsPt, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("hMassDs2Star", "Ds^{*}2 candidates; Ds^{*}2 - m_{D^{#plus}} (GeV/#it{c}^{2}) ;entries", {HistType::kTH2F, {{100, 2.4, 2.7}, {(std::vector)binsPt, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("hMassXcRes", "XcRes candidates; XcRes - m_{D^{#plus}} (GeV/#it{c}^{2}) ;entries", {HistType::kTH2F, {{100, 2.9, 3.3}, {(std::vector)binsPt, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hMassDs1", "Ds1 candidates;m_{Ds1} (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{100, 2.4, 2.7}, {(std::vector)binsPt, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hMassDs2Star", "Ds^{*}2 candidates; m_Ds^{*}2 (GeV/#it{c}^{2}) ;entries", {HistType::kTH2F, {{100, 2.4, 2.7}, {(std::vector)binsPt, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hMassXcRes", "XcRes candidates; m_XcRes (GeV/#it{c}^{2}) ;entries", {HistType::kTH2F, {{100, 2.9, 3.3}, {(std::vector)binsPt, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hMassLambdaDminus", "LambdaDminus candidates; m_LambdaDminus (GeV/#it{c}^{2}) ;entries", {HistType::kTH2F, {{100, 2.9, 3.3}, {(std::vector)binsPt, "#it{p}_{T} (GeV/#it{c})"}}}); if (activateQA) { constexpr int kNBinsSelections = Selections::NSelSteps; std::string labels[kNBinsSelections]; @@ -109,19 +113,21 @@ struct HfCandidateCreatorCharmResoReduced { registry.get(HIST("hSelections"))->GetXaxis()->SetBinLabel(iBin + 1, labels[iBin].data()); } } - + // mass constants massK0 = o2::constants::physics::MassK0Short; massLambda = o2::constants::physics::MassLambda; massDplus = o2::constants::physics::MassDPlus; massDstar = o2::constants::physics::MassDStar; } - + /// Basic selection of D candidates + /// \param candD is the reduced D meson candidate + /// \return true if selections are passed template bool isDSelected(DRedTable const& candD) { float massD{0.}; // slection on D candidate mass - if (channel == DecayChannel::Ds2StarToDplusK0s || channel == DecayChannel::XcToDplusLambda) { + if (channel == DecayChannel::Ds2StarToDplusK0s || channel == DecayChannel::XcToDplusLambda || channel == DecayChannel::LambdaDminus) { massD = massDplus; } else if (channel == DecayChannel::Ds1ToDstarK0s) { massD = massDstar; @@ -132,19 +138,26 @@ struct HfCandidateCreatorCharmResoReduced { return true; } + /// Basic selection of V0 candidates + /// \param candV0 is the reduced V0 candidate + /// \param candD is the reduced D meson candidate + /// \return true if selections are passed template bool isV0Selected(V0RedTable const& candV0, DRedTable const& candD) { float massV0{0.}; float invMassV0{0.}; + // slection on V0 candidate mass if (channel == DecayChannel::Ds2StarToDplusK0s || channel == DecayChannel::Ds1ToDstarK0s) { massV0 = massK0; invMassV0 = candV0.invMassK0s(); - } else if (channel == DecayChannel::XcToDplusLambda) { + } else if (channel == DecayChannel::XcToDplusLambda || channel == DecayChannel::LambdaDminus) { massV0 = massLambda; + int wsFact{1}; + if (channel == DecayChannel::LambdaDminus) wsFact = -1; uint8_t targetV0Type{0}; - if (candD.dType() > 0) { + if (wsFact * candD.dType() > 0) { invMassV0 = candV0.invMassLambda(); targetV0Type = V0Type::Lambda; } else { @@ -161,7 +174,7 @@ struct HfCandidateCreatorCharmResoReduced { return true; } - template + template void runCandidateCreation(Coll const& collisions, DRedTable const& candsD, V0RedTable const& candsV0) @@ -217,6 +230,15 @@ struct HfCandidateCreatorCharmResoReduced { invMassReso = RecoDecay::m(std::array{pVecD, pVecV0}, std::array{massDplus, massLambda}); registry.fill(HIST("hMassXcRes"), invMassReso, ptReso); break; + case DecayChannel::LambdaDminus: + if (candD.dType() < 0) { + invMassV0 = candV0.invMassLambda(); + } else { + invMassV0 = candV0.invMassAntiLambda(); + } + invMassReso = RecoDecay::m(std::array{pVecD, pVecV0}, std::array{massDplus, massLambda}); + registry.fill(HIST("hMassLambdaDminus"), invMassReso, ptReso); + break; default: break; } @@ -231,6 +253,9 @@ struct HfCandidateCreatorCharmResoReduced { candV0.cpa(), candV0.dca(), candV0.radius()); + if constexpr(fillMl) { + mlScores(candD.mlScoreBkgMassHypo0(),candD.mlScorePromptMassHypo0(),candD.mlScoreNonpromptMassHypo0()); + } } } } // main function @@ -239,25 +264,67 @@ struct HfCandidateCreatorCharmResoReduced { aod::HfRed3PrNoTrks const& candsD, aod::HfRedVzeros const&) { - runCandidateCreation(collision, candsD, candidatesK0s); + runCandidateCreation(collision, candsD, candidatesK0s); + } + PROCESS_SWITCH(HfCandidateCreatorCharmResoReduced, processDs2StarToDplusK0s, "Process Ds2* candidates without ML info", true); + + void processDs2StarToDplusK0sWithMl(aod::HfRedCollisions::iterator const& collision, + soa::Join const& candsD, + aod::HfRedVzeros const&) + { + runCandidateCreation(collision, candsD, candidatesK0s); } - PROCESS_SWITCH(HfCandidateCreatorCharmResoReduced, processDs2StarToDplusK0s, "Process Ds2* candidates without MC info and without ML info", true); + PROCESS_SWITCH(HfCandidateCreatorCharmResoReduced, processDs2StarToDplusK0sWithMl, "Process Ds2* candidates with Ml info", false); void processDs1ToDstarK0s(aod::HfRedCollisions::iterator const& collision, aod::HfRed3PrNoTrks const& candsD, aod::HfRedVzeros const&) { - runCandidateCreation(collision, candsD, candidatesK0s); + runCandidateCreation(collision, candsD, candidatesK0s); + } + PROCESS_SWITCH(HfCandidateCreatorCharmResoReduced, processDs1ToDstarK0s, "Process Ds1 candidates without Ml info", false); + + void processDs1ToDstarK0sWithMl(aod::HfRedCollisions::iterator const& collision, + soa::Join const& candsD, + aod::HfRedVzeros const&) + { + runCandidateCreation(collision, candsD, candidatesK0s); } - PROCESS_SWITCH(HfCandidateCreatorCharmResoReduced, processDs1ToDstarK0s, "Process Ds1 candidates without MC info and without ML info", false); + PROCESS_SWITCH(HfCandidateCreatorCharmResoReduced, processDs1ToDstarK0sWithMl, "Process Ds1 candidates with Ml info", false); void processXcToDplusLambda(aod::HfRedCollisions::iterator const& collision, aod::HfRed3PrNoTrks const& candsD, aod::HfRedVzeros const&) { - runCandidateCreation(collision, candsD, candidatesLambda); + runCandidateCreation(collision, candsD, candidatesLambda); + } + PROCESS_SWITCH(HfCandidateCreatorCharmResoReduced, processXcToDplusLambda, "Process Xc candidates without Ml info", false); + + void processXcToDplusLambdaWithMl(aod::HfRedCollisions::iterator const& collision, + soa::Join const& candsD, + aod::HfRedVzeros const&) + { + runCandidateCreation(collision, candsD, candidatesLambda); + } + PROCESS_SWITCH(HfCandidateCreatorCharmResoReduced, processXcToDplusLambdaWithMl, "Process Xc candidates with Ml info", false); + + + void processLambdaDminus(aod::HfRedCollisions::iterator const& collision, + aod::HfRed3PrNoTrks const& candsD, + aod::HfRedVzeros const&) + { + runCandidateCreation(collision, candsD, candidatesLambda); + } + PROCESS_SWITCH(HfCandidateCreatorCharmResoReduced, processLambdaDminus, "Process LambdaDminus candidates without Ml info", false); + + void processLambdaDminusWithMl(aod::HfRedCollisions::iterator const& collision, + soa::Join const& candsD, + aod::HfRedVzeros const&) + { + runCandidateCreation(collision, candsD, candidatesLambda); } - PROCESS_SWITCH(HfCandidateCreatorCharmResoReduced, processXcToDplusLambda, "Process Xc candidates without MC info and without ML info", false); + PROCESS_SWITCH(HfCandidateCreatorCharmResoReduced, processLambdaDminusWithMl, "Process LambdaDminus candidates with Ml info", false); + }; // struct WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) diff --git a/PWGHF/TableProducer/treeCreatorDplusToPiKPi.cxx b/PWGHF/TableProducer/treeCreatorDplusToPiKPi.cxx index b5c72dfaa1c..5faf9336b8e 100644 --- a/PWGHF/TableProducer/treeCreatorDplusToPiKPi.cxx +++ b/PWGHF/TableProducer/treeCreatorDplusToPiKPi.cxx @@ -93,6 +93,9 @@ DECLARE_SOA_TABLE(HfCandDpLites, "AOD", "HFCANDDPLITE", hf_cand::ImpactParameter0, hf_cand::ImpactParameter1, hf_cand::ImpactParameter2, + hf_cand::ImpactParameterZ0, + hf_cand::ImpactParameterZ1, + hf_cand::ImpactParameterZ2, full::NSigTpcPi0, full::NSigTpcKa0, full::NSigTofPi0, @@ -164,6 +167,12 @@ DECLARE_SOA_TABLE(HfCandDpFulls, "AOD", "HFCANDDPFULL", hf_cand::ErrorImpactParameter0, hf_cand::ErrorImpactParameter1, hf_cand::ErrorImpactParameter2, + hf_cand::ImpactParameterZ0, + hf_cand::ImpactParameterZ1, + hf_cand::ImpactParameterZ2, + hf_cand::ErrorImpactParameterZ0, + hf_cand::ErrorImpactParameterZ1, + hf_cand::ErrorImpactParameterZ2, full::NSigTpcPi0, full::NSigTpcKa0, full::NSigTofPi0, @@ -287,6 +296,9 @@ struct HfTreeCreatorDplusToPiKPi { candidate.impactParameter0(), candidate.impactParameter1(), candidate.impactParameter2(), + candidate.impactParameterZ0(), + candidate.impactParameterZ1(), + candidate.impactParameterZ2(), prong0.tpcNSigmaPi(), prong0.tpcNSigmaKa(), prong0.tofNSigmaPi(), @@ -358,6 +370,12 @@ struct HfTreeCreatorDplusToPiKPi { candidate.errorImpactParameter0(), candidate.errorImpactParameter1(), candidate.errorImpactParameter2(), + candidate.impactParameterZ0(), + candidate.impactParameterZ1(), + candidate.impactParameterZ2(), + candidate.errorImpactParameterZ0(), + candidate.errorImpactParameterZ1(), + candidate.errorImpactParameterZ2(), prong0.tpcNSigmaPi(), prong0.tpcNSigmaKa(), prong0.tofNSigmaPi(), From 944491684e335f6b3a8b33313839b92252715bad Mon Sep 17 00:00:00 2001 From: ALICE Action Bot Date: Thu, 18 Apr 2024 15:22:42 +0000 Subject: [PATCH 12/13] Please consider the following formatting changes --- .../candidateCreatorCharmResoReduced.cxx | 44 +++++++++---------- .../dataCreatorCharmResoReduced.cxx | 37 ++++++++-------- .../TableProducer/treeCreatorDplusToPiKPi.cxx | 12 ++--- 3 files changed, 46 insertions(+), 47 deletions(-) diff --git a/PWGHF/D2H/TableProducer/candidateCreatorCharmResoReduced.cxx b/PWGHF/D2H/TableProducer/candidateCreatorCharmResoReduced.cxx index 6e6d8e02596..28deede7c74 100644 --- a/PWGHF/D2H/TableProducer/candidateCreatorCharmResoReduced.cxx +++ b/PWGHF/D2H/TableProducer/candidateCreatorCharmResoReduced.cxx @@ -74,7 +74,7 @@ struct HfCandidateCreatorCharmResoReduced { Configurable> binsPt{"binsPt", std::vector{vecBins}, "pT bin limits"}; using reducedDWithMl = soa::Join; - + // Partition of V0 candidates based on v0Type Partition candidatesK0s = aod::hf_reso_cand_reduced::v0Type == (uint8_t)1 || aod::hf_reso_cand_reduced::v0Type == (uint8_t)3 || aod::hf_reso_cand_reduced::v0Type == (uint8_t)5; Partition candidatesLambda = aod::hf_reso_cand_reduced::v0Type == (uint8_t)2 || aod::hf_reso_cand_reduced::v0Type == (uint8_t)4; @@ -95,7 +95,7 @@ struct HfCandidateCreatorCharmResoReduced { if ((std::accumulate(doprocess.begin(), doprocess.end(), 0)) != 1) { LOGP(fatal, "Only one process function should be enabled! Please check your configuration!"); } - // histograms + // histograms const AxisSpec axisPt{(std::vector)vecBins, "#it{p}_{T} (GeV/#it{c})"}; registry.add("hMassDs1", "Ds1 candidates;m_{Ds1} (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{100, 2.4, 2.7}, {(std::vector)binsPt, "#it{p}_{T} (GeV/#it{c})"}}}); registry.add("hMassDs2Star", "Ds^{*}2 candidates; m_Ds^{*}2 (GeV/#it{c}^{2}) ;entries", {HistType::kTH2F, {{100, 2.4, 2.7}, {(std::vector)binsPt, "#it{p}_{T} (GeV/#it{c})"}}}); @@ -119,7 +119,7 @@ struct HfCandidateCreatorCharmResoReduced { massDplus = o2::constants::physics::MassDPlus; massDstar = o2::constants::physics::MassDStar; } - /// Basic selection of D candidates + /// Basic selection of D candidates /// \param candD is the reduced D meson candidate /// \return true if selections are passed template @@ -138,7 +138,7 @@ struct HfCandidateCreatorCharmResoReduced { return true; } - /// Basic selection of V0 candidates + /// Basic selection of V0 candidates /// \param candV0 is the reduced V0 candidate /// \param candD is the reduced D meson candidate /// \return true if selections are passed @@ -155,7 +155,8 @@ struct HfCandidateCreatorCharmResoReduced { } else if (channel == DecayChannel::XcToDplusLambda || channel == DecayChannel::LambdaDminus) { massV0 = massLambda; int wsFact{1}; - if (channel == DecayChannel::LambdaDminus) wsFact = -1; + if (channel == DecayChannel::LambdaDminus) + wsFact = -1; uint8_t targetV0Type{0}; if (wsFact * candD.dType() > 0) { invMassV0 = candV0.invMassLambda(); @@ -253,8 +254,8 @@ struct HfCandidateCreatorCharmResoReduced { candV0.cpa(), candV0.dca(), candV0.radius()); - if constexpr(fillMl) { - mlScores(candD.mlScoreBkgMassHypo0(),candD.mlScorePromptMassHypo0(),candD.mlScoreNonpromptMassHypo0()); + if constexpr (fillMl) { + mlScores(candD.mlScoreBkgMassHypo0(), candD.mlScorePromptMassHypo0(), candD.mlScoreNonpromptMassHypo0()); } } } @@ -267,10 +268,10 @@ struct HfCandidateCreatorCharmResoReduced { runCandidateCreation(collision, candsD, candidatesK0s); } PROCESS_SWITCH(HfCandidateCreatorCharmResoReduced, processDs2StarToDplusK0s, "Process Ds2* candidates without ML info", true); - + void processDs2StarToDplusK0sWithMl(aod::HfRedCollisions::iterator const& collision, - soa::Join const& candsD, - aod::HfRedVzeros const&) + soa::Join const& candsD, + aod::HfRedVzeros const&) { runCandidateCreation(collision, candsD, candidatesK0s); } @@ -283,10 +284,10 @@ struct HfCandidateCreatorCharmResoReduced { runCandidateCreation(collision, candsD, candidatesK0s); } PROCESS_SWITCH(HfCandidateCreatorCharmResoReduced, processDs1ToDstarK0s, "Process Ds1 candidates without Ml info", false); - + void processDs1ToDstarK0sWithMl(aod::HfRedCollisions::iterator const& collision, - soa::Join const& candsD, - aod::HfRedVzeros const&) + soa::Join const& candsD, + aod::HfRedVzeros const&) { runCandidateCreation(collision, candsD, candidatesK0s); } @@ -299,27 +300,26 @@ struct HfCandidateCreatorCharmResoReduced { runCandidateCreation(collision, candsD, candidatesLambda); } PROCESS_SWITCH(HfCandidateCreatorCharmResoReduced, processXcToDplusLambda, "Process Xc candidates without Ml info", false); - + void processXcToDplusLambdaWithMl(aod::HfRedCollisions::iterator const& collision, - soa::Join const& candsD, - aod::HfRedVzeros const&) + soa::Join const& candsD, + aod::HfRedVzeros const&) { runCandidateCreation(collision, candsD, candidatesLambda); } PROCESS_SWITCH(HfCandidateCreatorCharmResoReduced, processXcToDplusLambdaWithMl, "Process Xc candidates with Ml info", false); - void processLambdaDminus(aod::HfRedCollisions::iterator const& collision, - aod::HfRed3PrNoTrks const& candsD, - aod::HfRedVzeros const&) + aod::HfRed3PrNoTrks const& candsD, + aod::HfRedVzeros const&) { runCandidateCreation(collision, candsD, candidatesLambda); } PROCESS_SWITCH(HfCandidateCreatorCharmResoReduced, processLambdaDminus, "Process LambdaDminus candidates without Ml info", false); - + void processLambdaDminusWithMl(aod::HfRedCollisions::iterator const& collision, - soa::Join const& candsD, - aod::HfRedVzeros const&) + soa::Join const& candsD, + aod::HfRedVzeros const&) { runCandidateCreation(collision, candsD, candidatesLambda); } diff --git a/PWGHF/D2H/TableProducer/dataCreatorCharmResoReduced.cxx b/PWGHF/D2H/TableProducer/dataCreatorCharmResoReduced.cxx index cc60a4bb739..1acec493668 100644 --- a/PWGHF/D2H/TableProducer/dataCreatorCharmResoReduced.cxx +++ b/PWGHF/D2H/TableProducer/dataCreatorCharmResoReduced.cxx @@ -69,17 +69,16 @@ enum DType : uint8_t { /// Creation of D-V0 pairs struct HfDataCreatorCharmResoReduced { - + // Produces AOD tables to store track information Produces hfReducedCollision; // Defined in PWGHF/D2H/DataModel/ReducedDataModel.h Produces hfCollisionCounter; // Defined in PWGHF/D2H/DataModel/ReducedDataModel.h - //V0 and D candidates reduced tables + // V0 and D candidates reduced tables Produces hfCandV0; // Defined in PWGHF/D2H/DataModel/ReducedDataModel.h Produces hfCandD; // Defined in PWGHF/D2H/DataModel/ReducedDataModel.h - //ML optional Tables - Produces hfCandDMl; // Defined in PWGHF/D2H/DataModel/ReducedDataModel.h + // ML optional Tables + Produces hfCandDMl; // Defined in PWGHF/D2H/DataModel/ReducedDataModel.h - // CCDB configuration o2::ccdb::CcdbApi ccdbApi; Service ccdb; @@ -256,7 +255,7 @@ struct HfDataCreatorCharmResoReduced { prongIdsD[1] = candD.prong1Id(); prongIdsD[2] = candD.prongPiId(); dtype = candD.signSoftPi() * DType::Dstar; - if constexpr(withMl){ + if constexpr (withMl) { std::copy(candD.mlProbDstarToD0Pi().begin(), candD.mlProbDstarToD0Pi().end(), bdtScores.begin()); } } else if constexpr (DecayChannel == DecayChannel::DplusV0) { @@ -271,7 +270,7 @@ struct HfDataCreatorCharmResoReduced { prongIdsD[1] = candD.prong1Id(); prongIdsD[2] = candD.prong2Id(); dtype = static_cast(prong0.sign() * DType::Dplus); - if constexpr(withMl){ + if constexpr (withMl) { std::copy(candD.mlProbDplusToPiKPi().begin(), candD.mlProbDplusToPiKPi().end(), bdtScores.begin()); } } // else if @@ -356,8 +355,8 @@ struct HfDataCreatorCharmResoReduced { pVecD[0], pVecD[1], pVecD[2], dtype); if constexpr (withMl) { - hfCandDMl(bdtScores[0], bdtScores[1], bdtScores[2]); - } + hfCandDMl(bdtScores[0], bdtScores[1], bdtScores[2]); + } fillHfReducedCollision = true; switch (DecayChannel) { case DecayChannel::DstarV0: @@ -404,11 +403,11 @@ struct HfDataCreatorCharmResoReduced { PROCESS_SWITCH(HfDataCreatorCharmResoReduced, processDplusV0, "Process Dplus candidates without MC info and without ML info", true); void processDplusV0WithMl(aod::Collisions const& collisions, - CandsDplusFilteredWithMl const& candsDplus, - aod::TrackAssoc const& trackIndices, - aod::V0Datas const& V0s, - BigTracksPID const& tracks, - aod::BCsWithTimestamps const& bcs) + CandsDplusFilteredWithMl const& candsDplus, + aod::TrackAssoc const& trackIndices, + aod::V0Datas const& V0s, + BigTracksPID const& tracks, + aod::BCsWithTimestamps const& bcs) { // handle normalization by the right number of collisions hfCollisionCounter(collisions.tableSize()); @@ -442,11 +441,11 @@ struct HfDataCreatorCharmResoReduced { PROCESS_SWITCH(HfDataCreatorCharmResoReduced, processDstarV0, "Process DStar candidates without MC info and without ML info", false); void processDstarV0WithMl(aod::Collisions const& collisions, - CandDstarFilteredWithMl const& candsDstar, - aod::TrackAssoc const& trackIndices, - aod::V0Datas const& V0s, - BigTracksPID const& tracks, - aod::BCsWithTimestamps const& bcs) + CandDstarFilteredWithMl const& candsDstar, + aod::TrackAssoc const& trackIndices, + aod::V0Datas const& V0s, + BigTracksPID const& tracks, + aod::BCsWithTimestamps const& bcs) { // handle normalization by the right number of collisions hfCollisionCounter(collisions.tableSize()); diff --git a/PWGHF/TableProducer/treeCreatorDplusToPiKPi.cxx b/PWGHF/TableProducer/treeCreatorDplusToPiKPi.cxx index 5faf9336b8e..75d43c1b490 100644 --- a/PWGHF/TableProducer/treeCreatorDplusToPiKPi.cxx +++ b/PWGHF/TableProducer/treeCreatorDplusToPiKPi.cxx @@ -93,8 +93,8 @@ DECLARE_SOA_TABLE(HfCandDpLites, "AOD", "HFCANDDPLITE", hf_cand::ImpactParameter0, hf_cand::ImpactParameter1, hf_cand::ImpactParameter2, - hf_cand::ImpactParameterZ0, - hf_cand::ImpactParameterZ1, + hf_cand::ImpactParameterZ0, + hf_cand::ImpactParameterZ1, hf_cand::ImpactParameterZ2, full::NSigTpcPi0, full::NSigTpcKa0, @@ -167,11 +167,11 @@ DECLARE_SOA_TABLE(HfCandDpFulls, "AOD", "HFCANDDPFULL", hf_cand::ErrorImpactParameter0, hf_cand::ErrorImpactParameter1, hf_cand::ErrorImpactParameter2, - hf_cand::ImpactParameterZ0, - hf_cand::ImpactParameterZ1, + hf_cand::ImpactParameterZ0, + hf_cand::ImpactParameterZ1, hf_cand::ImpactParameterZ2, - hf_cand::ErrorImpactParameterZ0, - hf_cand::ErrorImpactParameterZ1, + hf_cand::ErrorImpactParameterZ0, + hf_cand::ErrorImpactParameterZ1, hf_cand::ErrorImpactParameterZ2, full::NSigTpcPi0, full::NSigTpcKa0, From cb54635208c7534dd04ae6bf51bb3b30b7b89cf6 Mon Sep 17 00:00:00 2001 From: Luca Aglietta <75362880+Luca610@users.noreply.github.com> Date: Mon, 22 Apr 2024 12:05:49 +0200 Subject: [PATCH 13/13] Added new line at the end of taskDplus.cxx --- PWGHF/D2H/Tasks/taskDplus.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGHF/D2H/Tasks/taskDplus.cxx b/PWGHF/D2H/Tasks/taskDplus.cxx index e52e88d3c78..3911bfa53da 100644 --- a/PWGHF/D2H/Tasks/taskDplus.cxx +++ b/PWGHF/D2H/Tasks/taskDplus.cxx @@ -361,4 +361,4 @@ struct HfTaskDplus { WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { return WorkflowSpec{adaptAnalysisTask(cfgc)}; -} \ No newline at end of file +}