Skip to content

Commit 8060987

Browse files
committed
Fix: TrackLTIntegral.addStep needs (q/p)^2 instead of 1/p^2
Since the charge dependence of beta is accounted internally.
1 parent 67b8169 commit 8060987

File tree

7 files changed

+32
-19
lines changed

7 files changed

+32
-19
lines changed

DataFormats/Reconstruction/include/ReconstructionDataFormats/TrackLTIntegral.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ class TrackLTIntegral
6363
}
6464
}
6565

66-
GPUd() void addStep(float dL, float p2Inv);
66+
GPUd() void addStep(float dL, float q2p2);
6767
GPUd() void addX2X0(float d) { mX2X0 += d; }
6868
GPUd() void addXRho(float d) { mXRho += d; }
6969

DataFormats/Reconstruction/include/ReconstructionDataFormats/TrackParametrization.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,7 @@ class TrackParametrization
191191
GPUd() value_t getPhi() const;
192192
GPUd() value_t getPhiPos() const;
193193

194+
GPUd() value_t getQ2P2() const;
194195
GPUd() value_t getPtInv() const;
195196
GPUd() value_t getP2Inv() const;
196197
GPUd() value_t getP2() const;
@@ -555,6 +556,18 @@ GPUdi() auto TrackParametrization<value_T>::getPhiPos() const -> value_t
555556
return phi;
556557
}
557558

559+
//____________________________________________________________
560+
template <typename value_T>
561+
GPUdi() auto TrackParametrization<value_T>::getQ2P2() const -> value_t
562+
{
563+
// return the (q/p)^2
564+
value_t q2pt2 = mP[kQ2Pt] * mP[kQ2Pt];
565+
if (q2pt2 < MinPTInv * MinPTInv) {
566+
q2pt2 = MinPTInv * MinPTInv;
567+
}
568+
return q2pt2 / (1.f + getTgl() * getTgl());
569+
}
570+
558571
//____________________________________________________________
559572
template <typename value_T>
560573
GPUdi() auto TrackParametrization<value_T>::getPtInv() const -> value_t

DataFormats/Reconstruction/src/TrackLTIntegral.cxx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,17 +39,17 @@ GPUd() void TrackLTIntegral::print() const
3939
}
4040

4141
//_____________________________________________________
42-
GPUd() void TrackLTIntegral::addStep(float dL, float p2Inv)
42+
GPUd() void TrackLTIntegral::addStep(float dL, float q2p2)
4343
{
44-
///< add step in cm to integrals
44+
///< add step in cm to integrals, q2p2 is (q/p)^2.
4545
mL += dL;
4646
if (isTimeNotNeeded()) {
4747
return;
4848
}
4949
const float dTns = dL * 1000.f / o2::constants::physics::LightSpeedCm2NS; // time change in ps for beta = 1 particle
5050
for (int id = 0; id < getNTOFs(); id++) {
5151
const float m2z = track::PID::getMass2Z(id);
52-
const float betaInv = math_utils::sqrt(1.f + m2z * m2z * p2Inv);
52+
const float betaInv = math_utils::sqrt(1.f + m2z * m2z * q2p2);
5353
mT[id] += dTns * betaInv;
5454
}
5555
}

DataFormats/Reconstruction/test/testLTOFIntegration.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ BOOST_AUTO_TEST_CASE(TrackLTIntegral)
3333
const int nStep = 100;
3434
const float dx2x0 = 0.01f;
3535
for (int i = 0; i < nStep; i++) {
36-
lt.addStep(1., trc.getP2Inv());
37-
lt1.addStep(1., trc1.getP2Inv());
36+
lt.addStep(1., trc.getQ2P2());
37+
lt1.addStep(1., trc1.getQ2P2());
3838
lt1.addX2X0(dx2x0);
3939
}
4040
trc.printParam();

