Skip to content
26 changes: 22 additions & 4 deletions PWGHF/D2H/TableProducer/candidateCreatorBToJpsiReduced.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
#include <Framework/WorkflowSpec.h>
#include <Framework/runDataProcessing.h>
#include <ReconstructionDataFormats/DCA.h>
#include <ReconstructionDataFormats/TrackParametrization.h>
#include <ReconstructionDataFormats/TrackParametrizationWithError.h>

#include <TH1.h>
Expand All @@ -45,6 +46,7 @@
#include <cstdint>
#include <memory>
#include <stdexcept>
#include <utility> // std::move

using namespace o2;
using namespace o2::aod;
Expand Down Expand Up @@ -176,10 +178,26 @@ struct HfCandidateCreatorBToJpsiReduced {
}

for (const auto& candJpsi : candsJpsiThisColl) {
o2::track::TrackParametrizationWithError<float> trackPosParCov(
candJpsi.xDauPos(), candJpsi.alphaDauPos(), {candJpsi.yDauPos(), candJpsi.zDauPos(), candJpsi.snpDauPos(), candJpsi.tglDauPos(), candJpsi.signed1PtDauPos()}, 1 /*Charge*/, 1 /*Muon*/);
o2::track::TrackParametrizationWithError<float> trackNegParCov(
candJpsi.xDauNeg(), candJpsi.alphaDauNeg(), {candJpsi.yDauNeg(), candJpsi.zDauNeg(), candJpsi.snpDauNeg(), candJpsi.tglDauNeg(), candJpsi.signed1PtDauNeg()}, -1 /*Charge*/, 1 /*Muon*/);

std::array<float, o2::track::kNParams> parsTrackPos = {candJpsi.yDauPos(), candJpsi.zDauPos(), candJpsi.snpDauPos(), candJpsi.tglDauPos(), candJpsi.signed1PtDauPos()};
std::array<float, o2::track::kNParams> parsTrackNeg = {candJpsi.yDauNeg(), candJpsi.zDauNeg(), candJpsi.snpDauNeg(), candJpsi.tglDauNeg(), candJpsi.signed1PtDauNeg()};

std::array<float, o2::track::kCovMatSize> 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<float, o2::track::kCovMatSize> 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<float> trackPosParCov(candJpsi.xDauPos(), candJpsi.alphaDauPos(), std::move(parsTrackPos), std::move(covTrackPos));
o2::track::TrackParametrizationWithError<float> trackNegParCov(candJpsi.xDauNeg(), candJpsi.alphaDauNeg(), std::move(parsTrackNeg), std::move(covTrackNeg));

// ---------------------------------
// reconstruct J/Psi candidate
Expand Down
14 changes: 5 additions & 9 deletions PWGHF/D2H/TableProducer/dataCreatorJpsiHadReduced.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@
#include <Framework/WorkflowSpec.h>
#include <Framework/runDataProcessing.h>
#include <ReconstructionDataFormats/DCA.h>
#include <ReconstructionDataFormats/Track.h>

#include <TH1.h>
#include <TH2.h>
Expand Down Expand Up @@ -106,13 +105,13 @@ enum WrongCollisionType : uint8_t {
SplitCollision,
};

std::map<int, hf_decay::hf_cand_beauty::DecayChannelToJpsiMain> partlyRecoDecayMapMuMu = {
std::map<int, hf_decay::hf_cand_beauty::DecayChannelToJpsiMain> 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<int, hf_decay::hf_cand_beauty::DecayChannelToJpsiMain> partlyRecoDecayMapEE = {
std::map<int, hf_decay::hf_cand_beauty::DecayChannelToJpsiMain> 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},
Expand Down Expand Up @@ -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;
}
}
Expand Down Expand Up @@ -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;
}
}
Expand Down Expand Up @@ -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;
}
}
Expand Down Expand Up @@ -1115,7 +1114,6 @@ struct HfDataCreatorJpsiHadReduced {
}
registry.fill(HIST("hFitCandidatesBPlus"), SVFitting::FitOk);

o2::track::TrackParCov trackParCovBPlus{};
std::array<float, 3> pVecBPlus{}, pVec0{}, pVec1{}, pVec2{};

auto secondaryVertexBPlus = df3.getPCACandidate();
Expand All @@ -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;
Expand Down
21 changes: 10 additions & 11 deletions PWGHF/D2H/Tasks/taskB0ToJpsiK0StarReduced.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand All @@ -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,
Expand Down Expand Up @@ -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(),
Expand Down
2 changes: 2 additions & 0 deletions PWGHF/D2H/Tasks/taskBplusToJpsiKReduced.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -450,6 +451,7 @@ struct HfTaskBplusToJpsiKReduced {
HfHelper::yBplus(candidate),
candidate.cpa(),
candidate.cpaXY(),
candidate.cpaJpsi(),
candidate.chi2PCA(),
candidate.decayLength(),
candidate.decayLengthXY(),
Expand Down
2 changes: 2 additions & 0 deletions PWGHF/D2H/Tasks/taskBsToJpsiPhiReduced.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -486,6 +487,7 @@ struct HfTaskBsToJpsiPhiReduced {
HfHelper::yBs(candidate),
candidate.cpa(),
candidate.cpaXY(),
candidate.cpaJpsi(),
candidate.chi2PCA(),
candidate.decayLength(),
candidate.decayLengthXY(),
Expand Down
Loading
Loading