1515#ifndef ALICEO2_track_PID_H_
1616#define ALICEO2_track_PID_H_
1717
18- #include < Rtypes.h >
18+ #include " GPUCommonRtypes.h "
1919#include " CommonConstants/PhysicsConstants.h"
2020
2121namespace o2
@@ -26,7 +26,7 @@ class PID
2626{
2727 public:
2828 // particle identifiers, continuos starting from 0
29- typedef std:: int32_t ID ;
29+ typedef uint8_t ID ;
3030
3131 static constexpr ID Electron = 0 ;
3232 static constexpr ID Muon = 1 ;
@@ -40,7 +40,17 @@ class PID
4040
4141 static constexpr ID First = Electron;
4242 static constexpr ID Last = Alpha; // /< if extra IDs added, update this !!!
43- static constexpr int NIDs = Last + 1 ; // /< number of defined IDs
43+ static constexpr ID NIDs = Last + 1 ; // /< number of defined IDs
44+
45+ // PID for derived particles
46+ static constexpr ID PI0 = 9 ;
47+ static constexpr ID Photon = 10 ;
48+ static constexpr ID K0 = 11 ;
49+ static constexpr ID Lambda = 12 ;
50+ static constexpr ID HyperTriton = 13 ;
51+ static constexpr ID FirstExt = PI0 ;
52+ static constexpr ID LastExt = HyperTriton;
53+ static constexpr ID NIDsTot = LastExt + 1 ; // /< total number of defined IDs
4454
4555 PID () = default ;
4656 PID (ID id) : mID (id) {}
@@ -49,6 +59,7 @@ class PID
4959 PID & operator =(const PID & src) = default ;
5060
5161 ID getID () const { return mID ; }
62+ operator ID () const { return getID (); }
5263
5364 float getMass () const { return getMass (mID ); }
5465 float getMass2Z () const { return getMass2Z (mID ); }
@@ -69,32 +80,39 @@ class PID
6980 return !*x && !*y ? true : /* default */ (*x == *y && sameStr (x + 1 , y + 1 ));
7081 }
7182
72- inline static constexpr int nameToID (char const * name, int id)
83+ inline static constexpr ID nameToID (char const * name, ID id)
7384 {
74- return id > Last ? id : sameStr (name, sNames [id]) ? id : nameToID (name, id + 1 );
85+ return id > LastExt ? id : sameStr (name, sNames [id]) ? id : nameToID (name, id + 1 );
7586 }
7687
77- static constexpr const char * sNames [NIDs + 1 ] = // /< defined particle names
78- {" Electron" , " Muon" , " Pion" , " Kaon" , " Proton" , " Deuteron" , " Triton" , " He3" , " Alpha" , nullptr };
88+ static constexpr const char * sNames [NIDsTot + 1 ] = // /< defined particle names
89+ {" Electron" , " Muon" , " Pion" , " Kaon" , " Proton" , " Deuteron" , " Triton" , " He3" , " Alpha" ,
90+ " Pion0" , " Photon" , " K0" , " Lambda" , " HyperTriton" ,
91+ nullptr };
7992
80- static constexpr const float sMasses [NIDs ] = // /< defined particle masses
93+ static constexpr const float sMasses [NIDsTot ] = // /< defined particle masses
8194 {o2::constants::physics::MassElectron, o2::constants::physics::MassMuon,
8295 o2::constants::physics::MassPionCharged, o2::constants::physics::MassKaonCharged,
8396 o2::constants::physics::MassProton, o2::constants::physics::MassDeuteron,
8497 o2::constants::physics::MassTriton, o2::constants::physics::MassHelium3,
85- o2::constants::physics::MassAlpha};
98+ o2::constants::physics::MassAlpha,
99+ o2::constants::physics::MassPionNeutral, o2::constants::physics::MassPhoton,
100+ o2::constants::physics::MassKaonNeutral, o2::constants::physics::MassLambda,
101+ o2::constants::physics::MassHyperTriton};
86102
87- static constexpr const float sMasses2Z [NIDs ] = // /< defined particle masses / Z
103+ static constexpr const float sMasses2Z [NIDsTot ] = // /< defined particle masses / Z
88104 {o2::constants::physics::MassElectron, o2::constants::physics::MassMuon,
89105 o2::constants::physics::MassPionCharged, o2::constants::physics::MassKaonCharged,
90106 o2::constants::physics::MassProton, o2::constants::physics::MassDeuteron,
91107 o2::constants::physics::MassTriton, o2::constants::physics::MassHelium3 / 2 .,
92- o2::constants::physics::MassAlpha / 2 .};
108+ o2::constants::physics::MassAlpha / 2 .,
109+ 0 , 0 , 0 , 0 , o2::constants::physics::MassHyperTriton};
93110
94- static constexpr const int sCharges [NIDs] = // /< defined particle charges
95- {1 , 1 , 1 , 1 , 1 , 1 , 1 , 2 , 2 };
111+ static constexpr const int sCharges [NIDsTot] = // /< defined particle charges
112+ {1 , 1 , 1 , 1 , 1 , 1 , 1 , 2 , 2 ,
113+ 0 , 0 , 0 , 0 , 1 };
96114
97- ClassDefNV (PID , 1 );
115+ ClassDefNV (PID , 2 );
98116};
99117} // namespace track
100118} // namespace o2
0 commit comments