17#ifndef AliceO2_TPC_PIDResponse_H
18#define AliceO2_TPC_PIDResponse_H
49 GPUd()
void setMIP(
float mip) { mMIP = mip; }
50 GPUd()
void setChargeFactor(
float chargeFactor) { mChargeFactor = chargeFactor; }
53 GPUd()
const float* getBetheBlochParams()
const {
return mBetheBlochParams; }
54 GPUd() float getMIP()
const {
return mMIP; }
55 GPUd() float getChargeFactor()
const {
return mChargeFactor; }
61 GPUd()
o2::track::
PID::
ID getMostProbablePID(
const TrackTPC& track,
float PID_EKrangeMin,
float PID_EKrangeMax,
float PID_EPrangeMin,
float PID_EPrangeMax,
float PID_EDrangeMin,
float PID_EDrangeMax,
float PID_ETrangeMin,
float PID_ETrangeMax,
char PID_useNsigma,
float PID_sigma)
const;
64 float mBetheBlochParams[5] = {0.19310481, 4.26696118, 0.00522579, 2.38124907, 0.98055396};
66 float mChargeFactor = 2.299999952316284f;
73 for (
int i = 0;
i < 5;
i++) {
74 mBetheBlochParams[
i] = betheBlochParams[
i];
78GPUd() float PIDResponse::getExpectedSignal(const
TrackTPC& track, const
o2::track::
PID::
ID id)
const
80 const float bg =
static_cast<float>(track.getP() / o2::track::pid_constants::sMasses[
id]);
84 const float bethe = mMIP * o2::tpc::BetheBlochAleph(bg, mBetheBlochParams[0], mBetheBlochParams[1], mBetheBlochParams[2], mBetheBlochParams[3], mBetheBlochParams[4]) * o2::gpu::GPUCommonMath::Pow(
static_cast<float>(o2::track::pid_constants::sCharges[
id]), mChargeFactor);
85 return bethe >= 0. ? bethe : -999.;
89GPUd()
o2::track::
PID::
ID PIDResponse::getMostProbablePID(const
TrackTPC& track,
float PID_EKrangeMin,
float PID_EKrangeMax,
float PID_EPrangeMin,
float PID_EPrangeMax,
float PID_EDrangeMin,
float PID_EDrangeMax,
float PID_ETrangeMin,
float PID_ETrangeMax,
char PID_useNsigma,
float PID_sigma)
const
91 const float dEdx =
track.getdEdx().dEdxTotTPC;
94 return o2::track::PID::Pion;
97 auto id = o2::track::PID::Electron;
98 float distanceMin = 0.;
99 float dEdxExpected = getExpectedSignal(track,
id);
102 distanceMin = o2::gpu::GPUCommonMath::Abs((dEdx - dEdxExpected) / (PID_sigma * dEdxExpected));
105 distanceMin = o2::gpu::GPUCommonMath::Abs(dEdx - dEdxExpected);
112 dEdxExpected = getExpectedSignal(track,
i);
115 distance = o2::gpu::GPUCommonMath::Abs((dEdx - dEdxExpected) / (PID_sigma * dEdxExpected));
118 distance = o2::gpu::GPUCommonMath::Abs(dEdx - dEdxExpected);
127 if (
id == o2::track::PID::Electron) {
128 const float p =
track.getP();
129 if ((p > PID_EKrangeMin) && (p < PID_EKrangeMax)) {
130 id = o2::track::PID::Kaon;
131 }
else if ((p > PID_EPrangeMin) && (p < PID_EPrangeMax)) {
132 id = o2::track::PID::Proton;
133 }
else if ((p > PID_EDrangeMin) && (p < PID_EDrangeMax)) {
134 id = o2::track::PID::Deuteron;
135 }
else if ((p > PID_ETrangeMin) && (p < PID_ETrangeMax)) {
136 id = o2::track::PID::Triton;
GPUd() float getMIP() const
GPUd() void setChargeFactor(float chargeFactor)
GPUd() void setBetheBlochParams(const float betheBlochParams[5])
setters
const o2::track::PID::ID id const
PIDResponse()=default
default constructor
~PIDResponse()=default
default destructor
GPUd() const float *getBetheBlochParams() const
getters
GPUd() float getChargeFactor() const
GLsizei GLsizei GLfloat distance
typedef void(APIENTRYP PFNGLCULLFACEPROC)(GLenum mode)
const bool const int TrackITSInternal< NLayers > & track
Global TPC definitions and constants.
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...