Skip to content

Commit

Permalink
Fix Z bias of TRD-matched tracks
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
shahor02 authored and noferini committed Mar 15, 2024
1 parent 4da6cbe commit 9f9a131
Showing 1 changed file with 24 additions and 5 deletions.
29 changes: 24 additions & 5 deletions Detectors/TRD/workflow/src/TRDGlobalTrackingSpec.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -569,8 +569,14 @@ bool TRDGlobalTracking::refitITSTPCTRDTrack(TrackTRD& trk, float timeTRD, o2::gl
return false;
}
}

int retVal = mTPCRefitter->RefitTrackAsTrackParCov(outerParam, mTPCTracksArray[detRefs[GTrackID::TPC]].getClusterRef(), (timeTRD + mTPCTDriftOffset) * mTPCTBinMUSInv, &chi2Out, true, false); // outward refit
// propagate to TPC inner boundary
float xtogo = 0;
if (!outerParam.getXatLabR(o2::constants::geom::XTPCInnerRef, xtogo, propagator->getNominalBz(), o2::track::DirOutward) ||
!propagator->PropagateToXBxByBz(outerParam, xtogo, o2::base::Propagator::MAX_SIN_PHI, o2::base::Propagator::MAX_STEP, matCorr)) {
LOG(debug) << "Propagation to inner TPC boundary X=" << xtogo << " failed, Xtr=" << outerParam.getX() << " snp=" << outerParam.getSnp();
return false;
}
int retVal = mTPCRefitter->RefitTrackAsTrackParCov(outerParam, mTPCTracksArray[detRefs[GTrackID::TPC]].getClusterRef(), timeTRD * mTPCTBinMUSInv, &chi2Out, true, false); // outward refit
if (retVal < 0) {
LOG(debug) << "TPC refit outwards failed";
return false;
Expand All @@ -589,7 +595,7 @@ bool TRDGlobalTracking::refitITSTPCTRDTrack(TrackTRD& trk, float timeTRD, o2::gl
return false;
}
auto posStart = trk.getXYZGlo();
retVal = mTPCRefitter->RefitTrackAsTrackParCov(trk, mTPCTracksArray[detRefs[GTrackID::TPC]].getClusterRef(), (timeTRD + mTPCTDriftOffset) * mTPCTBinMUSInv, &chi2In, false, false); // inward refit
retVal = mTPCRefitter->RefitTrackAsTrackParCov(trk, mTPCTracksArray[detRefs[GTrackID::TPC]].getClusterRef(), timeTRD * mTPCTBinMUSInv, &chi2In, false, false); // inward refit
if (retVal < 0) {
LOG(debug) << "TPC refit inwards failed";
return false;
Expand Down Expand Up @@ -654,7 +660,7 @@ bool TRDGlobalTracking::refitTPCTRDTrack(TrackTRD& trk, float timeTRD, o2::globa
outerParam = trk;
float chi2Out = 0, timeZErr = 0.;
bool pileUpOn = trk.hasPileUpInfo(); // distance to farthest collision within the pileup integration time is set
int retVal = mTPCRefitter->RefitTrackAsTrackParCov(outerParam, mTPCTracksArray[detRefs[GTrackID::TPC]].getClusterRef(), (timeTRD + mTPCTDriftOffset) * mTPCTBinMUSInv, &chi2Out, true, false); // outward refit
int retVal = mTPCRefitter->RefitTrackAsTrackParCov(outerParam, mTPCTracksArray[detRefs[GTrackID::TPC]].getClusterRef(), timeTRD * mTPCTBinMUSInv, &chi2Out, true, false); // outward refit
if (retVal < 0) {
LOG(debug) << "TPC refit outwards failed";
return false;
Expand All @@ -675,7 +681,7 @@ bool TRDGlobalTracking::refitTPCTRDTrack(TrackTRD& trk, float timeTRD, o2::globa
return false;
}
auto posStart = trk.getXYZGlo();
retVal = mTPCRefitter->RefitTrackAsTrackParCov(trk, mTPCTracksArray[detRefs[GTrackID::TPC]].getClusterRef(), (timeTRD + mTPCTDriftOffset) * mTPCTBinMUSInv, &chi2In, false, false); // inward refit
retVal = mTPCRefitter->RefitTrackAsTrackParCov(trk, mTPCTracksArray[detRefs[GTrackID::TPC]].getClusterRef(), timeTRD * mTPCTBinMUSInv, &chi2In, false, false); // inward refit
if (retVal < 0) {
LOG(debug) << "TPC refit inwards failed";
return false;
Expand Down Expand Up @@ -781,6 +787,19 @@ bool TRDGlobalTracking::refitTRDTrack(TrackTRD& trk, float& chi2, bool inwards,
}
if (!inwards) { // to make sure that the inward fit will start from the trkParam
((o2::track::TrackParCov&)trk) = *trkParam;
} else { // propagate to the TPC outer reference
if (!propagator->PropagateToXBxByBz(*trkParam, o2::constants::geom::XTPCOuterRef, o2::base::Propagator::MAX_SIN_PHI, o2::base::Propagator::MAX_STEP, matCorr, tofL)) {
LOG(debug) << "Propagation to TPC outer reference X after TRD inward refit failed";
return false;
}
// make sure we are in the correct sector
int sector = o2::math_utils::angle2Sector(trkParam->getPhiPos());
if (sector != o2::math_utils::angle2Sector(trkParam->getAlpha()) &&
!trkParam->rotate(o2::math_utils::sector2Angle(sector)) &&
!propagator->PropagateToXBxByBz(*trkParam, o2::constants::geom::XTPCOuterRef, o2::base::Propagator::MAX_SIN_PHI, o2::base::Propagator::MAX_STEP, matCorr, tofL)) {
LOG(debug) << "Propagation/rotation to TPC outer reference X after TRD inward refit failed " << trkParam->asString();
return false;
}
}
return true;
}
Expand Down

0 comments on commit 9f9a131

Please sign in to comment.