Skip to content

Commit 43e8fdf

Browse files
authored
Convert collision time to ps (#5026)
1 parent 7ed4626 commit 43e8fdf

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

Analysis/DataModel/include/AnalysisDataModel/PID/PIDTOF.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,17 +41,17 @@ class Beta
4141
Beta() = default;
4242
~Beta() = default;
4343

44-
/// Computes the beta of a track given a length, a time measurement and an event time
44+
/// Computes the beta of a track given a length, a time measurement and an event time (in ps)
4545
static float GetBeta(const float length, const float tofSignal, const float collisionTime);
4646

4747
/// Gets the beta for the track of interest
48-
float GetBeta(const Coll& col, const Trck& trk) const { return GetBeta(trk.length(), trk.tofSignal(), col.collisionTime()); }
48+
float GetBeta(const Coll& col, const Trck& trk) const { return GetBeta(trk.length(), trk.tofSignal(), col.collisionTime() * 1000.f); }
4949

5050
/// Computes the expected uncertainty on the beta measurement
5151
static float GetExpectedSigma(const float& length, const float& tofSignal, const float& collisionTime, const float& time_reso);
5252

5353
/// Gets the expected uncertainty on the beta measurement of the track of interest
54-
float GetExpectedSigma(const Coll& col, const Trck& trk) const { return GetExpectedSigma(trk.length(), trk.tofSignal(), col.collisionTime(), mExpectedResolution); }
54+
float GetExpectedSigma(const Coll& col, const Trck& trk) const { return GetExpectedSigma(trk.length(), trk.tofSignal(), col.collisionTime() * 1000.f, mExpectedResolution); }
5555

5656
/// Gets the expected beta for a given mass hypothesis (no energy loss taken into account)
5757
static float GetExpectedSignal(const float& mom, const float& mass);
@@ -113,7 +113,7 @@ class ExpTimes
113113
float GetExpectedSigma(const DetectorResponse& response, const Coll& col, const Trck& trk) const;
114114

115115
/// Gets the number of sigmas with respect the expected time
116-
float GetSeparation(const DetectorResponse& response, const Coll& col, const Trck& trk) const { return (trk.tofSignal() - col.collisionTime() - GetExpectedSignal(col, trk)) / GetExpectedSigma(response, col, trk); }
116+
float GetSeparation(const DetectorResponse& response, const Coll& col, const Trck& trk) const { return (trk.tofSignal() - col.collisionTime() * 1000.f - GetExpectedSignal(col, trk)) / GetExpectedSigma(response, col, trk); }
117117
};
118118

119119
//_________________________________________________________________________
@@ -131,7 +131,7 @@ float ExpTimes<Coll, Trck, id>::GetExpectedSigma(const DetectorResponse& respons
131131
if (trk.tofSignal() <= 0) {
132132
return -999.f;
133133
}
134-
const float x[4] = {trk.p(), trk.tofSignal(), col.collisionTimeRes(), o2::track::PID::getMass2Z(id)};
134+
const float x[4] = {trk.p(), trk.tofSignal(), col.collisionTimeRes() * 1000.f, o2::track::PID::getMass2Z(id)};
135135
return response(response.kSigma, x);
136136
// return response(response.kSigma, const Coll& col, const Trck& trk, id);
137137
}

Analysis/Tasks/pidTOF.cxx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,15 +220,16 @@ struct pidTOFTaskQA {
220220

221221
void process(aod::Collision const& collision, soa::Join<aod::Tracks, aod::TracksExtra, aod::pidRespTOF, aod::pidRespTOFbeta> const& tracks)
222222
{
223+
const float collisionTime_ps = collision.collisionTime() * 1000.f;
223224
histos.fill(HIST("event/vertexz"), collision.posZ());
224-
histos.fill(HIST("event/colltime"), collision.collisionTime());
225+
histos.fill(HIST("event/colltime"), collisionTime_ps);
225226

226227
for (auto t : tracks) {
227228
//
228229
if (t.tofSignal() < 0) { // Skipping tracks without TOF
229230
continue;
230231
}
231-
const float tof = t.tofSignal() - collision.collisionTime();
232+
const float tof = t.tofSignal() - collisionTime_ps;
232233
//
233234
histos.fill(HIST("event/tofsignal"), t.p(), t.tofSignal());
234235
histos.fill(HIST("event/tofbeta"), t.p(), t.beta());

0 commit comments

Comments
 (0)