Project
Loading...
Searching...
No Matches
ECSDataAdapters.h
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
15
16#ifndef ALICEO2_ECSADAPTERS_H_
17#define ALICEO2_ECSADAPTERS_H_
18
19// NOTE: please only stdlib includes here!
20#include <string>
21#include <string_view>
22#include <array>
23
24namespace o2
25{
26namespace parameters
27{
28
29namespace GRPECS
30{
31
54static constexpr std::array<std::string_view, NRUNTYPES> RunTypeNames = {
55 "NONE",
56 "PHYSICS",
57 "TECHNICAL",
58 "PEDESTAL",
59 "PULSER",
60 "LASER",
61 "CALIBRATION_ITHR_TUNING",
62 "CALIBRATION_VCASN_TUNING",
63 "CALIBRATION_THR_SCAN",
64 "CALIBRATION_DIGITAL_SCAN",
65 "CALIBRATION_ANALOG_SCAN",
66 "CALIBRATION_FHR",
67 "CALIBRATION_ALPIDE_SCAN",
68 "CALIBRATION",
69 "COSMICS",
70 "SYNTHETIC",
71 "NOISE",
72 "CALIBRATION_PULSE_LENGTH",
73 "CALIBRATION_VRESETD"};
74
75//_______________________________________________
76static RunType string2RunType(const std::string& rts)
77{
78 int rt = -1;
79 for (int i = 0; i < int(RunType::NRUNTYPES); i++) {
80 if (rts == RunTypeNames[i]) {
81 rt = i;
82 break;
83 }
84 }
85 return RunType(rt);
86}
87
88//_______________________________________________
89static std::string getRawDataPersistencyMode(const std::string& runType, bool imposeRaw = false)
90{
91 if (imposeRaw) {
92 return "raw";
93 }
94 std::string ret = "other";
95 auto rt = string2RunType(runType);
96 switch (rt) {
99 ret = "raw";
100 break;
102 case RunType::PULSER:
103 case RunType::LASER:
114 ret = "calib";
115 default:
116 break;
117 }
118 return ret;
119}
120
121} // namespace GRPECS
122} // namespace parameters
123} // namespace o2
124
125#endif
int32_t i
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...