Skip to content

Commit 4b9ede8

Browse files
committed
Protect LT-int.calculation in TRD refit from bad TPC correction
1 parent 25896b2 commit 4b9ede8

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

Detectors/TRD/workflow/src/TRDGlobalTrackingSpec.cxx

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -615,7 +615,6 @@ bool TRDGlobalTracking::refitITSTPCTRDTrack(TrackTRD& trk, float timeTRD, o2::gl
615615
LOG(debug) << "TRD refit outwards failed";
616616
return false;
617617
}
618-
619618
// refit ITS-TPC-TRD track inwards to innermost ITS cluster
620619
// here we also calculate the LT integral for matching to TOF
621620
float chi2In = 0.f;
@@ -629,6 +628,12 @@ bool TRDGlobalTracking::refitITSTPCTRDTrack(TrackTRD& trk, float timeTRD, o2::gl
629628
LOG(debug) << "TPC refit inwards failed";
630629
return false;
631630
}
631+
// if for some reason the track was overshoot over the inner field cage, bring it back w/o material correction and LTintegral update
632+
if (trk.getX() < o2::constants::geom::XTPCInnerRef &&
633+
!propagator->PropagateToXBxByBz(trk, o2::constants::geom::XTPCInnerRef, o2::base::Propagator::MAX_SIN_PHI, o2::base::Propagator::MAX_STEP, o2::base::Propagator::MatCorrType::USEMatCorrNONE)) {
634+
LOG(debug) << "BACK-Propagationto inner boundary failed";
635+
return false;
636+
}
632637
auto posEnd = trk.getXYZGlo();
633638
auto lInt = propagator->estimateLTIncrement(trk, posStart, posEnd);
634639
trk.getLTIntegralOut().addStep(lInt, trk.getP2Inv());
@@ -718,7 +723,12 @@ bool TRDGlobalTracking::refitTPCTRDTrack(TrackTRD& trk, float timeTRD, o2::globa
718723
if (pileUpOn) { // account pileup time uncertainty in Z errors
719724
trk.updateCov(timeZErr, o2::track::CovLabels::kSigZ2);
720725
}
721-
726+
// if for some reason the track was overshoot over the inner field cage, bring it back w/o material correction and LTintegral update
727+
if (trk.getX() < o2::constants::geom::XTPCInnerRef &&
728+
!propagator->PropagateToXBxByBz(trk, o2::constants::geom::XTPCInnerRef, o2::base::Propagator::MAX_SIN_PHI, o2::base::Propagator::MAX_STEP, o2::base::Propagator::MatCorrType::USEMatCorrNONE)) {
729+
LOG(debug) << "BACK-Propagationto inner boundary failed";
730+
return false;
731+
}
722732
auto posEnd = trk.getXYZGlo();
723733
auto lInt = propagator->estimateLTIncrement(trk, posStart, posEnd);
724734
trk.getLTIntegralOut().addStep(lInt, trk.getP2Inv());

0 commit comments

Comments
 (0)