16#ifndef ALICEO2_track_PID_H_
17#define ALICEO2_track_PID_H_
19#ifndef GPUCA_GPUCODE_DEVICE
33namespace pid_constants
36static constexpr ID NIDsTot = 19;
38#if !defined(GPUCA_GPUCODE_DEVICE) || defined(GPUCA_GPU_DEBUG_PRINT)
40 {
"Electron",
"Muon",
"Pion",
"Kaon",
"Proton",
"Deuteron",
"Triton",
"He3",
"Alpha",
41 "Pion0",
"Photon",
"K0",
"Lambda",
"HyperTriton",
"Hyperhydrog4",
"XiMinus",
"OmegaMinus",
"HyperHelium4",
"HyperHelium5",
nullptr};
82 {1, 1, 1, 1, 1, 1, 1, 2, 2,
122 static_assert(
NIDsTot ==
LastExt + 1,
"Incorrect NIDsTot, please update!");
131 GPUd() operator
ID()
const {
return getID(); }
133 GPUd() float getMass()
const {
return getMass(mID); }
134 GPUd() float getMass2()
const {
return getMass2(mID); }
135 GPUd() float getMass2Z()
const {
return getMass2Z(mID); }
136 GPUd()
int getCharge()
const {
return getCharge(mID); }
138 GPUd() static
float getMass(
ID id) {
return pid_constants::sMasses[
id]; }
139 GPUd() static
float getMass2(
ID id) {
return pid_constants::sMasses2[
id]; }
140 GPUd() static
float getMass2Z(
ID id) {
return pid_constants::sMasses2Z[
id]; }
141 GPUd() static
int getCharge(
ID id) {
return pid_constants::sCharges[
id]; }
142#if !defined(GPUCA_GPUCODE_DEVICE) || defined(GPUCA_GPU_DEBUG_PRINT)
153#if !defined(GPUCA_GPUCODE_DEVICE) || defined(GPUCA_GPU_DEBUG_PRINT)
155 GPUdi() static constexpr
bool sameStr(
char const*
x,
char const*
y)
157 return !*
x && !*
y ? true : (*
x == *
y && sameStr(
x + 1,
y + 1));
160 GPUdi() static constexpr
ID nameToID(
char const*
name,
ID id)
162 return id >
LastExt ?
id : sameStr(
name, pid_constants::sNames[
id]) ?
id : nameToID(
name,
id + 1);
std::string getName(const TDataMember *dm, int index, int size)
Header to collect physics constants.
GPUd() static float getMass(ID id)
static constexpr ID HyperHelium4
static constexpr ID Electron
static constexpr ID HyperTriton
static constexpr ID LastExt
static constexpr ID NIDs
number of defined IDs
static constexpr ID Last
if extra IDs added, update this !!!
static constexpr ID FirstExt
GPUdDefault() PID()=default
GPUd() operator ID() const
static constexpr ID Lambda
GPUd() static float getMass2(ID id)
static constexpr ID Helium3
GPUd() float getMass() const
GPUd() PID(const char *name)
GPUd() static const char *getName(ID id)
GPUd() static int getCharge(ID id)
static constexpr ID NIDsTot
total number of defined IDs
static constexpr ID HyperHelium5
static constexpr ID Deuteron
static constexpr ID OmegaMinus
static constexpr ID Photon
static constexpr ID Proton
static constexpr ID First
GPUd() const char *getName() const
GPUd() float getMass2() const
static constexpr ID Triton
GPUd() int getCharge() const
static constexpr ID XiMinus
static constexpr ID Hyperhydrog4
GPUd() float getMass2Z() const
GPUd() static float getMass2Z(ID id)
static constexpr ID Alpha
GLuint const GLchar * name
constexpr double MassPhoton
constexpr double MassLambda
constexpr double MassHyperhydrog4
constexpr double MassHelium3
constexpr double MassPionNeutral
constexpr double MassHyperHelium4
constexpr double MassHyperHelium5
constexpr double MassTriton
constexpr double MassMuon
constexpr double MassKaonCharged
constexpr double MassOmegaMinus
constexpr double MassXiMinus
constexpr double MassKaonNeutral
constexpr double MassDeuteron
constexpr double MassHyperTriton
constexpr double MassAlpha
constexpr double MassElectron
constexpr double MassProton
constexpr double MassPionCharged
GPUconstexpr() const char *sNames[NIDsTot+1]
defined particle names
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...