Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert collision time to ps in TOF PID response #5026

Merged
merged 1 commit into from
Jan 5, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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