File tree Expand file tree Collapse file tree
DataFormats/Detectors/Common/include/DetectorsCommonDataFormats Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -131,6 +131,13 @@ class DetID
131131 static mask_t getMask (const std::string_view detList);
132132
133133 static std::string getNames (mask_t mask, char delimiter = ' ,' );
134+
135+ inline static constexpr int nameToID (char const * name, int id)
136+ {
137+ return id > Last ? -1 : sameStr (name, sDetNames [id]) ? id
138+ : nameToID (name, id + 1 );
139+ }
140+
134141#endif // GPUCA_GPUCODE_DEVICE
135142
136143 private:
@@ -143,11 +150,6 @@ class DetID
143150 ID mID = First; // /< detector ID
144151
145152#ifndef GPUCA_GPUCODE_DEVICE
146- inline static constexpr int nameToID (char const * name, int id)
147- {
148- return id > Last ? id : sameStr (name, sDetNames [id]) ? id : nameToID (name, id + 1 );
149- }
150-
151153 // detector names, will be defined in DataSources
152154 static constexpr const char * sDetNames [nDetectors + 1 ] = // /< defined detector names
153155#ifdef ENABLE_UPGRADES
You can’t perform that action at this time.
0 commit comments