diff --git a/PWGHF/D2H/TableProducer/candidateCreatorBToJpsiReduced.cxx b/PWGHF/D2H/TableProducer/candidateCreatorBToJpsiReduced.cxx index ba5527cfcab..25430a1ce18 100644 --- a/PWGHF/D2H/TableProducer/candidateCreatorBToJpsiReduced.cxx +++ b/PWGHF/D2H/TableProducer/candidateCreatorBToJpsiReduced.cxx @@ -36,6 +36,7 @@ #include #include #include +#include #include #include @@ -45,6 +46,7 @@ #include #include #include +#include // std::move using namespace o2; using namespace o2::aod; @@ -176,10 +178,26 @@ struct HfCandidateCreatorBToJpsiReduced { } for (const auto& candJpsi : candsJpsiThisColl) { - o2::track::TrackParametrizationWithError trackPosParCov( - candJpsi.xDauPos(), candJpsi.alphaDauPos(), {candJpsi.yDauPos(), candJpsi.zDauPos(), candJpsi.snpDauPos(), candJpsi.tglDauPos(), candJpsi.signed1PtDauPos()}, 1 /*Charge*/, 1 /*Muon*/); - o2::track::TrackParametrizationWithError trackNegParCov( - candJpsi.xDauNeg(), candJpsi.alphaDauNeg(), {candJpsi.yDauNeg(), candJpsi.zDauNeg(), candJpsi.snpDauNeg(), candJpsi.tglDauNeg(), candJpsi.signed1PtDauNeg()}, -1 /*Charge*/, 1 /*Muon*/); + + std::array parsTrackPos = {candJpsi.yDauPos(), candJpsi.zDauPos(), candJpsi.snpDauPos(), candJpsi.tglDauPos(), candJpsi.signed1PtDauPos()}; + std::array parsTrackNeg = {candJpsi.yDauNeg(), candJpsi.zDauNeg(), candJpsi.snpDauNeg(), candJpsi.tglDauNeg(), candJpsi.signed1PtDauNeg()}; + + std::array covTrackPos = {candJpsi.cYYDauPos(), candJpsi.cZYDauPos(), candJpsi.cZZDauPos(), + candJpsi.cSnpYDauPos(), candJpsi.cSnpZDauPos(), + candJpsi.cSnpSnpDauPos(), candJpsi.cTglYDauPos(), candJpsi.cTglZDauPos(), + candJpsi.cTglSnpDauPos(), candJpsi.cTglTglDauPos(), + candJpsi.c1PtYDauPos(), candJpsi.c1PtZDauPos(), candJpsi.c1PtSnpDauPos(), + candJpsi.c1PtTglDauPos(), candJpsi.c1Pt21Pt2DauPos()}; + + std::array covTrackNeg = {candJpsi.cYYDauNeg(), candJpsi.cZYDauNeg(), candJpsi.cZZDauNeg(), + candJpsi.cSnpYDauNeg(), candJpsi.cSnpZDauNeg(), + candJpsi.cSnpSnpDauNeg(), candJpsi.cTglYDauNeg(), candJpsi.cTglZDauNeg(), + candJpsi.cTglSnpDauNeg(), candJpsi.cTglTglDauNeg(), + candJpsi.c1PtYDauNeg(), candJpsi.c1PtZDauNeg(), candJpsi.c1PtSnpDauNeg(), + candJpsi.c1PtTglDauNeg(), candJpsi.c1Pt21Pt2DauNeg()}; + + o2::track::TrackParametrizationWithError trackPosParCov(candJpsi.xDauPos(), candJpsi.alphaDauPos(), std::move(parsTrackPos), std::move(covTrackPos)); + o2::track::TrackParametrizationWithError trackNegParCov(candJpsi.xDauNeg(), candJpsi.alphaDauNeg(), std::move(parsTrackNeg), std::move(covTrackNeg)); // --------------------------------- // reconstruct J/Psi candidate diff --git a/PWGHF/D2H/TableProducer/dataCreatorJpsiHadReduced.cxx b/PWGHF/D2H/TableProducer/dataCreatorJpsiHadReduced.cxx index f4cfcaaa40c..0bdc38965c7 100644 --- a/PWGHF/D2H/TableProducer/dataCreatorJpsiHadReduced.cxx +++ b/PWGHF/D2H/TableProducer/dataCreatorJpsiHadReduced.cxx @@ -60,7 +60,6 @@ #include #include #include -#include #include #include @@ -106,13 +105,13 @@ enum WrongCollisionType : uint8_t { SplitCollision, }; -std::map partlyRecoDecayMapMuMu = { +std::map const partlyRecoDecayMapMuMu = { {Pdg::kB0, hf_decay::hf_cand_beauty::DecayChannelToJpsiMain::B0ToJpsiXToMuMuX}, {Pdg::kBPlus, hf_decay::hf_cand_beauty::DecayChannelToJpsiMain::BplusToJpsiXToMuMuX}, {Pdg::kBS, hf_decay::hf_cand_beauty::DecayChannelToJpsiMain::BsToJpsiXToMuMuX}, {Pdg::kLambdaB0, hf_decay::hf_cand_beauty::DecayChannelToJpsiMain::LbToJpsiXToMuMuX}}; -std::map partlyRecoDecayMapEE = { +std::map const partlyRecoDecayMapEE = { {Pdg::kB0, hf_decay::hf_cand_beauty::DecayChannelToJpsiMain::B0ToJpsiXToEEX}, {Pdg::kBPlus, hf_decay::hf_cand_beauty::DecayChannelToJpsiMain::BplusToJpsiXToEEX}, {Pdg::kBS, hf_decay::hf_cand_beauty::DecayChannelToJpsiMain::BsToJpsiXToEEX}, @@ -595,7 +594,7 @@ struct HfDataCreatorJpsiHadReduced { // check that the other prongs come from the same b-hadron int const index2Mother = RecoDecay::getMother(particlesMc, vecDaughtersB[2].mcParticle(), bHadronMotherHypo, true); if (indexRecB > -1 && indexRecJPsi > -1 && index2Mother > -1 && index2Mother == indexRecB) { - flag = jpsiDau == kMuonMinus ? signB * partlyRecoDecayMapMuMu[std::abs(bHadronMotherHypo)] : signB * partlyRecoDecayMapEE[std::abs(bHadronMotherHypo)]; + flag = jpsiDau == kMuonMinus ? signB * partlyRecoDecayMapMuMu.at(std::abs(bHadronMotherHypo)) : signB * partlyRecoDecayMapEE.at(std::abs(bHadronMotherHypo)); break; } } @@ -695,7 +694,7 @@ struct HfDataCreatorJpsiHadReduced { int const index2Mother = RecoDecay::getMother(particlesMc, vecDaughtersB[2].mcParticle(), bHadronMotherHypo, true); int const index3Mother = RecoDecay::getMother(particlesMc, vecDaughtersB[3].mcParticle(), bHadronMotherHypo, true); if (indexRecB > -1 && indexRecJPsi > -1 && index2Mother > -1 && index3Mother > -1 && index2Mother == indexRecB && index3Mother == indexRecB) { - flag = jpsiDau == kMuonMinus ? signB * partlyRecoDecayMapMuMu[std::abs(bHadronMotherHypo)] : signB * partlyRecoDecayMapEE[std::abs(bHadronMotherHypo)]; + flag = jpsiDau == kMuonMinus ? signB * partlyRecoDecayMapMuMu.at(std::abs(bHadronMotherHypo)) : signB * partlyRecoDecayMapEE.at(std::abs(bHadronMotherHypo)); break; } } @@ -796,7 +795,7 @@ struct HfDataCreatorJpsiHadReduced { int const index2Mother = RecoDecay::getMother(particlesMc, vecDaughtersB[2].mcParticle(), bHadronMotherHypo, true); int const index3Mother = RecoDecay::getMother(particlesMc, vecDaughtersB[3].mcParticle(), bHadronMotherHypo, true); if (indexRecB > -1 && indexRecJPsi > -1 && index2Mother > -1 && index3Mother > -1 && index2Mother == indexRecB && index3Mother == indexRecB) { - flag = jpsiDau == kMuonMinus ? signB * partlyRecoDecayMapMuMu[std::abs(bHadronMotherHypo)] : signB * partlyRecoDecayMapEE[std::abs(bHadronMotherHypo)]; + flag = jpsiDau == kMuonMinus ? signB * partlyRecoDecayMapMuMu.at(std::abs(bHadronMotherHypo)) : signB * partlyRecoDecayMapEE.at(std::abs(bHadronMotherHypo)); break; } } @@ -1115,7 +1114,6 @@ struct HfDataCreatorJpsiHadReduced { } registry.fill(HIST("hFitCandidatesBPlus"), SVFitting::FitOk); - o2::track::TrackParCov trackParCovBPlus{}; std::array pVecBPlus{}, pVec0{}, pVec1{}, pVec2{}; auto secondaryVertexBPlus = df3.getPCACandidate(); @@ -1124,8 +1122,6 @@ struct HfDataCreatorJpsiHadReduced { df3.getTrack(2).getPxPyPzGlo(pVec2); pVecBPlus = RecoDecay::pVec(pVec0, pVec1, pVec2); pVecJpsi = RecoDecay::pVec(pVec0, pVec1); - trackParCovBPlus = df3.createParentTrackParCov(); - trackParCovBPlus.setAbsCharge(0); // to be sure if (!isBSelected(pVecBPlus, secondaryVertexBPlus, collision)) { continue; diff --git a/PWGHF/D2H/Tasks/taskB0ToJpsiK0StarReduced.cxx b/PWGHF/D2H/Tasks/taskB0ToJpsiK0StarReduced.cxx index d4d5ccf7d1c..fdcf6be8b80 100644 --- a/PWGHF/D2H/Tasks/taskB0ToJpsiK0StarReduced.cxx +++ b/PWGHF/D2H/Tasks/taskB0ToJpsiK0StarReduced.cxx @@ -91,7 +91,7 @@ DECLARE_SOA_COLUMN(TpcChi2NClLfTrack1, tpcChi2NClLfTrack1, float); DECLARE_SOA_COLUMN(AbsEtaLfTrack1, absEtaLfTrack1, float); //! |eta| DECLARE_SOA_COLUMN(MJpsi, mJpsi, float); //! Invariant mass of Jpsi daughter candidates (GeV/c) DECLARE_SOA_COLUMN(MK0Star, mK0Star, float); //! Invariant mass of K*0 daughter candidates (GeV/c) -DECLARE_SOA_COLUMN(M, m, float); //! Invariant mass of candidate (GeV/c2) +DECLARE_SOA_COLUMN(M, m, float); //! Invariant mass of candidate particle (GeV/c2) DECLARE_SOA_COLUMN(Pt, pt, float); //! Transverse momentum of candidate (GeV/c) DECLARE_SOA_COLUMN(PtGen, ptGen, float); //! Transverse momentum of candidate (GeV/c) DECLARE_SOA_COLUMN(P, p, float); //! Momentum of candidate (GeV/c) @@ -127,7 +127,7 @@ DECLARE_SOA_COLUMN(DecayLength, decayLength, float); DECLARE_SOA_COLUMN(DecayLengthXY, decayLengthXY, float); //! Transverse decay length of candidate (cm) DECLARE_SOA_COLUMN(DecayLengthNormalised, decayLengthNormalised, float); //! Normalised decay length of candidate DECLARE_SOA_COLUMN(DecayLengthXYNormalised, decayLengthXYNormalised, float); //! Normalised transverse decay length of candidate -DECLARE_SOA_COLUMN(CtXY, ctXY, float); //! Pseudo-proper decay length of candidate +DECLARE_SOA_COLUMN(CtXY, ctXY, float); //! Pseudo-proper decay length of candidate particle DECLARE_SOA_COLUMN(ImpactParameterProduct, impactParameterProduct, float); //! Impact parameter product of B daughters DECLARE_SOA_COLUMN(ImpactParameterProductJpsi, impactParameterProductJpsi, float); //! Impact parameter product of Jpsi daughters DECLARE_SOA_COLUMN(ImpactParameterProductK0Star, impactParameterProductK0Star, float); //! Impact parameter product of K*0 daughters @@ -154,6 +154,7 @@ DECLARE_SOA_TABLE(HfRedCandB0Lites, "AOD", "HFREDCANDB0LITE", //! Table with som hf_cand_b0tojpsik0star_lite::Y, hf_cand_b0tojpsik0star_lite::Cpa, hf_cand_b0tojpsik0star_lite::CpaXY, + hf_cand_b0tojpsik0star_lite::CpaJpsi, hf_cand::Chi2PCA, hf_cand_b0tojpsik0star_lite::DecayLength, hf_cand_b0tojpsik0star_lite::DecayLengthXY, @@ -565,37 +566,35 @@ struct HfTaskB0ToJpsiK0StarReduced { } auto fillTable = [&](bool isSelKPi) { - auto ctXY = isSelKPi ? candidate.ctXY(std::array{o2::constants::physics::MassMuon, o2::constants::physics::MassMuon, o2::constants::physics::MassKPlus, o2::constants::physics::MassPiPlus}) - : candidate.ctXY(std::array{o2::constants::physics::MassMuon, o2::constants::physics::MassMuon, o2::constants::physics::MassPiPlus, o2::constants::physics::MassKPlus}); - auto mlScoreSig = isSelKPi ? mlScoreSigKPi : mlScoreSigPiK; - auto invMassB0 = isSelKPi ? invMassB0KPi : invMassB0PiK; - auto invMassK0Star = isSelKPi ? invMassK0StarKPi : invMassK0StarPiK; + auto ctXY = candidate.ctXY(std::array{o2::constants::physics::MassMuon, o2::constants::physics::MassMuon, o2::constants::physics::MassKPlus, o2::constants::physics::MassPiPlus}); + auto ctXYBar = candidate.ctXY(std::array{o2::constants::physics::MassMuon, o2::constants::physics::MassMuon, o2::constants::physics::MassPiPlus, o2::constants::physics::MassKPlus}); hfRedCandB0Lite( // B0 - meson features - invMassB0, + isSelKPi ? invMassB0KPi : invMassB0PiK, ptCandB0, candidate.eta(), candidate.phi(), HfHelper::yB0(candidate), candidate.cpa(), candidate.cpaXY(), + candidate.cpaJpsi(), candidate.chi2PCA(), candidate.decayLength(), candidate.decayLengthXY(), candidate.decayLengthNormalised(), candidate.decayLengthXYNormalised(), - ctXY, + isSelKPi ? ctXY : ctXYBar, candidate.impactParameterProduct(), candidate.impactParameterProductJpsi(), candidate.impactParameterProductK0Star(), candidate.maxNormalisedDeltaIP(), - mlScoreSig, + isSelKPi ? mlScoreSigKPi : mlScoreSigPiK, isSelKPi ? statusB0KPi : -1, isSelKPi ? -1 : statusB0PiK, // J/Psi features invMassJpsi, ptJpsi, - invMassK0Star, + isSelKPi ? invMassK0StarKPi : invMassK0StarPiK, candidate.impactParameter0(), candidate.impactParameter1(), candidate.impactParameter2(), diff --git a/PWGHF/D2H/Tasks/taskBplusToJpsiKReduced.cxx b/PWGHF/D2H/Tasks/taskBplusToJpsiKReduced.cxx index 8207b3dc36a..bdb9a91b64f 100644 --- a/PWGHF/D2H/Tasks/taskBplusToJpsiKReduced.cxx +++ b/PWGHF/D2H/Tasks/taskBplusToJpsiKReduced.cxx @@ -134,6 +134,7 @@ DECLARE_SOA_TABLE(HfRedCandBpLites, "AOD", "HFREDCANDBPLITE", //! Table with som hf_cand_bplustojpsik_lite::Y, hf_cand_bplustojpsik_lite::Cpa, hf_cand_bplustojpsik_lite::CpaXY, + hf_cand_bplustojpsik_lite::CpaJpsi, hf_cand::Chi2PCA, hf_cand_bplustojpsik_lite::DecayLength, hf_cand_bplustojpsik_lite::DecayLengthXY, @@ -450,6 +451,7 @@ struct HfTaskBplusToJpsiKReduced { HfHelper::yBplus(candidate), candidate.cpa(), candidate.cpaXY(), + candidate.cpaJpsi(), candidate.chi2PCA(), candidate.decayLength(), candidate.decayLengthXY(), diff --git a/PWGHF/D2H/Tasks/taskBsToJpsiPhiReduced.cxx b/PWGHF/D2H/Tasks/taskBsToJpsiPhiReduced.cxx index 9a374a53e47..4853f6c6035 100644 --- a/PWGHF/D2H/Tasks/taskBsToJpsiPhiReduced.cxx +++ b/PWGHF/D2H/Tasks/taskBsToJpsiPhiReduced.cxx @@ -146,6 +146,7 @@ DECLARE_SOA_TABLE(HfRedCandBsLites, "AOD", "HFREDCANDBSLITE", //! Table with som hf_cand_bstojpsiphi_lite::Y, hf_cand_bstojpsiphi_lite::Cpa, hf_cand_bstojpsiphi_lite::CpaXY, + hf_cand_bstojpsiphi_lite::CpaJpsi, hf_cand::Chi2PCA, hf_cand_bstojpsiphi_lite::DecayLength, hf_cand_bstojpsiphi_lite::DecayLengthXY, @@ -486,6 +487,7 @@ struct HfTaskBsToJpsiPhiReduced { HfHelper::yBs(candidate), candidate.cpa(), candidate.cpaXY(), + candidate.cpaJpsi(), candidate.chi2PCA(), candidate.decayLength(), candidate.decayLengthXY(), diff --git a/PWGHF/DataModel/CandidateReconstructionTables.h b/PWGHF/DataModel/CandidateReconstructionTables.h index 37147a62937..c5c3eea19f1 100644 --- a/PWGHF/DataModel/CandidateReconstructionTables.h +++ b/PWGHF/DataModel/CandidateReconstructionTables.h @@ -589,6 +589,10 @@ DECLARE_SOA_DYNAMIC_COLUMN(ImpactParameterProduct, impactParameterProduct, // Im [](float px0, float py0, float pz0, float px1, float py1, float pz1, float xVtxP, float yVtxP, float zVtxP, float xVtxS, float yVtxS, float zVtxS, float impParK) -> float { return impParK * RecoDecay::impParXY(std::array{xVtxP, yVtxP, zVtxP}, std::array{xVtxS, yVtxS, zVtxS}, RecoDecay::pVec(std::array{px0, py0, pz0}, std::array{px1, py1, pz1})); }); DECLARE_SOA_DYNAMIC_COLUMN(ImpactParameterProductJpsi, impactParameterProductJpsi, // J/Psi impact parameter for B+ -> J/Psi K [](float dcaDauPos, float dcaDauNeg) -> float { return dcaDauPos * dcaDauNeg; }); +DECLARE_SOA_DYNAMIC_COLUMN(CpaJpsi, cpaJpsi, //! + [](float xVtxP, float yVtxP, float zVtxP, float xVtxS, float yVtxS, float zVtxS, float px0, float py0, float pz0, float px1, float py1, float pz1) -> float { return RecoDecay::cpa(std::array{xVtxP, yVtxP, zVtxP}, std::array{xVtxS, yVtxS, zVtxS}, std::array{px0 + px1, py0 + py1, pz0 + pz1}); }); +DECLARE_SOA_DYNAMIC_COLUMN(CpaJpsiXY, cpaJpsiXY, //! + [](float xVtxP, float yVtxP, float xVtxS, float yVtxS, float px0, float py0, float px1, float py1) -> float { return RecoDecay::cpaXY(std::array{xVtxP, yVtxP}, std::array{xVtxS, yVtxS}, std::array{px0 + px1, py0 + py1}); }); enum DecayTypeMc : uint8_t { BplusToD0PiToKPiPi = 0, BplusToD0KToKPiK, @@ -900,6 +904,8 @@ DECLARE_SOA_TABLE(HfCandBpJPBase, "AOD", "HFCANDBPJPBASE", hf_cand::PVector, hf_cand::Cpa, hf_cand::CpaXY, + hf_cand_bplus::CpaJpsi, + hf_cand_bplus::CpaJpsiXY, hf_cand::Ct, hf_cand::ImpactParameterXY, hf_cand_3prong::MaxNormalisedDeltaIP, @@ -1944,6 +1950,10 @@ DECLARE_SOA_DYNAMIC_COLUMN(MaxNormalisedDeltaIP, maxNormalisedDeltaIP, //! [](float xVtxP, float yVtxP, float xVtxS, float yVtxS, float errDlxy, float pxM, float pyM, float ip0, float errIp0, float ip1, float errIp1, float ip2, float errIp2, float ip3, float errIp3, float px0, float py0, float px1, float py1, float px2, float py2, float px3, float py3) -> float { return RecoDecay::maxNormalisedDeltaIP(std::array{xVtxP, yVtxP}, std::array{xVtxS, yVtxS}, errDlxy, std::array{pxM, pyM}, std::array{ip0, ip1, ip2, ip3}, std::array{errIp0, errIp1, errIp2, errIp3}, std::array{std::array{px0, py0}, std::array{px1, py1}, std::array{px2, py2}, std::array{px3, py3}}); }); DECLARE_SOA_DYNAMIC_COLUMN(CtXY, ctXY, //! [](float px0, float py0, float pz0, float px1, float py1, float pz1, float px2, float py2, float pz2, float px3, float py3, float pz3, float xVtxP, float yVtxP, float xVtxS, float yVtxS, const std::array& m) -> float { return RecoDecay::ctXY(std::array{xVtxP, yVtxP}, std::array{xVtxS, yVtxS}, std::array{std::array{px0, py0, pz0}, std::array{px1, py1, pz1}, std::array{px2, py2, pz2}, std::array{px3, py3, pz3}}, m); }); +DECLARE_SOA_DYNAMIC_COLUMN(CpaJpsi, cpaJpsi, //! + [](float xVtxP, float yVtxP, float zVtxP, float xVtxS, float yVtxS, float zVtxS, float px0, float py0, float pz0, float px1, float py1, float pz1) -> float { return RecoDecay::cpa(std::array{xVtxP, yVtxP, zVtxP}, std::array{xVtxS, yVtxS, zVtxS}, std::array{px0 + px1, py0 + py1, pz0 + pz1}); }); +DECLARE_SOA_DYNAMIC_COLUMN(CpaJpsiXY, cpaJpsiXY, //! + [](float xVtxP, float yVtxP, float xVtxS, float yVtxS, float px0, float py0, float px1, float py1) -> float { return RecoDecay::cpaXY(std::array{xVtxP, yVtxP}, std::array{xVtxS, yVtxS}, std::array{px0 + px1, py0 + py1}); }); } // namespace hf_cand_4prong // declare dedicated B0 -> J/Psi K*0 decay candidate table @@ -1982,6 +1992,8 @@ DECLARE_SOA_TABLE(HfCandB0JPBase, "AOD", "HFCANDB0JPBASE", hf_cand::PVector, hf_cand::Cpa, hf_cand::CpaXY, + hf_cand_4prong::CpaJpsi, + hf_cand_4prong::CpaJpsiXY, hf_cand::Ct, hf_cand::ImpactParameterXY, hf_cand_4prong::MaxNormalisedDeltaIP, @@ -2037,6 +2049,8 @@ DECLARE_SOA_TABLE(HfCandBsJPBase, "AOD", "HFCANDBSJPBASE", hf_cand::PVector, hf_cand::Cpa, hf_cand::CpaXY, + hf_cand_4prong::CpaJpsi, + hf_cand_4prong::CpaJpsiXY, hf_cand::Ct, hf_cand::ImpactParameterXY, hf_cand_4prong::MaxNormalisedDeltaIP,