Skip to content

Commit 93fcf65

Browse files
fgrosaalibuild
andauthored
[PWGHF] Add cpaJPsi and small fixes in B2JPsi code (#17987)
Co-authored-by: ALICE Action Bot <alibuild@cern.ch>
1 parent 4ca72cf commit 93fcf65

6 files changed

Lines changed: 55 additions & 24 deletions

PWGHF/D2H/TableProducer/candidateCreatorBToJpsiReduced.cxx

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
#include <Framework/WorkflowSpec.h>
3737
#include <Framework/runDataProcessing.h>
3838
#include <ReconstructionDataFormats/DCA.h>
39+
#include <ReconstructionDataFormats/TrackParametrization.h>
3940
#include <ReconstructionDataFormats/TrackParametrizationWithError.h>
4041

4142
#include <TH1.h>
@@ -45,6 +46,7 @@
4546
#include <cstdint>
4647
#include <memory>
4748
#include <stdexcept>
49+
#include <utility> // std::move
4850

4951
using namespace o2;
5052
using namespace o2::aod;
@@ -176,10 +178,26 @@ struct HfCandidateCreatorBToJpsiReduced {
176178
}
177179

178180
for (const auto& candJpsi : candsJpsiThisColl) {
179-
o2::track::TrackParametrizationWithError<float> trackPosParCov(
180-
candJpsi.xDauPos(), candJpsi.alphaDauPos(), {candJpsi.yDauPos(), candJpsi.zDauPos(), candJpsi.snpDauPos(), candJpsi.tglDauPos(), candJpsi.signed1PtDauPos()}, 1 /*Charge*/, 1 /*Muon*/);
181-
o2::track::TrackParametrizationWithError<float> trackNegParCov(
182-
candJpsi.xDauNeg(), candJpsi.alphaDauNeg(), {candJpsi.yDauNeg(), candJpsi.zDauNeg(), candJpsi.snpDauNeg(), candJpsi.tglDauNeg(), candJpsi.signed1PtDauNeg()}, -1 /*Charge*/, 1 /*Muon*/);
181+
182+
std::array<float, o2::track::kNParams> parsTrackPos = {candJpsi.yDauPos(), candJpsi.zDauPos(), candJpsi.snpDauPos(), candJpsi.tglDauPos(), candJpsi.signed1PtDauPos()};
183+
std::array<float, o2::track::kNParams> parsTrackNeg = {candJpsi.yDauNeg(), candJpsi.zDauNeg(), candJpsi.snpDauNeg(), candJpsi.tglDauNeg(), candJpsi.signed1PtDauNeg()};
184+
185+
std::array<float, o2::track::kCovMatSize> covTrackPos = {candJpsi.cYYDauPos(), candJpsi.cZYDauPos(), candJpsi.cZZDauPos(),
186+
candJpsi.cSnpYDauPos(), candJpsi.cSnpZDauPos(),
187+
candJpsi.cSnpSnpDauPos(), candJpsi.cTglYDauPos(), candJpsi.cTglZDauPos(),
188+
candJpsi.cTglSnpDauPos(), candJpsi.cTglTglDauPos(),
189+
candJpsi.c1PtYDauPos(), candJpsi.c1PtZDauPos(), candJpsi.c1PtSnpDauPos(),
190+
candJpsi.c1PtTglDauPos(), candJpsi.c1Pt21Pt2DauPos()};
191+
192+
std::array<float, o2::track::kCovMatSize> covTrackNeg = {candJpsi.cYYDauNeg(), candJpsi.cZYDauNeg(), candJpsi.cZZDauNeg(),
193+
candJpsi.cSnpYDauNeg(), candJpsi.cSnpZDauNeg(),
194+
candJpsi.cSnpSnpDauNeg(), candJpsi.cTglYDauNeg(), candJpsi.cTglZDauNeg(),
195+
candJpsi.cTglSnpDauNeg(), candJpsi.cTglTglDauNeg(),
196+
candJpsi.c1PtYDauNeg(), candJpsi.c1PtZDauNeg(), candJpsi.c1PtSnpDauNeg(),
197+
candJpsi.c1PtTglDauNeg(), candJpsi.c1Pt21Pt2DauNeg()};
198+
199+
o2::track::TrackParametrizationWithError<float> trackPosParCov(candJpsi.xDauPos(), candJpsi.alphaDauPos(), std::move(parsTrackPos), std::move(covTrackPos));
200+
o2::track::TrackParametrizationWithError<float> trackNegParCov(candJpsi.xDauNeg(), candJpsi.alphaDauNeg(), std::move(parsTrackNeg), std::move(covTrackNeg));
183201

184202
// ---------------------------------
185203
// reconstruct J/Psi candidate

PWGHF/D2H/TableProducer/dataCreatorJpsiHadReduced.cxx

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@
6060
#include <Framework/WorkflowSpec.h>
6161
#include <Framework/runDataProcessing.h>
6262
#include <ReconstructionDataFormats/DCA.h>
63-
#include <ReconstructionDataFormats/Track.h>
6463

6564
#include <TH1.h>
6665
#include <TH2.h>
@@ -106,13 +105,13 @@ enum WrongCollisionType : uint8_t {
106105
SplitCollision,
107106
};
108107

109-
std::map<int, hf_decay::hf_cand_beauty::DecayChannelToJpsiMain> partlyRecoDecayMapMuMu = {
108+
std::map<int, hf_decay::hf_cand_beauty::DecayChannelToJpsiMain> const partlyRecoDecayMapMuMu = {
110109
{Pdg::kB0, hf_decay::hf_cand_beauty::DecayChannelToJpsiMain::B0ToJpsiXToMuMuX},
111110
{Pdg::kBPlus, hf_decay::hf_cand_beauty::DecayChannelToJpsiMain::BplusToJpsiXToMuMuX},
112111
{Pdg::kBS, hf_decay::hf_cand_beauty::DecayChannelToJpsiMain::BsToJpsiXToMuMuX},
113112
{Pdg::kLambdaB0, hf_decay::hf_cand_beauty::DecayChannelToJpsiMain::LbToJpsiXToMuMuX}};
114113

115-
std::map<int, hf_decay::hf_cand_beauty::DecayChannelToJpsiMain> partlyRecoDecayMapEE = {
114+
std::map<int, hf_decay::hf_cand_beauty::DecayChannelToJpsiMain> const partlyRecoDecayMapEE = {
116115
{Pdg::kB0, hf_decay::hf_cand_beauty::DecayChannelToJpsiMain::B0ToJpsiXToEEX},
117116
{Pdg::kBPlus, hf_decay::hf_cand_beauty::DecayChannelToJpsiMain::BplusToJpsiXToEEX},
118117
{Pdg::kBS, hf_decay::hf_cand_beauty::DecayChannelToJpsiMain::BsToJpsiXToEEX},
@@ -595,7 +594,7 @@ struct HfDataCreatorJpsiHadReduced {
595594
// check that the other prongs come from the same b-hadron
596595
int const index2Mother = RecoDecay::getMother(particlesMc, vecDaughtersB[2].mcParticle(), bHadronMotherHypo, true);
597596
if (indexRecB > -1 && indexRecJPsi > -1 && index2Mother > -1 && index2Mother == indexRecB) {
598-
flag = jpsiDau == kMuonMinus ? signB * partlyRecoDecayMapMuMu[std::abs(bHadronMotherHypo)] : signB * partlyRecoDecayMapEE[std::abs(bHadronMotherHypo)];
597+
flag = jpsiDau == kMuonMinus ? signB * partlyRecoDecayMapMuMu.at(std::abs(bHadronMotherHypo)) : signB * partlyRecoDecayMapEE.at(std::abs(bHadronMotherHypo));
599598
break;
600599
}
601600
}
@@ -695,7 +694,7 @@ struct HfDataCreatorJpsiHadReduced {
695694
int const index2Mother = RecoDecay::getMother(particlesMc, vecDaughtersB[2].mcParticle(), bHadronMotherHypo, true);
696695
int const index3Mother = RecoDecay::getMother(particlesMc, vecDaughtersB[3].mcParticle(), bHadronMotherHypo, true);
697696
if (indexRecB > -1 && indexRecJPsi > -1 && index2Mother > -1 && index3Mother > -1 && index2Mother == indexRecB && index3Mother == indexRecB) {
698-
flag = jpsiDau == kMuonMinus ? signB * partlyRecoDecayMapMuMu[std::abs(bHadronMotherHypo)] : signB * partlyRecoDecayMapEE[std::abs(bHadronMotherHypo)];
697+
flag = jpsiDau == kMuonMinus ? signB * partlyRecoDecayMapMuMu.at(std::abs(bHadronMotherHypo)) : signB * partlyRecoDecayMapEE.at(std::abs(bHadronMotherHypo));
699698
break;
700699
}
701700
}
@@ -796,7 +795,7 @@ struct HfDataCreatorJpsiHadReduced {
796795
int const index2Mother = RecoDecay::getMother(particlesMc, vecDaughtersB[2].mcParticle(), bHadronMotherHypo, true);
797796
int const index3Mother = RecoDecay::getMother(particlesMc, vecDaughtersB[3].mcParticle(), bHadronMotherHypo, true);
798797
if (indexRecB > -1 && indexRecJPsi > -1 && index2Mother > -1 && index3Mother > -1 && index2Mother == indexRecB && index3Mother == indexRecB) {
799-
flag = jpsiDau == kMuonMinus ? signB * partlyRecoDecayMapMuMu[std::abs(bHadronMotherHypo)] : signB * partlyRecoDecayMapEE[std::abs(bHadronMotherHypo)];
798+
flag = jpsiDau == kMuonMinus ? signB * partlyRecoDecayMapMuMu.at(std::abs(bHadronMotherHypo)) : signB * partlyRecoDecayMapEE.at(std::abs(bHadronMotherHypo));
800799
break;
801800
}
802801
}
@@ -1115,7 +1114,6 @@ struct HfDataCreatorJpsiHadReduced {
11151114
}
11161115
registry.fill(HIST("hFitCandidatesBPlus"), SVFitting::FitOk);
11171116

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

11211119
auto secondaryVertexBPlus = df3.getPCACandidate();
@@ -1124,8 +1122,6 @@ struct HfDataCreatorJpsiHadReduced {
11241122
df3.getTrack(2).getPxPyPzGlo(pVec2);
11251123
pVecBPlus = RecoDecay::pVec(pVec0, pVec1, pVec2);
11261124
pVecJpsi = RecoDecay::pVec(pVec0, pVec1);
1127-
trackParCovBPlus = df3.createParentTrackParCov();
1128-
trackParCovBPlus.setAbsCharge(0); // to be sure
11291125

11301126
if (!isBSelected(pVecBPlus, secondaryVertexBPlus, collision)) {
11311127
continue;

PWGHF/D2H/Tasks/taskB0ToJpsiK0StarReduced.cxx

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ DECLARE_SOA_COLUMN(TpcChi2NClLfTrack1, tpcChi2NClLfTrack1, float);
9191
DECLARE_SOA_COLUMN(AbsEtaLfTrack1, absEtaLfTrack1, float); //! |eta|
9292
DECLARE_SOA_COLUMN(MJpsi, mJpsi, float); //! Invariant mass of Jpsi daughter candidates (GeV/c)
9393
DECLARE_SOA_COLUMN(MK0Star, mK0Star, float); //! Invariant mass of K*0 daughter candidates (GeV/c)
94-
DECLARE_SOA_COLUMN(M, m, float); //! Invariant mass of candidate (GeV/c2)
94+
DECLARE_SOA_COLUMN(M, m, float); //! Invariant mass of candidate particle (GeV/c2)
9595
DECLARE_SOA_COLUMN(Pt, pt, float); //! Transverse momentum of candidate (GeV/c)
9696
DECLARE_SOA_COLUMN(PtGen, ptGen, float); //! Transverse momentum of candidate (GeV/c)
9797
DECLARE_SOA_COLUMN(P, p, float); //! Momentum of candidate (GeV/c)
@@ -127,7 +127,7 @@ DECLARE_SOA_COLUMN(DecayLength, decayLength, float);
127127
DECLARE_SOA_COLUMN(DecayLengthXY, decayLengthXY, float); //! Transverse decay length of candidate (cm)
128128
DECLARE_SOA_COLUMN(DecayLengthNormalised, decayLengthNormalised, float); //! Normalised decay length of candidate
129129
DECLARE_SOA_COLUMN(DecayLengthXYNormalised, decayLengthXYNormalised, float); //! Normalised transverse decay length of candidate
130-
DECLARE_SOA_COLUMN(CtXY, ctXY, float); //! Pseudo-proper decay length of candidate
130+
DECLARE_SOA_COLUMN(CtXY, ctXY, float); //! Pseudo-proper decay length of candidate particle
131131
DECLARE_SOA_COLUMN(ImpactParameterProduct, impactParameterProduct, float); //! Impact parameter product of B daughters
132132
DECLARE_SOA_COLUMN(ImpactParameterProductJpsi, impactParameterProductJpsi, float); //! Impact parameter product of Jpsi daughters
133133
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
154154
hf_cand_b0tojpsik0star_lite::Y,
155155
hf_cand_b0tojpsik0star_lite::Cpa,
156156
hf_cand_b0tojpsik0star_lite::CpaXY,
157+
hf_cand_b0tojpsik0star_lite::CpaJpsi,
157158
hf_cand::Chi2PCA,
158159
hf_cand_b0tojpsik0star_lite::DecayLength,
159160
hf_cand_b0tojpsik0star_lite::DecayLengthXY,
@@ -565,37 +566,35 @@ struct HfTaskB0ToJpsiK0StarReduced {
565566
}
566567

567568
auto fillTable = [&](bool isSelKPi) {
568-
auto ctXY = isSelKPi ? candidate.ctXY(std::array{o2::constants::physics::MassMuon, o2::constants::physics::MassMuon, o2::constants::physics::MassKPlus, o2::constants::physics::MassPiPlus})
569-
: candidate.ctXY(std::array{o2::constants::physics::MassMuon, o2::constants::physics::MassMuon, o2::constants::physics::MassPiPlus, o2::constants::physics::MassKPlus});
570-
auto mlScoreSig = isSelKPi ? mlScoreSigKPi : mlScoreSigPiK;
571-
auto invMassB0 = isSelKPi ? invMassB0KPi : invMassB0PiK;
572-
auto invMassK0Star = isSelKPi ? invMassK0StarKPi : invMassK0StarPiK;
569+
auto ctXY = candidate.ctXY(std::array{o2::constants::physics::MassMuon, o2::constants::physics::MassMuon, o2::constants::physics::MassKPlus, o2::constants::physics::MassPiPlus});
570+
auto ctXYBar = candidate.ctXY(std::array{o2::constants::physics::MassMuon, o2::constants::physics::MassMuon, o2::constants::physics::MassPiPlus, o2::constants::physics::MassKPlus});
573571
hfRedCandB0Lite(
574572
// B0 - meson features
575-
invMassB0,
573+
isSelKPi ? invMassB0KPi : invMassB0PiK,
576574
ptCandB0,
577575
candidate.eta(),
578576
candidate.phi(),
579577
HfHelper::yB0(candidate),
580578
candidate.cpa(),
581579
candidate.cpaXY(),
580+
candidate.cpaJpsi(),
582581
candidate.chi2PCA(),
583582
candidate.decayLength(),
584583
candidate.decayLengthXY(),
585584
candidate.decayLengthNormalised(),
586585
candidate.decayLengthXYNormalised(),
587-
ctXY,
586+
isSelKPi ? ctXY : ctXYBar,
588587
candidate.impactParameterProduct(),
589588
candidate.impactParameterProductJpsi(),
590589
candidate.impactParameterProductK0Star(),
591590
candidate.maxNormalisedDeltaIP(),
592-
mlScoreSig,
591+
isSelKPi ? mlScoreSigKPi : mlScoreSigPiK,
593592
isSelKPi ? statusB0KPi : -1,
594593
isSelKPi ? -1 : statusB0PiK,
595594
// J/Psi features
596595
invMassJpsi,
597596
ptJpsi,
598-
invMassK0Star,
597+
isSelKPi ? invMassK0StarKPi : invMassK0StarPiK,
599598
candidate.impactParameter0(),
600599
candidate.impactParameter1(),
601600
candidate.impactParameter2(),

PWGHF/D2H/Tasks/taskBplusToJpsiKReduced.cxx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ DECLARE_SOA_TABLE(HfRedCandBpLites, "AOD", "HFREDCANDBPLITE", //! Table with som
134134
hf_cand_bplustojpsik_lite::Y,
135135
hf_cand_bplustojpsik_lite::Cpa,
136136
hf_cand_bplustojpsik_lite::CpaXY,
137+
hf_cand_bplustojpsik_lite::CpaJpsi,
137138
hf_cand::Chi2PCA,
138139
hf_cand_bplustojpsik_lite::DecayLength,
139140
hf_cand_bplustojpsik_lite::DecayLengthXY,
@@ -450,6 +451,7 @@ struct HfTaskBplusToJpsiKReduced {
450451
HfHelper::yBplus(candidate),
451452
candidate.cpa(),
452453
candidate.cpaXY(),
454+
candidate.cpaJpsi(),
453455
candidate.chi2PCA(),
454456
candidate.decayLength(),
455457
candidate.decayLengthXY(),

PWGHF/D2H/Tasks/taskBsToJpsiPhiReduced.cxx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,7 @@ DECLARE_SOA_TABLE(HfRedCandBsLites, "AOD", "HFREDCANDBSLITE", //! Table with som
146146
hf_cand_bstojpsiphi_lite::Y,
147147
hf_cand_bstojpsiphi_lite::Cpa,
148148
hf_cand_bstojpsiphi_lite::CpaXY,
149+
hf_cand_bstojpsiphi_lite::CpaJpsi,
149150
hf_cand::Chi2PCA,
150151
hf_cand_bstojpsiphi_lite::DecayLength,
151152
hf_cand_bstojpsiphi_lite::DecayLengthXY,
@@ -486,6 +487,7 @@ struct HfTaskBsToJpsiPhiReduced {
486487
HfHelper::yBs(candidate),
487488
candidate.cpa(),
488489
candidate.cpaXY(),
490+
candidate.cpaJpsi(),
489491
candidate.chi2PCA(),
490492
candidate.decayLength(),
491493
candidate.decayLengthXY(),

0 commit comments

Comments
 (0)