Detectors/Base/src/Propagator.cxx

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -189,14 +189,14 @@ GPUd() bool PropagatorImpl<value_T>::PropagateToXBxByBz(TrackParCov_t& track, va
189189
res = false;
190190
}
191191
if (tofInfo) {
192-
tofInfo->addStep(mb.length, track.getP2Inv()); // fill L,ToF info using already calculated step length
192+
tofInfo->addStep(mb.length, track.getQ2P2()); // fill L,ToF info using already calculated step length
193193
tofInfo->addX2X0(mb.meanX2X0);
194194
tofInfo->addXRho(mb.getXRho(signCorr));
195195
}
196196
} else if (tofInfo) { // if tofInfo filling was requested w/o material correction, we need to calculate the step lenght
197197
auto xyz1 = track.getXYZGlo();
198198
math_utils::Vector3D<value_type> stepV(xyz1.X() - xyz0.X(), xyz1.Y() - xyz0.Y(), xyz1.Z() - xyz0.Z());
199-
tofInfo->addStep(stepV.R(), track.getP2Inv());
199+
tofInfo->addStep(stepV.R(), track.getQ2P2());
200200
}
201201
return res;
202202
};
@@ -258,14 +258,14 @@ GPUd() bool PropagatorImpl<value_T>::PropagateToXBxByBz(TrackPar_t& track, value
258258
res = false;
259259
}
260260
if (tofInfo) {
261-
tofInfo->addStep(mb.length, track.getP2Inv()); // fill L,ToF info using already calculated step length
261+
tofInfo->addStep(mb.length, track.getQ2P2()); // fill L,ToF info using already calculated step length
262262
tofInfo->addX2X0(mb.meanX2X0);
263263
tofInfo->addXRho(mb.getXRho(signCorr));
264264
}
265265
} else if (tofInfo) { // if tofInfo filling was requested w/o material correction, we need to calculate the step lenght
266266
auto xyz1 = track.getXYZGlo();
267267
math_utils::Vector3D<value_type> stepV(xyz1.X() - xyz0.X(), xyz1.Y() - xyz0.Y(), xyz1.Z() - xyz0.Z());
268-
tofInfo->addStep(stepV.R(), track.getP2Inv());
268+
tofInfo->addStep(stepV.R(), track.getQ2P2());
269269
}
270270
return res;
271271
};
@@ -324,14 +324,14 @@ GPUd() bool PropagatorImpl<value_T>::propagateToX(TrackParCov_t& track, value_ty
324324
res = false;
325325
}
326326
if (tofInfo) {
327-
tofInfo->addStep(mb.length, track.getP2Inv()); // fill L,ToF info using already calculated step length
327+
tofInfo->addStep(mb.length, track.getQ2P2()); // fill L,ToF info using already calculated step length
328328
tofInfo->addX2X0(mb.meanX2X0);
329329
tofInfo->addXRho(mb.getXRho(signCorr));
330330
}
331331
} else if (tofInfo) { // if tofInfo filling was requested w/o material correction, we need to calculate the step lenght
332332
auto xyz1 = track.getXYZGlo();
333333
math_utils::Vector3D<value_type> stepV(xyz1.X() - xyz0.X(), xyz1.Y() - xyz0.Y(), xyz1.Z() - xyz0.Z());
334-
tofInfo->addStep(stepV.R(), track.getP2Inv());
334+
tofInfo->addStep(stepV.R(), track.getQ2P2());
335335
}
336336
return res;
337337
};
@@ -390,14 +390,14 @@ GPUd() bool PropagatorImpl<value_T>::propagateToX(TrackPar_t& track, value_type
390390
res = false;
391391
}
392392
if (tofInfo) {
393-
tofInfo->addStep(mb.length, track.getP2Inv()); // fill L,ToF info using already calculated step length
393+
tofInfo->addStep(mb.length, track.getQ2P2()); // fill L,ToF info using already calculated step length
394394
tofInfo->addX2X0(mb.meanX2X0);
395395
tofInfo->addXRho(mb.getXRho(signCorr));
396396
}
397397
} else if (tofInfo) { // if tofInfo filling was requested w/o material correction, we need to calculate the step lenght
398398
auto xyz1 = track.getXYZGlo();
399399
math_utils::Vector3D<value_type> stepV(xyz1.X() - xyz0.X(), xyz1.Y() - xyz0.Y(), xyz1.Z() - xyz0.Z());
400-
tofInfo->addStep(stepV.R(), track.getP2Inv());
400+
tofInfo->addStep(stepV.R(), track.getQ2P2());
401401
}
402402
return res;
403403
};
@@ -717,7 +717,7 @@ GPUd() value_T PropagatorImpl<value_T>::estimateLTFast(o2::track::TrackLTIntegra
717717
// since we assume the track or its parent comes from the beam-line or decay, add XY(?) distance to it
718718
value_T dcaT = math_utils::detail::sqrt<value_type>(xdca * xdca + ydca * ydca);
719719
length += dcaT;
720-
lt.addStep(length, trc.getP2Inv());
720+
lt.addStep(length, trc.getQ2P2());
721721
return dcaT;
722722
}
723723

