31 if (dps.size() == 0) {
37 using namespace std::literals;
38 constexpr auto TEMP_ID{
"TPC_PT"sv};
39 constexpr auto HV_ID{
"TPC_HV"sv};
40 constexpr auto GAS_ID1{
"TPC_GC"sv};
41 constexpr auto GAS_ID2{
"TPC_An"sv};
42 constexpr auto PRESS_ID1{
"Cavern"sv};
43 constexpr auto PRESS_ID2{
"Surfac"sv};
45 for (
const auto& dp : dps) {
46 const std::string_view alias(dp.id.get_alias());
47 const auto id = alias.substr(0, 6);
49 LOGP(
debug,
"Temperature DP: {}", alias);
51 }
else if (
id == HV_ID) {
52 LOGP(
debug,
"HV DP: {}", alias);
54 }
else if (
id == GAS_ID1 ||
id == GAS_ID2) {
55 LOGP(
debug,
"Gas DP: {}", alias);
57 }
else if (
id == PRESS_ID1 ||
id == PRESS_ID2) {
58 LOGP(
debug,
"Pressure DP: {}", alias);
61 LOGP(warning,
"Unknown data point: {} with id {}", alias,
id);
68 if (dp.
id.
get_type() == DeliveryType::DPVAL_FLOAT) {
69 return o2::dcs::getValue<float>(dp);
70 }
else if (dp.
id.
get_type() == DeliveryType::DPVAL_DOUBLE) {
71 return static_cast<float>(o2::dcs::getValue<double>(dp));
93 if (alias.back() ==
'S') {
96 static bool statTypePrinted =
false;
97 if (!statTypePrinted) {
98 LOGP(info,
"Delivery type for STATUS ({}): {}", alias, (
int)
type);
99 statTypePrinted =
true;
101 if (
type == DeliveryType::DPVAL_UINT) {
102 value = o2::dcs::getValue<uint32_t>(dp);
103 }
else if (
type == DeliveryType::DPVAL_INT) {
104 value = uint32_t(o2::dcs::getValue<int32_t>(dp));
111 static bool uiTypePrinted =
false;
112 if (!uiTypePrinted) {
113 LOGP(info,
"Delivery type for current, voltage ({}): {}", alias, (
int)
type);
114 uiTypePrinted =
true;
151 mTimeTemperature = {getMinTime(mTemperature.
raw, mRoundToInterval, mFitInterval), getMaxTime(mTemperature.
raw)};
158 auto minTime = getMinTime(mHighVoltage.
currents, mRoundToInterval, mFitInterval);
159 minTime = std::min(minTime, getMinTime(mHighVoltage.
voltages, mRoundToInterval, mFitInterval));
160 minTime = std::min(minTime, getMinTime(mHighVoltage.
states, mRoundToInterval, mFitInterval));
162 auto maxTime = getMaxTime(mHighVoltage.
currents);
163 maxTime = std::max(maxTime, getMaxTime(mHighVoltage.
voltages));
164 maxTime = std::max(maxTime, getMaxTime(mHighVoltage.
states));
166 mTimeHighVoltage = {minTime, maxTime};
180 if (mTimePressure.
last > 0) {
188 mDebugStream = std::make_unique<o2::utils::TreeStreamRedirector>(mDebugOutputName.data(),
"recreate");
191 *mDebugStream <<
"dcs"
192 <<
"Temperature=" << mTemperature
193 <<
"HV=" << mHighVoltage
195 <<
"Pressure=" << mPressure
202 mDebugStream->Close();
TPC DCS data point processor.
DeliveryType get_type() const noexcept
const char *const get_alias() const noexcept
void fillPressure(const DPCOM &dp)
void finalizeHighVoltage()
void process(const gsl::span< const DPCOM > dps)
void fillHV(const DPCOM &dp)
void fillTemperature(const DPCOM &dp)
float getValueF(const DPCOM &dp) const
void writeDebug()
write the debug output tree
void finalizeTemperature()
void fillGas(const DPCOM &dp)
GLsizei const GLfloat * value
GLint GLint GLsizei GLint GLenum GLenum type
Global TPC definitions and constants.
const DataPointIdentifier id
uint64_t get_epoch_time() const noexcept
void fill(std::string_view sensor, const TimeStampType time, const DataType value)
TimeStampType getMaxTime() const
TimeStampType getMinTime() const
std::vector< RawDPsF > voltages
voltages per GEM stack, counting is IROCs GEM1 top, bottom, GEM2 top, bottom, .. O1 ....
std::vector< RawDPsState > states
HV state per sector.
std::vector< RawDPsF > currents
currents per GEM stack, counting is IROCs GEM1 top, bottom, GEM2 top, bottom, .. O1 ....
void fillStatus(std::string_view sensor, const TimeStampType time, const uint32_t value)
Fill stack status information.
void fillUI(std::string_view sensor, const TimeStampType time, const DataType value)
Fill voltage and current information.
void sortAndClean(float pMin=800, float pMax=1100)
void fill(std::string_view sensor, const TimeStampType time, const DataType value)
fill pressure data
void makeRobustPressure(TimeStampType timeInterval=100 *1000, TimeStampType timeIntervalRef=24 *60 *1000, TimeStampType tStart=1, TimeStampType tEnd=0, const int nthreads=1)
average pressure values for given time interval
TimeStampType getMinTime() const
TimeStampType getMaxTime() const
void fitTemperature(Side side, dcs::TimeStampType fitInterval=5 *60 *1000, const bool roundToInterval=false)
make fit of the mean temperature and gradients in time intervals
std::vector< RawDPsF > raw
raw temperature values from DCS for
void fill(std::string_view sensor, const TimeStampType time, const DataType temperature)