diff --git a/DataFormats/Reconstruction/include/ReconstructionDataFormats/TrackLTIntegral.h b/DataFormats/Reconstruction/include/ReconstructionDataFormats/TrackLTIntegral.h index 6cf9ceda8e195..e799804805972 100644 --- a/DataFormats/Reconstruction/include/ReconstructionDataFormats/TrackLTIntegral.h +++ b/DataFormats/Reconstruction/include/ReconstructionDataFormats/TrackLTIntegral.h @@ -63,7 +63,7 @@ class TrackLTIntegral } } - GPUd() void addStep(float dL, float p2Inv); + GPUd() void addStep(float dL, float q2p2); GPUd() void addX2X0(float d) { mX2X0 += d; } GPUd() void addXRho(float d) { mXRho += d; } diff --git a/DataFormats/Reconstruction/include/ReconstructionDataFormats/TrackParametrization.h b/DataFormats/Reconstruction/include/ReconstructionDataFormats/TrackParametrization.h index a51ec3b7010a7..bfd56eb8f024f 100644 --- a/DataFormats/Reconstruction/include/ReconstructionDataFormats/TrackParametrization.h +++ b/DataFormats/Reconstruction/include/ReconstructionDataFormats/TrackParametrization.h @@ -191,6 +191,7 @@ class TrackParametrization GPUd() value_t getPhi() const; GPUd() value_t getPhiPos() const; + GPUd() value_t getQ2P2() const; GPUd() value_t getPtInv() const; GPUd() value_t getP2Inv() const; GPUd() value_t getP2() const; @@ -555,6 +556,18 @@ GPUdi() auto TrackParametrization::getPhiPos() const -> value_t return phi; } +//____________________________________________________________ +template +GPUdi() auto TrackParametrization::getQ2P2() const -> value_t +{ + // return the (q/p)^2 + value_t q2pt2 = mP[kQ2Pt] * mP[kQ2Pt]; + if (q2pt2 < MinPTInv * MinPTInv) { + q2pt2 = MinPTInv * MinPTInv; + } + return q2pt2 / (1.f + getTgl() * getTgl()); +} + //____________________________________________________________ template GPUdi() auto TrackParametrization::getPtInv() const -> value_t diff --git a/DataFormats/Reconstruction/src/TrackLTIntegral.cxx b/DataFormats/Reconstruction/src/TrackLTIntegral.cxx index 3efddff00f512..426c3da04726c 100644 --- a/DataFormats/Reconstruction/src/TrackLTIntegral.cxx +++ b/DataFormats/Reconstruction/src/TrackLTIntegral.cxx @@ -39,9 +39,9 @@ GPUd() void TrackLTIntegral::print() const } //_____________________________________________________ -GPUd() void TrackLTIntegral::addStep(float dL, float p2Inv) +GPUd() void TrackLTIntegral::addStep(float dL, float q2p2) { - ///< add step in cm to integrals + ///< add step in cm to integrals, q2p2 is (q/p)^2. mL += dL; if (isTimeNotNeeded()) { return; @@ -49,7 +49,7 @@ GPUd() void TrackLTIntegral::addStep(float dL, float p2Inv) const float dTns = dL * 1000.f / o2::constants::physics::LightSpeedCm2NS; // time change in ps for beta = 1 particle for (int id = 0; id < getNTOFs(); id++) { const float m2z = track::PID::getMass2Z(id); - const float betaInv = math_utils::sqrt(1.f + m2z * m2z * p2Inv); + const float betaInv = math_utils::sqrt(1.f + m2z * m2z * q2p2); mT[id] += dTns * betaInv; } } diff --git a/DataFormats/Reconstruction/test/testLTOFIntegration.cxx b/DataFormats/Reconstruction/test/testLTOFIntegration.cxx index bb65c60d08d18..f737b1df53666 100644 --- a/DataFormats/Reconstruction/test/testLTOFIntegration.cxx +++ b/DataFormats/Reconstruction/test/testLTOFIntegration.cxx @@ -33,8 +33,8 @@ BOOST_AUTO_TEST_CASE(TrackLTIntegral) const int nStep = 100; const float dx2x0 = 0.01f; for (int i = 0; i < nStep; i++) { - lt.addStep(1., trc.getP2Inv()); - lt1.addStep(1., trc1.getP2Inv()); + lt.addStep(1., trc.getQ2P2()); + lt1.addStep(1., trc1.getQ2P2()); lt1.addX2X0(dx2x0); } trc.printParam(); diff --git a/Detectors/Base/src/Propagator.cxx b/Detectors/Base/src/Propagator.cxx index c7c7b461034e5..754c0c14e6f60 100644 --- a/Detectors/Base/src/Propagator.cxx +++ b/Detectors/Base/src/Propagator.cxx @@ -189,14 +189,14 @@ GPUd() bool PropagatorImpl::PropagateToXBxByBz(TrackParCov_t& track, va res = false; } if (tofInfo) { - tofInfo->addStep(mb.length, track.getP2Inv()); // fill L,ToF info using already calculated step length + tofInfo->addStep(mb.length, track.getQ2P2()); // fill L,ToF info using already calculated step length tofInfo->addX2X0(mb.meanX2X0); tofInfo->addXRho(mb.getXRho(signCorr)); } } else if (tofInfo) { // if tofInfo filling was requested w/o material correction, we need to calculate the step lenght auto xyz1 = track.getXYZGlo(); math_utils::Vector3D stepV(xyz1.X() - xyz0.X(), xyz1.Y() - xyz0.Y(), xyz1.Z() - xyz0.Z()); - tofInfo->addStep(stepV.R(), track.getP2Inv()); + tofInfo->addStep(stepV.R(), track.getQ2P2()); } return res; }; @@ -258,14 +258,14 @@ GPUd() bool PropagatorImpl::PropagateToXBxByBz(TrackPar_t& track, value res = false; } if (tofInfo) { - tofInfo->addStep(mb.length, track.getP2Inv()); // fill L,ToF info using already calculated step length + tofInfo->addStep(mb.length, track.getQ2P2()); // fill L,ToF info using already calculated step length tofInfo->addX2X0(mb.meanX2X0); tofInfo->addXRho(mb.getXRho(signCorr)); } } else if (tofInfo) { // if tofInfo filling was requested w/o material correction, we need to calculate the step lenght auto xyz1 = track.getXYZGlo(); math_utils::Vector3D stepV(xyz1.X() - xyz0.X(), xyz1.Y() - xyz0.Y(), xyz1.Z() - xyz0.Z()); - tofInfo->addStep(stepV.R(), track.getP2Inv()); + tofInfo->addStep(stepV.R(), track.getQ2P2()); } return res; }; @@ -324,14 +324,14 @@ GPUd() bool PropagatorImpl::propagateToX(TrackParCov_t& track, value_ty res = false; } if (tofInfo) { - tofInfo->addStep(mb.length, track.getP2Inv()); // fill L,ToF info using already calculated step length + tofInfo->addStep(mb.length, track.getQ2P2()); // fill L,ToF info using already calculated step length tofInfo->addX2X0(mb.meanX2X0); tofInfo->addXRho(mb.getXRho(signCorr)); } } else if (tofInfo) { // if tofInfo filling was requested w/o material correction, we need to calculate the step lenght auto xyz1 = track.getXYZGlo(); math_utils::Vector3D stepV(xyz1.X() - xyz0.X(), xyz1.Y() - xyz0.Y(), xyz1.Z() - xyz0.Z()); - tofInfo->addStep(stepV.R(), track.getP2Inv()); + tofInfo->addStep(stepV.R(), track.getQ2P2()); } return res; }; @@ -390,14 +390,14 @@ GPUd() bool PropagatorImpl::propagateToX(TrackPar_t& track, value_type res = false; } if (tofInfo) { - tofInfo->addStep(mb.length, track.getP2Inv()); // fill L,ToF info using already calculated step length + tofInfo->addStep(mb.length, track.getQ2P2()); // fill L,ToF info using already calculated step length tofInfo->addX2X0(mb.meanX2X0); tofInfo->addXRho(mb.getXRho(signCorr)); } } else if (tofInfo) { // if tofInfo filling was requested w/o material correction, we need to calculate the step lenght auto xyz1 = track.getXYZGlo(); math_utils::Vector3D stepV(xyz1.X() - xyz0.X(), xyz1.Y() - xyz0.Y(), xyz1.Z() - xyz0.Z()); - tofInfo->addStep(stepV.R(), track.getP2Inv()); + tofInfo->addStep(stepV.R(), track.getQ2P2()); } return res; }; @@ -717,7 +717,7 @@ GPUd() value_T PropagatorImpl::estimateLTFast(o2::track::TrackLTIntegra // since we assume the track or its parent comes from the beam-line or decay, add XY(?) distance to it value_T dcaT = math_utils::detail::sqrt(xdca * xdca + ydca * ydca); length += dcaT; - lt.addStep(length, trc.getP2Inv()); + lt.addStep(length, trc.getQ2P2()); return dcaT; } diff --git a/Detectors/GlobalTracking/src/MatchTPCITS.cxx b/Detectors/GlobalTracking/src/MatchTPCITS.cxx index f689caed87351..c8c9dda6a4025 100644 --- a/Detectors/GlobalTracking/src/MatchTPCITS.cxx +++ b/Detectors/GlobalTracking/src/MatchTPCITS.cxx @@ -1714,7 +1714,7 @@ bool MatchTPCITS::refitTrackTPCITS(int slot, int iTPC, int& iITS, pmr::vectorestimateLTIncrement(tracOut, posStart, posEnd); - tofL.addStep(lInt, tracOut.getP2Inv()); + tofL.addStep(lInt, tracOut.getQ2P2()); tofL.addX2X0(lInt * mTPCmeanX0Inv); propagator->PropagateToXBxByBz(tracOut, o2::constants::geom::XTPCOuterRef, MaxSnp, 10., mUseMatCorrFlag, &tofL); @@ -1804,7 +1804,7 @@ bool MatchTPCITS::refitABTrack(int iITSAB, const TPCABSeed& seed, pmr::vectorestimateLTIncrement(tracOut, posStart, posEnd); - tofL.addStep(lInt, tracOut.getP2Inv()); + tofL.addStep(lInt, tracOut.getQ2P2()); tofL.addX2X0(lInt * mTPCmeanX0Inv); propagator->PropagateToXBxByBz(tracOut, o2::constants::geom::XTPCOuterRef, MaxSnp, 10., mUseMatCorrFlag, &tofL); const auto& trackTune = TrackTuneParams::Instance(); diff --git a/Detectors/TRD/workflow/src/TRDGlobalTrackingSpec.cxx b/Detectors/TRD/workflow/src/TRDGlobalTrackingSpec.cxx index 375fa732007cc..b5a1530e83d8c 100644 --- a/Detectors/TRD/workflow/src/TRDGlobalTrackingSpec.cxx +++ b/Detectors/TRD/workflow/src/TRDGlobalTrackingSpec.cxx @@ -638,7 +638,7 @@ bool TRDGlobalTracking::refitITSTPCTRDTrack(TrackTRD& trk, float timeTRD, o2::gl } auto posEnd = trk.getXYZGlo(); auto lInt = propagator->estimateLTIncrement(trk, posStart, posEnd); - trk.getLTIntegralOut().addStep(lInt, trk.getP2Inv()); + trk.getLTIntegralOut().addStep(lInt, trk.getQ2P2()); // trk.getLTIntegralOut().addX2X0(lInt * mTPCmeanX0Inv); // do we need to account for the material budget here? probably const auto& trackTune = TrackTuneParams::Instance(); @@ -733,7 +733,7 @@ bool TRDGlobalTracking::refitTPCTRDTrack(TrackTRD& trk, float timeTRD, o2::globa } auto posEnd = trk.getXYZGlo(); auto lInt = propagator->estimateLTIncrement(trk, posStart, posEnd); - trk.getLTIntegralOut().addStep(lInt, trk.getP2Inv()); + trk.getLTIntegralOut().addStep(lInt, trk.getQ2P2()); // trk.getLTIntegralOut().addX2X0(lInt * mTPCmeanX0Inv); // do we need to account for the material budget here? probably? if (!propagator->PropagateToXBxByBz(trk, o2::constants::geom::XTPCInnerRef, o2::base::Propagator::MAX_SIN_PHI, o2::base::Propagator::MAX_STEP, matCorr, &trk.getLTIntegralOut())) {