Project
Loading...
Searching...
No Matches
DCSProcessor.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 O2_TPC_DCSProcessor_H_
17#define O2_TPC_DCSProcessor_H_
18
19#include <memory>
20#include <gsl/span>
21#include <algorithm>
22#include <limits>
23
24#include "Rtypes.h"
25
28#include "DataFormatsTPC/DCS.h"
29
31
32namespace o2::tpc
33{
35{
36 public:
41
42 void process(const gsl::span<const DPCOM> dps);
43
44 float getValueF(const DPCOM& dp) const;
45
46 void fillTemperature(const DPCOM& dp);
47 void fillHV(const DPCOM& dp);
48 void fillGas(const DPCOM& dp);
49 void fillPressure(const DPCOM& dp);
50 void finalizeSlot();
51 void finalize();
52
55 void finalizeGas();
56 void finalizePressure();
57
59 void setDebugOutputName(std::string_view name) { mDebugOutputName = name; }
60
62 void setWriteDebug(const bool debug = true) { mWriteDebug = debug; }
63
65 void writeDebug();
66
68 void setFitInterval(dcs::TimeStampType interval) { mFitInterval = interval; }
69
71 void setPressureInterval(dcs::TimeStampType interval) { mPressureInterval = interval; }
72
73 void setRefPressureInterval(dcs::TimeStampType interval) { mPressureIntervalRef = interval; }
74
76 auto getFitInterval() const { return mFitInterval; }
77
79 auto getPressureInterval() const { return mPressureInterval; }
80
82 void setRoundToInterval(const bool round = true) { mRoundToInterval = round; }
83
85 void reset()
86 {
87 mTemperature.clear();
88 mHighVoltage.clear();
89 mGas.clear();
90 mPressure.clear();
91
92 mTimeTemperature = {};
93 mTimeHighVoltage = {};
94 mTimeGas = {};
95 }
96
98 bool hasData() const { return mHasData; }
99
100 const auto& getTimeTemperature() const { return mTimeTemperature; }
101 const auto& getTimeHighVoltage() const { return mTimeHighVoltage; }
102 const auto& getTimeGas() const { return mTimeGas; }
103 const auto& getTimePressure() const { return mTimePressure; }
104
107 auto getPressureCCDBStartTime() const { return mPressureCCDBStartTime; }
108
109 auto& getTemperature() { return mTemperature; }
110 auto& getHighVoltage() { return mHighVoltage; }
111 auto& getGas() { return mGas; }
112 auto& getPressure() { return mPressure; }
113
114 private:
115 dcs::Temperature mTemperature;
116 dcs::HV mHighVoltage;
117 dcs::Gas mGas;
118 dcs::Pressure mPressure;
119
120 TimeRange mTimeTemperature;
121 TimeRange mTimeHighVoltage;
122 TimeRange mTimeGas;
123 TimeRange mTimePressure;
124
125 dcs::TimeStampType mFitInterval{5 * 60 * 1000};
126 dcs::TimeStampType mPressureInterval{200 * 1000};
127 dcs::TimeStampType mPressureIntervalRef{60 * 60 * 1000};
128 dcs::TimeStampType mLastPressureOutputEndTime{0};
129 dcs::TimeStampType mPressureCCDBStartTime{0};
130 bool mWriteDebug{false};
131 bool mRoundToInterval{false};
132 bool mHasData{false};
133 std::string mDebugOutputName{"DCS_debug.root"};
134 std::unique_ptr<o2::utils::TreeStreamRedirector> mDebugStream;
135
136 ClassDefNV(DCSProcessor, 0);
137};
138
139} // namespace o2::tpc
140#endif
DCS data point data formats.
std::ostringstream debug
Timeframe settings Average distance in cm of events merged into Randomize distance around average distance of merged events Simulate correct bunch interactions instead of placing only the average number of events A value[n] sets TFlen for[n] collisions in Number of bunches per trainsort Number of bunch trains Instantaneous interaction rate Do not simulate border Total number of collisions to be placed in the interior of all time Do not select random but walk over array of events in stride steps h Event generator settings h configStandalone Use CPU for GPU Force usage of the specified GPU device no CPU fallback Continue processing after an error First event to process
Timeframe settings Average distance in cm of events merged into Randomize distance around average distance of merged events Simulate correct bunch interactions instead of placing only the average number of events A value[n] sets TFlen for[n] collisions in Number of bunches per trainsort Number of bunch trains Instantaneous interaction rate Do not simulate border Total number of collisions to be placed in the interior of all time Do not select random but walk over array of events in stride steps h Event generator settings h configStandalone Use CPU for GPU Force usage of the specified GPU device no CPU fallback Continue processing after an error First event to Number of events to Number of iterations to Number of iterations to Number of initial iterations excluded from const char Directory with events to Events directory is and not inside events Show standalone event Run event generator maximum time bin of continuous for triggered for automatic continuous for automatic continuous triggered uint64_t
auto getPressureCCDBStartTime() const
const auto & getTimeGas() const
void fillPressure(const DPCOM &dp)
const auto & getTimePressure() const
bool hasData() const
if data to process
void setFitInterval(dcs::TimeStampType interval)
set the fit interval
void setWriteDebug(const bool debug=true)
if to write debug information
void fillHV(const DPCOM &dp)
const auto & getTimeTemperature() const
void reset()
reset all data
void setRefPressureInterval(dcs::TimeStampType interval)
void setRoundToInterval(const bool round=true)
round to fit interval
void fillTemperature(const DPCOM &dp)
float getValueF(const DPCOM &dp) const
void setDebugOutputName(std::string_view name)
name of the debug output tree
void setPressureInterval(dcs::TimeStampType interval)
set the interval for averaging the pressure values
void writeDebug()
write the debug output tree
auto getPressureInterval() const
get fit interval
const auto & getTimeHighVoltage() const
auto getFitInterval() const
get fit interval
void fillGas(const DPCOM &dp)
GLuint const GLchar * name
Definition glcorearb.h:781
GLint first
Definition glcorearb.h:399
uint64_t TimeStampType
Definition DCS.h:45
Global TPC definitions and constants.
void clear()
Definition DCS.h:519
void clear()
Definition DCS.h:430
void clear()
\clear all stored data except the buffer
Definition DCS.cxx:305