@@ -33,7 +33,7 @@ namespace o2cp = o2::constants::physics;
3333namespace pid_constants // GPUs currently cannot have static constexpr array members
3434{
3535typedef uint8_t ID ;
36- static constexpr ID NIDsTot = 19 ;
36+ static GPUglobalconstexpr () ID NIDsTot = 19;
3737
3838#if !defined(GPUCA_GPUCODE_DEVICE) || defined(GPUCA_GPU_DEBUG_PRINT)
3939GPUconstexpr () const char* sNames[NIDsTot + 1] = // /< defined particle names
@@ -49,24 +49,24 @@ GPUconstexpr() const float sMasses[NIDsTot] = ///< defined particle masses
4949
5050GPUconstexpr () const float sMasses2 [NIDsTot] = // /< defined particle masses^2
5151 {o2cp::MassElectron * o2cp::MassElectron,
52- o2cp::MassMuon* o2cp::MassMuon,
53- o2cp::MassPionCharged* o2cp::MassPionCharged,
54- o2cp::MassKaonCharged* o2cp::MassKaonCharged,
55- o2cp::MassProton* o2cp::MassProton,
56- o2cp::MassDeuteron* o2cp::MassDeuteron,
57- o2cp::MassTriton* o2cp::MassTriton,
58- o2cp::MassHelium3* o2cp::MassHelium3,
59- o2cp::MassAlpha* o2cp::MassAlpha,
60- o2cp::MassPionNeutral* o2cp::MassPionNeutral,
61- o2cp::MassPhoton* o2cp::MassPhoton,
62- o2cp::MassKaonNeutral* o2cp::MassKaonNeutral,
63- o2cp::MassLambda* o2cp::MassLambda,
64- o2cp::MassHyperTriton* o2cp::MassHyperTriton,
65- o2cp::MassHyperhydrog4* o2cp::MassHyperhydrog4,
66- o2cp::MassXiMinus* o2cp::MassXiMinus,
67- o2cp::MassOmegaMinus* o2cp::MassOmegaMinus,
68- o2cp::MassHyperHelium4* o2cp::MassHyperHelium4,
69- o2cp::MassHyperHelium5* o2cp::MassHyperHelium5};
52+ o2cp::MassMuon * o2cp::MassMuon,
53+ o2cp::MassPionCharged * o2cp::MassPionCharged,
54+ o2cp::MassKaonCharged * o2cp::MassKaonCharged,
55+ o2cp::MassProton * o2cp::MassProton,
56+ o2cp::MassDeuteron * o2cp::MassDeuteron,
57+ o2cp::MassTriton * o2cp::MassTriton,
58+ o2cp::MassHelium3 * o2cp::MassHelium3,
59+ o2cp::MassAlpha * o2cp::MassAlpha,
60+ o2cp::MassPionNeutral * o2cp::MassPionNeutral,
61+ o2cp::MassPhoton * o2cp::MassPhoton,
62+ o2cp::MassKaonNeutral * o2cp::MassKaonNeutral,
63+ o2cp::MassLambda * o2cp::MassLambda,
64+ o2cp::MassHyperTriton * o2cp::MassHyperTriton,
65+ o2cp::MassHyperhydrog4 * o2cp::MassHyperhydrog4,
66+ o2cp::MassXiMinus * o2cp::MassXiMinus,
67+ o2cp::MassOmegaMinus * o2cp::MassOmegaMinus,
68+ o2cp::MassHyperHelium4 * o2cp::MassHyperHelium4,
69+ o2cp::MassHyperHelium5 * o2cp::MassHyperHelium5};
7070
7171GPUconstexpr () const float sMasses2Z [NIDsTot] = // /< defined particle masses / Z
7272 {o2cp::MassElectron, o2cp::MassMuon,
@@ -91,34 +91,34 @@ class PID
9191 // particle identifiers, continuos starting from 0
9292 typedef pid_constants::ID ID ;
9393
94- static constexpr ID Electron = 0 ;
95- static constexpr ID Muon = 1 ;
96- static constexpr ID Pion = 2 ;
97- static constexpr ID Kaon = 3 ;
98- static constexpr ID Proton = 4 ;
99- static constexpr ID Deuteron = 5 ;
100- static constexpr ID Triton = 6 ;
101- static constexpr ID Helium3 = 7 ;
102- static constexpr ID Alpha = 8 ;
94+ static GPUglobalconstexpr () ID Electron = 0;
95+ static GPUglobalconstexpr () ID Muon = 1;
96+ static GPUglobalconstexpr () ID Pion = 2;
97+ static GPUglobalconstexpr () ID Kaon = 3;
98+ static GPUglobalconstexpr () ID Proton = 4;
99+ static GPUglobalconstexpr () ID Deuteron = 5;
100+ static GPUglobalconstexpr () ID Triton = 6;
101+ static GPUglobalconstexpr () ID Helium3 = 7;
102+ static GPUglobalconstexpr () ID Alpha = 8;
103103
104- static constexpr ID First = Electron;
105- static constexpr ID Last = Alpha; // /< if extra IDs added, update this !!!
106- static constexpr ID NIDs = Last + 1 ; // /< number of defined IDs
104+ static GPUglobalconstexpr () ID First = Electron;
105+ static GPUglobalconstexpr () ID Last = Alpha; // /< if extra IDs added, update this !!!
106+ static GPUglobalconstexpr () ID NIDs = Last + 1; // /< number of defined IDs
107107
108108 // PID for derived particles
109- static constexpr ID PI0 = 9 ;
110- static constexpr ID Photon = 10 ;
111- static constexpr ID K0 = 11 ;
112- static constexpr ID Lambda = 12 ;
113- static constexpr ID HyperTriton = 13 ;
114- static constexpr ID Hyperhydrog4 = 14 ;
115- static constexpr ID XiMinus = 15 ;
116- static constexpr ID OmegaMinus = 16 ;
117- static constexpr ID HyperHelium4 = 17 ;
118- static constexpr ID HyperHelium5 = 18 ;
119- static constexpr ID FirstExt = PI0 ;
120- static constexpr ID LastExt = HyperHelium5;
121- static constexpr ID NIDsTot = pid_constants::NIDsTot; // /< total number of defined IDs
109+ static GPUglobalconstexpr () ID PI0 = 9;
110+ static GPUglobalconstexpr () ID Photon = 10;
111+ static GPUglobalconstexpr () ID K0 = 11;
112+ static GPUglobalconstexpr () ID Lambda = 12;
113+ static GPUglobalconstexpr () ID HyperTriton = 13;
114+ static GPUglobalconstexpr () ID Hyperhydrog4 = 14;
115+ static GPUglobalconstexpr () ID XiMinus = 15;
116+ static GPUglobalconstexpr () ID OmegaMinus = 16;
117+ static GPUglobalconstexpr () ID HyperHelium4 = 17;
118+ static GPUglobalconstexpr () ID HyperHelium5 = 18;
119+ static GPUglobalconstexpr () ID FirstExt = PI0;
120+ static GPUglobalconstexpr () ID LastExt = HyperHelium5;
121+ static GPUglobalconstexpr () ID NIDsTot = pid_constants::NIDsTot; // /< total number of defined IDs
122122 static_assert (NIDsTot == LastExt + 1 , " Incorrect NIDsTot, please update!" );
123123
124124 GPUdDefault () PID () = default ;
@@ -159,7 +159,8 @@ class PID
159159
160160 GPUdi () static constexpr ID nameToID(char const * name, ID id)
161161 {
162- return id > LastExt ? id : sameStr (name, pid_constants::sNames [id]) ? id : nameToID (name, id + 1 );
162+ return id > LastExt ? id : sameStr (name, pid_constants::sNames [id]) ? id
163+ : nameToID (name, id + 1 );
163164 }
164165#endif
165166
0 commit comments