Skip to content

Commit

Permalink
Protect LT-int.calculation in TRD refit from bad TPC correction
Browse files Browse the repository at this point in the history
  • Loading branch information
shahor02 committed Nov 13, 2024
1 parent 25896b2 commit 4b9ede8
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions Detectors/TRD/workflow/src/TRDGlobalTrackingSpec.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -615,7 +615,6 @@ bool TRDGlobalTracking::refitITSTPCTRDTrack(TrackTRD& trk, float timeTRD, o2::gl
LOG(debug) << "TRD refit outwards failed";
return false;
}

// refit ITS-TPC-TRD track inwards to innermost ITS cluster
// here we also calculate the LT integral for matching to TOF
float chi2In = 0.f;
Expand All @@ -629,6 +628,12 @@ bool TRDGlobalTracking::refitITSTPCTRDTrack(TrackTRD& trk, float timeTRD, o2::gl
LOG(debug) << "TPC refit inwards failed";
return false;
}
// if for some reason the track was overshoot over the inner field cage, bring it back w/o material correction and LTintegral update
if (trk.getX() < o2::constants::geom::XTPCInnerRef &&
!propagator->PropagateToXBxByBz(trk, o2::constants::geom::XTPCInnerRef, o2::base::Propagator::MAX_SIN_PHI, o2::base::Propagator::MAX_STEP, o2::base::Propagator::MatCorrType::USEMatCorrNONE)) {
LOG(debug) << "BACK-Propagationto inner boundary failed";
return false;
}
auto posEnd = trk.getXYZGlo();
auto lInt = propagator->estimateLTIncrement(trk, posStart, posEnd);
trk.getLTIntegralOut().addStep(lInt, trk.getP2Inv());
Expand Down Expand Up @@ -718,7 +723,12 @@ bool TRDGlobalTracking::refitTPCTRDTrack(TrackTRD& trk, float timeTRD, o2::globa
if (pileUpOn) { // account pileup time uncertainty in Z errors
trk.updateCov(timeZErr, o2::track::CovLabels::kSigZ2);
}

// if for some reason the track was overshoot over the inner field cage, bring it back w/o material correction and LTintegral update
if (trk.getX() < o2::constants::geom::XTPCInnerRef &&
!propagator->PropagateToXBxByBz(trk, o2::constants::geom::XTPCInnerRef, o2::base::Propagator::MAX_SIN_PHI, o2::base::Propagator::MAX_STEP, o2::base::Propagator::MatCorrType::USEMatCorrNONE)) {
LOG(debug) << "BACK-Propagationto inner boundary failed";
return false;
}
auto posEnd = trk.getXYZGlo();
auto lInt = propagator->estimateLTIncrement(trk, posStart, posEnd);
trk.getLTIntegralOut().addStep(lInt, trk.getP2Inv());
Expand Down

0 comments on commit 4b9ede8

Please sign in to comment.