diff --git a/PWGHF/D2H/DataModel/ReducedDataModel.h b/PWGHF/D2H/DataModel/ReducedDataModel.h index 44c434c790b..590b536f61a 100644 --- a/PWGHF/D2H/DataModel/ReducedDataModel.h +++ b/PWGHF/D2H/DataModel/ReducedDataModel.h @@ -802,7 +802,7 @@ namespace hf_reso_cand_reduced DECLARE_SOA_COLUMN(InvMass, invMass, float); //! Invariant mass in GeV/c2 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(InvMassD0, invMassD0, float); //! Invariant Mass of potential D0 daughter +DECLARE_SOA_COLUMN(InvMassD0, invMassD0, float); //! Invariant Mass of potential D0 daughter 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 diff --git a/PWGHF/D2H/TableProducer/candidateCreatorCharmResoReduced.cxx b/PWGHF/D2H/TableProducer/candidateCreatorCharmResoReduced.cxx index 3ed8160215d..ba88f63cd8e 100644 --- a/PWGHF/D2H/TableProducer/candidateCreatorCharmResoReduced.cxx +++ b/PWGHF/D2H/TableProducer/candidateCreatorCharmResoReduced.cxx @@ -94,13 +94,13 @@ struct HfCandidateCreatorCharmResoReduced { Configurable> binsPtD{"binsPtD", std::vector{hf_cuts_d_daughter::vecBinsPt}, "pT bin limits for D daughter cuts"}; Configurable> cutsV0{"cutsV0daughter", {hf_cuts_v0_daughter::cuts[0], hf_cuts_v0_daughter::nBinsPt, hf_cuts_v0_daughter::nCutVars, hf_cuts_v0_daughter::labelsPt, hf_cuts_v0_daughter::labelsCutVar}, "V0 daughter selections"}; Configurable> binsPtV0{"binsPtV0", std::vector{hf_cuts_v0_daughter::vecBinsPt}, "pT bin limits for V0 daughter cuts"}; - + // Configurables for ME 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"}; - + using reducedDWithMl = soa::Join; // Partition of V0 candidates based on v0Type @@ -266,11 +266,11 @@ struct HfCandidateCreatorCharmResoReduced { float invMassD0{0.}; if (std::abs(candD.dType()) == 1) invMassD = candD.invMassDplus(); - if (candD.dType() == 2){ + if (candD.dType() == 2) { invMassD = candD.invMassDstar(); invMassD0 = candD.invMassD0(); - } - if (candD.dType() == -2){ + } + if (candD.dType() == -2) { invMassD = candD.invMassAntiDstar(); invMassD0 = candD.invMassD0Bar(); } @@ -382,12 +382,12 @@ struct HfCandidateCreatorCharmResoReduced { { using BinningType = ColumnBinningPolicy; BinningType corrBinning{{zPoolBins, multPoolBins}, true}; - auto bachTuple = std::make_tuple(candsD,candsV0Tr); + auto bachTuple = std::make_tuple(candsD, candsV0Tr); Pair pairs{corrBinning, numberEventsMixed, numberEventsToSkip, collisions, bachTuple, &cache}; - for (const auto& [collision1, bachDs, collision2, bachV0Trs] : pairs){ + for (const auto& [collision1, bachDs, collision2, bachV0Trs] : pairs) { registry.fill(HIST("hNPvContCorr"), collision1.numContrib(), collision2.numContrib()); registry.fill(HIST("hZvertCorr"), collision1.posZ(), collision2.posZ()); - for (const auto& [bachD, bachV0Tr] : o2::soa::combinations(o2::soa::CombinationsFullIndexPolicy(bachDs, bachV0Trs))){ + for (const auto& [bachD, bachV0Tr] : o2::soa::combinations(o2::soa::CombinationsFullIndexPolicy(bachDs, bachV0Trs))) { // Apply analysis selections on D and V0 bachelors if (!isDSelected(bachD) || !isV0Selected(bachV0Tr, bachD)) { continue; @@ -397,11 +397,11 @@ struct HfCandidateCreatorCharmResoReduced { float invMassD0{0.}; if (std::abs(bachD.dType()) == 1) invMassD = bachD.invMassDplus(); - if (bachD.dType() == 2){ + if (bachD.dType() == 2) { invMassD = bachD.invMassDstar(); invMassD0 = bachD.invMassD0(); - } - if (bachD.dType() == -2){ + } + if (bachD.dType() == -2) { invMassD = bachD.invMassAntiDstar(); invMassD0 = bachD.invMassD0Bar(); } @@ -443,15 +443,15 @@ struct HfCandidateCreatorCharmResoReduced { break; } // Fill output table - rowCandidateReso( pVecD[0], pVecD[1], pVecD[2], - pVecV0Tr[0], pVecV0Tr[1], pVecV0Tr[2], - invMassReso, - invMassD, - invMassV0, - bachV0Tr.cpa(), - bachV0Tr.dca(), - bachV0Tr.v0Radius(), - invMassD0); + rowCandidateReso(pVecD[0], pVecD[1], pVecD[2], + pVecV0Tr[0], pVecV0Tr[1], pVecV0Tr[2], + invMassReso, + invMassD, + invMassV0, + bachV0Tr.cpa(), + bachV0Tr.dca(), + bachV0Tr.v0Radius(), + invMassD0); rowCandidateResoIndices(collision1.globalIndex(), bachD.globalIndex(), bachV0Tr.globalIndex()); @@ -490,16 +490,16 @@ struct HfCandidateCreatorCharmResoReduced { PROCESS_SWITCH(HfCandidateCreatorCharmResoReduced, processDs2StarToDplusK0sWithMl, "Process Ds2* candidates with Ml info", false); void processDs2StarToDplusK0sMixedEvent(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, processDs2StarToDplusK0sMixedEvent, "Process Ds2Star mixed Event without ML", false); void processDs2StarToDplusK0sMixedEventWithMl(aod::HfRedCollisions const& collisions, - reducedDWithMl const& candsD, - aod::HfRedVzeros const& candsV0) + reducedDWithMl const& candsD, + aod::HfRedVzeros const& candsV0) { runCandidateCreationMixedEvent(collisions, candsD, candsV0); } @@ -540,8 +540,8 @@ struct HfCandidateCreatorCharmResoReduced { PROCESS_SWITCH(HfCandidateCreatorCharmResoReduced, processDs1ToDstarK0sMixedEvent, "Process Ds1 mixed Event without ML", false); void processDs1ToDstarK0sMixedEventWithMl(aod::HfRedCollisions const& collisions, - reducedDWithMl const& candsD, - aod::HfRedVzeros const& candsV0) + reducedDWithMl const& candsD, + aod::HfRedVzeros const& candsV0) { runCandidateCreationMixedEvent(collisions, candsD, candsV0); } @@ -637,7 +637,7 @@ struct HfCandidateCreatorCharmResoReducedExpressions { ConfigurableAxis axisInvMassReso{"axisInvMassReso", {200, 2.5, 2.7}, "inv. mass (DV_{0}) (GeV/#it{c}^{2})"}; ConfigurableAxis axisInvMassProng0{"axisInvMassProng0", {200, 0.14, 0.17}, "inv. mass (D) (GeV/#it{c}^{2})"}; ConfigurableAxis axisInvMassProng1{"axisInvMassProng1", {200, 0.47, 0.53}, "inv. mass ({V}_{0}) (GeV/#it{c}^{2})"}; - ConfigurableAxis axisInvMassD0{"axisInvMassD0", {200, 1.65, 2.05}, "inv. mass ({V}_{0}) (GeV/#it{c}^{2})"}; + ConfigurableAxis axisInvMassD0{"axisInvMassD0", {200, 1.65, 2.05}, "inv. mass ({V}_{0}) (GeV/#it{c}^{2})"}; ConfigurableAxis axisDebug{"axisDebug", {16, -0.5, 15.5}, "MC debug flag"}; ConfigurableAxis axisOrigin{"axisOrigin", {3, -0.5, 2.5}, "MC origin flag"}; HistogramRegistry registry{"registry"}; @@ -655,7 +655,7 @@ struct HfCandidateCreatorCharmResoReducedExpressions { registry.add("hMassMcMatchedVsD0Mass", "Reso MC candidates NOT Matched with generate particle;m (GeV/#it{c}^{2}); m (GeV/#it{c}^{2})", {HistType::kTH2F, {axisInvMassReso, axisInvMassD0}}); registry.add("hMassMcUnmatchedVsD0Mass", "Reso MC candidates Matched with generate particle w. Invcomplete decay;m (GeV/#it{c}^{2}); m (GeV/#it{c}^{2})", {HistType::kTH2F, {axisInvMassReso, axisInvMassD0}}); registry.add("hMassMcUnmatchedVsDebug", "Reso MC candidates NOT Matched with generate particle;m (GeV/#it{c}^{2});debug flag", {HistType::kTH2F, {axisInvMassReso, axisDebug}}); - registry.add("hSparseUnmatchedDebug","THn for debug of MC matching and Correlated BKG study", HistType::kTHnSparseF, {axisInvMassReso, axisPt, axisInvMassProng0, axisInvMassProng1, axisInvMassD0, axisDebug, axisOrigin}); + registry.add("hSparseUnmatchedDebug", "THn for debug of MC matching and Correlated BKG study", HistType::kTHnSparseF, {axisInvMassReso, axisPt, axisInvMassProng0, axisInvMassProng1, axisInvMassD0, axisDebug, axisOrigin}); } /// Fill candidate information at MC reconstruction level @@ -674,7 +674,7 @@ struct HfCandidateCreatorCharmResoReducedExpressions { filledMcInfo = true; if (TESTBIT(rowDV0McRec.flagMcMatchRec(), DecayTypeMc::Ds1ToDStarK0ToD0PiK0s) || TESTBIT(rowDV0McRec.flagMcMatchRec(), DecayTypeMc::Ds2StarToDplusK0sToPiKaPiPiPi)) { registry.fill(HIST("hMassMcMatched"), candReso.invMass(), candReso.pt()); - registry.fill(HIST("hMassMcMatchedVsBach0Mass"), candReso.invMass(), candReso.invMassProng0()-candReso.invMassD0()); + registry.fill(HIST("hMassMcMatchedVsBach0Mass"), candReso.invMass(), candReso.invMassProng0() - candReso.invMassD0()); registry.fill(HIST("hMassMcMatchedVsBach1Mass"), candReso.invMass(), candReso.invMassProng1()); registry.fill(HIST("hMassMcMatchedVsD0Mass"), candReso.invMass(), candReso.invMassD0()); @@ -682,11 +682,11 @@ struct HfCandidateCreatorCharmResoReducedExpressions { registry.fill(HIST("hMassMcMatchedIncomplete"), candReso.invMass(), candReso.pt()); } else { registry.fill(HIST("hMassMcUnmatched"), candReso.invMass(), candReso.pt()); - registry.fill(HIST("hMassMcUnmatchedVsBach0Mass"), candReso.invMass(), candReso.invMassProng0()-candReso.invMassD0()); + registry.fill(HIST("hMassMcUnmatchedVsBach0Mass"), candReso.invMass(), candReso.invMassProng0() - candReso.invMassD0()); registry.fill(HIST("hMassMcUnmatchedVsBach1Mass"), candReso.invMass(), candReso.invMassProng1()); registry.fill(HIST("hMassMcUnmatchedVsD0Mass"), candReso.invMass(), candReso.invMassD0()); registry.fill(HIST("hMassMcUnmatchedVsDebug"), candReso.invMass(), rowDV0McRec.debugMcRec()); - registry.fill(HIST("hSparseUnmatchedDebug"), candReso.invMass(), candReso.pt(), candReso.invMassProng0()-candReso.invMassD0(), candReso.invMassProng1(), candReso.invMassD0(), rowDV0McRec.debugMcRec(), rowDV0McRec.origin()); + registry.fill(HIST("hSparseUnmatchedDebug"), candReso.invMass(), candReso.pt(), candReso.invMassProng0() - candReso.invMassD0(), candReso.invMassProng1(), candReso.invMassD0(), rowDV0McRec.debugMcRec(), rowDV0McRec.origin()); } break; diff --git a/PWGHF/D2H/TableProducer/dataCreatorCharmResoReduced.cxx b/PWGHF/D2H/TableProducer/dataCreatorCharmResoReduced.cxx index 4853ff201db..97c46f6e3ec 100644 --- a/PWGHF/D2H/TableProducer/dataCreatorCharmResoReduced.cxx +++ b/PWGHF/D2H/TableProducer/dataCreatorCharmResoReduced.cxx @@ -949,8 +949,8 @@ struct HfDataCreatorCharmResoReduced { if (RecoDecay::isMatchedMCGen(particlesMc, candDStarMC, Pdg::kDStar, std::array{-kKPlus, +kPiPlus, +kPiPlus}, true, &signDStar, 2)) { flag = signDStar * BIT(DecayTypeMc::Ds1ToDStarK0ToD0PiK0s); if (RecoDecay::isMatchedMCGen(particlesMc, candV0MC, kK0, std::array{+kPiPlus, -kMuonPlus, +kNuMu}, true, &signV0, 3) || - RecoDecay::isMatchedMCGen(particlesMc, candDStarMC, Pdg::kDStar, std::array{-kKPlus, +kPiPlus, +kMuonPlus, -kNuMu}, true, &signDStar, 3)){ - flag = signDStar * BIT(DecayTypeMc::Ds1ToDStarK0ToD0PiK0sOneMu); + RecoDecay::isMatchedMCGen(particlesMc, candDStarMC, Pdg::kDStar, std::array{-kKPlus, +kPiPlus, +kMuonPlus, -kNuMu}, true, &signDStar, 3)) { + flag = signDStar * BIT(DecayTypeMc::Ds1ToDStarK0ToD0PiK0sOneMu); } } else if (RecoDecay::isMatchedMCGen(particlesMc, candD0MC, Pdg::kD0, std::array{-kKPlus, +kPiPlus, +kPiPlus, +kPi0}, true, &signDStar, 2) || RecoDecay::isMatchedMCGen(particlesMc, candD0MC, Pdg::kD0, std::array{-kKPlus, +kPiPlus, +kPiPlus, -kPi0}, true, &signDStar, 2)) { diff --git a/PWGHF/D2H/Tasks/taskCharmResoReduced.cxx b/PWGHF/D2H/Tasks/taskCharmResoReduced.cxx index 89cc73a3f94..9b343e82514 100644 --- a/PWGHF/D2H/Tasks/taskCharmResoReduced.cxx +++ b/PWGHF/D2H/Tasks/taskCharmResoReduced.cxx @@ -42,44 +42,44 @@ enum DecayTypeMc : uint8_t { namespace o2::aod { - namespace hf_cand_reso_lite - { - DECLARE_SOA_COLUMN(PtBach0, ptBach0, float); //! Transverse momentum of bachelor 0 (GeV/c) - DECLARE_SOA_COLUMN(PtBach1, ptBach1, float); //! Transverse momentum of bachelor 1 (GeV/c) - DECLARE_SOA_COLUMN(MBach0, mBach0, float); //! Invariant mass of bachelor 0 (GeV/c) - DECLARE_SOA_COLUMN(MBach1, mBach1, float); //! Invariant mass of bachelor 1 (GeV/c) - DECLARE_SOA_COLUMN(MBachD0, mBachD0, float); //! Invariant mass of D0 bachelor (of bachelor 0) (GeV/c) - DECLARE_SOA_COLUMN(M, m, float); //! Invariant mass of candidate (GeV/c2) - DECLARE_SOA_COLUMN(Pt, pt, float); //! Transverse momentum of candidate (GeV/c) - DECLARE_SOA_COLUMN(P, p, float); //! Momentum of candidate (GeV/c) - DECLARE_SOA_COLUMN(Y, y, float); //! Rapidity of candidate - DECLARE_SOA_COLUMN(Eta, eta, float); //! Pseudorapidity of candidate - DECLARE_SOA_COLUMN(Phi, phi, float); //! Azimuth angle of candidate - DECLARE_SOA_COLUMN(E, e, float); //! Energy of candidate (GeV) - DECLARE_SOA_COLUMN(Sign, sign, int8_t); //! Sign of candidate - DECLARE_SOA_COLUMN(CosThetaStar, cosThetaStar, float); //! VosThetaStar of candidate (GeV) - DECLARE_SOA_COLUMN(MlScoreBkgBach0, mlScoreBkgBach0, float); //! ML score for background class of charm daughter - DECLARE_SOA_COLUMN(MlScorePromptBach0, mlScorePromptBach0, float); //! ML score for prompt class of charm daughter - DECLARE_SOA_COLUMN(MlScoreNonPromptBach0, mlScoreNonPromptBach0, float); //! ML score for non-prompt class of charm daughter - 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(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(FlagMcMatchRec, flagMcMatchRec, int8_t); //! flag for decay channel classification reconstruction level - DECLARE_SOA_COLUMN(DebugMcRec, debugMcRec, int8_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(PtGen, ptGen, float); //! Transverse momentum of candidate (GeV/c) - DECLARE_SOA_COLUMN(SignD0, signD0, float); //! Flag to distinguish D0 and D0Bar +namespace hf_cand_reso_lite +{ +DECLARE_SOA_COLUMN(PtBach0, ptBach0, float); //! Transverse momentum of bachelor 0 (GeV/c) +DECLARE_SOA_COLUMN(PtBach1, ptBach1, float); //! Transverse momentum of bachelor 1 (GeV/c) +DECLARE_SOA_COLUMN(MBach0, mBach0, float); //! Invariant mass of bachelor 0 (GeV/c) +DECLARE_SOA_COLUMN(MBach1, mBach1, float); //! Invariant mass of bachelor 1 (GeV/c) +DECLARE_SOA_COLUMN(MBachD0, mBachD0, float); //! Invariant mass of D0 bachelor (of bachelor 0) (GeV/c) +DECLARE_SOA_COLUMN(M, m, float); //! Invariant mass of candidate (GeV/c2) +DECLARE_SOA_COLUMN(Pt, pt, float); //! Transverse momentum of candidate (GeV/c) +DECLARE_SOA_COLUMN(P, p, float); //! Momentum of candidate (GeV/c) +DECLARE_SOA_COLUMN(Y, y, float); //! Rapidity of candidate +DECLARE_SOA_COLUMN(Eta, eta, float); //! Pseudorapidity of candidate +DECLARE_SOA_COLUMN(Phi, phi, float); //! Azimuth angle of candidate +DECLARE_SOA_COLUMN(E, e, float); //! Energy of candidate (GeV) +DECLARE_SOA_COLUMN(Sign, sign, int8_t); //! Sign of candidate +DECLARE_SOA_COLUMN(CosThetaStar, cosThetaStar, float); //! VosThetaStar of candidate (GeV) +DECLARE_SOA_COLUMN(MlScoreBkgBach0, mlScoreBkgBach0, float); //! ML score for background class of charm daughter +DECLARE_SOA_COLUMN(MlScorePromptBach0, mlScorePromptBach0, float); //! ML score for prompt class of charm daughter +DECLARE_SOA_COLUMN(MlScoreNonPromptBach0, mlScoreNonPromptBach0, float); //! ML score for non-prompt class of charm daughter +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(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(FlagMcMatchRec, flagMcMatchRec, int8_t); //! flag for decay channel classification reconstruction level +DECLARE_SOA_COLUMN(DebugMcRec, debugMcRec, int8_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(PtGen, ptGen, float); //! Transverse momentum of candidate (GeV/c) +DECLARE_SOA_COLUMN(SignD0, signD0, float); //! Flag to distinguish D0 and D0Bar - }// namespace hf_cand_reso_lite +} // namespace hf_cand_reso_lite - DECLARE_SOA_TABLE(HfCandResoLites, "AOD", "HFCANDRESOLITE", //! Table with some B0 properties - //Candidate Properties +DECLARE_SOA_TABLE(HfCandResoLites, "AOD", "HFCANDRESOLITE", //! Table with some B0 properties + // Candidate Properties hf_cand_reso_lite::M, hf_cand_reso_lite::Pt, hf_cand_reso_lite::P, @@ -89,7 +89,7 @@ namespace o2::aod hf_cand_reso_lite::E, hf_cand_reso_lite::CosThetaStar, hf_cand_reso_lite::Sign, - //Bachelors Properties + // Bachelors Properties hf_cand_reso_lite::MBach0, hf_cand_reso_lite::PtBach0, hf_cand_reso_lite::MlScoreBkgBach0, @@ -106,14 +106,14 @@ namespace o2::aod hf_cand_reso_lite::ItsNClsProngMinBach1, hf_cand_reso_lite::TpcNClsCrossedRowsProngMinBach1, hf_cand_reso_lite::TpcChi2NClProngMaxBach1, - //MC + // MC hf_cand_reso_lite::FlagMcMatchRec, hf_cand_reso_lite::DebugMcRec, hf_cand_reso_lite::Origin, hf_cand_reso_lite::PtGen, hf_cand_reso_lite::SignD0); - -}// namespace aod + +} // namespace o2::aod enum DecayChannel : uint8_t { Ds1ToDstarK0s = 0, @@ -168,14 +168,14 @@ struct HfTaskCharmResoReduced { registry.add("hZvert", "Collision Z Vtx ; z PV [cm] ; entries", {HistType::kTH1F, {{120, -12., 12.}}}); registry.add("hBz", "Collision Bz ; Bz [T] ; entries", {HistType::kTH1F, {{20, -10., 10.}}}); registry.add("hSparse", "THn for production studies with cosThStar and BDT scores", HistType::kTHnSparseF, {axisPt, axisPtProng0, axisPtProng1, axisInvMassReso, axisInvMassProng0, axisInvMassProng1, axisCosThetaStar, axisBkgBdtScore, axisNonPromptBdtScore}); - - if(doprocessDs1Mc || doprocessDs2StarMc){ + + if (doprocessDs1Mc || doprocessDs2StarMc) { // gen histos registry.add("hYGenPrompt", "Prompt {D_{S}}^j particles (generated);#it{p}_{T}^{gen}({D_{S}}^j) (GeV/#it{c});#it{y}^{gen}({D_{S}}^j);entries", {HistType::kTH2F, {axisPt, axisEta}}); registry.add("hYGenPromptWithProngsInAcceptance", "Prompt {D_{S}}^j particles (generated-daughters in acceptance);#it{p}_{T}^{gen}({D_{S}}^j) (GeV/#it{c});#it{y}^{gen}({D_{S}}^j);entries", {HistType::kTH2F, {axisPt, axisEta}}); registry.add("hYGenNonPrompt", "NonPrompt {D_{S}}^j particles (generated);#it{p}_{T}^{gen}({D_{S}}^j) (GeV/#it{c});#it{y}^{gen}({D_{S}}^j);entries", {HistType::kTH2F, {axisPt, axisEta}}); registry.add("hYGenNonPromptWithProngsInAcceptance", "NonPrompt {D_{S}}^j particles (generated-daughters in acceptance);#it{p}_{T}^{gen}({D_{S}}^j) (GeV/#it{c});#it{y}^{gen}({D_{S}}^j);entries", {HistType::kTH2F, {axisPt, axisEta}}); - if (fillSparses){ + if (fillSparses) { registry.add("hPtYGenSig", "{D_{S}}^j particles (generated);#it{p}_{T}({D_{S}}^j) (GeV/#it{c});#it{y}({D_{S}}^j)", {HistType::kTHnSparseF, {axisPt, axisEta, axisOrigin, axisFlag}}); registry.add("hPtYWithProngsInAccepanceGenSig", "{D_{S}}^j particles (generated-daughters in acceptance);#it{p}_{T}({D_{S}}^j) (GeV/#it{c});#it{y}({D_{S}}^j)", {HistType::kTHnSparseF, {axisPt, axisEta, axisOrigin, axisFlag}}); } @@ -188,33 +188,33 @@ struct HfTaskCharmResoReduced { /// \param coll is a reduced collision /// \param bach0 is a bachelor of the candidate /// \param bach1 is a bachelor of the candidate - template + template void fillCand(const Cand& candidate, const Coll& collision, const CharmBach& bach0, const V0Bach& bach1) - { + { // Compute quantities to be saved float invMassReso, pdgMassReso, invMassBach0, invMassBach1, pdgMassBach0, pdgMassBach1, sign, invMassD0, cosThetaStar; - if (channel == DecayChannel::Ds1ToDstarK0s){ + if (channel == DecayChannel::Ds1ToDstarK0s) { pdgMassReso = MassDS1; pdgMassBach0 = MassDStar; pdgMassBach1 = MassK0; invMassBach1 = bach1.invMassK0s(); cosThetaStar = candidate.cosThetaStarDs1(); - if (bach0.dType() > 0){ + if (bach0.dType() > 0) { invMassBach0 = bach0.invMassDstar(); invMassD0 = bach0.invMassD0(); sign = 1; - if (useDeltaMass){ - invMassReso = RecoDecay::m(std::array{bach0.pVectorProng0(), bach0.pVectorProng1(), bach0.pVectorProng2(), bach1.pVector()}, std::array{MassPiPlus, MassKPlus, MassPiPlus, MassK0}); + if (useDeltaMass) { + invMassReso = RecoDecay::m(std::array{bach0.pVectorProng0(), bach0.pVectorProng1(), bach0.pVectorProng2(), bach1.pVector()}, std::array{MassPiPlus, MassKPlus, MassPiPlus, MassK0}); } - } else{ + } else { invMassBach0 = bach0.invMassAntiDstar(); invMassD0 = bach0.invMassD0Bar(); sign = -1; - if (useDeltaMass){ - invMassReso = RecoDecay::m(std::array{bach0.pVectorProng1(), bach0.pVectorProng0(), bach0.pVectorProng2(), bach1.pVector()}, std::array{MassPiPlus, MassKPlus, MassPiPlus, MassK0}); + if (useDeltaMass) { + invMassReso = RecoDecay::m(std::array{bach0.pVectorProng1(), bach0.pVectorProng0(), bach0.pVectorProng2(), bach1.pVector()}, std::array{MassPiPlus, MassKPlus, MassPiPlus, MassK0}); } } - } else if (channel == DecayChannel::Ds2StarToDplusK0s){ + } else if (channel == DecayChannel::Ds2StarToDplusK0s) { pdgMassReso = MassDS2Star; pdgMassBach0 = MassDPlus; pdgMassBach1 = MassK0; @@ -222,37 +222,37 @@ struct HfTaskCharmResoReduced { invMassD0 = 0; invMassBach1 = bach1.invMassK0s(); cosThetaStar = candidate.cosThetaStarDs2Star(); - if (useDeltaMass){ - invMassReso = RecoDecay::m(std::array{bach0.pVectorProng0(), bach0.pVectorProng1(), bach0.pVectorProng2(), bach1.pVector()}, std::array{MassPiPlus, MassKPlus, MassPiPlus, MassK0}); + if (useDeltaMass) { + invMassReso = RecoDecay::m(std::array{bach0.pVectorProng0(), bach0.pVectorProng1(), bach0.pVectorProng2(), bach1.pVector()}, std::array{MassPiPlus, MassKPlus, MassPiPlus, MassK0}); } - if (bach0.dType() > 0){ + if (bach0.dType() > 0) { sign = 1; - } else{ + } else { sign = -1; } - } - float y = RecoDecay::y(std::array{candidate.px(),candidate.py(),candidate.pz()}, pdgMassReso); - float eta = RecoDecay::eta(std::array{candidate.px(),candidate.py(),candidate.pz()}); - 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()}, pdgMassReso); - if (useDeltaMass){ + } + float y = RecoDecay::y(std::array{candidate.px(), candidate.py(), candidate.pz()}, pdgMassReso); + float eta = RecoDecay::eta(std::array{candidate.px(), candidate.py(), candidate.pz()}); + 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()}, pdgMassReso); + if (useDeltaMass) { invMassReso = invMassReso - invMassBach0; } else { - invMassReso = RecoDecay::m(std::array{bach0.pVector(),bach1.pVector()}, std::array{pdgMassBach0,pdgMassBach1}); + invMassReso = RecoDecay::m(std::array{bach0.pVector(), bach1.pVector()}, std::array{pdgMassBach0, pdgMassBach1}); } invMassBach0 = invMassBach0 - invMassD0; float ptGen{-1.}; int8_t origin{-1}, flagMcMatchRec{-1}, debugMcRec{-1}, signD0{0}; - if constexpr (doMc){ + if constexpr (doMc) { ptGen = candidate.ptMother(); origin = candidate.origin(); flagMcMatchRec = candidate.flagMcMatchRec(); debugMcRec = candidate.debugMcRec(); - // signD0 = candidate.signD0(); + // signD0 = candidate.signD0(); } float mlScoreBkg{-1.}, mlScorePrompt{-1.}, mlScoreNonPrompt{-1.}; - if constexpr (withMl){ + if constexpr (withMl) { mlScoreBkg = bach0.mlScoreBkgMassHypo0(); mlScorePrompt = bach0.mlScorePromptMassHypo0(); mlScoreNonPrompt = bach0.mlScoreNonpromptMassHypo0(); @@ -268,19 +268,19 @@ struct HfTaskCharmResoReduced { registry.fill(HIST("hPt"), candidate.pt()); registry.fill(HIST("hPtProng0"), candidate.ptProng0()); registry.fill(HIST("hPtProng1"), candidate.ptProng1()); - if (fillSparses){ + if (fillSparses) { registry.fill(HIST("hSparse"), candidate.pt(), candidate.ptProng0(), candidate.ptProng1(), candidate.invMass(), candidate.invMassProng0(), candidate.invMassProng1(), cosThetaStar, mlScoreBkg, mlScoreNonPrompt); } - if (doMc && fillOnlySignal){ - if (channel == DecayChannel::Ds1ToDstarK0s && !(TESTBIT(flagMcMatchRec,DecayTypeMc::Ds1ToDStarK0ToD0PiK0s) || TESTBIT(flagMcMatchRec,DecayTypeMc::Ds1ToDStarK0ToD0PiK0sPart) || TESTBIT(flagMcMatchRec,DecayTypeMc::Ds1ToDStarK0ToD0NoPiK0sPart) || TESTBIT(flagMcMatchRec,DecayTypeMc::Ds1ToDStarK0ToD0PiK0sOneMu))) { + if (doMc && fillOnlySignal) { + if (channel == DecayChannel::Ds1ToDstarK0s && !(TESTBIT(flagMcMatchRec, DecayTypeMc::Ds1ToDStarK0ToD0PiK0s) || TESTBIT(flagMcMatchRec, DecayTypeMc::Ds1ToDStarK0ToD0PiK0sPart) || TESTBIT(flagMcMatchRec, DecayTypeMc::Ds1ToDStarK0ToD0NoPiK0sPart) || TESTBIT(flagMcMatchRec, DecayTypeMc::Ds1ToDStarK0ToD0PiK0sOneMu))) { return; } - if (channel == DecayChannel::Ds2StarToDplusK0s && !(TESTBIT(flagMcMatchRec,DecayTypeMc::Ds2StarToDplusK0) || TESTBIT(flagMcMatchRec,DecayTypeMc::Ds1ToDStarK0ToDPlusPi0K0s))) { + if (channel == DecayChannel::Ds2StarToDplusK0s && !(TESTBIT(flagMcMatchRec, DecayTypeMc::Ds2StarToDplusK0) || TESTBIT(flagMcMatchRec, DecayTypeMc::Ds1ToDStarK0ToDPlusPi0K0s))) { return; } } - if (fillTrees){ - hfCandResoLite( + if (fillTrees) { + hfCandResoLite( invMassReso, candidate.pt(), p, @@ -290,7 +290,7 @@ struct HfTaskCharmResoReduced { e, cosThetaStar, sign, - //Bachelors Properties + // Bachelors Properties invMassBach0, bach0.pt(), mlScoreBkg, @@ -307,7 +307,7 @@ struct HfTaskCharmResoReduced { bach1.itsNClsProngMin(), bach1.tpcNClsCrossedRowsProngMin(), bach1.tpcChi2NClProngMax(), - //MC + // MC flagMcMatchRec, debugMcRec, origin, @@ -330,12 +330,12 @@ struct HfTaskCharmResoReduced { continue; } float pdgMassReso{0}; - if (channel == DecayChannel::Ds1ToDstarK0s){ + if (channel == DecayChannel::Ds1ToDstarK0s) { pdgMassReso = MassDS1; - } else if(channel == DecayChannel::Ds2StarToDplusK0s){ + } else if (channel == DecayChannel::Ds2StarToDplusK0s) { pdgMassReso = MassDS2Star; } - if (yCandRecoMax >= 0. && std::abs(RecoDecay::y(std::array{cand.px(),cand.py(),cand.pz()}, pdgMassReso)) > yCandRecoMax ){ + if (yCandRecoMax >= 0. && std::abs(RecoDecay::y(std::array{cand.px(), cand.py(), cand.pz()}, pdgMassReso)) > yCandRecoMax) { continue; } auto coll = cand.template hfRedCollision_as(); @@ -355,12 +355,11 @@ struct HfTaskCharmResoReduced { return std::abs(etaProng) <= etaTrackMax && ptProng >= ptTrackMin; } - /// Fill particle histograms (gen MC truth) template void fillCandMcGen(aod::HfMcGenRedResos const& mcParticles) { - for (const auto& particle : mcParticles){ + for (const auto& particle : mcParticles) { auto ptParticle = particle.ptTrack(); auto yParticle = particle.yTrack(); auto etaParticle = particle.etaTrack(); @@ -373,13 +372,13 @@ struct HfTaskCharmResoReduced { std::array etaProngs = {particle.etaProng0(), particle.etaProng1()}; bool prongsInAcc = isProngInAcceptance(etaProngs[0], ptProngs[0]) && isProngInAcceptance(etaProngs[1], ptProngs[1]); if ((channel == DecayChannel::Ds1ToDstarK0s && TESTBIT(flag, DecayTypeMc::Ds1ToDStarK0ToD0PiK0s)) || - (channel == DecayChannel::Ds2StarToDplusK0s && TESTBIT(flag, DecayTypeMc::Ds2StarToDplusK0))){ - if (originParticle == 1){ //prompt particles + (channel == DecayChannel::Ds2StarToDplusK0s && TESTBIT(flag, DecayTypeMc::Ds2StarToDplusK0))) { + if (originParticle == 1) { // prompt particles registry.fill(HIST("hYGenPrompt"), ptParticle, yParticle); if (prongsInAcc) { registry.fill(HIST("hYGenPromptWithProngsInAcceptance"), ptParticle, yParticle); } - } else if (originParticle == 2){ + } else if (originParticle == 2) { registry.fill(HIST("hYGenNonPrompt"), ptParticle, yParticle); if (prongsInAcc) { registry.fill(HIST("hYGenNonPromptWithProngsInAcceptance"), ptParticle, yParticle); @@ -393,7 +392,7 @@ struct HfTaskCharmResoReduced { } } } - }// fillCandMcGen + } // fillCandMcGen // process functions @@ -415,7 +414,7 @@ struct HfTaskCharmResoReduced { } PROCESS_SWITCH(HfTaskCharmResoReduced, processDs2StarData, "Process data Ds2Star analysis without Ml", false); - void processDs2StarDataWithMl(aod::HfRedCollisions const& collisions, ReducedResoWithMl const& candidates) + void processDs2StarDataWithMl(aod::HfRedCollisions const& collisions, ReducedResoWithMl const& candidates) { processData(collisions, candidates); }