diff --git a/PWGHF/Core/HfMlResponseB0ToDPi.h b/PWGHF/Core/HfMlResponseB0ToDPi.h index 354d295f7a6..475fc8f4127 100644 --- a/PWGHF/Core/HfMlResponseB0ToDPi.h +++ b/PWGHF/Core/HfMlResponseB0ToDPi.h @@ -30,10 +30,9 @@ // Fill the map of available input features // the key is the feature's name (std::string) // the value is the corresponding value in EnumInputFeatures -#define FILL_MAP_B0(FEATURE) \ - { \ - #FEATURE, static_cast(InputFeaturesB0ToDPi::FEATURE) \ - } +#define FILL_MAP_B0(FEATURE) \ + { \ + #FEATURE, static_cast(InputFeaturesB0ToDPi::FEATURE)} // Check if the index of mCachedIndices (index associated to a FEATURE) // matches the entry in EnumInputFeatures associated to this FEATURE @@ -90,6 +89,14 @@ enum class InputFeaturesB0ToDPi : uint8_t { decayLengthXYNormalised, cpa, cpaXY, + decayLengthDToPv, + decayLengthDToPvXY, + decayLengthDToB, + decayLengthDToBXY, + cpaDToPv, + cpaDToPvXY, + cpaDToB, + cpaDToBXY, maxNormalisedDeltaIP, prong0MlScoreBkg, prong0MlScorePrompt, @@ -139,6 +146,14 @@ class HfMlResponseB0ToDPi : public HfMlResponse CHECK_AND_FILL_VEC_B0(decayLengthXYNormalised); CHECK_AND_FILL_VEC_B0(cpa); CHECK_AND_FILL_VEC_B0(cpaXY); + CHECK_AND_FILL_VEC_B0(decayLengthDToPv); + CHECK_AND_FILL_VEC_B0(decayLengthDToPvXY); + CHECK_AND_FILL_VEC_B0(decayLengthDToB); + CHECK_AND_FILL_VEC_B0(decayLengthDToBXY); + CHECK_AND_FILL_VEC_B0(cpaDToPv); + CHECK_AND_FILL_VEC_B0(cpaDToPvXY); + CHECK_AND_FILL_VEC_B0(cpaDToB); + CHECK_AND_FILL_VEC_B0(cpaDToBXY); CHECK_AND_FILL_VEC_B0(maxNormalisedDeltaIP); // TPC PID variable CHECK_AND_FILL_VEC_B0_FULL(prongBachPi, tpcNSigmaPi1, tpcNSigmaPi); @@ -202,6 +217,14 @@ class HfMlResponseB0ToDPi : public HfMlResponse CHECK_AND_FILL_VEC_B0(decayLengthXYNormalised); CHECK_AND_FILL_VEC_B0(cpa); CHECK_AND_FILL_VEC_B0(cpaXY); + CHECK_AND_FILL_VEC_B0(decayLengthDToPv); + CHECK_AND_FILL_VEC_B0(decayLengthDToPvXY); + CHECK_AND_FILL_VEC_B0(decayLengthDToB); + CHECK_AND_FILL_VEC_B0(decayLengthDToBXY); + CHECK_AND_FILL_VEC_B0(cpaDToPv); + CHECK_AND_FILL_VEC_B0(cpaDToPvXY); + CHECK_AND_FILL_VEC_B0(cpaDToB); + CHECK_AND_FILL_VEC_B0(cpaDToBXY); CHECK_AND_FILL_VEC_B0(maxNormalisedDeltaIP); // TPC PID variable CHECK_AND_FILL_VEC_B0_FULL(prongBachPi, tpcNSigmaPiBachPi, tpcNSigmaPi); @@ -257,6 +280,14 @@ class HfMlResponseB0ToDPi : public HfMlResponse FILL_MAP_B0(decayLengthXYNormalised), FILL_MAP_B0(cpa), FILL_MAP_B0(cpaXY), + FILL_MAP_B0(decayLengthDToPv), + FILL_MAP_B0(decayLengthDToPvXY), + FILL_MAP_B0(decayLengthDToB), + FILL_MAP_B0(decayLengthDToBXY), + FILL_MAP_B0(cpaDToPv), + FILL_MAP_B0(cpaDToPvXY), + FILL_MAP_B0(cpaDToB), + FILL_MAP_B0(cpaDToBXY), FILL_MAP_B0(maxNormalisedDeltaIP), FILL_MAP_B0(prong0MlScoreBkg), FILL_MAP_B0(prong0MlScorePrompt), diff --git a/PWGHF/D2H/TableProducer/candidateCreatorB0Reduced.cxx b/PWGHF/D2H/TableProducer/candidateCreatorB0Reduced.cxx index 613bae38b31..df07d60011b 100644 --- a/PWGHF/D2H/TableProducer/candidateCreatorB0Reduced.cxx +++ b/PWGHF/D2H/TableProducer/candidateCreatorB0Reduced.cxx @@ -225,7 +225,8 @@ struct HfCandidateCreatorB0Reduced { pVecSoftPion[0], pVecSoftPion[1], pVecSoftPion[2], pVecBachPion[0], pVecBachPion[1], pVecBachPion[2], dcaD.getY(), dcaSoftPion.getY(), dcaBachPion.getY(), - std::sqrt(dcaD.getSigmaY2()), std::sqrt(dcaSoftPion.getSigmaY2()), std::sqrt(dcaBachPion.getSigmaY2())); + std::sqrt(dcaD.getSigmaY2()), std::sqrt(dcaSoftPion.getSigmaY2()), std::sqrt(dcaBachPion.getSigmaY2()), + candD.xSecondaryVertex(), candD.ySecondaryVertex(), candD.zSecondaryVertex()); rowCandidateProngsDStar(candD.globalIndex(), trackBachPion.globalIndex(), trackSoftPion.globalIndex()); @@ -327,7 +328,8 @@ struct HfCandidateCreatorB0Reduced { pVecD[0], pVecD[1], pVecD[2], pVecPion[0], pVecPion[1], pVecPion[2], dcaD.getY(), dcaPion.getY(), - std::sqrt(dcaD.getSigmaY2()), std::sqrt(dcaPion.getSigmaY2())); + std::sqrt(dcaD.getSigmaY2()), std::sqrt(dcaPion.getSigmaY2()), + candD.xSecondaryVertex(), candD.ySecondaryVertex(), candD.zSecondaryVertex()); rowCandidateProngs(candD.globalIndex(), trackPion.globalIndex()); diff --git a/PWGHF/D2H/Tasks/taskB0Reduced.cxx b/PWGHF/D2H/Tasks/taskB0Reduced.cxx index 16634591c5f..dd508c8f7ba 100644 --- a/PWGHF/D2H/Tasks/taskB0Reduced.cxx +++ b/PWGHF/D2H/Tasks/taskB0Reduced.cxx @@ -90,11 +90,17 @@ DECLARE_SOA_COLUMN(DecayLengthNormalised, decayLengthNormalised, float); DECLARE_SOA_COLUMN(DecayLengthXYNormalised, decayLengthXYNormalised, float); //! Normalised transverse decay length of candidate DECLARE_SOA_COLUMN(DecayLengthD, decayLengthD, float); //! Decay length of D-meson daughter candidate (cm) DECLARE_SOA_COLUMN(DecayLengthXYD, decayLengthXYD, float); //! Transverse decay length of D-meson daughter candidate (cm) +DECLARE_SOA_COLUMN(DecayLengthDToB, decayLengthDToB, float); //! Decay length of D-meson daughter candidate from B decay vertex (cm) +DECLARE_SOA_COLUMN(DecayLengthXYDToB, decayLengthXYDToB, float); //! Transverse decay length of D-meson daughter candidate from B decay vertex (cm) DECLARE_SOA_COLUMN(ImpactParameterD, impactParameterD, float); //! Impact parameter product of D-meson daughter candidate DECLARE_SOA_COLUMN(ImpactParameterBach, impactParameterBach, float); //! Impact parameter product of bachelor pion DECLARE_SOA_COLUMN(ImpactParameterProduct, impactParameterProduct, float); //! Impact parameter product of daughters DECLARE_SOA_COLUMN(Cpa, cpa, float); //! Cosine pointing angle of candidate DECLARE_SOA_COLUMN(CpaXY, cpaXY, float); //! Cosine pointing angle of candidate in transverse plane +DECLARE_SOA_COLUMN(CpaD, cpaD, float); //! Cosine pointing angle of D candidate to PV +DECLARE_SOA_COLUMN(CpaDXY, cpaDXY, float); //! Cosine pointing angle of D candidate to PV in transverse plane +DECLARE_SOA_COLUMN(CpaDToB, cpaDToB, float); //! Cosine pointing angle of D candidate to B decay vertex +DECLARE_SOA_COLUMN(CpaDToBXY, cpaDToBXY, float); //! Cosine pointing angle of D candidate to B decay vertex in transverse plane DECLARE_SOA_COLUMN(MaxNormalisedDeltaIP, maxNormalisedDeltaIP, float); //! Maximum normalized difference between measured and expected impact parameter of candidate prongs DECLARE_SOA_COLUMN(MlScoreSig, mlScoreSig, float); //! ML score for signal class DECLARE_SOA_COLUMN(FlagWrongCollision, flagWrongCollision, int8_t); //! Flag for association with wrong collision @@ -123,6 +129,12 @@ DECLARE_SOA_TABLE(HfRedCandB0Lites, "AOD", "HFREDCANDB0LITE", //! Table with som hf_cand_b0_lite::PtD, hf_cand_b0_lite::DecayLengthD, hf_cand_b0_lite::DecayLengthXYD, + hf_cand_b0_lite::DecayLengthDToB, + hf_cand_b0_lite::DecayLengthXYDToB, + hf_cand_b0_lite::CpaD, + hf_cand_b0_lite::CpaDXY, + hf_cand_b0_lite::CpaDToB, + hf_cand_b0_lite::CpaDToBXY, hf_cand_b0_lite::ImpactParameterD, hf_cand_b0_lite::PtDmesProngMin, hf_cand_b0_lite::AbsEtaDmesProngMin, @@ -621,8 +633,14 @@ struct HfTaskB0Reduced { // D-meson features invMassD, ptD, - decLenD, - decLenXyD, + candidate.decayLengthDToPv(), + candidate.decayLengthDToPvXY(), + candidate.decayLengthDToB(), + candidate.decayLengthDToBXY(), + candidate.cpaDToPv(), + candidate.cpaDToPvXY(), + candidate.cpaDToB(), + candidate.cpaDToBXY(), candidate.impactParameter0(), candD.ptProngMin(), candD.absEtaProngMin(), @@ -878,8 +896,14 @@ struct HfTaskB0Reduced { // D-meson features invMassD, ptD, - decLenD, - decLenXyD, + candidate.decayLengthDToPv(), + candidate.decayLengthDToPvXY(), + candidate.decayLengthDToB(), + candidate.decayLengthDToBXY(), + candidate.cpaDToPv(), + candidate.cpaDToPvXY(), + candidate.cpaDToB(), + candidate.cpaDToBXY(), candidate.impactParameter0(), candD.ptProngMin(), candD.absEtaProngMin(), diff --git a/PWGHF/DataModel/CandidateReconstructionTables.h b/PWGHF/DataModel/CandidateReconstructionTables.h index 5fddf9d0f0d..37147a62937 100644 --- a/PWGHF/DataModel/CandidateReconstructionTables.h +++ b/PWGHF/DataModel/CandidateReconstructionTables.h @@ -1687,6 +1687,9 @@ DECLARE_SOA_TABLE(HfCandLbMcGen, "AOD", "HFCANDLBMCGEN", //! // specific B0 candidate properties namespace hf_cand_b0 { +DECLARE_SOA_COLUMN(XSecondaryVertexD, xSecondaryVertexD, float); +DECLARE_SOA_COLUMN(YSecondaryVertexD, ySecondaryVertexD, float); +DECLARE_SOA_COLUMN(ZSecondaryVertexD, zSecondaryVertexD, float); DECLARE_SOA_INDEX_COLUMN_FULL(Prong0, prong0, int, HfCand3Prong, "_0"); // D index DECLARE_SOA_DYNAMIC_COLUMN(ImpactParameterProduct, impactParameterProduct, // Impact parameter product for B0 -> J/Psi K*0 [](float pxJpsiDauPos, float pyJpsiDauPos, float pzJpsiDauPos, float pxJpsiDauNeg, float pyJpsiDauNeg, float pzJpsiDauNeg, float pxLfTrack0, float pyLfTrack0, float pzLfTrack0, float pxLfTrack1, float pyLfTrack1, float pzLfTrack1, float xVtxP, float yVtxP, float zVtxP, float xVtxS, float yVtxS, float zVtxS) -> float { @@ -1698,6 +1701,22 @@ DECLARE_SOA_DYNAMIC_COLUMN(ImpactParameterProductJpsi, impactParameterProductJps [](float dcaDauPos, float dcaDauNeg) -> float { return dcaDauPos * dcaDauNeg; }); DECLARE_SOA_DYNAMIC_COLUMN(ImpactParameterProductK0Star, impactParameterProductK0Star, // K*0 impact parameter product for B0 -> J/Psi K*0 [](float dcaLfTrack0, float dcaLfTrack1) -> float { return dcaLfTrack0 * dcaLfTrack1; }); +DECLARE_SOA_DYNAMIC_COLUMN(CpaDToPv, cpaDToPv, //! + [](float xVtxP, float yVtxP, float zVtxP, float xVtxS, float yVtxS, float zVtxS, float px, float py, float pz) -> float { return RecoDecay::cpa(std::array{xVtxP, yVtxP, zVtxP}, std::array{xVtxS, yVtxS, zVtxS}, std::array{px, py, pz}); }); +DECLARE_SOA_DYNAMIC_COLUMN(CpaDToPvXY, cpaDToPvXY, //! + [](float xVtxP, float yVtxP, float xVtxS, float yVtxS, float px, float py) -> float { return RecoDecay::cpaXY(std::array{xVtxP, yVtxP}, std::array{xVtxS, yVtxS}, std::array{px, py}); }); +DECLARE_SOA_DYNAMIC_COLUMN(CpaDToB, cpaDToB, //! + [](float xVtxB, float yVtxB, float zVtxB, float xVtxS, float yVtxS, float zVtxS, float px, float py, float pz) -> float { return RecoDecay::cpa(std::array{xVtxB, yVtxB, zVtxB}, std::array{xVtxS, yVtxS, zVtxS}, std::array{px, py, pz}); }); +DECLARE_SOA_DYNAMIC_COLUMN(CpaDToBXY, cpaDToBXY, //! + [](float xVtxB, float yVtxB, float xVtxS, float yVtxS, float px, float py) -> float { return RecoDecay::cpaXY(std::array{xVtxB, yVtxB}, std::array{xVtxS, yVtxS}, std::array{px, py}); }); +DECLARE_SOA_DYNAMIC_COLUMN(DecayLengthDToPv, decayLengthDToPv, //! + [](float xVtxP, float yVtxP, float zVtxP, float xVtxS, float yVtxS, float zVtxS) -> float { return RecoDecay::distance(std::array{xVtxP, yVtxP, zVtxP}, std::array{xVtxS, yVtxS, zVtxS}); }); +DECLARE_SOA_DYNAMIC_COLUMN(DecayLengthDToPvXY, decayLengthDToPvXY, //! + [](float xVtxP, float yVtxP, float xVtxS, float yVtxS) -> float { return RecoDecay::distanceXY(std::array{xVtxP, yVtxP}, std::array{xVtxS, yVtxS}); }); +DECLARE_SOA_DYNAMIC_COLUMN(DecayLengthDToB, decayLengthDToB, //! + [](float xVtxB, float yVtxB, float zVtxB, float xVtxS, float yVtxS, float zVtxS) -> float { return RecoDecay::distance(std::array{xVtxB, yVtxB, zVtxB}, std::array{xVtxS, yVtxS, zVtxS}); }); +DECLARE_SOA_DYNAMIC_COLUMN(DecayLengthDToBXY, decayLengthDToBXY, //! + [](float xVtxB, float yVtxB, float xVtxS, float yVtxS) -> float { return RecoDecay::distanceXY(std::array{xVtxB, yVtxB}, std::array{xVtxS, yVtxS}); }); enum DecayTypeMc : uint8_t { B0ToDplusPiToPiKPiPi = 0, B0ToDsPiToKKPiPi, @@ -1718,7 +1737,17 @@ DECLARE_SOA_TABLE(HfCandB0Base, "AOD", "HFCANDB0BASE", hf_cand::PxProng1, hf_cand::PyProng1, hf_cand::PzProng1, hf_cand::ImpactParameter0, hf_cand::ImpactParameter1, hf_cand::ErrorImpactParameter0, hf_cand::ErrorImpactParameter1, + // D meson decay vertex position + hf_cand_b0::XSecondaryVertexD, hf_cand_b0::YSecondaryVertexD, hf_cand_b0::ZSecondaryVertexD, /* dynamic columns */ + hf_cand_b0::CpaDToPv, + hf_cand_b0::CpaDToPvXY, + hf_cand_b0::CpaDToB, + hf_cand_b0::CpaDToBXY, + hf_cand_b0::DecayLengthDToPv, + hf_cand_b0::DecayLengthDToPvXY, + hf_cand_b0::DecayLengthDToB, + hf_cand_b0::DecayLengthDToBXY, hf_cand_2prong::M, hf_cand_2prong::M2, hf_cand_2prong::ImpactParameterProduct, @@ -1755,7 +1784,17 @@ DECLARE_SOA_TABLE(HfCandB0DStar, "AOD", "HFCANDB0DSTAR", hf_cand::PxProng2, hf_cand::PyProng2, hf_cand::PzProng2, hf_cand::ImpactParameter0, hf_cand::ImpactParameter1, hf_cand::ImpactParameter2, hf_cand::ErrorImpactParameter0, hf_cand::ErrorImpactParameter1, hf_cand::ErrorImpactParameter2, + // D meson decay vertex position + hf_cand_b0::XSecondaryVertexD, hf_cand_b0::YSecondaryVertexD, hf_cand_b0::ZSecondaryVertexD, /* dynamic columns */ + hf_cand_b0::CpaDToPv, + hf_cand_b0::CpaDToPvXY, + hf_cand_b0::CpaDToB, + hf_cand_b0::CpaDToBXY, + hf_cand_b0::DecayLengthDToPv, + hf_cand_b0::DecayLengthDToPvXY, + hf_cand_b0::DecayLengthDToB, + hf_cand_b0::DecayLengthDToBXY, hf_cand_3prong::M, hf_cand_3prong::M2, hf_cand_2prong::ImpactParameterProduct, diff --git a/PWGHF/TableProducer/candidateCreatorB0.cxx b/PWGHF/TableProducer/candidateCreatorB0.cxx index 385a2d551aa..850c9796de6 100644 --- a/PWGHF/TableProducer/candidateCreatorB0.cxx +++ b/PWGHF/TableProducer/candidateCreatorB0.cxx @@ -373,7 +373,8 @@ struct HfCandidateCreatorB0 { pVecD[0], pVecD[1], pVecD[2], pVecPion[0], pVecPion[1], pVecPion[2], dcaD.getY(), dcaPion.getY(), - std::sqrt(dcaD.getSigmaY2()), std::sqrt(dcaPion.getSigmaY2())); + std::sqrt(dcaD.getSigmaY2()), std::sqrt(dcaPion.getSigmaY2()), + candD.xSecondaryVertex(), candD.ySecondaryVertex(), candD.zSecondaryVertex()); rowCandidateProngs(candD.globalIndex(), trackPion.globalIndex()); } // pi loop