Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -555,6 +556,18 @@ GPUdi() auto TrackParametrization<value_T>::getPhiPos() const -> value_t
return phi;
}

//____________________________________________________________
template <typename value_T>
GPUdi() auto TrackParametrization<value_T>::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 <typename value_T>
GPUdi() auto TrackParametrization<value_T>::getPtInv() const -> value_t
Expand Down
6 changes: 3 additions & 3 deletions DataFormats/Reconstruction/src/TrackLTIntegral.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,17 @@ 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;
}
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;
}
}
Expand Down
4 changes: 2 additions & 2 deletions DataFormats/Reconstruction/test/testLTOFIntegration.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
18 changes: 9 additions & 9 deletions Detectors/Base/src/Propagator.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -189,14 +189,14 @@ GPUd() bool PropagatorImpl<value_T>::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<value_type> 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;
};
Expand Down Expand Up @@ -258,14 +258,14 @@ GPUd() bool PropagatorImpl<value_T>::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<value_type> 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;
};
Expand Down Expand Up @@ -324,14 +324,14 @@ GPUd() bool PropagatorImpl<value_T>::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<value_type> 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;
};
Expand Down Expand Up @@ -390,14 +390,14 @@ GPUd() bool PropagatorImpl<value_T>::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<value_type> 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;
};
Expand Down Expand Up @@ -717,7 +717,7 @@ GPUd() value_T PropagatorImpl<value_T>::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<value_type>(xdca * xdca + ydca * ydca);
length += dcaT;
lt.addStep(length, trc.getP2Inv());
lt.addStep(length, trc.getQ2P2());
return dcaT;
}

Expand Down
4 changes: 2 additions & 2 deletions Detectors/GlobalTracking/src/MatchTPCITS.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -1714,7 +1714,7 @@ bool MatchTPCITS::refitTrackTPCITS(int slot, int iTPC, int& iITS, pmr::vector<o2
}
auto posEnd = tracOut.getXYZGlo();
auto lInt = propagator->estimateLTIncrement(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);

Expand Down Expand Up @@ -1804,7 +1804,7 @@ bool MatchTPCITS::refitABTrack(int iITSAB, const TPCABSeed& seed, pmr::vector<o2
}
auto posEnd = tracOut.getXYZGlo();
auto lInt = propagator->estimateLTIncrement(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();
Expand Down
4 changes: 2 additions & 2 deletions Detectors/TRD/workflow/src/TRDGlobalTrackingSpec.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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())) {
Expand Down