@@ -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
890884
891885 if (!isBSelected (pVecBPlus, secondaryVertexBPlus, collision)) {
892886 continue ;
893887 }
888+ // compute invariant mass square and apply selection
889+ invMass2JpsiHad = RecoDecay::m2 (std::array{pVecJpsi, pVecBach}, std::array{MassJPsi, MassKPlus});
890+ if ((invMass2JpsiHad < invMass2JpsiHadMin) || (invMass2JpsiHad > invMass2JpsiHadMax)) {
891+ continue ;
892+ }
893+ registry.fill (HIST (" hMassJpsiKaon" ), std::sqrt (invMass2JpsiHad));
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