Skip to content

Commit f91985f

Browse files
committed
Fix B mass determination
1 parent 0a9a63b commit f91985f

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

PWGHF/D2H/TableProducer/dataCreatorJpsiHadReduced.cxx

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -803,8 +803,7 @@ struct HfDataCreatorJpsiHadReduced {
803803

804804
// ---------------------------------
805805
// reconstruct J/Psi candidate secondary vertex
806-
o2::track::TrackParCov const trackParCovJpsi{}; // FIXME: unused
807-
std::array<float, 3> const pVecJpsi{}; // FIXME: unused
806+
std::array<float, 3> pVecJpsi{};
808807
registry.fill(HIST("hFitCandidatesJpsi"), SVFitting::BeforeFit);
809808
try {
810809
if (df2.process(trackPosParCov, trackNegParCov) == 0) {
@@ -858,12 +857,6 @@ struct HfDataCreatorJpsiHadReduced {
858857

859858
if constexpr (DecChannel == DecayChannel::BplusToJpsiK) {
860859
registry.fill(HIST("hPtKaon"), trackParCovBach.getPt());
861-
// compute invariant mass square and apply selection
862-
invMass2JpsiHad = RecoDecay::m2(std::array{pVecJpsi, pVecBach}, std::array{MassJPsi, MassKPlus});
863-
if ((invMass2JpsiHad < invMass2JpsiHadMin) || (invMass2JpsiHad > invMass2JpsiHadMax)) {
864-
continue;
865-
}
866-
registry.fill(HIST("hMassJpsiKaon"), std::sqrt(invMass2JpsiHad));
867860

868861
registry.fill(HIST("hFitCandidatesBPlus"), SVFitting::BeforeFit);
869862
try {
@@ -885,12 +878,19 @@ struct HfDataCreatorJpsiHadReduced {
885878
df3.getTrack(1).getPxPyPzGlo(pVec1);
886879
df3.getTrack(2).getPxPyPzGlo(pVec2);
887880
pVecBPlus = RecoDecay::pVec(pVec0, pVec1, pVec2);
881+
pVecJpsi = RecoDecay::pVec(pVec0, pVec1);
888882
trackParCovBPlus = df3.createParentTrackParCov();
889883
trackParCovBPlus.setAbsCharge(0); // to be sure
884+
registry.fill(HIST("hMassJpsiKaon"), std::sqrt(invMass2JpsiHad));
890885

891886
if (!isBSelected(pVecBPlus, secondaryVertexBPlus, collision)) {
892887
continue;
893888
}
889+
// compute invariant mass square and apply selection
890+
invMass2JpsiHad = RecoDecay::m2(std::array{pVecJpsi, pVecBach}, std::array{MassJPsi, MassKPlus});
891+
if ((invMass2JpsiHad < invMass2JpsiHadMin) || (invMass2JpsiHad > invMass2JpsiHadMax)) {
892+
continue;
893+
}
894894

895895
// fill Kaon tracks table
896896
// if information on track already stored, go to next track
@@ -973,6 +973,7 @@ struct HfDataCreatorJpsiHadReduced {
973973
df4.getTrack(2).getPxPyPzGlo(pVec2);
974974
df4.getTrack(3).getPxPyPzGlo(pVec3);
975975
pVecBS = RecoDecay::pVec(pVec0, pVec1, pVec2, pVec3);
976+
pVecJpsi = RecoDecay::pVec(pVec0, pVec1);
976977
pVecPhi = RecoDecay::pVec(pVec2, pVec3);
977978
trackParCovBS = df4.createParentTrackParCov();
978979
trackParCovBS.setAbsCharge(0); // to be sure

0 commit comments

Comments
 (0)