Skip to content

Commit

Permalink
Convert collision time to ps (#5026)
Browse files Browse the repository at this point in the history
  • Loading branch information
njacazio committed Jan 5, 2021
1 parent 7ed4626 commit 43e8fdf
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
10 changes: 5 additions & 5 deletions Analysis/DataModel/include/AnalysisDataModel/PID/PIDTOF.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,17 @@ class Beta
Beta() = default;
~Beta() = default;

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

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

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

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

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

/// Gets the number of sigmas with respect the expected time
float GetSeparation(const DetectorResponse& response, const Coll& col, const Trck& trk) const { return (trk.tofSignal() - col.collisionTime() - GetExpectedSignal(col, trk)) / GetExpectedSigma(response, col, trk); }
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); }
};

//_________________________________________________________________________
Expand All @@ -131,7 +131,7 @@ float ExpTimes<Coll, Trck, id>::GetExpectedSigma(const DetectorResponse& respons
if (trk.tofSignal() <= 0) {
return -999.f;
}
const float x[4] = {trk.p(), trk.tofSignal(), col.collisionTimeRes(), o2::track::PID::getMass2Z(id)};
const float x[4] = {trk.p(), trk.tofSignal(), col.collisionTimeRes() * 1000.f, o2::track::PID::getMass2Z(id)};
return response(response.kSigma, x);
// return response(response.kSigma, const Coll& col, const Trck& trk, id);
}
Expand Down
5 changes: 3 additions & 2 deletions Analysis/Tasks/pidTOF.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -220,15 +220,16 @@ struct pidTOFTaskQA {

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

for (auto t : tracks) {
//
if (t.tofSignal() < 0) { // Skipping tracks without TOF
continue;
}
const float tof = t.tofSignal() - collision.collisionTime();
const float tof = t.tofSignal() - collisionTime_ps;
//
histos.fill(HIST("event/tofsignal"), t.p(), t.tofSignal());
histos.fill(HIST("event/tofbeta"), t.p(), t.beta());
Expand Down

0 comments on commit 43e8fdf

Please sign in to comment.