Skip to content

Commit dbd2625

Browse files
committed
Add to trackdata in residuals TOF time difference and t0 error
TrackData got extra data member deltaTOF, which provides the difference between the measered and expected time-of-flight in ps: timeTOF - t0 - tof_integral(track_PID) if the the tracks was matched to TOF (0 otherwhise). The meaning of the clAvailTOF data member is changed: as before, 0 means no TOF match, otherwhise the value of the uncertainty on the interaction t0 is stored in ps (200 means that the nominal BC compatible with the TOF time was assumed).
1 parent ef0de0f commit dbd2625

File tree

2 files changed

+18
-4
lines changed

2 files changed

+18
-4
lines changed

Detectors/TPC/calibration/SpacePoints/include/SpacePoints/TrackInterpolation.h

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,14 +140,19 @@ struct TrackData {
140140
float chi2TPC{}; ///< chi2 of TPC track
141141
float chi2ITS{}; ///< chi2 of ITS track
142142
float chi2TRD{}; ///< chi2 of TRD track
143+
float deltaTOF{}; ///< TOFsignal - T0 - texp(PID), if T0 is available
143144

144145
unsigned short nClsTPC{}; ///< number of attached TPC clusters
145146
unsigned short nClsITS{}; ///< number of attached ITS clusters
146147
unsigned short nTrkltsTRD{}; ///< number of attached TRD tracklets
147-
unsigned short clAvailTOF{}; ///< whether or not track seed has a matched TOF cluster
148+
unsigned short clAvailTOF{}; ///< whether or not track seed has a matched TOF cluster, if so, gives the resolution of the T0 in ps
148149
uint8_t nExtDetResid = 0; ///< number of external detectors (to TPC) residuals stored, on top of clIdx.getEntries
149150
o2::dataformats::RangeReference<> clIdx{}; ///< index of first cluster residual and total number of TPC cluster residuals of this track
150-
ClassDefNV(TrackData, 7);
151+
152+
float getT0Error() const { return float(clAvailTOF); }
153+
bool isTOFAvail() const { return clAvailTOF != 0; }
154+
155+
ClassDefNV(TrackData, 8);
151156
};
152157

153158
/// \class TrackInterpolation

Detectors/TPC/calibration/SpacePoints/src/TrackInterpolation.cxx

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -620,7 +620,13 @@ void TrackInterpolation::interpolateTrack(int iSeed)
620620
trackData.nClsTPC = trkTPC.getNClusterReferences();
621621
trackData.nClsITS = trkITS.getNumberOfClusters();
622622
trackData.nTrkltsTRD = gidTable[GTrackID::TRD].isIndexSet() ? mRecoCont->getITSTPCTRDTrack<o2::trd::TrackTRD>(gidTable[GTrackID::ITSTPCTRD]).getNtracklets() : 0;
623-
trackData.clAvailTOF = gidTable[GTrackID::TOF].isIndexSet() ? 1 : 0;
623+
if (gidTable[GTrackID::TOF].isIndexSet()) {
624+
const auto& tofMatch = mRecoCont->getTOFMatch(mGIDs[iSeed]);
625+
trackData.deltaTOF = tofMatch.getSignal() - tofMatch.getFT0Best() - tofMatch.getLTIntegralOut().getTOF(trkTPC.getPID().getID());
626+
trackData.clAvailTOF = uint16_t(tofMatch.getFT0BestRes());
627+
} else {
628+
trackData.clAvailTOF = 0;
629+
}
624630
trackData.dEdxTPC = trkTPC.getdEdx().dEdxTotTPC;
625631

626632
TrackParams params; // for refitted track parameters and flagging rejected clusters
@@ -933,7 +939,11 @@ void TrackInterpolation::extrapolateTrack(int iSeed)
933939
}
934940

935941
// do we have TOF residual to add?
942+
trackData.clAvailTOF = 0;
936943
while (gidTableFull[GTrackID::TOF].isIndexSet() && !stopPropagation) {
944+
const auto& tofMatch = mRecoCont->getTOFMatch(gidFull);
945+
trackData.deltaTOF = tofMatch.getSignal() - tofMatch.getFT0Best() - tofMatch.getLTIntegralOut().getTOF(trkTPC.getPID().getID());
946+
trackData.clAvailTOF = uint16_t(tofMatch.getFT0BestRes());
937947
const auto& clTOF = mRecoCont->getTOFClusters()[gidTableFull[GTrackID::TOF]];
938948
const float clTOFAlpha = o2::math_utils::sector2Angle(clTOF.getCount());
939949
float clTOFxyz[3] = {clTOF.getX(), clTOF.getY(), clTOF.getZ()};
@@ -955,7 +965,6 @@ void TrackInterpolation::extrapolateTrack(int iSeed)
955965
auto dz = clTOFxyz[2] - trkWork.getZ();
956966
if ((std::abs(dy) < param::MaxResid) && (std::abs(dz) < param::MaxResid) && (std::abs(trkWork.getY()) < param::MaxY) && (std::abs(trkWork.getZ()) < param::MaxZ) && (std::abs(tgPhi) < param::MaxTgSlp)) {
957967
mClRes.emplace_back(dy, dz, tgPhi, trkWork.getY(), trkWork.getZ(), 170, clTOF.getCount(), clTOF.getPadInSector());
958-
trackData.clAvailTOF = 1;
959968
trackData.nExtDetResid++;
960969
}
961970
break;

0 commit comments

Comments
 (0)