Project
Loading...
Searching...
No Matches
MeasurementType.cxx
Go to the documentation of this file.
1// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3// All rights not expressly granted are reserved.
4//
5// This software is distributed under the terms of the GNU General Public
6// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7//
8// In applying this license CERN does not waive the privileges and immunities
9// granted to it by virtue of its status as an Intergovernmental Organization
10// or submit itself to any jurisdiction.
11
13#include <array>
14#include <fmt/core.h>
15
16namespace o2::mch::dcs
17{
19{
20 switch (m) {
22 return "vMon";
24 return "iMon";
26 return "an";
28 return "di";
30 return "Sol";
31 }
32 return "INVALID";
33}
35{
36 std::array<MeasurementType, 5> measurements = {
37 MeasurementType::HV_V,
38 MeasurementType::HV_I,
39 MeasurementType::LV_V_FEE_ANALOG,
40 MeasurementType::LV_V_FEE_DIGITAL,
41 MeasurementType::LV_V_SOLAR};
42
43 for (const auto m : measurements) {
44 const auto mname = name(m);
45 if (alias.find(mname) != std::string::npos) {
46 return m;
47 }
48 }
49 throw std::invalid_argument(fmt::format("Cannot infer the measurementType for alias={}", alias));
50}
51
52} // namespace o2::mch::dcs
const GLfloat * m
Definition glcorearb.h:4066
GLuint const GLchar * name
Definition glcorearb.h:781
MeasurementType aliasToMeasurementType(std::string_view alias)