@@ -127,13 +127,16 @@ class ExpTimes
127127 if (!trk.hasTOF ()) {
128128 return -999 .f ;
129129 }
130+ if (!trk.has_collision ()) {
131+ return -999 .f ;
132+ }
130133 const float x[7 ] = {trk.p (), trk.tofSignal (), trk.collision ().collisionTimeRes () * 1000 .f , o2::track::PID::getMass2Z (id), trk.length (), trk.sigma1Pt (), trk.pt ()};
131134 const float reso = response (response.kSigma , x);
132135 return reso >= 0 .f ? reso : 0 .f ;
133136 }
134137
135138 // / Gets the number of sigmas with respect the expected time
136- static float GetSeparation (const DetectorResponse& response, const TrackType& trk) { return trk.hasTOF () ? (trk.tofSignal () - trk.collision ().collisionTime () * 1000 .f - GetExpectedSignal (trk)) / GetExpectedSigma (response, trk) : -999 .f ; }
139+ static float GetSeparation (const DetectorResponse& response, const TrackType& trk) { return trk.has_collision () ? (trk. hasTOF () ? (trk.tofSignal () - trk.collision ().collisionTime () * 1000 .f - GetExpectedSignal (trk)) / GetExpectedSigma (response, trk) : - 999 . f ) : -999 .f ; }
137140
138141 // / Gets the expected resolution of the measurement from the track time
139142 float GetExpectedSigmaFromTrackTime (const DetectorResponse& response, const TrackType& trk) const ;
@@ -212,6 +215,9 @@ float ExpTimes<TrackType, id>::GetExpectedSigmaFromTrackTime(const DetectorRespo
212215 if (!trk.hasTOF ()) {
213216 return -999 .f ;
214217 }
218+ if (!trk.has_collision ()) {
219+ return -999 .f ;
220+ }
215221 const float x[7 ] = {trk.p (), o2::pid::tof::TOFSignal<TrackType>::GetTOFSignal (trk), trk.collision ().collisionTimeRes () * 1000 .f , o2::track::PID::getMass2Z (id), trk.length (), trk.sigma1Pt (), trk.pt ()};
216222 const float reso = response (response.kSigma , x);
217223 return reso >= 0 .f ? reso : 0 .f ;
@@ -221,7 +227,7 @@ float ExpTimes<TrackType, id>::GetExpectedSigmaFromTrackTime(const DetectorRespo
221227template <typename TrackType, o2::track::PID::ID id>
222228float ExpTimes<TrackType, id>::GetSeparationFromTrackTime(const DetectorResponse& response, const TrackType& trk) const
223229{
224- return trk.hasTOF () ? (o2::pid::tof::TOFSignal<TrackType>::GetTOFSignal (trk) - trk.collision ().collisionTime () * 1000 .f - GetExpectedSignal (trk)) / GetExpectedSigmaFromTrackTime (response, trk) : -999 .f ;
230+ return trk.has_collision () ? (trk. hasTOF () ? (o2::pid::tof::TOFSignal<TrackType>::GetTOFSignal (trk) - trk.collision ().collisionTime () * 1000 .f - GetExpectedSignal (trk)) / GetExpectedSigmaFromTrackTime (response, trk) : - 999 . f ) : -999 .f ;
225231}
226232
227233} // namespace o2::pid::tof
0 commit comments