Project
Loading...
Searching...
No Matches
DCS.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
15
16#include <limits>
17
18#include "DataFormatsTPC/DCS.h"
19
20using namespace o2::tpc::dcs;
21
22//==============================================================================
23//
24//
25const std::unordered_map<std::string, int> Temperature::SensorNameMap = {
26 {"TPC_PT_351_TEMPERATURE", 0},
27 {"TPC_PT_376_TEMPERATURE", 1},
28 {"TPC_PT_415_TEMPERATURE", 2},
29 {"TPC_PT_447_TEMPERATURE", 3},
30 {"TPC_PT_477_TEMPERATURE", 4},
31 {"TPC_PT_488_TEMPERATURE", 5},
32 {"TPC_PT_537_TEMPERATURE", 6},
33 {"TPC_PT_575_TEMPERATURE", 7},
34 {"TPC_PT_589_TEMPERATURE", 8},
35 {"TPC_PT_629_TEMPERATURE", 9},
36 {"TPC_PT_664_TEMPERATURE", 10},
37 {"TPC_PT_695_TEMPERATURE", 11},
38 {"TPC_PT_735_TEMPERATURE", 12},
39 {"TPC_PT_757_TEMPERATURE", 13},
40 {"TPC_PT_797_TEMPERATURE", 14},
41 {"TPC_PT_831_TEMPERATURE", 15},
42 {"TPC_PT_851_TEMPERATURE", 16},
43 {"TPC_PT_895_TEMPERATURE", 17},
44};
45
46Temperature::Temperature() noexcept : raw(SensorsPerSide * SIDES)
47{
48 for (size_t i = 0; i < raw.size(); ++i) {
49 raw[i].sensorNumber = i;
50 }
51}
52
53//==============================================================================
54//
55//
56HV::HV() noexcept : voltages(2 * GEMSTACKSPERSECTOR * GEMSPERSTACK * SECTORSPERSIDE * SIDES),
59{
60 for (size_t i = 0; i < voltages.size(); ++i) {
61 voltages[i].sensorNumber = i;
62 currents[i].sensorNumber = i;
63 }
64 for (size_t i = 0; i < states.size(); ++i) {
65 states[i].sensorNumber = i;
66 }
67}
68
69const std::unordered_map<HV::StackState, std::string> HV::StackStateNameMap =
70 {
71 {StackState::OFF, "OFF"},
72 {StackState::STBY_CONFIGURED, "STBY_CONFIGURED"},
73 {StackState::INTERMEDIATE, "INTERMEDIATE"},
74 {StackState::ON, "ON"},
75 {StackState::ERROR, "ERROR"},
76 {StackState::ERROR_LOCAL, "ERROR_LOCAL"},
77 {StackState::SOFT_INTERLOCK, "SOFT_INTERLOCK"},
78 {StackState::INTERLOCK, "INTERLOCK"},
79 {StackState::RAMPIG_UP_LOW, "RAMPIG_UP_LOW"},
80 {StackState::RAMPIG_DOWN_LOW, "RAMPIG_DOWN_LOW"},
81 {StackState::RAMPIG_UP, "RAMPIG_UP"},
82 {StackState::RAMPIG_DOWN, "RAMPIG_DOWN"},
83 {StackState::MIXED, "MIXED"},
84 {StackState::NO_CONTROL, "NO_CONTROL"},
85};
86
88{
89 constexpr auto max = std::numeric_limits<dcs::TimeStampType>::max();
90 const std::vector<TimeStampType> times{
91 neon.data.size() ? neon.data.front().time : max,
92 co2.data.size() ? co2.data.front().time : max,
93 n2.data.size() ? n2.data.front().time : max,
94 argon.data.size() ? argon.data.front().time : max,
95 h2o.data.size() ? h2o.data.front().time : max,
96 o2.data.size() ? o2.data.front().time : max,
97 h2oSensor.data.size() ? h2oSensor.data.front().time : max,
98 o2Sensor.data.size() ? o2Sensor.data.front().time : max,
99 };
100
101 return *std::min_element(times.begin(), times.end());
102}
103
105{
106 constexpr auto min = 0;
107 const std::vector<TimeStampType> times{
108 neon.data.size() ? neon.data.back().time : min,
109 co2.data.size() ? co2.data.back().time : min,
110 n2.data.size() ? n2.data.back().time : min,
111 argon.data.size() ? argon.data.back().time : min,
112 h2o.data.size() ? h2o.data.back().time : min,
113 o2.data.size() ? o2.data.back().time : min,
114 h2oSensor.data.size() ? h2oSensor.data.back().time : min,
115 o2Sensor.data.size() ? o2Sensor.data.back().time : min,
116 };
117
118 return *std::max_element(times.begin(), times.end());
119}
std::vector< unsigned long > times
DCS data point data formats.
int32_t i
GLuint * states
Definition glcorearb.h:4932
uint64_t TimeStampType
Definition DCS.h:41
constexpr unsigned char SECTORSPERSIDE
Definition Defs.h:40
constexpr unsigned short GEMSPERSTACK
Definition Defs.h:58
constexpr unsigned char SIDES
Definition Defs.h:41
constexpr unsigned short GEMSTACKSPERSECTOR
Definition Defs.h:57
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
std::vector< DPType > data
Definition DCS.h:67
RawDPsF h2o
H2O measurement from gas chromatograph.
Definition DCS.h:395
RawDPsF neon
neon measurement from gas chromatograph
Definition DCS.h:391
TimeStampType getMaxTime() const
Definition DCS.cxx:104
TimeStampType getMinTime() const
Definition DCS.cxx:87
RawDPsF co2
CO2 measurement from gas chromatograph.
Definition DCS.h:392
RawDPsF h2oSensor
O2 measurement from dedicated gas sensor.
Definition DCS.h:397
RawDPsF argon
argon measurement from gas chromatograph
Definition DCS.h:394
RawDPsF o2Sensor
O2 measurement from dedicated gas sensor.
Definition DCS.h:398
RawDPsF n2
neon measurement from gas chromatograph
Definition DCS.h:393
std::vector< RawDPsF > voltages
voltages per GEM stack, counting is IROCs GEM1 top, bottom, GEM2 top, bottom, .. O1 ....
Definition DCS.h:306
static const std::unordered_map< StackState, std::string > StackStateNameMap
map state to string
Definition DCS.h:302
std::vector< RawDPsF > currents
currents per GEM stack, counting is IROCs GEM1 top, bottom, GEM2 top, bottom, .. O1 ....
Definition DCS.h:307
Temperature() noexcept
Definition DCS.cxx:46
static const std::unordered_map< std::string, int > SensorNameMap
Definition DCS.h:188
std::vector< RawDPsF > raw
raw temperature values from DCS for
Definition DCS.h:227
constexpr size_t min
constexpr size_t max