1 #include "artdaq-ots/Overlays/FragmentType.hh"
8 ots::FragmentType ots::toFragmentType(std::string t_string)
10 std::transform(t_string.begin(), t_string.end(), t_string.begin(), toupper);
11 auto it = std::find(names.begin(), names.end(), t_string);
12 return (it == names.end()) ? FragmentType::INVALID : static_cast<FragmentType>(artdaq::Fragment::FirstUserFragmentType + (it - names.begin()));
15 std::string ots::fragmentTypeToString(FragmentType val)
17 if(val < FragmentType::INVALID)
19 return names[val - FragmentType::MISSED];
23 return "INVALID/UNKNOWN";
27 std::map<artdaq::Fragment::type_t, std::string> ots::makeFragmentTypeMap()
29 auto output = artdaq::Fragment::MakeSystemTypeMap();
30 for(
auto name : names)
32 output[toFragmentType(name)] = name;