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#include <fmt/format.h>
16#include <stdexcept>
17
18namespace o2::mch::dcs
19{
21{
22 switch (m) {
24 return "vMon";
26 return "iMon";
28 return "an";
30 return "di";
32 return "Sol";
33 }
34 return "INVALID";
35}
37{
38 std::array<MeasurementType, 5> measurements = {
39 MeasurementType::HV_V,
40 MeasurementType::HV_I,
41 MeasurementType::LV_V_FEE_ANALOG,
42 MeasurementType::LV_V_FEE_DIGITAL,
43 MeasurementType::LV_V_SOLAR};
44
45 for (const auto m : measurements) {
46 const auto mname = name(m);
47 if (alias.find(mname) != std::string::npos) {
48 return m;
49 }
50 }
51 throw std::invalid_argument(fmt::format("Cannot infer the measurementType for alias={}", alias));
52}
53
54} // 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)