Skip to content

Commit 99c08d3

Browse files
authored
improve track extrapolation to vtx wo MCS correction (#14189)
1 parent b45085c commit 99c08d3

File tree

2 files changed

+31
-6
lines changed

2 files changed

+31
-6
lines changed

Detectors/MUON/MCH/Tracking/include/MCHTracking/TrackExtrap.h

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#define O2_MCH_TRACKEXTRAP_H_
1919

2020
#include <cstddef>
21+
#include <optional>
2122

2223
#include <TMatrixD.h>
2324

@@ -70,17 +71,21 @@ class TrackExtrap
7071
/// Add branson correction resolution to parameter covariances
7172
return extrapToVertex(trackParam, xVtx, yVtx, zVtx, errXVtx, errYVtx, true, false);
7273
}
73-
static bool extrapToVertexWithoutBranson(TrackParam& trackParam, double zVtx)
74+
static bool extrapToVertexWithoutBranson(TrackParam& trackParam, double zVtx,
75+
double xUpstream = 0., double yUpstream = 0.,
76+
std::optional<double> zUpstream = std::nullopt)
7477
{
7578
/// Extrapolate track parameters to vertex, corrected for energy loss effects only
7679
/// Add dispersion due to multiple scattering and energy loss fluctuation to parameter covariances
77-
return extrapToVertex(trackParam, 0., 0., zVtx, 0., 0., false, true);
80+
return extrapToVertex(trackParam, 0., 0., zVtx, 0., 0., false, true, xUpstream, yUpstream, zUpstream);
7881
}
79-
static bool extrapToVertexUncorrected(TrackParam& trackParam, double zVtx)
82+
static bool extrapToVertexUncorrected(TrackParam& trackParam, double zVtx,
83+
double xUpstream = 0., double yUpstream = 0.,
84+
std::optional<double> zUpstream = std::nullopt)
8085
{
8186
/// Extrapolate track parameters to vertex without multiple scattering and energy loss corrections
8287
/// Add dispersion due to multiple scattering to parameter covariances
83-
return extrapToVertex(trackParam, 0., 0., zVtx, 0., 0., false, false);
88+
return extrapToVertex(trackParam, 0., 0., zVtx, 0., 0., false, false, xUpstream, yUpstream, zUpstream);
8489
}
8590

8691
static bool extrapToMID(TrackParam& trackParam);
@@ -92,7 +97,8 @@ class TrackExtrap
9297

9398
private:
9499
static bool extrapToVertex(TrackParam& trackParam, double xVtx, double yVtx, double zVtx,
95-
double errXVtx, double errYVtx, bool correctForMCS, bool correctForEnergyLoss);
100+
double errXVtx, double errYVtx, bool correctForMCS, bool correctForEnergyLoss,
101+
double xUpstream = 0., double yUpstream = 0., std::optional<double> zUpstream = std::nullopt);
96102

97103
static bool getAbsorberCorrectionParam(double trackXYZIn[3], double trackXYZOut[3], double pTotal,
98104
double& pathLength, double& f0, double& f1, double& f2,

Detectors/MUON/MCH/Tracking/src/TrackExtrap.cxx

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,8 @@ bool TrackExtrap::extrapToMID(TrackParam& trackParam)
276276

277277
//__________________________________________________________________________
278278
bool TrackExtrap::extrapToVertex(TrackParam& trackParam, double xVtx, double yVtx, double zVtx,
279-
double errXVtx, double errYVtx, bool correctForMCS, bool correctForEnergyLoss)
279+
double errXVtx, double errYVtx, bool correctForMCS, bool correctForEnergyLoss,
280+
double xUpstream, double yUpstream, std::optional<double> zUpstream)
280281
{
281282
/// Main method for extrapolation to the vertex:
282283
/// Returns the track parameters and covariances resulting from the extrapolation of the current trackParam
@@ -285,6 +286,8 @@ bool TrackExtrap::extrapToVertex(TrackParam& trackParam, double xVtx, double yVt
285286
/// if correctForMCS=false: add parameter dispersion due to MCS in parameter covariances
286287
/// if correctForEnergyLoss=true: correct parameters for energy loss and add energy loss fluctuation to covariances
287288
/// if correctForEnergyLoss=false: do nothing about energy loss
289+
/// In case correctForMCS=false and the position of the track upstream the absorber is provided, it is used
290+
/// to compute the absorber correction parameters, instead of the extrapolated track position from downstream
288291

289292
if (trackParam.getZ() == zVtx) {
290293
return true; // nothing to be done if already at vertex
@@ -301,6 +304,18 @@ bool TrackExtrap::extrapToVertex(TrackParam& trackParam, double xVtx, double yVt
301304
}
302305
}
303306

307+
// check the upstream track position with respect to the absorber if provided and used (spectro z<0)
308+
// zUpstream must be >= SAbsZBeg with 100 µm tolerance to account for numerical precision
309+
if (!correctForMCS && zUpstream && *zUpstream < SAbsZBeg - 0.01) {
310+
if (*zUpstream < SAbsZEnd) {
311+
LOG(warning) << "Upstream Z (" << *zUpstream << ") downstream the front absorber (zAbsorberEnd = " << SAbsZEnd << ")";
312+
return false;
313+
} else {
314+
LOG(warning) << "Upstream Z (" << *zUpstream << ") inside the front absorber (" << SAbsZBeg << ", " << SAbsZEnd << ")";
315+
return false;
316+
}
317+
}
318+
304319
// Check the track position with respect to the vertex and the absorber (spectro z<0)
305320
if (trackParam.getZ() > SAbsZEnd) {
306321
if (trackParam.getZ() > zVtx) {
@@ -328,6 +343,10 @@ bool TrackExtrap::extrapToVertex(TrackParam& trackParam, double xVtx, double yVt
328343
trackXYZIn[2] = SAbsZBeg;
329344
trackXYZIn[0] = trackXYZOut[0] + (xVtx - trackXYZOut[0]) / (zVtx - trackXYZOut[2]) * (trackXYZIn[2] - trackXYZOut[2]);
330345
trackXYZIn[1] = trackXYZOut[1] + (yVtx - trackXYZOut[1]) / (zVtx - trackXYZOut[2]) * (trackXYZIn[2] - trackXYZOut[2]);
346+
} else if (zUpstream) { // or linear propagation to the upstream track position
347+
trackXYZIn[2] = SAbsZBeg;
348+
trackXYZIn[0] = trackXYZOut[0] + (xUpstream - trackXYZOut[0]) / (*zUpstream - trackXYZOut[2]) * (trackXYZIn[2] - trackXYZOut[2]);
349+
trackXYZIn[1] = trackXYZOut[1] + (yUpstream - trackXYZOut[1]) / (*zUpstream - trackXYZOut[2]) * (trackXYZIn[2] - trackXYZOut[2]);
331350
} else { // or standard propagation without vertex constraint
332351
TrackParam trackParamIn(trackParam);
333352
if (!extrapToZ(trackParamIn, SAbsZBeg)) {

0 commit comments

Comments
 (0)