20#include <fairlogger/Logger.h>
26constexpr const char* DetID::sDetNames[DetID::nDetectors + 1];
29constexpr DetID::ID DetID::ITS, DetID::TPC, DetID::TRD, DetID::TOF, DetID::PHS, DetID::CPV, DetID::EMC,
30 DetID::HMP, DetID::MFT, DetID::MCH, DetID::MID, DetID::ZDC, DetID::FT0, DetID::FV0, DetID::FDD, DetID::TST, DetID::CTP, DetID::FOC, DetID::First,
DetID::Last;
39constexpr int DetID::nDetectors;
45 std::string ss(detList), sname{};
46 if (ss.find(
NONE) != std::string::npos) {
49 if (ss.find(
ALL) != std::string::npos) {
53 std::replace(ss.begin(), ss.end(),
' ',
',');
54 std::replace(ss.begin(), ss.end(),
';',
',');
56 for (
auto& dname : dv) {
59 throw std::runtime_error(fmt::format(
"Wrong entry {:s} in detectors list {:s}", dname, detList));
78 for (
auto id = DetID::First;
id <=
DetID::Last;
id++) {
ClassImp(o2::detectors::DetID)
Static class with identifiers, bitmasks and names for ALICE detectors.
static constexpr const char * getName(ID id)
names of defined detectors
static constexpr std::string_view NONE
keywork for no-detector
static constexpr std::string_view ALL
keywork for all detectors
static std::string getNames(mask_t mask, char delimiter=',')
static constexpr int nameToID(char const *name, int id=First)
static constexpr ID Last
if extra detectors added, update this !!!
static mask_t getMask(const std::string_view detList)
detector masks from any non-alpha-num delimiter-separated list (empty if NONE is supplied)
static std::vector< std::string > tokenize(const std::string &src, char delim, bool trimToken=true, bool skipEmpty=true)