File tree Expand file tree Collapse file tree 2 files changed +13
-5
lines changed
DataFormats/Detectors/Common
include/DetectorsCommonDataFormats Expand file tree Collapse file tree 2 files changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -98,10 +98,18 @@ class DetID
9898 static constexpr std::string_view ALL{" all" }; // /< keywork for all detectors
9999#endif // GPUCA_GPUCODE_DEVICE
100100
101- GPUdi () DetID(ID id) : mID (id)
101+ constexpr GPUdi () DetID(ID id) : mID(id)
102102 {
103103 }
104- DetID (const char * name);
104+
105+ #ifndef GPUCA_GPUCODE_DEVICE
106+ constexpr DetID (const char * name) : mID(nameToID(name, First))
107+ {
108+ // construct from the name
109+ assert (mID < nDetectors);
110+ }
111+ #endif // GPUCA_GPUCODE_DEVICE
112+
105113 GPUdDefault () DetID(const DetID& src) = default ;
106114 GPUdDefault () DetID& operator =(const DetID& src) = default ;
107115 // we need default c-tor only for root persistency, code must use c-tor with argument
Original file line number Diff line number Diff line change @@ -61,14 +61,14 @@ DetID::mask_t DetID::getMask(const std::string_view detList)
6161 }
6262 return mask;
6363}
64-
64+ /*
6565//_______________________________
66- DetID::DetID (const char * name) : mID(nameToID(name, First))
66+ constexpr DetID::DetID(const char* name) : mID(nameToID(name, First))
6767{
6868 // construct from the name
6969 assert(mID < nDetectors);
7070}
71-
71+ */
7272// _______________________________
7373std::string DetID::getNames (DetID::mask_t mask, char delimiter)
7474{
You can’t perform that action at this time.
0 commit comments