Skip to content

Commit 478f338

Browse files
committed
Add cpaJPsi and small fixes in B2JPsi code
1 parent 9fe4e71 commit 478f338

6 files changed

Lines changed: 58 additions & 18 deletions

PWGHF/D2H/TableProducer/candidateCreatorBToJpsiReduced.cxx

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -176,10 +176,26 @@ struct HfCandidateCreatorBToJpsiReduced {
176176
}
177177

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

184200
// ---------------------------------
185201
// reconstruct J/Psi candidate

PWGHF/D2H/TableProducer/dataCreatorJpsiHadReduced.cxx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1115,7 +1115,6 @@ struct HfDataCreatorJpsiHadReduced {
11151115
}
11161116
registry.fill(HIST("hFitCandidatesBPlus"), SVFitting::FitOk);
11171117

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

11211120
auto secondaryVertexBPlus = df3.getPCACandidate();
@@ -1124,8 +1123,6 @@ struct HfDataCreatorJpsiHadReduced {
11241123
df3.getTrack(2).getPxPyPzGlo(pVec2);
11251124
pVecBPlus = RecoDecay::pVec(pVec0, pVec1, pVec2);
11261125
pVecJpsi = RecoDecay::pVec(pVec0, pVec1);
1127-
trackParCovBPlus = df3.createParentTrackParCov();
1128-
trackParCovBPlus.setAbsCharge(0); // to be sure
11291126

11301127
if (!isBSelected(pVecBPlus, secondaryVertexBPlus, collision)) {
11311128
continue;

PWGHF/D2H/Tasks/taskB0ToJpsiK0StarReduced.cxx

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,9 @@ 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(MK0StarBar, mK0StarBar, float); //! Invariant mass of K*0bar daughter candidates (GeV/c)
95+
DECLARE_SOA_COLUMN(M, m, float); //! Invariant mass of candidate particle (GeV/c2)
96+
DECLARE_SOA_COLUMN(MBar, mBar, float); //! Invariant mass of candidate antiparticle (GeV/c2)
9597
DECLARE_SOA_COLUMN(Pt, pt, float); //! Transverse momentum of candidate (GeV/c)
9698
DECLARE_SOA_COLUMN(PtGen, ptGen, float); //! Transverse momentum of candidate (GeV/c)
9799
DECLARE_SOA_COLUMN(P, p, float); //! Momentum of candidate (GeV/c)
@@ -127,7 +129,8 @@ DECLARE_SOA_COLUMN(DecayLength, decayLength, float);
127129
DECLARE_SOA_COLUMN(DecayLengthXY, decayLengthXY, float); //! Transverse decay length of candidate (cm)
128130
DECLARE_SOA_COLUMN(DecayLengthNormalised, decayLengthNormalised, float); //! Normalised decay length of candidate
129131
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
132+
DECLARE_SOA_COLUMN(CtXY, ctXY, float); //! Pseudo-proper decay length of candidate particle
133+
DECLARE_SOA_COLUMN(CtXYBar, ctXYBar, float); //! Pseudo-proper decay length of candidate antiparticle
131134
DECLARE_SOA_COLUMN(ImpactParameterProduct, impactParameterProduct, float); //! Impact parameter product of B daughters
132135
DECLARE_SOA_COLUMN(ImpactParameterProductJpsi, impactParameterProductJpsi, float); //! Impact parameter product of Jpsi daughters
133136
DECLARE_SOA_COLUMN(ImpactParameterProductK0Star, impactParameterProductK0Star, float); //! Impact parameter product of K*0 daughters
@@ -148,18 +151,21 @@ DECLARE_SOA_COLUMN(FlagWrongCollision, flagWrongCollision, int8_t);
148151

149152
DECLARE_SOA_TABLE(HfRedCandB0Lites, "AOD", "HFREDCANDB0LITE", //! Table with some B0 properties
150153
hf_cand_b0tojpsik0star_lite::M,
154+
hf_cand_b0tojpsik0star_lite::MBar,
151155
hf_cand_b0tojpsik0star_lite::Pt,
152156
hf_cand_b0tojpsik0star_lite::Eta,
153157
hf_cand_b0tojpsik0star_lite::Phi,
154158
hf_cand_b0tojpsik0star_lite::Y,
155159
hf_cand_b0tojpsik0star_lite::Cpa,
156160
hf_cand_b0tojpsik0star_lite::CpaXY,
161+
hf_cand_b0tojpsik0star_lite::CpaJpsi,
157162
hf_cand::Chi2PCA,
158163
hf_cand_b0tojpsik0star_lite::DecayLength,
159164
hf_cand_b0tojpsik0star_lite::DecayLengthXY,
160165
hf_cand_b0tojpsik0star_lite::DecayLengthNormalised,
161166
hf_cand_b0tojpsik0star_lite::DecayLengthXYNormalised,
162167
hf_cand_b0tojpsik0star_lite::CtXY,
168+
hf_cand_b0tojpsik0star_lite::CtXYBar,
163169
hf_cand_b0tojpsik0star_lite::ImpactParameterProduct,
164170
hf_cand_b0tojpsik0star_lite::ImpactParameterProductJpsi,
165171
hf_cand_b0tojpsik0star_lite::ImpactParameterProductK0Star,
@@ -171,6 +177,7 @@ DECLARE_SOA_TABLE(HfRedCandB0Lites, "AOD", "HFREDCANDB0LITE", //! Table with som
171177
hf_cand_b0tojpsik0star_lite::MJpsi,
172178
hf_cand_b0tojpsik0star_lite::PtJpsi,
173179
hf_cand_b0tojpsik0star_lite::MK0Star,
180+
hf_cand_b0tojpsik0star_lite::MK0StarBar,
174181
hf_cand_b0tojpsik0star_lite::ImpactParameterJpsiDauPos,
175182
hf_cand_b0tojpsik0star_lite::ImpactParameterJpsiDauNeg,
176183
hf_cand_b0tojpsik0star_lite::ImpactParameterLfTrack0,
@@ -565,37 +572,39 @@ struct HfTaskB0ToJpsiK0StarReduced {
565572
}
566573

567574
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;
575+
auto ctXY = candidate.ctXY(std::array{o2::constants::physics::MassMuon, o2::constants::physics::MassMuon, o2::constants::physics::MassKPlus, o2::constants::physics::MassPiPlus});
576+
auto ctXYBar = candidate.ctXY(std::array{o2::constants::physics::MassMuon, o2::constants::physics::MassMuon, o2::constants::physics::MassPiPlus, o2::constants::physics::MassKPlus});
577+
auto mlScoreSig = TESTBIT(isSelKPi, SelectionStep::RecoPID) ? mlScoreSigKPi : mlScoreSigPiK;
573578
hfRedCandB0Lite(
574579
// B0 - meson features
575-
invMassB0,
580+
invMassB0KPi,
581+
invMassB0PiK,
576582
ptCandB0,
577583
candidate.eta(),
578584
candidate.phi(),
579585
HfHelper::yB0(candidate),
580586
candidate.cpa(),
581587
candidate.cpaXY(),
588+
candidate.cpaJpsi(),
582589
candidate.chi2PCA(),
583590
candidate.decayLength(),
584591
candidate.decayLengthXY(),
585592
candidate.decayLengthNormalised(),
586593
candidate.decayLengthXYNormalised(),
587594
ctXY,
595+
ctXYBar,
588596
candidate.impactParameterProduct(),
589597
candidate.impactParameterProductJpsi(),
590598
candidate.impactParameterProductK0Star(),
591599
candidate.maxNormalisedDeltaIP(),
592600
mlScoreSig,
593-
isSelKPi ? statusB0KPi : -1,
594-
isSelKPi ? -1 : statusB0PiK,
601+
statusB0KPi,
602+
statusB0PiK,
595603
// J/Psi features
596604
invMassJpsi,
597605
ptJpsi,
598-
invMassK0Star,
606+
invMassK0StarKPi,
607+
invMassK0StarPiK,
599608
candidate.impactParameter0(),
600609
candidate.impactParameter1(),
601610
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,
@@ -487,6 +488,7 @@ struct HfTaskBsToJpsiPhiReduced {
487488
candidate.cpa(),
488489
candidate.cpaXY(),
489490
candidate.chi2PCA(),
491+
candidate.cpaJpsi(),
490492
candidate.decayLength(),
491493
candidate.decayLengthXY(),
492494
candidate.decayLengthNormalised(),

0 commit comments

Comments
 (0)