From 4a7b37f8a4ae2ddcf0b87cbf45d25dc03c26dbe3 Mon Sep 17 00:00:00 2001 From: ALICE Action Bot Date: Fri, 11 Jul 2025 09:21:48 +0000 Subject: [PATCH] Please consider the following formatting changes --- PWGHF/Core/DecayChannels.h | 4 +- PWGHF/D2H/Core/SelectorCutsRedDataFormat.h | 2 +- PWGHF/D2H/DataModel/ReducedDataModel.h | 61 +-- .../candidateCreatorCharmResoReduced.cxx | 188 ++++---- .../dataCreatorCharmResoReduced.cxx | 443 +++++++++--------- .../D2H/Tasks/taskCharmResoToDTrkReduced.cxx | 73 ++- PWGHF/D2H/Tasks/taskCharmResoToDV0Reduced.cxx | 51 +- PWGHF/Utils/utilsMcMatching.h | 80 ++-- 8 files changed, 444 insertions(+), 458 deletions(-) diff --git a/PWGHF/Core/DecayChannels.h b/PWGHF/Core/DecayChannels.h index 4b92574aa1b..abc8ac291a6 100644 --- a/PWGHF/Core/DecayChannels.h +++ b/PWGHF/Core/DecayChannels.h @@ -234,7 +234,7 @@ enum DecayChannelMain : int8_t { // Ds1(2536)+ Ds1ToDstarK0s = 5, // D*+ K0s // Ds2*(2573)+ - Ds2starToD0Kplus = 6, // D0 K+ + Ds2starToD0Kplus = 6, // D0 K+ Ds2starToDplusK0s = 7, // D+ K0s Ds2starToDstarK0s = 8, // D*+ K0s // Ds1*(2700)+ @@ -252,7 +252,7 @@ enum DecayChannelMain : int8_t { // Xic(3080)+ Xic3080plusToDplusLambda = 15 // D+ Λ }; -} +} // namespace hf_cand_reso } // namespace o2::hf_decay #endif // PWGHF_CORE_DECAYCHANNELS_H_ diff --git a/PWGHF/D2H/Core/SelectorCutsRedDataFormat.h b/PWGHF/D2H/Core/SelectorCutsRedDataFormat.h index a9f53eb0d11..4373ded905c 100644 --- a/PWGHF/D2H/Core/SelectorCutsRedDataFormat.h +++ b/PWGHF/D2H/Core/SelectorCutsRedDataFormat.h @@ -95,7 +95,7 @@ static constexpr int NCutVars = 7; constexpr double Cuts[1][NCutVars] = {{0.1, 3, 40, 4, 3, -1, -1}}; // nSigmaTpc, nSigmaTof, nSigmaCombined // row labels static const std::vector labelsCutVar = {"ptMin", "itsNClsMin", "tpcNCrossedRowsMin", "tpcChi2Max", "nSigmaTpc", "nSigmaTof", "nSigmaComb"}; -} +} // namespace hf_cuts_track_daughter } // namespace o2::analysis #endif // PWGHF_D2H_CORE_SELECTORCUTSREDDATAFORMAT_H_ diff --git a/PWGHF/D2H/DataModel/ReducedDataModel.h b/PWGHF/D2H/DataModel/ReducedDataModel.h index e5f952c23af..e5a776c02c4 100644 --- a/PWGHF/D2H/DataModel/ReducedDataModel.h +++ b/PWGHF/D2H/DataModel/ReducedDataModel.h @@ -1161,7 +1161,7 @@ DECLARE_SOA_TABLE(HfCandLbConfigs, "AOD", "HFCANDLBCONFIG", //! Table with confi // Charm resonances analysis namespace hf_reso_3_prong { -DECLARE_SOA_COLUMN(Sign, sign, int8_t); //! Integer with selected D candidate sign +DECLARE_SOA_COLUMN(Sign, sign, int8_t); //! Integer with selected D candidate sign DECLARE_SOA_COLUMN(ItsNClsSoftPi, itsNClsSoftPi, int); //! minimum value of number of ITS clusters for the decay daughter tracks DECLARE_SOA_COLUMN(TpcNClsCrossedRowsSoftPi, tpcNClsCrossedRowsSoftPi, int); //! minimum value of number of TPC crossed rows for the decay daughter tracks DECLARE_SOA_COLUMN(TpcChi2NClSoftPi, tpcChi2NClSoftPi, float); //! maximum value of TPC chi2 for the decay daughter tracks @@ -1368,7 +1368,6 @@ DECLARE_SOA_TABLE(HfRedDstarNoTrks, "AOD", "HFREDDSTARNOTRK", //! Table with 3 p hf_cand::PVectorProng2, hf_reso_3_prong::PVector); - namespace hf_reso_cand_reduced { DECLARE_SOA_COLUMN(InvMass, invMass, float); //! Invariant mass in GeV/c2 @@ -1381,7 +1380,7 @@ DECLARE_SOA_COLUMN(FlagMcMatchRec, flagMcMatchRec, int8_t); // fla DECLARE_SOA_COLUMN(FlagMcMatchRecD, flagMcMatchRecD, int8_t); // flag for D meson bachelor decay channel classification reconstruction level DECLARE_SOA_COLUMN(FlagMcMatchChanD, flagMcMatchChanD, int8_t); // flag for D meson resonant channel classification reconstruction level DECLARE_SOA_COLUMN(FlagMcMatchGen, flagMcMatchGen, int8_t); // flag for decay channel classification generator level -DECLARE_SOA_COLUMN(DebugMcRec, debugMcRec, uint16_t); // debug flag for mis-association at reconstruction level +DECLARE_SOA_COLUMN(DebugMcRec, debugMcRec, uint16_t); // debug flag for mis-association at reconstruction level DECLARE_SOA_COLUMN(Origin, origin, int8_t); // Flag for origin of MC particle 1=promt, 2=FD DECLARE_SOA_COLUMN(SignD0, signD0, int8_t); // Sign of the D0 in the channels with D* -> D0 pi, needed in case of non-matched D* DECLARE_SOA_COLUMN(PtGen, ptGen, float); // Pt at generation level in GeV/c @@ -1394,30 +1393,36 @@ DECLARE_SOA_DYNAMIC_COLUMN(PtProng1, ptProng1, //! [](float pxProng1, float pyProng1) -> float { return RecoDecay::pt(pxProng1, pyProng1); }); } // namespace hf_reso_cand_reduced -namespace hf_reso_3pr_v0{ - DECLARE_SOA_INDEX_COLUMN_FULL(Prong0, prong0, int, HfRed3PrNoTrks, "_0"); //! Prong0 index (D daughter) - DECLARE_SOA_INDEX_COLUMN_FULL(Prong1, prong1, int, HfRedVzeros, "_1"); //! Prong1 index (V0 daughter) -} -namespace hf_reso_dstar_v0{ - DECLARE_SOA_INDEX_COLUMN_FULL(Prong0, prong0, int, HfRedDstarNoTrks, "_0"); //! Prong0 index (D daughter) - DECLARE_SOA_INDEX_COLUMN_FULL(Prong1, prong1, int, HfRedVzeros, "_1"); //! Prong1 index (V0 daughter) -} -namespace hf_reso_2pr_v0{ - DECLARE_SOA_INDEX_COLUMN_FULL(Prong0, prong0, int, HfRed2PrNoTrks, "_0"); //! Prong0 index (D daughter) - DECLARE_SOA_INDEX_COLUMN_FULL(Prong1, prong1, int, HfRedVzeros, "_1"); //! Prong1 index (V0 daughter) -} -namespace hf_reso_3pr_trk{ - DECLARE_SOA_INDEX_COLUMN_FULL(Prong0, prong0, int, HfRed3PrNoTrks, "_0"); //! Prong0 index (D daughter) - DECLARE_SOA_INDEX_COLUMN_FULL(Prong1, prong1, int, HfRedTrkNoParams, "_1"); //! Prong1 index (Track daughter) -} -namespace hf_reso_dstar_trk{ - DECLARE_SOA_INDEX_COLUMN_FULL(Prong0, prong0, int, HfRedDstarNoTrks, "_0"); //! Prong0 index (D daughter) - DECLARE_SOA_INDEX_COLUMN_FULL(Prong1, prong1, int, HfRedTrkNoParams, "_1"); //! Prong1 index (Track daughter) -} -namespace hf_reso_2pr_trk{ - DECLARE_SOA_INDEX_COLUMN_FULL(Prong0, prong0, int, HfRed2PrNoTrks, "_0"); //! Prong0 index (D daughter) - DECLARE_SOA_INDEX_COLUMN_FULL(Prong1, prong1, int, HfRedTrkNoParams, "_1"); //! Prong1 index (Track daughter) -} +namespace hf_reso_3pr_v0 +{ +DECLARE_SOA_INDEX_COLUMN_FULL(Prong0, prong0, int, HfRed3PrNoTrks, "_0"); //! Prong0 index (D daughter) +DECLARE_SOA_INDEX_COLUMN_FULL(Prong1, prong1, int, HfRedVzeros, "_1"); //! Prong1 index (V0 daughter) +} // namespace hf_reso_3pr_v0 +namespace hf_reso_dstar_v0 +{ +DECLARE_SOA_INDEX_COLUMN_FULL(Prong0, prong0, int, HfRedDstarNoTrks, "_0"); //! Prong0 index (D daughter) +DECLARE_SOA_INDEX_COLUMN_FULL(Prong1, prong1, int, HfRedVzeros, "_1"); //! Prong1 index (V0 daughter) +} // namespace hf_reso_dstar_v0 +namespace hf_reso_2pr_v0 +{ +DECLARE_SOA_INDEX_COLUMN_FULL(Prong0, prong0, int, HfRed2PrNoTrks, "_0"); //! Prong0 index (D daughter) +DECLARE_SOA_INDEX_COLUMN_FULL(Prong1, prong1, int, HfRedVzeros, "_1"); //! Prong1 index (V0 daughter) +} // namespace hf_reso_2pr_v0 +namespace hf_reso_3pr_trk +{ +DECLARE_SOA_INDEX_COLUMN_FULL(Prong0, prong0, int, HfRed3PrNoTrks, "_0"); //! Prong0 index (D daughter) +DECLARE_SOA_INDEX_COLUMN_FULL(Prong1, prong1, int, HfRedTrkNoParams, "_1"); //! Prong1 index (Track daughter) +} // namespace hf_reso_3pr_trk +namespace hf_reso_dstar_trk +{ +DECLARE_SOA_INDEX_COLUMN_FULL(Prong0, prong0, int, HfRedDstarNoTrks, "_0"); //! Prong0 index (D daughter) +DECLARE_SOA_INDEX_COLUMN_FULL(Prong1, prong1, int, HfRedTrkNoParams, "_1"); //! Prong1 index (Track daughter) +} // namespace hf_reso_dstar_trk +namespace hf_reso_2pr_trk +{ +DECLARE_SOA_INDEX_COLUMN_FULL(Prong0, prong0, int, HfRed2PrNoTrks, "_0"); //! Prong0 index (D daughter) +DECLARE_SOA_INDEX_COLUMN_FULL(Prong1, prong1, int, HfRedTrkNoParams, "_1"); //! Prong1 index (Track daughter) +} // namespace hf_reso_2pr_trk DECLARE_SOA_TABLE(HfCandCharmReso, "AOD", "HFCANDCHARMRESO", //! Table with Resonance candidate information for resonances reduced workflow o2::soa::Index<>, @@ -1478,7 +1483,7 @@ DECLARE_SOA_TABLE(Hf3PrV0McRec, "AOD", "HF3PRV0MCREC", hf_reso_cand_reduced::InvMassGen, hf_cand::NTracksDecayed, o2::soa::Marker<1>); - + DECLARE_SOA_TABLE(HfDstarV0McRec, "AOD", "HFDSTARV0MCREC", hf_reso_dstar_v0::Prong0Id, hf_reso_dstar_v0::Prong1Id, diff --git a/PWGHF/D2H/TableProducer/candidateCreatorCharmResoReduced.cxx b/PWGHF/D2H/TableProducer/candidateCreatorCharmResoReduced.cxx index c848ae92e95..e67e3ccfc17 100644 --- a/PWGHF/D2H/TableProducer/candidateCreatorCharmResoReduced.cxx +++ b/PWGHF/D2H/TableProducer/candidateCreatorCharmResoReduced.cxx @@ -110,9 +110,9 @@ struct HfCandidateCreatorCharmResoReduced { Produces rowCandidateResoIndices2PrTrks; // D Configurables struct : ConfigurableGroup { - Configurable> binsPtD{"binsPtD", std::vector{hf_cuts_d_daughter::vecBinsPt}, "pT bin limits for D daughter cuts"}; - Configurable> cutsD{"cutsDmesDaughter", {hf_cuts_d_daughter::Cuts[0], hf_cuts_d_daughter::NBinsPt, hf_cuts_d_daughter::NCutVars, hf_cuts_d_daughter::labelsPt, hf_cuts_d_daughter::labelsCutVar}, "D daughter selections"}; - Configurable keepSideBands{"keepSideBands", false, "flag to keep events from D meson sidebands for backgorund estimation"}; + Configurable> binsPtD{"binsPtD", std::vector{hf_cuts_d_daughter::vecBinsPt}, "pT bin limits for D daughter cuts"}; + Configurable> cutsD{"cutsDmesDaughter", {hf_cuts_d_daughter::Cuts[0], hf_cuts_d_daughter::NBinsPt, hf_cuts_d_daughter::NCutVars, hf_cuts_d_daughter::labelsPt, hf_cuts_d_daughter::labelsCutVar}, "D daughter selections"}; + Configurable keepSideBands{"keepSideBands", false, "flag to keep events from D meson sidebands for backgorund estimation"}; } cfgDmesCuts; // V0 cuts configurables struct : ConfigurableGroup { @@ -123,15 +123,15 @@ struct HfCandidateCreatorCharmResoReduced { // Track cuts configurables struct : ConfigurableGroup { Configurable> cutsTrk{"cutsTrk", {hf_cuts_track_daughter::Cuts[0], hf_cuts_track_daughter::NCutVars, hf_cuts_track_daughter::labelsCutVar}, "Track daughter selections, set to -1 to disable cuts"}; - Configurable massHypo {"massHypo", 1, "Mass Hypothesis for the track daughters (0: pion, 1: kaon, 2: proton)"}; + Configurable massHypo{"massHypo", 1, "Mass Hypothesis for the track daughters (0: pion, 1: kaon, 2: proton)"}; } cfgTrackCuts; - // Mixed Event configurables + // Mixed Event configurables struct : ConfigurableGroup { Configurable numberEventsMixed{"numberEventsMixed", 5, "Number of events mixed in ME process"}; Configurable numberEventsToSkip{"numberEventsToSkip", -1, "Number of events to Skip in ME process"}; ConfigurableAxis multPoolBins{"multPoolBins", {VARIABLE_WIDTH, 0., 45., 60., 75., 95, 250}, "event multiplicity pools (PV contributors for now)"}; ConfigurableAxis zPoolBins{"zPoolBins", {VARIABLE_WIDTH, -10.0, -4, -1, 1, 4, 10.0}, "z vertex position pools"}; - }cfgMixedEvent; + } cfgMixedEvent; // Histogram axes configurables struct : ConfigurableGroup { ConfigurableAxis axisPtD{"axPtD", {100, 0., 50}, "#it{p}_{T} (GeV/#it{c})"}; @@ -140,7 +140,7 @@ struct HfCandidateCreatorCharmResoReduced { ConfigurableAxis axisMassD{"axMassD", {100, 1.7f, 2.1f}, "inv. mass (D) (GeV/#it{c}^{2})"}; ConfigurableAxis axisMassV0{"axMassV0", {100, 0.45f, 0.55f}, "inv. mass (V_{0}) (GeV/#it{c}^{2})"}; ConfigurableAxis axisMassDsj{"axMassReso", {400, 0.49f, 0.89f}, "inv. mass (DV_{0}) (GeV/#it{c}^{2})"}; - }cfgHistAxes; + } cfgHistAxes; // Other Configurables Configurable rejectPairsWithCommonDaughter{"rejectPairsWithCommonDaughter", true, "flag to reject the pairs that share a daughter track if not done in the derived data creation"}; Configurable useDeltaMass{"useDeltaMass", true, "Use Delta Mass for resonance invariant Mass calculation"}; @@ -198,11 +198,11 @@ struct HfCandidateCreatorCharmResoReduced { if (ptBin == -1) { return 0; } - if constexpr (dType == DType::Dplus){ + if constexpr (dType == DType::Dplus) { invMassD = candD.invMassDplus(); if (!isInMassInterval(invMassD, ptBin)) { - return 0; - } + return 0; + } } else if constexpr (dType == DType::Dstar) { if (candD.sign() > 0) { invMassD = candD.invMassDstar() - candD.invMassD0(); @@ -210,8 +210,8 @@ struct HfCandidateCreatorCharmResoReduced { invMassD = candD.invMassAntiDstar() - candD.invMassD0Bar(); } if (!isInMassInterval(invMassD, ptBin)) { - return 0; - } + return 0; + } } else if constexpr (dType == DType::D0) { if (TESTBIT(candD.selFlagD0(), PartSel::selAsPart)) { invMassD = candD.invMassD0(); @@ -228,7 +228,7 @@ struct HfCandidateCreatorCharmResoReduced { } } else { CLRBIT(selection, PartSel::selAsAntiPart); - } + } } return selection; } @@ -248,11 +248,11 @@ struct HfCandidateCreatorCharmResoReduced { return false; } if ((candV0.invMassK0s() - MassK0Short) > cfgV0Cuts.cutsV0->get(ptBin, "invMassLow") && (MassK0Short - candV0.invMassK0s()) < cfgV0Cuts.cutsV0->get(ptBin, "invMassLow")) { - return false; + return false; } } else if (cfgV0Cuts.v0Type == V0Type::Lambda) { // Lambda if (!TESTBIT(candV0.v0Type(), V0Type::Lambda) && !TESTBIT(candV0.v0Type(), V0Type::AntiLambda)) { - return false; + return false; } if ((candV0.invMassLambda() - MassLambda) > cfgV0Cuts.cutsV0->get(ptBin, "invMassLow") && (MassLambda - candV0.invMassLambda()) < cfgV0Cuts.cutsV0->get(ptBin, "invMassLow")) { return false; @@ -263,7 +263,7 @@ struct HfCandidateCreatorCharmResoReduced { } else { LOG(error) << "Unsupported V0 type for selection: " << cfgV0Cuts.v0Type; return false; - } + } // selection on kinematics and topology if (candV0.dca() > cfgV0Cuts.cutsV0->get(ptBin, "dcaMax") || candV0.cpa() < cfgV0Cuts.cutsV0->get(ptBin, "cpaMin") || candV0.v0Radius() < cfgV0Cuts.cutsV0->get(ptBin, "radiusMin")) { return false; @@ -326,7 +326,7 @@ struct HfCandidateCreatorCharmResoReduced { } else { LOG(error) << "Unsupported mass hypothesis for track selection: " << cfgTrackCuts.massHypo; return false; - } + } return true; } @@ -341,7 +341,7 @@ struct HfCandidateCreatorCharmResoReduced { DRedTable const& candD, V0TrRedTable const& candV0Tr, int selectionFlag) - { + { std::vector> pVectorCharmProngs = {candD.pVectorProng0(), candD.pVectorProng1()}; std::array pVecD = candD.pVector(); std::array pVecV0Tr = candV0Tr.pVector(); @@ -349,7 +349,7 @@ struct HfCandidateCreatorCharmResoReduced { int8_t signReso{0}, isWrongSign{0}; double ptReso = RecoDecay::pt(RecoDecay::sumOfVec(pVecV0Tr, pVecD)); - if constexpr (dType == DType::Dplus){ + if constexpr (dType == DType::Dplus) { invMassD = candD.invMassDplus(); pVectorCharmProngs.push_back(candD.pVectorProng2()); if constexpr (bachType == BachelorType::V0) { @@ -369,7 +369,7 @@ struct HfCandidateCreatorCharmResoReduced { invMassV0Tr = candV0Tr.invMassAntiLambda(); signReso = candD.sign(); isWrongSign = 1; - } + } if (useDeltaMass) { invMassReso = RecoDecay::m(std::array{pVectorCharmProngs[0], pVectorCharmProngs[1], pVectorCharmProngs[2], pVecV0Tr}, std::array{MassPiPlus, MassKPlus, MassPiPlus, MassLambda}) - invMassD; } else { @@ -377,12 +377,12 @@ struct HfCandidateCreatorCharmResoReduced { } } rowCandidateReso(pVecD[0], pVecD[1], pVecD[2], - pVecV0Tr[0], pVecV0Tr[1], pVecV0Tr[2], - invMassReso, - invMassD, - invMassV0Tr, - signReso, - isWrongSign); + pVecV0Tr[0], pVecV0Tr[1], pVecV0Tr[2], + invMassReso, + invMassD, + invMassV0Tr, + signReso, + isWrongSign); rowCandidateResoIndices3PrV0s(collision.globalIndex(), candD.globalIndex(), candV0Tr.globalIndex()); registry.fill(HIST("hMassResoVsPt"), invMassReso, ptReso); registry.fill(HIST("hMassDmesDauVsPt"), invMassD, candD.pt()); @@ -413,12 +413,12 @@ struct HfCandidateCreatorCharmResoReduced { } } rowCandidateReso(pVecD[0], pVecD[1], pVecD[2], - pVecV0Tr[0], pVecV0Tr[1], pVecV0Tr[2], - invMassReso, - invMassD, - invMassV0Tr, - signReso, - isWrongSign); + pVecV0Tr[0], pVecV0Tr[1], pVecV0Tr[2], + invMassReso, + invMassD, + invMassV0Tr, + signReso, + isWrongSign); rowCandidateResoIndices3PrTrks(collision.globalIndex(), candD.globalIndex(), candV0Tr.globalIndex()); registry.fill(HIST("hMassResoVsPt"), invMassReso, ptReso); registry.fill(HIST("hMassDmesDauVsPt"), invMassD, candD.pt()); @@ -465,12 +465,12 @@ struct HfCandidateCreatorCharmResoReduced { } } rowCandidateReso(pVecD[0], pVecD[1], pVecD[2], - pVecV0Tr[0], pVecV0Tr[1], pVecV0Tr[2], - invMassReso, - invMassD - invMassD0, - invMassV0Tr, - signReso, - isWrongSign); + pVecV0Tr[0], pVecV0Tr[1], pVecV0Tr[2], + invMassReso, + invMassD - invMassD0, + invMassV0Tr, + signReso, + isWrongSign); rowCandidateResoIndicesDstarV0s(collision.globalIndex(), candD.globalIndex(), candV0Tr.globalIndex()); registry.fill(HIST("hMassResoVsPt"), invMassReso, ptReso); registry.fill(HIST("hMassDmesDauVsPt"), invMassD - invMassD0, candD.pt()); @@ -513,19 +513,19 @@ struct HfCandidateCreatorCharmResoReduced { } } rowCandidateReso(pVecD[0], pVecD[1], pVecD[2], - pVecV0Tr[0], pVecV0Tr[1], pVecV0Tr[2], - invMassReso, - invMassD - invMassD0, - invMassV0Tr, - signReso, - isWrongSign); + pVecV0Tr[0], pVecV0Tr[1], pVecV0Tr[2], + invMassReso, + invMassD - invMassD0, + invMassV0Tr, + signReso, + isWrongSign); rowCandidateResoIndicesDstarTrks(collision.globalIndex(), candD.globalIndex(), candV0Tr.globalIndex()); registry.fill(HIST("hMassResoVsPt"), invMassReso, ptReso); registry.fill(HIST("hMassDmesDauVsPt"), invMassD, candD.pt()); registry.fill(HIST("hMassV0DauVsPt"), invMassV0Tr, candV0Tr.pt()); } } else if constexpr (dType == DType::D0) { - //D0 + // D0 if (TESTBIT(selectionFlag, PartSel::selAsPart)) { invMassD = candD.invMassD0(); if constexpr (bachType == BachelorType::V0) { @@ -551,12 +551,12 @@ struct HfCandidateCreatorCharmResoReduced { } } rowCandidateReso(pVecD[0], pVecD[1], pVecD[2], - pVecV0Tr[0], pVecV0Tr[1], pVecV0Tr[2], - invMassReso, - invMassD, - invMassV0Tr, - signReso, - isWrongSign); + pVecV0Tr[0], pVecV0Tr[1], pVecV0Tr[2], + invMassReso, + invMassD, + invMassV0Tr, + signReso, + isWrongSign); rowCandidateResoIndices2PrV0s(collision.globalIndex(), candD.globalIndex(), candV0Tr.globalIndex()); registry.fill(HIST("hMassResoVsPt"), invMassReso, ptReso); registry.fill(HIST("hMassDmesDauVsPt"), invMassD, candD.pt()); @@ -587,12 +587,12 @@ struct HfCandidateCreatorCharmResoReduced { } } rowCandidateReso(pVecD[0], pVecD[1], pVecD[2], - pVecV0Tr[0], pVecV0Tr[1], pVecV0Tr[2], - invMassReso, - invMassD, - invMassV0Tr, - signReso, - isWrongSign); + pVecV0Tr[0], pVecV0Tr[1], pVecV0Tr[2], + invMassReso, + invMassD, + invMassV0Tr, + signReso, + isWrongSign); rowCandidateResoIndices2PrTrks(collision.globalIndex(), candD.globalIndex(), candV0Tr.globalIndex()); registry.fill(HIST("hMassResoVsPt"), invMassReso, ptReso); registry.fill(HIST("hMassDmesDauVsPt"), invMassD, candD.pt()); @@ -625,12 +625,12 @@ struct HfCandidateCreatorCharmResoReduced { } } rowCandidateReso(pVecD[0], pVecD[1], pVecD[2], - pVecV0Tr[0], pVecV0Tr[1], pVecV0Tr[2], - invMassReso, - invMassD, - invMassV0Tr, - signReso, - isWrongSign); + pVecV0Tr[0], pVecV0Tr[1], pVecV0Tr[2], + invMassReso, + invMassD, + invMassV0Tr, + signReso, + isWrongSign); rowCandidateResoIndices2PrV0s(collision.globalIndex(), candD.globalIndex(), candV0Tr.globalIndex()); registry.fill(HIST("hMassResoVsPt"), invMassReso, ptReso); registry.fill(HIST("hMassDmesDauVsPt"), invMassD, candD.pt()); @@ -661,12 +661,12 @@ struct HfCandidateCreatorCharmResoReduced { } } rowCandidateReso(pVecD[0], pVecD[1], pVecD[2], - pVecV0Tr[0], pVecV0Tr[1], pVecV0Tr[2], - invMassReso, - invMassD, - invMassV0Tr, - signReso, - isWrongSign); + pVecV0Tr[0], pVecV0Tr[1], pVecV0Tr[2], + invMassReso, + invMassD, + invMassV0Tr, + signReso, + isWrongSign); rowCandidateResoIndices2PrTrks(collision.globalIndex(), candD.globalIndex(), candV0Tr.globalIndex()); registry.fill(HIST("hMassResoVsPt"), invMassReso, ptReso); registry.fill(HIST("hMassDmesDauVsPt"), invMassD, candD.pt()); @@ -676,7 +676,6 @@ struct HfCandidateCreatorCharmResoReduced { } } - template void runCandidateCreation(Coll const& collision, DRedTable const& candsD, @@ -699,7 +698,7 @@ struct HfCandidateCreatorCharmResoReduced { // loop on V0 or track candidates bool alreadyCounted{false}; for (const auto& candV0Tr : candsV0Tr) { - if constexpr (bachType == BachelorType::V0){ // Case: V0 + if constexpr (bachType == BachelorType::V0) { // Case: V0 if (rejectPairsWithCommonDaughter) { if (std::find(dDaughtersIDs.begin(), dDaughtersIDs.end(), candV0Tr.prong0Id()) != dDaughtersIDs.end() || std::find(dDaughtersIDs.begin(), dDaughtersIDs.end(), candV0Tr.prong1Id()) != dDaughtersIDs.end()) { continue; @@ -785,8 +784,8 @@ struct HfCandidateCreatorCharmResoReduced { PROCESS_SWITCH(HfCandidateCreatorCharmResoReduced, process3ProngV0s, "Process resonances decaying in a 3 prong D meson and a V0", true); void processDstarV0s(aod::HfRedCollisions const& collisions, - aod::HfRedDstarNoTrks const& candsD, - aod::HfRedVzeros const& candsV0) + aod::HfRedDstarNoTrks const& candsD, + aod::HfRedVzeros const& candsV0) { for (const auto& collision : collisions) { auto thisCollId = collision.globalIndex(); @@ -798,8 +797,8 @@ struct HfCandidateCreatorCharmResoReduced { PROCESS_SWITCH(HfCandidateCreatorCharmResoReduced, processDstarV0s, "Process resonances decaying in a Dstar meson and a V0", false); void process2PrV0s(aod::HfRedCollisions const& collisions, - aod::HfRed2PrNoTrks const& candsD, - aod::HfRedVzeros const& candsV0) + aod::HfRed2PrNoTrks const& candsD, + aod::HfRedVzeros const& candsV0) { for (const auto& collision : collisions) { auto thisCollId = collision.globalIndex(); @@ -837,8 +836,8 @@ struct HfCandidateCreatorCharmResoReduced { PROCESS_SWITCH(HfCandidateCreatorCharmResoReduced, processDstarTracks, "Process resonances decaying in a Dstar meson and a Track", false); void process2PrTracks(aod::HfRedCollisions const& collisions, - aod::HfRed2PrNoTrks const& candsD, - HfRedTrkNoParams const& candsTr) + aod::HfRed2PrNoTrks const& candsD, + HfRedTrkNoParams const& candsTr) { for (const auto& collision : collisions) { auto thisCollId = collision.globalIndex(); @@ -851,48 +850,48 @@ struct HfCandidateCreatorCharmResoReduced { // Mixed Event Process Functions void process3ProngV0sMixedEvent(aod::HfRedCollisions const& collisions, - aod::HfRed3PrNoTrks const& candsD, - aod::HfRedVzeros const& candsV0) + aod::HfRed3PrNoTrks const& candsD, + aod::HfRedVzeros const& candsV0) { runCandidateCreationMixedEvent(collisions, candsD, candsV0); } PROCESS_SWITCH(HfCandidateCreatorCharmResoReduced, process3ProngV0sMixedEvent, "Process mixed events for resonances decaying in a 3 prong D meson and a V0", false); void processDstarV0sMixedEvent(aod::HfRedCollisions const& collisions, - aod::HfRedDstarNoTrks const& candsD, - aod::HfRedVzeros const& candsV0) + aod::HfRedDstarNoTrks const& candsD, + aod::HfRedVzeros const& candsV0) { runCandidateCreationMixedEvent(collisions, candsD, candsV0); } PROCESS_SWITCH(HfCandidateCreatorCharmResoReduced, processDstarV0sMixedEvent, "Process mixed events for resonances decaying in a Dstar meson and a V0", false); void process2PrV0sMixedEvent(aod::HfRedCollisions const& collisions, - aod::HfRed2PrNoTrks const& candsD, - aod::HfRedVzeros const& candsV0) + aod::HfRed2PrNoTrks const& candsD, + aod::HfRedVzeros const& candsV0) { runCandidateCreationMixedEvent(collisions, candsD, candsV0); } PROCESS_SWITCH(HfCandidateCreatorCharmResoReduced, process2PrV0sMixedEvent, "Process mixed events for resonances decaying in a 2 prong D meson and a V0", false); void process3ProngTracksMixedEvent(aod::HfRedCollisions const& collisions, - aod::HfRed3PrNoTrks const& candsD, - HfRedTrkNoParams const& candsTr) + aod::HfRed3PrNoTrks const& candsD, + HfRedTrkNoParams const& candsTr) { runCandidateCreationMixedEvent(collisions, candsD, candsTr); } PROCESS_SWITCH(HfCandidateCreatorCharmResoReduced, process3ProngTracksMixedEvent, "Process mixed events for resonances decaying in a 3 prong D meson and a Track", false); void processDstarTracksMixedEvent(aod::HfRedCollisions const& collisions, - aod::HfRedDstarNoTrks const& candsD, - HfRedTrkNoParams const& candsTr) + aod::HfRedDstarNoTrks const& candsD, + HfRedTrkNoParams const& candsTr) { runCandidateCreationMixedEvent(collisions, candsD, candsTr); } PROCESS_SWITCH(HfCandidateCreatorCharmResoReduced, processDstarTracksMixedEvent, "Process mixed events for resonances decaying in a Dstar meson and a Track", false); void process2PrTracksMixedEvent(aod::HfRedCollisions const& collisions, - aod::HfRed2PrNoTrks const& candsD, - HfRedTrkNoParams const& candsTr) + aod::HfRed2PrNoTrks const& candsD, + HfRedTrkNoParams const& candsTr) { runCandidateCreationMixedEvent(collisions, candsD, candsTr); } @@ -910,7 +909,6 @@ struct HfCandidateCreatorCharmResoReducedExpressions { using CandResoWithIndices3PrTrks = soa::Join; using CandResoWithIndicesDstarV0s = soa::Join; using CandResoWithIndicesDstarTrks = soa::Join; - // Configurable axis ConfigurableAxis axisPt{"axisPt", {VARIABLE_WIDTH, 0., 1.f, 2.f, 3.f, 4.f, 5.f, 6.f, 8.f, 12.f, 24.f, 50.f}, "#it{p}_{T} (GeV/#it{c})"}; @@ -949,15 +947,15 @@ struct HfCandidateCreatorCharmResoReducedExpressions { rowDV0McRec.ptGen(), rowDV0McRec.invMassGen()); filledMcInfo = true; - if (std::abs(rowDV0McRec.flagMcMatchRec()) >0 && - !TESTBIT(rowDV0McRec.debugMcRec(), hf_decay::hf_cand_reso::PartialMatchMc::ResoPartlyMatched)){ + if (std::abs(rowDV0McRec.flagMcMatchRec()) > 0 && + !TESTBIT(rowDV0McRec.debugMcRec(), hf_decay::hf_cand_reso::PartialMatchMc::ResoPartlyMatched)) { registry.fill(HIST("hMassMcMatched"), candReso.invMass(), candReso.pt()); } else if (std::abs(rowDV0McRec.flagMcMatchRec()) > 0 && - TESTBIT(rowDV0McRec.debugMcRec(), hf_decay::hf_cand_reso::PartialMatchMc::ResoPartlyMatched)) { + TESTBIT(rowDV0McRec.debugMcRec(), hf_decay::hf_cand_reso::PartialMatchMc::ResoPartlyMatched)) { registry.fill(HIST("hMassMcMatchedIncomplete"), candReso.invMass(), candReso.pt()); } else { registry.fill(HIST("hMassMcUnmatched"), candReso.invMass(), candReso.pt()); - } + } break; } if (!filledMcInfo) { // protection to get same size tables in case something went wrong: we created a candidate that was not preselected in the D-Pi creator @@ -1002,7 +1000,7 @@ struct HfCandidateCreatorCharmResoReducedExpressions { fillResoMcRec(rowsMcRec, candsReso); } PROCESS_SWITCH(HfCandidateCreatorCharmResoReducedExpressions, process3PrTrackMc, "Process resonances to Dplus track MC", false); - + void processDummy(aod::HfCandCharmReso const&) {} PROCESS_SWITCH(HfCandidateCreatorCharmResoReducedExpressions, processDummy, "Process dummy", true); }; diff --git a/PWGHF/D2H/TableProducer/dataCreatorCharmResoReduced.cxx b/PWGHF/D2H/TableProducer/dataCreatorCharmResoReduced.cxx index 14401a86a5a..df9cc35e461 100644 --- a/PWGHF/D2H/TableProducer/dataCreatorCharmResoReduced.cxx +++ b/PWGHF/D2H/TableProducer/dataCreatorCharmResoReduced.cxx @@ -50,8 +50,8 @@ #include #include #include -#include #include +#include #include #include @@ -195,7 +195,7 @@ struct HfDataCreatorCharmResoReduced { Configurable doMcRecQa{"doMcRecQa", true, "Fill QA histograms for Mc matching"}; Configurable rejectPairsWithCommonDaughter{"rejectPairsWithCommonDaughter", true, "flag to reject already at this stage the pairs that share a daughter track"}; Configurable rejectCollisionsWithBadEvSel{"rejectCollisionsWithBadEvSel", true, "flag to reject collisions with bad event selection"}; - + HfHelper hfHelper; o2::hf_evsel::HfEventSelection hfEvSel; o2::hf_evsel::HfEventSelectionMc hfEvSelMc; @@ -246,7 +246,6 @@ struct HfDataCreatorCharmResoReduced { std::array pVectorProng1; std::array pVectorProng2; } varUtils; - // Dplus using CandsDplusFiltered = soa::Filtered>; @@ -288,7 +287,7 @@ struct HfDataCreatorCharmResoReduced { PresliceUnsorted colPerMcCollision = aod::mccollisionlabel::mcCollisionId; HistogramRegistry registry{"registry"}; - + void init(InitContext& initContext) { // histograms @@ -594,9 +593,9 @@ struct HfDataCreatorCharmResoReduced { } return true; } - + template - int8_t getMatchingFlagV0(PParticles const& particlesMc, const std::array& arrDaughtersV0) + int8_t getMatchingFlagV0(PParticles const& particlesMc, const std::array& arrDaughtersV0) { int8_t signV0{0}; int indexRec{-1}; @@ -621,31 +620,31 @@ struct HfDataCreatorCharmResoReduced { /// \param tracks is the table with tracks /// \param indexHfCandCharm is the index of the charm-hadron bachelor in the reduced table /// \param indexCandV0TrBach is the index of the v0 bachelor in the reduced table - template + template void fillMcRecoInfoDV0(PParticles const& particlesMc, - CCand const& candCharmBach, - BBachV0 const& bachelorV0, - Tr const& tracks, - int& indexHfCandCharm, - int64_t& indexCandV0Bach) + CCand const& candCharmBach, + BBachV0 const& bachelorV0, + Tr const& tracks, + int& indexHfCandCharm, + int64_t& indexCandV0Bach) { std::vector vecDaughtersReso{}; int8_t sign{0}, nKinkedTracks{0}, origin{0}, flagCharmBach{0}, flagCharmBachInterm{0}, flagV0{0}, flagReso{0}; int indexRec{-1}, debugMcRec{0}; float ptGen{-1.f}, invMassGen{-1.f}; - if constexpr (dType == DType::Dstar){ + if constexpr (dType == DType::Dstar) { vecDaughtersReso.push_back(tracks.rawIteratorAt(candCharmBach.prong0Id())); vecDaughtersReso.push_back(tracks.rawIteratorAt(candCharmBach.prong1Id())); vecDaughtersReso.push_back(tracks.rawIteratorAt(candCharmBach.prongPiId())); // Check if D* is matched flagCharmBach = candCharmBach.flagMcMatchRec(); - if (std::abs(flagCharmBach) > 0){ + if (std::abs(flagCharmBach) > 0) { SETBIT(debugMcRec, hf_decay::hf_cand_reso::PartialMatchMc::DstarMatched); origin = candCharmBach.originMcRec(); } // Check if D0 is matched flagCharmBachInterm = candCharmBach.flagMcMatchRecD0(); - if (std::abs(flagCharmBachInterm) > 0){ + if (std::abs(flagCharmBachInterm) > 0) { SETBIT(debugMcRec, hf_decay::hf_cand_reso::PartialMatchMc::D0Matched); } // Check if V0 is matched @@ -663,19 +662,19 @@ struct HfDataCreatorCharmResoReduced { indexRec = RecoDecay::getMatchedMCRec(particlesMc, arrDaughtersReso, pdgCodeReso, pdgCodesDaughters, true, &sign, 3, &nKinkedTracks); if (indexRec > -1) { flagReso = sign * decayChannelFlag; - break; + break; } } - } else if (std::abs(flagCharmBachInterm) > 0 && flagV0 == hf_decay::hf_cand_reso::PartialMatchMc::K0Matched){ + } else if (std::abs(flagCharmBachInterm) > 0 && flagV0 == hf_decay::hf_cand_reso::PartialMatchMc::K0Matched) { std::array pdgCodesDaughters = {+kPiPlus, -kKPlus, +kPiPlus, -kPiPlus}; - auto arrDaughtersReso = std::array{vecDaughtersReso[0], vecDaughtersReso[1], vecDaughtersReso[3], vecDaughtersReso[4]}; + auto arrDaughtersReso = std::array{vecDaughtersReso[0], vecDaughtersReso[1], vecDaughtersReso[3], vecDaughtersReso[4]}; // Peaking background of D0K0s <- Ds* with spurious soft pion for (const auto& [decayChannelFlag, pdgCodeReso] : hf_decay::hf_cand_reso::particlesToDstarK0s) { indexRec = RecoDecay::getMatchedMCRec(particlesMc, arrDaughtersReso, pdgCodeReso, pdgCodesDaughters, true, &sign, 3, &nKinkedTracks); if (indexRec > -1) { flagReso = sign * decayChannelFlag; SETBIT(debugMcRec, hf_decay::hf_cand_reso::PartialMatchMc::ResoPartlyMatched); - break; + break; } } } @@ -685,11 +684,11 @@ struct HfDataCreatorCharmResoReduced { ptGen = particleReso.pt(); invMassGen = RecoDecay::m(particleReso.p(), particleReso.e()); } - rowHfDstarV0McRecReduced(indexHfCandCharm, indexCandV0Bach, - flagReso, flagCharmBach, - flagCharmBachInterm, debugMcRec, - origin, ptGen, invMassGen, - nKinkedTracks); + rowHfDstarV0McRecReduced(indexHfCandCharm, indexCandV0Bach, + flagReso, flagCharmBach, + flagCharmBachInterm, debugMcRec, + origin, ptGen, invMassGen, + nKinkedTracks); } else if constexpr (dType == DType::Dplus) { vecDaughtersReso.push_back(tracks.rawIteratorAt(candCharmBach.prong0Id())); vecDaughtersReso.push_back(tracks.rawIteratorAt(candCharmBach.prong1Id())); @@ -697,7 +696,7 @@ struct HfDataCreatorCharmResoReduced { // Check if D+ is matched flagCharmBach = candCharmBach.flagMcMatchRec(); flagCharmBachInterm = candCharmBach.flagMcDecayChanRec(); - if (std::abs(flagCharmBach) > 0){ + if (std::abs(flagCharmBach) > 0) { SETBIT(debugMcRec, hf_decay::hf_cand_reso::PartialMatchMc::DplusMatched); origin = candCharmBach.originMcRec(); } @@ -709,8 +708,7 @@ struct HfDataCreatorCharmResoReduced { SETBIT(debugMcRec, std::abs(flagV0)); } // If both D+ and K0s are matched, try to match resonance - if (hf_decay::hf_cand_3prong::daughtersDplusMain.contains(static_cast(std::abs(flagCharmBach))) - && flagV0 == hf_decay::hf_cand_reso::PartialMatchMc::K0Matched) { + if (hf_decay::hf_cand_3prong::daughtersDplusMain.contains(static_cast(std::abs(flagCharmBach))) && flagV0 == hf_decay::hf_cand_reso::PartialMatchMc::K0Matched) { auto arrDaughtersReso = std::array{vecDaughtersReso[0], vecDaughtersReso[1], vecDaughtersReso[2], vecDaughtersReso[3], vecDaughtersReso[4]}; auto pdgCodesDplusDaughters = hf_decay::hf_cand_3prong::daughtersDplusMain.at(static_cast(std::abs(flagCharmBach))); auto pdgCodesDaughters = std::array{pdgCodesDplusDaughters[0], pdgCodesDplusDaughters[1], pdgCodesDplusDaughters[2], +kPiPlus, -kPiPlus}; @@ -721,8 +719,7 @@ struct HfDataCreatorCharmResoReduced { break; } } - } else if (hf_decay::hf_cand_3prong::daughtersDplusMain.contains(static_cast(std::abs(flagCharmBach))) - && std::abs(flagV0) == hf_decay::hf_cand_reso::PartialMatchMc::LambdaMatched) { + } else if (hf_decay::hf_cand_3prong::daughtersDplusMain.contains(static_cast(std::abs(flagCharmBach))) && std::abs(flagV0) == hf_decay::hf_cand_reso::PartialMatchMc::LambdaMatched) { // Peaking background of D+Lambda <- Ds* with spurious soft pion auto arrDaughtersReso = std::array{vecDaughtersReso[0], vecDaughtersReso[1], vecDaughtersReso[2], vecDaughtersReso[3], vecDaughtersReso[4]}; auto pdgCodesDplusDaughters = hf_decay::hf_cand_3prong::daughtersDplusMain.at(static_cast(std::abs(flagCharmBach))); @@ -740,18 +737,18 @@ struct HfDataCreatorCharmResoReduced { ptGen = particleReso.pt(); invMassGen = RecoDecay::m(particleReso.p(), particleReso.e()); } - rowHf3PrV0McRecReduced(indexHfCandCharm, indexCandV0Bach, - flagReso, flagCharmBach, - flagCharmBachInterm, debugMcRec, - origin, ptGen, invMassGen, - nKinkedTracks); + rowHf3PrV0McRecReduced(indexHfCandCharm, indexCandV0Bach, + flagReso, flagCharmBach, + flagCharmBachInterm, debugMcRec, + origin, ptGen, invMassGen, + nKinkedTracks); } else if constexpr (dType == DType::D0) { vecDaughtersReso.push_back(tracks.rawIteratorAt(candCharmBach.prong0Id())); vecDaughtersReso.push_back(tracks.rawIteratorAt(candCharmBach.prong1Id())); // Check if D0 is matched flagCharmBach = candCharmBach.flagMcMatchRec(); flagCharmBachInterm = candCharmBach.flagMcDecayChanRec(); - if (std::abs(flagCharmBach) > 0){ + if (std::abs(flagCharmBach) > 0) { SETBIT(debugMcRec, hf_decay::hf_cand_reso::PartialMatchMc::D0Matched); origin = candCharmBach.originMcRec(); } @@ -764,8 +761,7 @@ struct HfDataCreatorCharmResoReduced { } // No physical channel expected in D0 K0s // If both D0 and Lambda are matched, try to match resonance - if (hf_decay::hf_cand_2prong::daughtersD0Main.contains(static_cast(std::abs(flagCharmBach))) - && std::abs(flagV0) == hf_decay::hf_cand_reso::PartialMatchMc::LambdaMatched) { + if (hf_decay::hf_cand_2prong::daughtersD0Main.contains(static_cast(std::abs(flagCharmBach))) && std::abs(flagV0) == hf_decay::hf_cand_reso::PartialMatchMc::LambdaMatched) { auto arrDaughtersReso = std::array{vecDaughtersReso[0], vecDaughtersReso[1], vecDaughtersReso[2], vecDaughtersReso[3]}; auto pdgCodesDzeroDaughters = hf_decay::hf_cand_2prong::daughtersD0Main.at(static_cast(std::abs(flagCharmBach))); auto pdgCodesDaughters = std::array{pdgCodesDzeroDaughters[0], pdgCodesDzeroDaughters[1], +kProton, -kPiPlus}; @@ -782,11 +778,11 @@ struct HfDataCreatorCharmResoReduced { ptGen = particleReso.pt(); invMassGen = RecoDecay::m(particleReso.p(), particleReso.e()); } - rowHf2PrV0McRecReduced(indexHfCandCharm, indexCandV0Bach, - flagReso, flagCharmBach, - flagCharmBachInterm, debugMcRec, - origin, ptGen, invMassGen, - nKinkedTracks); + rowHf2PrV0McRecReduced(indexHfCandCharm, indexCandV0Bach, + flagReso, flagCharmBach, + flagCharmBachInterm, debugMcRec, + origin, ptGen, invMassGen, + nKinkedTracks); } registry.fill(HIST("hMCRecDebug"), debugMcRec); if (indexRec > -1) { @@ -794,14 +790,13 @@ struct HfDataCreatorCharmResoReduced { registry.fill(HIST("hMCRecOrigin"), origin); registry.fill(HIST("hMCRecMassGen"), invMassGen); } - if (std::abs(flagCharmBach) > 0){ + if (std::abs(flagCharmBach) > 0) { registry.fill(HIST("hMCRecCharmDau"), flagCharmBach); } } - - template < typename Tr> - int8_t getMatchingFlagTrack( Tr const& bachTrack) + template + int8_t getMatchingFlagTrack(Tr const& bachTrack) { auto particle = bachTrack.mcParticle(); auto pdgCode = std::abs(particle.pdgCode()); @@ -822,32 +817,32 @@ struct HfDataCreatorCharmResoReduced { /// \param tracks is the table with tracks /// \param indexHfCandCharm is the index of the charm-hadron bachelor in the reduced table /// \param indexCandTrBach is the index of the v0 bachelor in the reduced table - template + template void fillMcRecoInfoDTrack(PParticles const& particlesMc, - CCand const& candCharmBach, - BBachTr const& bachelorTrack, - Tr const& tracks, - int& indexHfCandCharm, - int64_t& indexCandTrBach) + CCand const& candCharmBach, + BBachTr const& bachelorTrack, + Tr const& tracks, + int& indexHfCandCharm, + int64_t& indexCandTrBach) { std::vector vecDaughtersReso{}; int8_t sign{0}, nKinkedTracks{0}, origin{0}, flagCharmBach{0}, flagCharmBachInterm{0}, flagTrack{0}, flagReso{0}; int indexRec{-1}; uint16_t debugMcRec{0}; float ptGen{-1.f}, invMassGen{-1.f}; - if constexpr (dType == DType::Dstar){ + if constexpr (dType == DType::Dstar) { vecDaughtersReso.push_back(tracks.rawIteratorAt(candCharmBach.prong0Id())); vecDaughtersReso.push_back(tracks.rawIteratorAt(candCharmBach.prong1Id())); vecDaughtersReso.push_back(tracks.rawIteratorAt(candCharmBach.prongPiId())); // Check if D* is matched flagCharmBach = candCharmBach.flagMcMatchRec(); - if (std::abs(flagCharmBach) > 0){ + if (std::abs(flagCharmBach) > 0) { SETBIT(debugMcRec, hf_decay::hf_cand_reso::PartialMatchMc::DstarMatched); origin = candCharmBach.originMcRec(); } // Check if D0 is matched flagCharmBachInterm = candCharmBach.flagMcMatchRecD0(); - if (std::abs(flagCharmBachInterm) > 0){ + if (std::abs(flagCharmBachInterm) > 0) { SETBIT(debugMcRec, hf_decay::hf_cand_reso::PartialMatchMc::D0Matched); } // Check if Track is matched @@ -863,21 +858,21 @@ struct HfDataCreatorCharmResoReduced { indexRec = RecoDecay::getMatchedMCRec(particlesMc, arrDaughtersReso, pdgCodeReso, pdgCodesDaughters, true, &sign, 3, &nKinkedTracks); if (indexRec > -1) { flagReso = sign * decayChannelFlag; - break; + break; } } - } + } // No channels in D*K+ or D*Pr if (indexRec > -1) { auto particleReso = particlesMc.iteratorAt(indexRec); ptGen = particleReso.pt(); - invMassGen = RecoDecay::m(particleReso.p(), particleReso.e()); + invMassGen = RecoDecay::m(particleReso.p(), particleReso.e()); } - rowHfDstarTrkMcRecReduced(indexHfCandCharm, indexCandTrBach, - flagReso, flagCharmBach, - flagCharmBachInterm, debugMcRec, - origin, ptGen, invMassGen, - nKinkedTracks); + rowHfDstarTrkMcRecReduced(indexHfCandCharm, indexCandTrBach, + flagReso, flagCharmBach, + flagCharmBachInterm, debugMcRec, + origin, ptGen, invMassGen, + nKinkedTracks); } else if constexpr (dType == DType::Dplus) { vecDaughtersReso.push_back(tracks.rawIteratorAt(candCharmBach.prong0Id())); vecDaughtersReso.push_back(tracks.rawIteratorAt(candCharmBach.prong1Id())); @@ -885,7 +880,7 @@ struct HfDataCreatorCharmResoReduced { // Check if D+ is matched flagCharmBach = candCharmBach.flagMcMatchRec(); flagCharmBachInterm = candCharmBach.flagMcDecayChanRec(); - if (std::abs(flagCharmBach) > 0){ + if (std::abs(flagCharmBach) > 0) { SETBIT(debugMcRec, hf_decay::hf_cand_reso::PartialMatchMc::DplusMatched); origin = candCharmBach.originMcRec(); } @@ -895,8 +890,7 @@ struct HfDataCreatorCharmResoReduced { SETBIT(debugMcRec, flagTrack); } // If both D+ and Track are matched, try to match resonance - if (hf_decay::hf_cand_3prong::daughtersDplusMain.contains(static_cast(std::abs(flagCharmBach))) - && flagTrack == hf_decay::hf_cand_reso::PartialMatchMc::PionMatched) { + if (hf_decay::hf_cand_3prong::daughtersDplusMain.contains(static_cast(std::abs(flagCharmBach))) && flagTrack == hf_decay::hf_cand_reso::PartialMatchMc::PionMatched) { auto arrDaughtersReso = std::array{vecDaughtersReso[0], vecDaughtersReso[1], vecDaughtersReso[2], bachelorTrack}; auto pdgCodesDplusDaughters = hf_decay::hf_cand_3prong::daughtersDplusMain.at(static_cast(std::abs(flagCharmBach))); auto pdgCodesDaughters = std::array{pdgCodesDplusDaughters[0], pdgCodesDplusDaughters[1], pdgCodesDplusDaughters[2], -kPiPlus}; @@ -907,30 +901,29 @@ struct HfDataCreatorCharmResoReduced { break; } } - } + } // No channels in D+K+ or D+Pr if (indexRec > -1) { auto particleReso = particlesMc.iteratorAt(indexRec); ptGen = particleReso.pt(); - invMassGen = RecoDecay::m(particleReso.p(), particleReso.e()); + invMassGen = RecoDecay::m(particleReso.p(), particleReso.e()); } - rowHf3PrTrkMcRecReduced(indexHfCandCharm, indexCandTrBach, - flagReso, flagCharmBach, - flagCharmBachInterm, debugMcRec, - origin, ptGen, invMassGen, - nKinkedTracks); + rowHf3PrTrkMcRecReduced(indexHfCandCharm, indexCandTrBach, + flagReso, flagCharmBach, + flagCharmBachInterm, debugMcRec, + origin, ptGen, invMassGen, + nKinkedTracks); } else if constexpr (dType == DType::D0) { vecDaughtersReso.push_back(tracks.rawIteratorAt(candCharmBach.prong0Id())); vecDaughtersReso.push_back(tracks.rawIteratorAt(candCharmBach.prong1Id())); // Check if D0 is matched flagCharmBach = candCharmBach.flagMcMatchRec(); flagCharmBachInterm = candCharmBach.flagMcDecayChanRec(); - if (std::abs(flagCharmBach) > 0){ + if (std::abs(flagCharmBach) > 0) { SETBIT(debugMcRec, hf_decay::hf_cand_reso::PartialMatchMc::D0Matched); origin = candCharmBach.originMcRec(); } - if (hf_decay::hf_cand_2prong::daughtersD0Main.contains(static_cast(std::abs(flagCharmBach))) - && flagTrack == hf_decay::hf_cand_reso::PartialMatchMc::PionMatched) { + if (hf_decay::hf_cand_2prong::daughtersD0Main.contains(static_cast(std::abs(flagCharmBach))) && flagTrack == hf_decay::hf_cand_reso::PartialMatchMc::PionMatched) { auto arrDaughtersReso = std::array{vecDaughtersReso[0], vecDaughtersReso[1], bachelorTrack}; auto pdgCodesDzeroDaughters = hf_decay::hf_cand_2prong::daughtersD0Main.at(static_cast(std::abs(flagCharmBach))); auto pdgCodesDaughters = std::array{pdgCodesDzeroDaughters[0], pdgCodesDzeroDaughters[1], +kPiPlus}; @@ -941,8 +934,7 @@ struct HfDataCreatorCharmResoReduced { break; } } - } else if (hf_decay::hf_cand_2prong::daughtersD0Main.contains(static_cast(std::abs(flagCharmBach))) - && flagTrack == hf_decay::hf_cand_reso::PartialMatchMc::KaonMatched) { + } else if (hf_decay::hf_cand_2prong::daughtersD0Main.contains(static_cast(std::abs(flagCharmBach))) && flagTrack == hf_decay::hf_cand_reso::PartialMatchMc::KaonMatched) { auto arrDaughtersReso = std::array{vecDaughtersReso[0], vecDaughtersReso[1], bachelorTrack}; auto pdgCodesDzeroDaughters = hf_decay::hf_cand_2prong::daughtersD0Main.at(static_cast(std::abs(flagCharmBach))); auto pdgCodesDaughters = std::array{pdgCodesDzeroDaughters[0], pdgCodesDzeroDaughters[1], +kKPlus}; @@ -957,13 +949,13 @@ struct HfDataCreatorCharmResoReduced { if (indexRec > -1) { auto particleReso = particlesMc.iteratorAt(indexRec); ptGen = particleReso.pt(); - invMassGen = RecoDecay::m(particleReso.p(), particleReso.e()); + invMassGen = RecoDecay::m(particleReso.p(), particleReso.e()); } - rowHf2PrTrkMcRecReduced(indexHfCandCharm, indexCandTrBach, - flagReso, flagCharmBach, - flagCharmBachInterm, debugMcRec, - origin, ptGen, invMassGen, - nKinkedTracks); + rowHf2PrTrkMcRecReduced(indexHfCandCharm, indexCandTrBach, + flagReso, flagCharmBach, + flagCharmBachInterm, debugMcRec, + origin, ptGen, invMassGen, + nKinkedTracks); } registry.fill(HIST("hMCRecDebug"), debugMcRec); if (indexRec > -1) { @@ -971,9 +963,9 @@ struct HfDataCreatorCharmResoReduced { registry.fill(HIST("hMCRecOrigin"), origin); registry.fill(HIST("hMCRecMassGen"), invMassGen); } - if (std::abs(flagCharmBach) > 0){ + if (std::abs(flagCharmBach) > 0) { registry.fill(HIST("hMCRecCharmDau"), flagCharmBach); - } + } } // fillMcRecoInfoDTrack template @@ -1079,11 +1071,10 @@ struct HfDataCreatorCharmResoReduced { std::copy(candD.mlProbD0().begin(), candD.mlProbD0().end(), bdtScores.begin()); std::copy(candD.mlProbD0bar().begin(), candD.mlProbD0bar().end(), bdtScores.begin() + 3); } - if (candD.isSelD0() >= cfgDmesCuts.selectionFlagD0){ + if (candD.isSelD0() >= cfgDmesCuts.selectionFlagD0) { registry.fill(HIST("hMassVsPtD0All"), varUtils.ptD, varUtils.invMassD0); - } - if (candD.isSelD0bar() >= cfgDmesCuts.selectionFlagD0Bar){ + if (candD.isSelD0bar() >= cfgDmesCuts.selectionFlagD0Bar) { registry.fill(HIST("hMassVsPtD0BarAll"), varUtils.ptD, varUtils.invMassD0Bar); } } // end of dType switch @@ -1250,10 +1241,13 @@ struct HfDataCreatorCharmResoReduced { fillHfCandD = true; // Optional filling of MC Rec table, for now only implemented for Ds1->D*K0s and Ds2*->D+K0s if constexpr (doMc) { - int indexHfCandCharm {-1}; - if constexpr (dType == DType::Dstar) indexHfCandCharm = hfCandDstar.lastIndex() + 1; - else if constexpr (dType == DType::Dplus) indexHfCandCharm = hfCandD3Pr.lastIndex() + 1; - else if constexpr (dType == DType::D0) indexHfCandCharm = hfCandD2Pr.lastIndex() + 1; + int indexHfCandCharm{-1}; + if constexpr (dType == DType::Dstar) + indexHfCandCharm = hfCandDstar.lastIndex() + 1; + else if constexpr (dType == DType::Dplus) + indexHfCandCharm = hfCandD3Pr.lastIndex() + 1; + else if constexpr (dType == DType::D0) + indexHfCandCharm = hfCandD2Pr.lastIndex() + 1; fillMcRecoInfoDV0(particlesMc, candD, v0, tracksIU, indexHfCandCharm, selectedV0s[v0.globalIndex()]); } } // end of loop on V0 candidates @@ -1439,10 +1433,13 @@ struct HfDataCreatorCharmResoReduced { } fillHfCandD = true; if constexpr (doMc) { - int indexHfCandCharm {-1}; - if constexpr (dType == DType::Dstar) indexHfCandCharm = hfCandDstar.lastIndex() + 1; - else if constexpr (dType == DType::Dplus) indexHfCandCharm = hfCandD3Pr.lastIndex() + 1; - else if constexpr (dType == DType::D0) indexHfCandCharm = hfCandD2Pr.lastIndex() + 1; + int indexHfCandCharm{-1}; + if constexpr (dType == DType::Dstar) + indexHfCandCharm = hfCandDstar.lastIndex() + 1; + else if constexpr (dType == DType::Dplus) + indexHfCandCharm = hfCandD3Pr.lastIndex() + 1; + else if constexpr (dType == DType::D0) + indexHfCandCharm = hfCandD2Pr.lastIndex() + 1; fillMcRecoInfoDTrack(particlesMc, candD, track, tracks, indexHfCandCharm, selectedTracks[track.globalIndex()]); } } // end of loop on bachelor tracks @@ -1480,14 +1477,14 @@ struct HfDataCreatorCharmResoReduced { } } else if constexpr (dType == DType::Dstar) { hfCandDstar(prongIdsD[0], prongIdsD[1], prongIdsD[2], - indexHfReducedCollision, - secondaryVertexD[0], secondaryVertexD[1], secondaryVertexD[2], - candD.pxProng0(), candD.pyProng0(), candD.pzProng0(), - candD.pxProng1(), candD.pyProng1(), candD.pzProng1(), - varUtils.pVectorProng2[0], varUtils.pVectorProng2[1], varUtils.pVectorProng2[2], - nItsClsDauMin, nTpcCrossRowsDauMin, chi2TpcDauMax, - nItsClsSoftPi, nTpcCrossRowsSoftPi, chi2TpcSoftPi, - varUtils.signD); + indexHfReducedCollision, + secondaryVertexD[0], secondaryVertexD[1], secondaryVertexD[2], + candD.pxProng0(), candD.pyProng0(), candD.pzProng0(), + candD.pxProng1(), candD.pyProng1(), candD.pzProng1(), + varUtils.pVectorProng2[0], varUtils.pVectorProng2[1], varUtils.pVectorProng2[2], + nItsClsDauMin, nTpcCrossRowsDauMin, chi2TpcDauMax, + nItsClsSoftPi, nTpcCrossRowsSoftPi, chi2TpcSoftPi, + varUtils.signD); if constexpr (withMl) { hfCandD3PrMl(bdtScores[0], bdtScores[1], bdtScores[2], bdtScores[3], bdtScores[4], bdtScores[5]); } @@ -1498,13 +1495,12 @@ struct HfDataCreatorCharmResoReduced { } else if constexpr (dType == DType::Dplus) { registry.fill(HIST("hMassVsPtDplusPaired"), candD.pt(), varUtils.invMassD); } else if constexpr (dType == DType::D0) { - if (candD.isSelD0() >= cfgDmesCuts.selectionFlagD0){ - registry.fill(HIST("hMassVsPtD0Paired"), varUtils.ptD, varUtils.invMassD0); - - } - if (candD.isSelD0bar() >= cfgDmesCuts.selectionFlagD0Bar){ - registry.fill(HIST("hMassVsPtD0BarPaired"), varUtils.ptD, varUtils.invMassD0Bar); - } + if (candD.isSelD0() >= cfgDmesCuts.selectionFlagD0) { + registry.fill(HIST("hMassVsPtD0Paired"), varUtils.ptD, varUtils.invMassD0); + } + if (candD.isSelD0bar() >= cfgDmesCuts.selectionFlagD0Bar) { + registry.fill(HIST("hMassVsPtD0BarPaired"), varUtils.ptD, varUtils.invMassD0Bar); + } } } } // candsD loop @@ -1518,10 +1514,8 @@ struct HfDataCreatorCharmResoReduced { hfReducedCollision(collision.posX(), collision.posY(), collision.posZ(), collision.numContrib(), hfRejMap, bz); } // end of runDataCreation function - - template - void runMcGen (McParticles const& mcParticles, + void runMcGen(McParticles const& mcParticles, CCs const& collInfos, McCollisions const& mcCollisions, BCsInfo const&) @@ -1551,33 +1545,33 @@ struct HfDataCreatorCharmResoReduced { bool matchedReso{false}, matchedD{false}, matchedV0Tr{false}; std::vector idxBhadMothers{}; if constexpr (dType == DType::Dstar) { - if (doV0s){ + if (doV0s) { // D* K0s - for (const auto& [decayChannelFlag, pdgCodeReso] : hf_decay::hf_cand_reso::particlesToDstarK0s){ + for (const auto& [decayChannelFlag, pdgCodeReso] : hf_decay::hf_cand_reso::particlesToDstarK0s) { matchedReso = RecoDecay::isMatchedMCGen(mcParticlesPerMcColl, particle, pdgCodeReso, std::array{static_cast(Pdg::kDStar), +kK0}, true, &sign, 1); - if (matchedReso){ + if (matchedReso) { flag = sign * decayChannelFlag; auto candV0MC = mcParticles.rawIteratorAt(particle.daughtersIds().back()); matchedV0Tr = RecoDecay::isMatchedMCGen(mcParticlesPerMcColl, candV0MC, kK0, std::array{+kPiPlus, -kPiPlus}, true, &signBach, 2); break; } - } + } } - if (doTracks && !matchedReso){ + if (doTracks && !matchedReso) { // D*+ pi- - for (const auto& [decayChannelFlag, pdgCodeReso] : hf_decay::hf_cand_reso::particlesToDstarPi){ + for (const auto& [decayChannelFlag, pdgCodeReso] : hf_decay::hf_cand_reso::particlesToDstarPi) { matchedReso = RecoDecay::isMatchedMCGen(mcParticlesPerMcColl, particle, pdgCodeReso, std::array{static_cast(Pdg::kDStar), -static_cast(kPiPlus)}, true, &sign, 1); - if (matchedReso){ + if (matchedReso) { flag = sign * decayChannelFlag; - matchedV0Tr = true; + matchedV0Tr = true; break; } } } if (matchedReso && matchedV0Tr) { - auto candDstarMC = mcParticles.rawIteratorAt(particle.daughtersIds().front()); + auto candDstarMC = mcParticles.rawIteratorAt(particle.daughtersIds().front()); matchedD = RecoDecay::isMatchedMCGen(mcParticlesPerMcColl, candDstarMC, Pdg::kDStar, std::array{static_cast(Pdg::kD0), +static_cast(kPiPlus)}, true, &signD, 1); - if (matchedD){ + if (matchedD) { auto candD0MC = mcParticles.rawIteratorAt(candDstarMC.daughtersIds().front()); matchedD = RecoDecay::isMatchedMCGen(mcParticlesPerMcColl, candD0MC, Pdg::kD0, std::array{-kKPlus, +kPiPlus}, true, &signD, 2); } @@ -1594,7 +1588,7 @@ struct HfDataCreatorCharmResoReduced { break; } } - if (!matchedReso){ + if (!matchedReso) { // D+ lambda for (const auto& [decayChannelFlag, pdgCodeReso] : hf_decay::hf_cand_reso::particlesToDplusLambda) { matchedReso = RecoDecay::isMatchedMCGen(mcParticlesPerMcColl, particle, pdgCodeReso, std::array{static_cast(Pdg::kDPlus), +kLambda0}, true, &sign, 1); @@ -1613,7 +1607,7 @@ struct HfDataCreatorCharmResoReduced { matchedReso = RecoDecay::isMatchedMCGen(mcParticlesPerMcColl, particle, pdgCodeReso, std::array{static_cast(Pdg::kDPlus), -static_cast(kPiPlus)}, true, &sign, 1); if (matchedReso) { flag = sign * decayChannelFlag; - matchedV0Tr = true; + matchedV0Tr = true; break; } } @@ -1641,17 +1635,17 @@ struct HfDataCreatorCharmResoReduced { matchedReso = RecoDecay::isMatchedMCGen(mcParticlesPerMcColl, particle, pdgCodeReso, std::array{static_cast(Pdg::kD0), +static_cast(kPiPlus)}, true, &sign, 1); if (matchedReso) { flag = sign * decayChannelFlag; - matchedV0Tr = true; + matchedV0Tr = true; break; } } // D0 K+ - if (!matchedReso){ + if (!matchedReso) { for (const auto& [decayChannelFlag, pdgCodeReso] : hf_decay::hf_cand_reso::particlesToD0Kplus) { matchedReso = RecoDecay::isMatchedMCGen(mcParticlesPerMcColl, particle, pdgCodeReso, std::array{static_cast(Pdg::kD0), +static_cast(kKPlus)}, true, &sign, 1); if (matchedReso) { flag = sign * decayChannelFlag; - matchedV0Tr = true; + matchedV0Tr = true; break; } } @@ -1685,12 +1679,11 @@ struct HfDataCreatorCharmResoReduced { ptProngs[0], yProngs[0], etaProngs[0], ptProngs[1], yProngs[1], etaProngs[1], invMassGen, rejectionMask); - } + } } } } - // Process functions // No ML // Data @@ -2171,13 +2164,13 @@ struct HfDataCreatorCharmResoReduced { PROCESS_SWITCH(HfDataCreatorCharmResoReduced, processDstarV0MC, "Process Dstar candidates paired with V0s with MC matching", false); void processDstarTrackMC(soa::Join const& collisions, - CandsDstarFilteredWithMc const& candsDstar, - TracksWithPIDAndMC const& tracks, - aod::TrackAssoc const& trackIndices, - aod::McParticles const& particlesMc, - BCsInfo const& bcs, - McCollisionsNoCents const& collInfos, - aod::McCollisions const& mcCollisions) + CandsDstarFilteredWithMc const& candsDstar, + TracksWithPIDAndMC const& tracks, + aod::TrackAssoc const& trackIndices, + aod::McParticles const& particlesMc, + BCsInfo const& bcs, + McCollisionsNoCents const& collInfos, + aod::McCollisions const& mcCollisions) { int zvtxColl{0}; int sel8Coll{0}; @@ -2198,15 +2191,15 @@ struct HfDataCreatorCharmResoReduced { PROCESS_SWITCH(HfDataCreatorCharmResoReduced, processDstarTrackMC, "Process Dstar candidates paired with tracks with MC matching", false); void processDstarV0AndTrackMC(soa::Join const& collisions, - CandsDstarFilteredWithMc const& candsDstar, - aod::V0s const& v0s, - aod::TrackAssoc const& trackIndices, - TracksWithPIDAndMC const& tracks, - TracksIUWithPIDAndMC const& tracksIU, - aod::McParticles const& particlesMc, - BCsInfo const& bcs, - McCollisionsNoCents const& collInfos, - aod::McCollisions const& mcCollisions) + CandsDstarFilteredWithMc const& candsDstar, + aod::V0s const& v0s, + aod::TrackAssoc const& trackIndices, + TracksWithPIDAndMC const& tracks, + TracksIUWithPIDAndMC const& tracksIU, + aod::McParticles const& particlesMc, + BCsInfo const& bcs, + McCollisionsNoCents const& collInfos, + aod::McCollisions const& mcCollisions) { int zvtxColl{0}; int sel8Coll{0}; @@ -2226,7 +2219,7 @@ struct HfDataCreatorCharmResoReduced { hfCollisionCounter(collisions.tableSize(), zvtxColl, sel8Coll, zvtxAndSel8Coll, zvtxAndSel8CollAndSoftTrig, allSelColl); } PROCESS_SWITCH(HfDataCreatorCharmResoReduced, processDstarV0AndTrackMC, "Process Dstar candidates paired with V0s and tracks with MC matching", false); - + // Dplus void processDplusV0MC(soa::Join const& collisions, CandsDplusFilteredWithMc const& candsDplus, @@ -2254,15 +2247,15 @@ struct HfDataCreatorCharmResoReduced { hfCollisionCounter(collisions.tableSize(), zvtxColl, sel8Coll, zvtxAndSel8Coll, zvtxAndSel8CollAndSoftTrig, allSelColl); } PROCESS_SWITCH(HfDataCreatorCharmResoReduced, processDplusV0MC, "Process Dstar candidates paired with V0s with MC matching", false); - + void processDplusTrackMC(soa::Join const& collisions, - CandsDplusFilteredWithMc const& candsDplus, - TracksWithPIDAndMC const& tracks, - aod::TrackAssoc const& trackIndices, - aod::McParticles const& particlesMc, - BCsInfo const& bcs, - McCollisionsNoCents const& collInfos, - aod::McCollisions const& mcCollisions) + CandsDplusFilteredWithMc const& candsDplus, + TracksWithPIDAndMC const& tracks, + aod::TrackAssoc const& trackIndices, + aod::McParticles const& particlesMc, + BCsInfo const& bcs, + McCollisionsNoCents const& collInfos, + aod::McCollisions const& mcCollisions) { int zvtxColl{0}; int sel8Coll{0}; @@ -2281,17 +2274,17 @@ struct HfDataCreatorCharmResoReduced { hfCollisionCounter(collisions.tableSize(), zvtxColl, sel8Coll, zvtxAndSel8Coll, zvtxAndSel8CollAndSoftTrig, allSelColl); } PROCESS_SWITCH(HfDataCreatorCharmResoReduced, processDplusTrackMC, "Process Dplus candidates paired with tracks with MC matching", false); - + void processDplusV0AndTrackMC(soa::Join const& collisions, - CandsDplusFilteredWithMc const& candsDplus, - aod::V0s const& v0s, - aod::TrackAssoc const& trackIndices, - TracksWithPIDAndMC const& tracks, - TracksIUWithPIDAndMC const& tracksIU, - aod::McParticles const& particlesMc, - BCsInfo const& bcs, - McCollisionsNoCents const& collInfos, - aod::McCollisions const& mcCollisions) + CandsDplusFilteredWithMc const& candsDplus, + aod::V0s const& v0s, + aod::TrackAssoc const& trackIndices, + TracksWithPIDAndMC const& tracks, + TracksIUWithPIDAndMC const& tracksIU, + aod::McParticles const& particlesMc, + BCsInfo const& bcs, + McCollisionsNoCents const& collInfos, + aod::McCollisions const& mcCollisions) { int zvtxColl{0}; int sel8Coll{0}; @@ -2311,7 +2304,7 @@ struct HfDataCreatorCharmResoReduced { hfCollisionCounter(collisions.tableSize(), zvtxColl, sel8Coll, zvtxAndSel8Coll, zvtxAndSel8CollAndSoftTrig, allSelColl); } PROCESS_SWITCH(HfDataCreatorCharmResoReduced, processDplusV0AndTrackMC, "Process Dplus candidates paired with V0s and tracks with MC matching", false); - + // D0 void processD0V0MC(soa::Join const& collisions, CandsD0FilteredWithMc const& candsD0, @@ -2426,13 +2419,13 @@ struct HfDataCreatorCharmResoReduced { PROCESS_SWITCH(HfDataCreatorCharmResoReduced, processDstarV0MCWithMl, "Process Dstar candidates paired with V0s with MC matching and with ML info", false); void processDstarTrackMCWithMl(soa::Join const& collisions, - CandsDstarFilteredWithMlAndMc const& candsDstar, - TracksWithPIDAndMC const& tracks, - aod::TrackAssoc const& trackIndices, - aod::McParticles const& particlesMc, - BCsInfo const& bcs, - McCollisionsNoCents const& collInfos, - aod::McCollisions const& mcCollisions) + CandsDstarFilteredWithMlAndMc const& candsDstar, + TracksWithPIDAndMC const& tracks, + aod::TrackAssoc const& trackIndices, + aod::McParticles const& particlesMc, + BCsInfo const& bcs, + McCollisionsNoCents const& collInfos, + aod::McCollisions const& mcCollisions) { int zvtxColl{0}; int sel8Coll{0}; @@ -2453,15 +2446,15 @@ struct HfDataCreatorCharmResoReduced { PROCESS_SWITCH(HfDataCreatorCharmResoReduced, processDstarTrackMCWithMl, "Process Dstar candidates paired with tracks with MC matching and with ML info", false); void processDstarV0AndTrackMCWithMl(soa::Join const& collisions, - CandsDstarFilteredWithMlAndMc const& candsDstar, - aod::V0s const& v0s, - aod::TrackAssoc const& trackIndices, - TracksWithPIDAndMC const& tracks, - TracksIUWithPIDAndMC const& tracksIU, - aod::McParticles const& particlesMc, - BCsInfo const& bcs, - McCollisionsNoCents const& collInfos, - aod::McCollisions const& mcCollisions) + CandsDstarFilteredWithMlAndMc const& candsDstar, + aod::V0s const& v0s, + aod::TrackAssoc const& trackIndices, + TracksWithPIDAndMC const& tracks, + TracksIUWithPIDAndMC const& tracksIU, + aod::McParticles const& particlesMc, + BCsInfo const& bcs, + McCollisionsNoCents const& collInfos, + aod::McCollisions const& mcCollisions) { int zvtxColl{0}; int sel8Coll{0}; @@ -2509,15 +2502,15 @@ struct HfDataCreatorCharmResoReduced { hfCollisionCounter(collisions.tableSize(), zvtxColl, sel8Coll, zvtxAndSel8Coll, zvtxAndSel8CollAndSoftTrig, allSelColl); } PROCESS_SWITCH(HfDataCreatorCharmResoReduced, processDplusV0MCWithMl, "Process Dplus candidates paired with V0s with MC matching and with ML info", false); - + void processDplusTrackMCWithMl(soa::Join const& collisions, - CandsDplusFilteredWithMlAndMc const& candsDplus, - TracksWithPIDAndMC const& tracks, - aod::TrackAssoc const& trackIndices, - aod::McParticles const& particlesMc, - BCsInfo const& bcs, - McCollisionsNoCents const& collInfos, - aod::McCollisions const& mcCollisions) + CandsDplusFilteredWithMlAndMc const& candsDplus, + TracksWithPIDAndMC const& tracks, + aod::TrackAssoc const& trackIndices, + aod::McParticles const& particlesMc, + BCsInfo const& bcs, + McCollisionsNoCents const& collInfos, + aod::McCollisions const& mcCollisions) { int zvtxColl{0}; int sel8Coll{0}; @@ -2536,17 +2529,17 @@ struct HfDataCreatorCharmResoReduced { hfCollisionCounter(collisions.tableSize(), zvtxColl, sel8Coll, zvtxAndSel8Coll, zvtxAndSel8CollAndSoftTrig, allSelColl); } PROCESS_SWITCH(HfDataCreatorCharmResoReduced, processDplusTrackMCWithMl, "Process Dplus candidates paired with tracks with MC matching and with ML info", false); - + void processDplusV0AndTrackMCWithMl(soa::Join const& collisions, - CandsDplusFilteredWithMlAndMc const& candsDplus, - aod::V0s const& v0s, - aod::TrackAssoc const& trackIndices, - TracksWithPIDAndMC const& tracks, - TracksIUWithPIDAndMC const& tracksIU, - aod::McParticles const& particlesMc, - BCsInfo const& bcs, - McCollisionsNoCents const& collInfos, - aod::McCollisions const& mcCollisions) + CandsDplusFilteredWithMlAndMc const& candsDplus, + aod::V0s const& v0s, + aod::TrackAssoc const& trackIndices, + TracksWithPIDAndMC const& tracks, + TracksIUWithPIDAndMC const& tracksIU, + aod::McParticles const& particlesMc, + BCsInfo const& bcs, + McCollisionsNoCents const& collInfos, + aod::McCollisions const& mcCollisions) { int zvtxColl{0}; int sel8Coll{0}; @@ -2569,13 +2562,13 @@ struct HfDataCreatorCharmResoReduced { // D0 void processD0V0MCWithMl(soa::Join const& collisions, - CandsD0FilteredWithMlAndMc const& candsD0, - aod::V0s const& v0s, - TracksIUWithPIDAndMC const& tracksIU, - aod::McParticles const& particlesMc, - BCsInfo const& bcs, - McCollisionsNoCents const& collInfos, - aod::McCollisions const& mcCollisions) + CandsD0FilteredWithMlAndMc const& candsD0, + aod::V0s const& v0s, + TracksIUWithPIDAndMC const& tracksIU, + aod::McParticles const& particlesMc, + BCsInfo const& bcs, + McCollisionsNoCents const& collInfos, + aod::McCollisions const& mcCollisions) { int zvtxColl{0}; int sel8Coll{0}; @@ -2596,13 +2589,13 @@ struct HfDataCreatorCharmResoReduced { PROCESS_SWITCH(HfDataCreatorCharmResoReduced, processD0V0MCWithMl, "Process D0 candidates paired with V0s with MC matching and with ML info", false); void processD0TrackMCWithMl(soa::Join const& collisions, - CandsD0FilteredWithMlAndMc const& candsD0, - TracksWithPIDAndMC const& tracks, - aod::TrackAssoc const& trackIndices, - aod::McParticles const& particlesMc, - BCsInfo const& bcs, - McCollisionsNoCents const& collInfos, - aod::McCollisions const& mcCollisions) + CandsD0FilteredWithMlAndMc const& candsD0, + TracksWithPIDAndMC const& tracks, + aod::TrackAssoc const& trackIndices, + aod::McParticles const& particlesMc, + BCsInfo const& bcs, + McCollisionsNoCents const& collInfos, + aod::McCollisions const& mcCollisions) { int zvtxColl{0}; int sel8Coll{0}; @@ -2623,15 +2616,15 @@ struct HfDataCreatorCharmResoReduced { PROCESS_SWITCH(HfDataCreatorCharmResoReduced, processD0TrackMCWithMl, "Process D0 candidates paired with tracks with MC matching and with ML info", false); void processD0V0AndTrackMCWithMl(soa::Join const& collisions, - CandsD0FilteredWithMlAndMc const& candsD0, - aod::V0s const& v0s, - aod::TrackAssoc const& trackIndices, - TracksWithPIDAndMC const& tracks, - TracksIUWithPIDAndMC const& tracksIU, - aod::McParticles const& particlesMc, - BCsInfo const& bcs, - McCollisionsNoCents const& collInfos, - aod::McCollisions const& mcCollisions) + CandsD0FilteredWithMlAndMc const& candsD0, + aod::V0s const& v0s, + aod::TrackAssoc const& trackIndices, + TracksWithPIDAndMC const& tracks, + TracksIUWithPIDAndMC const& tracksIU, + aod::McParticles const& particlesMc, + BCsInfo const& bcs, + McCollisionsNoCents const& collInfos, + aod::McCollisions const& mcCollisions) { int zvtxColl{0}; int sel8Coll{0}; diff --git a/PWGHF/D2H/Tasks/taskCharmResoToDTrkReduced.cxx b/PWGHF/D2H/Tasks/taskCharmResoToDTrkReduced.cxx index e213123be77..0b5860c4d8f 100644 --- a/PWGHF/D2H/Tasks/taskCharmResoToDTrkReduced.cxx +++ b/PWGHF/D2H/Tasks/taskCharmResoToDTrkReduced.cxx @@ -14,9 +14,8 @@ /// /// \author Luca Aglietta , University and INFN Torino -#include "PWGHF/D2H/DataModel/ReducedDataModel.h" - #include "PWGHF/Core/DecayChannels.h" +#include "PWGHF/D2H/DataModel/ReducedDataModel.h" #include "PWGHF/Utils/utilsMcMatching.h" #include "Common/Core/RecoDecay.h" @@ -71,17 +70,17 @@ DECLARE_SOA_COLUMN(MlScoreNonPromptBach0, mlScoreNonPromptBach0, float); DECLARE_SOA_COLUMN(ItsNClsProngMinBach0, itsNClsProngMinBach0, int); //! minimum value of number of ITS clusters for the decay daughter tracks of bachelor 0 DECLARE_SOA_COLUMN(TpcNClsCrossedRowsProngMinBach0, tpcNClsCrossedRowsProngMinBach0, int); //! minimum value of number of TPC crossed rows for the decay daughter tracks of bachelor 0 DECLARE_SOA_COLUMN(TpcChi2NClProngMaxBach0, tpcChi2NClProngMaxBach0, float); //! maximum value of TPC chi2 for the decay daughter tracks of bachelor 0 -DECLARE_SOA_COLUMN(ItsNClsBach1, itsNClsBach1, int); //! minimum value of number of ITS clusters for the decay daughter tracks of bachelor 1 -DECLARE_SOA_COLUMN(TpcNClsCrossedRowsBach1, tpcNClsCrossedRowsBach1, int); //! minimum value of number of TPC crossed rows for the decay daughter tracks of bachelor 1 -DECLARE_SOA_COLUMN(TpcChi2NClBach1, tpcChi2NClBach1, float); //! maximum value of TPC chi2 for the decay daughter tracks of bachelor 1 -DECLARE_SOA_COLUMN(TpcNSigmaBach1, tpcNSigmaBach1, float); //! NsigmaTPC for Bach1 for its mass hypothesis -DECLARE_SOA_COLUMN(TofNSigmaBach1, tofNSigmaBach1, float); //! NsigmaTOF for Bach1 for its mass hypothesis -DECLARE_SOA_COLUMN(TpcTofNSigmaBach1, tpcTofNSigmaBach1, float); //! Combined NsigmaTPC-TOF for Bach1 for its mass hypothesis -DECLARE_SOA_COLUMN(FlagMcMatch, flagMcMatch, int8_t); //! flag for decay channel classification reconstruction level -DECLARE_SOA_COLUMN(DebugMcRec, debugMcRec, int); //! debug flag for mis-association at reconstruction level +DECLARE_SOA_COLUMN(ItsNClsBach1, itsNClsBach1, int); //! minimum value of number of ITS clusters for the decay daughter tracks of bachelor 1 +DECLARE_SOA_COLUMN(TpcNClsCrossedRowsBach1, tpcNClsCrossedRowsBach1, int); //! minimum value of number of TPC crossed rows for the decay daughter tracks of bachelor 1 +DECLARE_SOA_COLUMN(TpcChi2NClBach1, tpcChi2NClBach1, float); //! maximum value of TPC chi2 for the decay daughter tracks of bachelor 1 +DECLARE_SOA_COLUMN(TpcNSigmaBach1, tpcNSigmaBach1, float); //! NsigmaTPC for Bach1 for its mass hypothesis +DECLARE_SOA_COLUMN(TofNSigmaBach1, tofNSigmaBach1, float); //! NsigmaTOF for Bach1 for its mass hypothesis +DECLARE_SOA_COLUMN(TpcTofNSigmaBach1, tpcTofNSigmaBach1, float); //! Combined NsigmaTPC-TOF for Bach1 for its mass hypothesis +DECLARE_SOA_COLUMN(FlagMcMatch, flagMcMatch, int8_t); //! flag for decay channel classification reconstruction level +DECLARE_SOA_COLUMN(DebugMcRec, debugMcRec, int); //! debug flag for mis-association at reconstruction level DECLARE_SOA_COLUMN(Origin, origin, int8_t); //! Flag for origin of MC particle 1=promt, 2=FD DECLARE_SOA_COLUMN(PtGen, ptGen, float); //! Transverse momentum of candidate (GeV/c) -DECLARE_SOA_COLUMN(InvMassGen, invMassGen, float); //! Invariant mass of candidate (GeV/c2) +DECLARE_SOA_COLUMN(InvMassGen, invMassGen, float); //! Invariant mass of candidate (GeV/c2) DECLARE_SOA_COLUMN(FlagCharmBach, flagCharmBach, int8_t); //! Flag for charm bachelor classification DECLARE_SOA_COLUMN(FlagCharmBachInterm, flagCharmBachInterm, int8_t); //! Flag for charm bachelor classification intermediate } // namespace hf_cand_reso_to_trk_lite @@ -105,7 +104,7 @@ DECLARE_SOA_TABLE(HfCandDTrkLites, "AOD", "HFCANDDTRKLITE", //! Table with some hf_cand_reso_to_trk_lite::MlScoreNonPromptBach0, hf_cand_reso_to_trk_lite::ItsNClsProngMinBach0, hf_cand_reso_to_trk_lite::TpcNClsCrossedRowsProngMinBach0, - hf_cand_reso_to_trk_lite::TpcChi2NClProngMaxBach0, + hf_cand_reso_to_trk_lite::TpcChi2NClProngMaxBach0, hf_cand_reso_to_trk_lite::PtBach1, hf_cand_reso_to_trk_lite::ItsNClsBach1, hf_cand_reso_to_trk_lite::TpcNClsCrossedRowsBach1, @@ -211,7 +210,7 @@ struct HfTaskCharmResoToDTrkReduced { int8_t sign{0}; float tpcNSigmaBach1{0}, tofNSigmaBach1{0}, tpcTofNSigmaBach1{0}; if constexpr (channel == DecayChannel::D0Kplus) { - massReso = useDeltaMass ? candidate.invMass() + MassD0: candidate.invMass(); + massReso = useDeltaMass ? candidate.invMass() + MassD0 : candidate.invMass(); cosThetaStar = RecoDecay::cosThetaStar(std::array{bach0.pVector(), bach1.pVector()}, std::array{MassD0, MassKPlus}, massReso, 0); tpcNSigmaBach1 = bach1.tpcNSigmaKa(); tofNSigmaBach1 = bach1.tofNSigmaKa(); @@ -223,8 +222,8 @@ struct HfTaskCharmResoToDTrkReduced { float phi = RecoDecay::phi(candidate.px(), candidate.py()); float p = RecoDecay::p(std::array{candidate.px(), candidate.py(), candidate.pz()}); float e = RecoDecay::e(std::array{candidate.px(), candidate.py(), candidate.pz()}, massReso); - - // MC Rec + + // MC Rec float ptGen{-1.}, invMassGen{-1}; int8_t origin{0}, flagMcMatchRec{0}, flagCharmBach{0}, flagCharmBachInterm{0}; int debugMcRec{-1}; @@ -238,9 +237,9 @@ struct HfTaskCharmResoToDTrkReduced { flagCharmBachInterm = candidate.flagMcMatchChanD(); if (fillOnlySignal) { if (channel == DecayChannel::D0Kplus && - !hf_decay::hf_cand_reso::particlesToD0Kplus.contains(static_cast(std::abs(flagMcMatchRec)))){ + !hf_decay::hf_cand_reso::particlesToD0Kplus.contains(static_cast(std::abs(flagMcMatchRec)))) { return; - } + } } if (origin == 1) { registry.fill(HIST("hYRecPrompt"), candidate.pt(), y); @@ -252,8 +251,8 @@ struct HfTaskCharmResoToDTrkReduced { // Ml float mlScoreBkg{-1.}, mlScorePrompt{-1.}, mlScoreNonPrompt{-1.}; if constexpr (withMl) { - if constexpr (channel == DecayChannel::D0Kplus) { - if (bach1.sign() > 0 && !doWrongSign){ + if constexpr (channel == DecayChannel::D0Kplus) { + if (bach1.sign() > 0 && !doWrongSign) { mlScoreBkg = bach0.mlScoreBkgMassHypo0(); mlScorePrompt = bach0.mlScorePromptMassHypo0(); mlScoreNonPrompt = bach0.mlScoreNonpromptMassHypo0(); @@ -287,7 +286,7 @@ struct HfTaskCharmResoToDTrkReduced { registry.fill(HIST("hPtProng0"), candidate.ptProng0()); registry.fill(HIST("hPtProng1"), candidate.ptProng1()); if (fillSparses) { - registry.fill(HIST("hSparse"), candidate.pt(), candidate.ptProng0(), candidate.ptProng1(), candidate.invMass(), candidate.invMassProng0(), cosThetaStar, mlScoreBkg, mlScoreNonPrompt); + registry.fill(HIST("hSparse"), candidate.pt(), candidate.ptProng0(), candidate.ptProng1(), candidate.invMass(), candidate.invMassProng0(), cosThetaStar, mlScoreBkg, mlScoreNonPrompt); } if (fillTrees) { hfCandResoLite( @@ -395,13 +394,13 @@ struct HfTaskCharmResoToDTrkReduced { std::array etaProngs = {particle.etaProng0(), particle.etaProng1()}; bool prongsInAcc = isProngInAcceptance(etaProngs[0], ptProngs[0]) && isProngInAcceptance(etaProngs[1], ptProngs[1]); if (channel == DecayChannel::D0Kplus && - !hf_decay::hf_cand_reso::particlesToD0Kplus.contains(static_cast(std::abs(flag)))){ + !hf_decay::hf_cand_reso::particlesToD0Kplus.contains(static_cast(std::abs(flag)))) { continue; - } + } registry.fill(HIST("hYGenAll"), ptParticle, yParticle); if (yCandGenMax >= 0. && std::abs(yParticle) > yCandGenMax) { continue; - } + } if (originParticle == 1) { // prompt particles registry.fill(HIST("hYGenPrompt"), ptParticle, yParticle); if (prongsInAcc) { @@ -427,9 +426,9 @@ struct HfTaskCharmResoToDTrkReduced { // process functions void processD0KplusData(aod::HfRedCollisions const& collisions, - ReducedReso2PrTrk const& candidates, - aod::HfRed2PrNoTrks const& charmBachs, - aod::HfRedTrkNoParams const& trkBachs) + ReducedReso2PrTrk const& candidates, + aod::HfRed2PrNoTrks const& charmBachs, + aod::HfRedTrkNoParams const& trkBachs) { processData(collisions, candidates, charmBachs, trkBachs); } @@ -437,9 +436,9 @@ struct HfTaskCharmResoToDTrkReduced { // Process data with ML void processD0KplusDataWithMl(aod::HfRedCollisions const& collisions, - ReducedReso2PrTrk const& candidates, - soa::Join const& charmBachs, - aod::HfRedTrkNoParams const& trkBachs) + ReducedReso2PrTrk const& candidates, + soa::Join const& charmBachs, + aod::HfRedTrkNoParams const& trkBachs) { processData(collisions, candidates, charmBachs, trkBachs); } @@ -447,10 +446,10 @@ struct HfTaskCharmResoToDTrkReduced { // MC void processD0KplusMC(aod::HfRedCollisions const& collisions, - ReducedReso2PrTrkMC const& candidates, - aod::HfRed2PrNoTrks const& charmBachs, - aod::HfRedTrkNoParams const& trkBachs, - aod::HfMcGenRedResos const& mcParticles) + ReducedReso2PrTrkMC const& candidates, + aod::HfRed2PrNoTrks const& charmBachs, + aod::HfRedTrkNoParams const& trkBachs, + aod::HfMcGenRedResos const& mcParticles) { processData(collisions, candidates, charmBachs, trkBachs); fillCandMcGen(mcParticles); @@ -459,10 +458,10 @@ struct HfTaskCharmResoToDTrkReduced { // MC with Ml void processD0KplusMCWithMl(aod::HfRedCollisions const& collisions, - ReducedReso2PrTrkMC const& candidates, - soa::Join const& charmBachs, - aod::HfRedTrkNoParams const& trkBachs, - aod::HfMcGenRedResos const& mcParticles) + ReducedReso2PrTrkMC const& candidates, + soa::Join const& charmBachs, + aod::HfRedTrkNoParams const& trkBachs, + aod::HfMcGenRedResos const& mcParticles) { processData(collisions, candidates, charmBachs, trkBachs); fillCandMcGen(mcParticles); diff --git a/PWGHF/D2H/Tasks/taskCharmResoToDV0Reduced.cxx b/PWGHF/D2H/Tasks/taskCharmResoToDV0Reduced.cxx index 51426f25e1e..860bd7b3eb6 100644 --- a/PWGHF/D2H/Tasks/taskCharmResoToDV0Reduced.cxx +++ b/PWGHF/D2H/Tasks/taskCharmResoToDV0Reduced.cxx @@ -14,9 +14,8 @@ /// /// \author Luca Aglietta , University and INFN Torino -#include "PWGHF/D2H/DataModel/ReducedDataModel.h" - #include "PWGHF/Core/DecayChannels.h" +#include "PWGHF/D2H/DataModel/ReducedDataModel.h" #include "PWGHF/Utils/utilsMcMatching.h" #include "Common/Core/RecoDecay.h" @@ -71,26 +70,26 @@ DECLARE_SOA_COLUMN(MlScoreNonPromptBach0, mlScoreNonPromptBach0, float); DECLARE_SOA_COLUMN(ItsNClsProngMinBach0, itsNClsProngMinBach0, int); //! minimum value of number of ITS clusters for the decay daughter tracks of bachelor 0 DECLARE_SOA_COLUMN(TpcNClsCrossedRowsProngMinBach0, tpcNClsCrossedRowsProngMinBach0, int); //! minimum value of number of TPC crossed rows for the decay daughter tracks of bachelor 0 DECLARE_SOA_COLUMN(TpcChi2NClProngMaxBach0, tpcChi2NClProngMaxBach0, float); //! maximum value of TPC chi2 for the decay daughter tracks of bachelor 0 -DECLARE_SOA_COLUMN(ItsNClsSoftPi, itsNClsSoftPi, int); //! minimum value of number of ITS clusters for the decay daughter tracks of bachelor 0 -DECLARE_SOA_COLUMN(TpcNClsCrossedRowsSoftPi, tpcNClsCrossedRowsSoftPi, int); //! minimum value of number of TPC crossed rows for the decay daughter tracks of bachelor 0 -DECLARE_SOA_COLUMN(TpcChi2NClSoftPi, tpcChi2NClSoftPi, float); //! maximum value of TPC chi2 for the decay daughter tracks of bachelor 0 +DECLARE_SOA_COLUMN(ItsNClsSoftPi, itsNClsSoftPi, int); //! minimum value of number of ITS clusters for the decay daughter tracks of bachelor 0 +DECLARE_SOA_COLUMN(TpcNClsCrossedRowsSoftPi, tpcNClsCrossedRowsSoftPi, int); //! minimum value of number of TPC crossed rows for the decay daughter tracks of bachelor 0 +DECLARE_SOA_COLUMN(TpcChi2NClSoftPi, tpcChi2NClSoftPi, float); //! maximum value of TPC chi2 for the decay daughter tracks of bachelor 0 DECLARE_SOA_COLUMN(ItsNClsProngMinBach1, itsNClsProngMinBach1, int); //! minimum value of number of ITS clusters for the decay daughter tracks of bachelor 1 DECLARE_SOA_COLUMN(TpcNClsCrossedRowsProngMinBach1, tpcNClsCrossedRowsProngMinBach1, int); //! minimum value of number of TPC crossed rows for the decay daughter tracks of bachelor 1 DECLARE_SOA_COLUMN(TpcChi2NClProngMaxBach1, tpcChi2NClProngMaxBach1, float); //! maximum value of TPC chi2 for the decay daughter tracks of bachelor 1 DECLARE_SOA_COLUMN(CpaBach1, cpaBach1, float); //! Cosine of Pointing Angle of bachelor 1 DECLARE_SOA_COLUMN(DcaBach1, dcaBach1, float); //! DCA of bachelor 1 DECLARE_SOA_COLUMN(RadiusBach1, radiusBach1, float); //! Radius of bachelor 1 -DECLARE_SOA_COLUMN(FlagMcMatch, flagMcMatch, int8_t); //! flag for decay channel classification reconstruction level -DECLARE_SOA_COLUMN(DebugMcRec, debugMcRec, int); //! debug flag for mis-association at reconstruction level +DECLARE_SOA_COLUMN(FlagMcMatch, flagMcMatch, int8_t); //! flag for decay channel classification reconstruction level +DECLARE_SOA_COLUMN(DebugMcRec, debugMcRec, int); //! debug flag for mis-association at reconstruction level DECLARE_SOA_COLUMN(Origin, origin, int8_t); //! Flag for origin of MC particle 1=promt, 2=FD DECLARE_SOA_COLUMN(PtGen, ptGen, float); //! Transverse momentum of candidate (GeV/c) -DECLARE_SOA_COLUMN(InvMassGen, invMassGen, float); //! Invariant mass of candidate (GeV/c2) +DECLARE_SOA_COLUMN(InvMassGen, invMassGen, float); //! Invariant mass of candidate (GeV/c2) DECLARE_SOA_COLUMN(FlagCharmBach, flagCharmBach, int8_t); //! Flag for charm bachelor classification DECLARE_SOA_COLUMN(FlagCharmBachInterm, flagCharmBachInterm, int8_t); //! Flag for charm bachelor classification intermediate } // namespace hf_cand_reso_to_v0_lite DECLARE_SOA_TABLE(HfCandDV0Lites, "AOD", "HFCANDDV0LITE", //! Table with some Resonances properties - // Candidate Properties + // Candidate Properties hf_cand_reso_to_v0_lite::M, hf_cand_reso_to_v0_lite::Pt, hf_cand_reso_to_v0_lite::P, @@ -230,21 +229,21 @@ struct HfTaskCharmResoToDV0Reduced { float tpcChi2NClSoftPi{0.}; if constexpr (channel == DecayChannel::DstarK0s) { sign = bach0.sign(); - massReso = useDeltaMass ? candidate.invMass() + MassDStar: candidate.invMass(); + massReso = useDeltaMass ? candidate.invMass() + MassDStar : candidate.invMass(); cosThetaStar = RecoDecay::cosThetaStar(std::array{bach0.pVector(), bach1.pVector()}, std::array{MassDStar, MassK0}, massReso, 0); itsNClsSoftPi = bach0.itsNClsSoftPi(); tpcNClsCrossedRowsSoftPi = bach0.tpcNClsCrossedRowsSoftPi(); tpcChi2NClSoftPi = bach0.tpcChi2NClSoftPi(); } else if constexpr (channel == DecayChannel::DplusK0s) { sign = bach0.sign(); - massReso = useDeltaMass ? candidate.invMass() + MassDPlus: candidate.invMass(); + massReso = useDeltaMass ? candidate.invMass() + MassDPlus : candidate.invMass(); cosThetaStar = RecoDecay::cosThetaStar(std::array{bach0.pVector(), bach1.pVector()}, std::array{MassDPlus, MassK0}, massReso, 0); } else if constexpr (channel == DecayChannel::DplusLambda) { sign = bach0.sign(); - massReso = useDeltaMass ? candidate.invMass() + MassDPlus: candidate.invMass(); + massReso = useDeltaMass ? candidate.invMass() + MassDPlus : candidate.invMass(); cosThetaStar = RecoDecay::cosThetaStar(std::array{bach0.pVector(), bach1.pVector()}, std::array{MassDPlus, MassLambda0}, massReso, 0); } else if constexpr (channel == DecayChannel::D0Lambda) { - massReso = useDeltaMass ? candidate.invMass() + MassD0: candidate.invMass(); + massReso = useDeltaMass ? candidate.invMass() + MassD0 : candidate.invMass(); cosThetaStar = RecoDecay::cosThetaStar(std::array{bach0.pVector(), bach1.pVector()}, std::array{MassD0, MassLambda0}, massReso, 0); } float y = RecoDecay::y(std::array{candidate.px(), candidate.py(), candidate.pz()}, massReso); @@ -252,8 +251,8 @@ struct HfTaskCharmResoToDV0Reduced { float phi = RecoDecay::phi(candidate.px(), candidate.py()); float p = RecoDecay::p(std::array{candidate.px(), candidate.py(), candidate.pz()}); float e = RecoDecay::e(std::array{candidate.px(), candidate.py(), candidate.pz()}, massReso); - - // MC Rec + + // MC Rec float ptGen{-1.}, invMassGen{-1}; int8_t origin{0}, flagMcMatchRec{0}, flagCharmBach{0}, flagCharmBachInterm{0}; int debugMcRec{-1}; @@ -267,16 +266,16 @@ struct HfTaskCharmResoToDV0Reduced { flagCharmBachInterm = candidate.flagMcMatchChanD(); if (fillOnlySignal) { if (channel == DecayChannel::DstarK0s && - !hf_decay::hf_cand_reso::particlesToDstarK0s.contains(static_cast(std::abs(flagMcMatchRec)))){ + !hf_decay::hf_cand_reso::particlesToDstarK0s.contains(static_cast(std::abs(flagMcMatchRec)))) { return; } else if (channel == DecayChannel::DplusK0s && - !hf_decay::hf_cand_reso::particlesToDplusK0s.contains(static_cast(std::abs(flagMcMatchRec)))){ + !hf_decay::hf_cand_reso::particlesToDplusK0s.contains(static_cast(std::abs(flagMcMatchRec)))) { return; } else if (channel == DecayChannel::DplusLambda && - !hf_decay::hf_cand_reso::particlesToDplusLambda.contains(static_cast(std::abs(flagMcMatchRec)))){ + !hf_decay::hf_cand_reso::particlesToDplusLambda.contains(static_cast(std::abs(flagMcMatchRec)))) { return; } else if (channel == DecayChannel::D0Lambda && - !hf_decay::hf_cand_reso::particlesToD0Lambda.contains(static_cast(std::abs(flagMcMatchRec)))){ + !hf_decay::hf_cand_reso::particlesToD0Lambda.contains(static_cast(std::abs(flagMcMatchRec)))) { return; } } @@ -290,8 +289,8 @@ struct HfTaskCharmResoToDV0Reduced { // Ml float mlScoreBkg{-1.}, mlScorePrompt{-1.}, mlScoreNonPrompt{-1.}; if constexpr (withMl) { - if constexpr (channel == DecayChannel::D0Lambda) { - if (TESTBIT(bach1.v0Type(), BachelorType::Lambda) && !doWrongSign){ + if constexpr (channel == DecayChannel::D0Lambda) { + if (TESTBIT(bach1.v0Type(), BachelorType::Lambda) && !doWrongSign) { mlScoreBkg = bach0.mlScoreBkgMassHypo0(); mlScorePrompt = bach0.mlScorePromptMassHypo0(); mlScoreNonPrompt = bach0.mlScoreNonpromptMassHypo0(); @@ -447,22 +446,22 @@ struct HfTaskCharmResoToDV0Reduced { std::array etaProngs = {particle.etaProng0(), particle.etaProng1()}; bool prongsInAcc = isProngInAcceptance(etaProngs[0], ptProngs[0]) && isProngInAcceptance(etaProngs[1], ptProngs[1]); if (channel == DecayChannel::DstarK0s && - !hf_decay::hf_cand_reso::particlesToDstarK0s.contains(static_cast(std::abs(flag)))){ + !hf_decay::hf_cand_reso::particlesToDstarK0s.contains(static_cast(std::abs(flag)))) { continue; } else if (channel == DecayChannel::DplusK0s && - !hf_decay::hf_cand_reso::particlesToDplusK0s.contains(static_cast(std::abs(flag)))){ + !hf_decay::hf_cand_reso::particlesToDplusK0s.contains(static_cast(std::abs(flag)))) { continue; } else if (channel == DecayChannel::DplusLambda && - !hf_decay::hf_cand_reso::particlesToDplusLambda.contains(static_cast(std::abs(flag)))){ + !hf_decay::hf_cand_reso::particlesToDplusLambda.contains(static_cast(std::abs(flag)))) { continue; } else if (channel == DecayChannel::D0Lambda && - !hf_decay::hf_cand_reso::particlesToD0Lambda.contains(static_cast(std::abs(flag)))){ + !hf_decay::hf_cand_reso::particlesToD0Lambda.contains(static_cast(std::abs(flag)))) { continue; } registry.fill(HIST("hYGenAll"), ptParticle, yParticle); if (yCandGenMax >= 0. && std::abs(yParticle) > yCandGenMax) { continue; - } + } if (originParticle == 1) { // prompt particles registry.fill(HIST("hYGenPrompt"), ptParticle, yParticle); if (prongsInAcc) { diff --git a/PWGHF/Utils/utilsMcMatching.h b/PWGHF/Utils/utilsMcMatching.h index 32c9aea2855..bac650d36d4 100644 --- a/PWGHF/Utils/utilsMcMatching.h +++ b/PWGHF/Utils/utilsMcMatching.h @@ -178,50 +178,42 @@ inline std::unordered_map> getDecayChan namespace hf_cand_reso { - const std::unordered_map particlesToDstarK0s = { - {DecayChannelMain::Ds1ToDstarK0s, constants::physics::Pdg::kDS1}, - {DecayChannelMain::Ds2starToDstarK0s, constants::physics::Pdg::kDS2Star}, - {DecayChannelMain::Ds1star2700ToDstarK0s, constants::physics::Pdg::kDS1Star2700}, - {DecayChannelMain::Ds1star2860ToDstarK0s, constants::physics::Pdg::kDS1Star2860}, - {DecayChannelMain::Ds3star2860ToDstarK0s, constants::physics::Pdg::kDS3Star2860} - }; - const std::unordered_map particlesToDplusK0s = { - {DecayChannelMain::Ds2starToDplusK0s, constants::physics::Pdg::kDS2Star} - }; - const std::unordered_map particlesToDplusLambda = { - {DecayChannelMain::Xic3055plusToDplusLambda, constants::physics::Pdg::kXiC3055Plus}, - {DecayChannelMain::Xic3080plusToDplusLambda, constants::physics::Pdg::kXiC3080Plus} - }; - const std::unordered_map particlesToD0Lambda = { - {DecayChannelMain::Xic3055zeroToD0Lambda, constants::physics::Pdg::kXiC3055_0}, - {DecayChannelMain::Xic3080zeroToD0Lambda, constants::physics::Pdg::kXiC3080_0} - }; - const std::unordered_map particlesToDstarPi = { - {DecayChannelMain::D1zeroToDstarPi, constants::physics::Pdg::kD10}, - {DecayChannelMain::D2starzeroToDstarPi, constants::physics::Pdg::kD2Star0} - }; - const std::unordered_map particlesToDplusPi = { - {DecayChannelMain::D2starzeroToDplusPi, constants::physics::Pdg::kD2Star0} - }; - const std::unordered_map particlesToD0Pi = { - {DecayChannelMain::D2starplusToD0Pi, constants::physics::Pdg::kD2StarPlus} - }; - const std::unordered_map particlesToD0Kplus = { - {DecayChannelMain::Ds2starToD0Kplus, constants::physics::Pdg::kDS2Star} - }; - - enum PartialMatchMc : uint8_t { - D0Matched = 0, - DstarMatched, - DplusMatched, - K0Matched, - LambdaMatched, - PionMatched, - KaonMatched, - ProtonMatched, - ResoPartlyMatched - }; -} +const std::unordered_map particlesToDstarK0s = { + {DecayChannelMain::Ds1ToDstarK0s, constants::physics::Pdg::kDS1}, + {DecayChannelMain::Ds2starToDstarK0s, constants::physics::Pdg::kDS2Star}, + {DecayChannelMain::Ds1star2700ToDstarK0s, constants::physics::Pdg::kDS1Star2700}, + {DecayChannelMain::Ds1star2860ToDstarK0s, constants::physics::Pdg::kDS1Star2860}, + {DecayChannelMain::Ds3star2860ToDstarK0s, constants::physics::Pdg::kDS3Star2860}}; +const std::unordered_map particlesToDplusK0s = { + {DecayChannelMain::Ds2starToDplusK0s, constants::physics::Pdg::kDS2Star}}; +const std::unordered_map particlesToDplusLambda = { + {DecayChannelMain::Xic3055plusToDplusLambda, constants::physics::Pdg::kXiC3055Plus}, + {DecayChannelMain::Xic3080plusToDplusLambda, constants::physics::Pdg::kXiC3080Plus}}; +const std::unordered_map particlesToD0Lambda = { + {DecayChannelMain::Xic3055zeroToD0Lambda, constants::physics::Pdg::kXiC3055_0}, + {DecayChannelMain::Xic3080zeroToD0Lambda, constants::physics::Pdg::kXiC3080_0}}; +const std::unordered_map particlesToDstarPi = { + {DecayChannelMain::D1zeroToDstarPi, constants::physics::Pdg::kD10}, + {DecayChannelMain::D2starzeroToDstarPi, constants::physics::Pdg::kD2Star0}}; +const std::unordered_map particlesToDplusPi = { + {DecayChannelMain::D2starzeroToDplusPi, constants::physics::Pdg::kD2Star0}}; +const std::unordered_map particlesToD0Pi = { + {DecayChannelMain::D2starplusToD0Pi, constants::physics::Pdg::kD2StarPlus}}; +const std::unordered_map particlesToD0Kplus = { + {DecayChannelMain::Ds2starToD0Kplus, constants::physics::Pdg::kDS2Star}}; + +enum PartialMatchMc : uint8_t { + D0Matched = 0, + DstarMatched, + DplusMatched, + K0Matched, + LambdaMatched, + PionMatched, + KaonMatched, + ProtonMatched, + ResoPartlyMatched +}; +} // namespace hf_cand_reso /// Compare an array of PDG codes with an expected array /// \tparam N size of the arrays to be compared