Detectors/GlobalTracking/src/MatchTPCITS.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1714,7 +1714,7 @@ bool MatchTPCITS::refitTrackTPCITS(int slot, int iTPC, int& iITS, pmr::vector<o2
17141714
}
17151715
auto posEnd = tracOut.getXYZGlo();
17161716
auto lInt = propagator->estimateLTIncrement(tracOut, posStart, posEnd);
1717-
tofL.addStep(lInt, tracOut.getP2Inv());
1717+
tofL.addStep(lInt, tracOut.getQ2P2());
17181718
tofL.addX2X0(lInt * mTPCmeanX0Inv);
17191719
propagator->PropagateToXBxByBz(tracOut, o2::constants::geom::XTPCOuterRef, MaxSnp, 10., mUseMatCorrFlag, &tofL);
17201720

@@ -1804,7 +1804,7 @@ bool MatchTPCITS::refitABTrack(int iITSAB, const TPCABSeed& seed, pmr::vector<o2
18041804
}
18051805
auto posEnd = tracOut.getXYZGlo();
18061806
auto lInt = propagator->estimateLTIncrement(tracOut, posStart, posEnd);
1807-
tofL.addStep(lInt, tracOut.getP2Inv());
1807+
tofL.addStep(lInt, tracOut.getQ2P2());
18081808
tofL.addX2X0(lInt * mTPCmeanX0Inv);
18091809
propagator->PropagateToXBxByBz(tracOut, o2::constants::geom::XTPCOuterRef, MaxSnp, 10., mUseMatCorrFlag, &tofL);
18101810
const auto& trackTune = TrackTuneParams::Instance();

Detectors/TRD/workflow/src/TRDGlobalTrackingSpec.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -638,7 +638,7 @@ bool TRDGlobalTracking::refitITSTPCTRDTrack(TrackTRD& trk, float timeTRD, o2::gl
638638
}
639639
auto posEnd = trk.getXYZGlo();
640640
auto lInt = propagator->estimateLTIncrement(trk, posStart, posEnd);
641-
trk.getLTIntegralOut().addStep(lInt, trk.getP2Inv());
641+
trk.getLTIntegralOut().addStep(lInt, trk.getQ2P2());
642642
// trk.getLTIntegralOut().addX2X0(lInt * mTPCmeanX0Inv); // do we need to account for the material budget here? probably
643643

644644
const auto& trackTune = TrackTuneParams::Instance();
@@ -733,7 +733,7 @@ bool TRDGlobalTracking::refitTPCTRDTrack(TrackTRD& trk, float timeTRD, o2::globa
733733
}
734734
auto posEnd = trk.getXYZGlo();
735735
auto lInt = propagator->estimateLTIncrement(trk, posStart, posEnd);
736-
trk.getLTIntegralOut().addStep(lInt, trk.getP2Inv());
736+
trk.getLTIntegralOut().addStep(lInt, trk.getQ2P2());
737737
// trk.getLTIntegralOut().addX2X0(lInt * mTPCmeanX0Inv); // do we need to account for the material budget here? probably?
738738

739739
if (!propagator->PropagateToXBxByBz(trk, o2::constants::geom::XTPCInnerRef, o2::base::Propagator::MAX_SIN_PHI, o2::base::Propagator::MAX_STEP, matCorr, &trk.getLTIntegralOut())) {

0 commit comments

Comments
 (0)