Skip to content

Commit 23e89f2

Browse files
shahor02noferini
authored andcommitted
Fix Z bias of TRD-matched tracks
1) When the time bias of TPC timebins was introduced, it had to be explicitly accounted for in the TPC tracks refits constrained by TRD timestamps (the t0 was subtracted from the TRD time). When the TPC fitter started to account for this t0 bias provided via VDrift object, this explicit accounting had to be removed but it was not. As a result, the t0 bias was accounted for twice, leading to a few cm bias in Z for constrained TPC tracks. While we were using large (1cm) systematic errors on Z error of TPC tracks, this bias was overridden by the following refit in the TRD or in the ITS, once we adopted smaller Z-error the bias started to affect matching in the TOF. 2) The TPC refitter was called on the track at the outer ITS or inner TRD radius (for the outward and inward refits resp.). Since the refitter propagates w/o material corrections, effectively the tracks were not accounting for the material between the TPC and ITS/TRD (before the refit, so the effect was small anyway). Now the tracks are explicitly propagated befor the refit to the TPC boundary using the standard propagator accounting for materials.
1 parent 13aaa16 commit 23e89f2

File tree

1 file changed

+24
-5
lines changed

1 file changed

+24
-5
lines changed

Detectors/TRD/workflow/src/TRDGlobalTrackingSpec.cxx

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -569,8 +569,14 @@ bool TRDGlobalTracking::refitITSTPCTRDTrack(TrackTRD& trk, float timeTRD, o2::gl
569569
return false;
570570
}
571571
}
572-
573-
int retVal = mTPCRefitter->RefitTrackAsTrackParCov(outerParam, mTPCTracksArray[detRefs[GTrackID::TPC]].getClusterRef(), (timeTRD + mTPCTDriftOffset) * mTPCTBinMUSInv, &chi2Out, true, false); // outward refit
572+
// propagate to TPC inner boundary
573+
float xtogo = 0;
574+
if (!outerParam.getXatLabR(o2::constants::geom::XTPCInnerRef, xtogo, propagator->getNominalBz(), o2::track::DirOutward) ||
575+
!propagator->PropagateToXBxByBz(outerParam, xtogo, o2::base::Propagator::MAX_SIN_PHI, o2::base::Propagator::MAX_STEP, matCorr)) {
576+
LOG(debug) << "Propagation to inner TPC boundary X=" << xtogo << " failed, Xtr=" << outerParam.getX() << " snp=" << outerParam.getSnp();
577+
return false;
578+
}
579+
int retVal = mTPCRefitter->RefitTrackAsTrackParCov(outerParam, mTPCTracksArray[detRefs[GTrackID::TPC]].getClusterRef(), timeTRD * mTPCTBinMUSInv, &chi2Out, true, false); // outward refit
574580
if (retVal < 0) {
575581
LOG(debug) << "TPC refit outwards failed";
576582
return false;
@@ -589,7 +595,7 @@ bool TRDGlobalTracking::refitITSTPCTRDTrack(TrackTRD& trk, float timeTRD, o2::gl
589595
return false;
590596
}
591597
auto posStart = trk.getXYZGlo();
592-
retVal = mTPCRefitter->RefitTrackAsTrackParCov(trk, mTPCTracksArray[detRefs[GTrackID::TPC]].getClusterRef(), (timeTRD + mTPCTDriftOffset) * mTPCTBinMUSInv, &chi2In, false, false); // inward refit
598+
retVal = mTPCRefitter->RefitTrackAsTrackParCov(trk, mTPCTracksArray[detRefs[GTrackID::TPC]].getClusterRef(), timeTRD * mTPCTBinMUSInv, &chi2In, false, false); // inward refit
593599
if (retVal < 0) {
594600
LOG(debug) << "TPC refit inwards failed";
595601
return false;
@@ -654,7 +660,7 @@ bool TRDGlobalTracking::refitTPCTRDTrack(TrackTRD& trk, float timeTRD, o2::globa
654660
outerParam = trk;
655661
float chi2Out = 0, timeZErr = 0.;
656662
bool pileUpOn = trk.hasPileUpInfo(); // distance to farthest collision within the pileup integration time is set
657-
int retVal = mTPCRefitter->RefitTrackAsTrackParCov(outerParam, mTPCTracksArray[detRefs[GTrackID::TPC]].getClusterRef(), (timeTRD + mTPCTDriftOffset) * mTPCTBinMUSInv, &chi2Out, true, false); // outward refit
663+
int retVal = mTPCRefitter->RefitTrackAsTrackParCov(outerParam, mTPCTracksArray[detRefs[GTrackID::TPC]].getClusterRef(), timeTRD * mTPCTBinMUSInv, &chi2Out, true, false); // outward refit
658664
if (retVal < 0) {
659665
LOG(debug) << "TPC refit outwards failed";
660666
return false;
@@ -675,7 +681,7 @@ bool TRDGlobalTracking::refitTPCTRDTrack(TrackTRD& trk, float timeTRD, o2::globa
675681
return false;
676682
}
677683
auto posStart = trk.getXYZGlo();
678-
retVal = mTPCRefitter->RefitTrackAsTrackParCov(trk, mTPCTracksArray[detRefs[GTrackID::TPC]].getClusterRef(), (timeTRD + mTPCTDriftOffset) * mTPCTBinMUSInv, &chi2In, false, false); // inward refit
684+
retVal = mTPCRefitter->RefitTrackAsTrackParCov(trk, mTPCTracksArray[detRefs[GTrackID::TPC]].getClusterRef(), timeTRD * mTPCTBinMUSInv, &chi2In, false, false); // inward refit
679685
if (retVal < 0) {
680686
LOG(debug) << "TPC refit inwards failed";
681687
return false;
@@ -781,6 +787,19 @@ bool TRDGlobalTracking::refitTRDTrack(TrackTRD& trk, float& chi2, bool inwards,
781787
}
782788
if (!inwards) { // to make sure that the inward fit will start from the trkParam
783789
((o2::track::TrackParCov&)trk) = *trkParam;
790+
} else { // propagate to the TPC outer reference
791+
if (!propagator->PropagateToXBxByBz(*trkParam, o2::constants::geom::XTPCOuterRef, o2::base::Propagator::MAX_SIN_PHI, o2::base::Propagator::MAX_STEP, matCorr, tofL)) {
792+
LOG(debug) << "Propagation to TPC outer reference X after TRD inward refit failed";
793+
return false;
794+
}
795+
// make sure we are in the correct sector
796+
int sector = o2::math_utils::angle2Sector(trkParam->getPhiPos());
797+
if (sector != o2::math_utils::angle2Sector(trkParam->getAlpha()) &&
798+
!trkParam->rotate(o2::math_utils::sector2Angle(sector)) &&
799+
!propagator->PropagateToXBxByBz(*trkParam, o2::constants::geom::XTPCOuterRef, o2::base::Propagator::MAX_SIN_PHI, o2::base::Propagator::MAX_STEP, matCorr, tofL)) {
800+
LOG(debug) << "Propagation/rotation to TPC outer reference X after TRD inward refit failed " << trkParam->asString();
801+
return false;
802+
}
784803
}
785804
return true;
786805
}

0 commit comments

Comments
 (0)