27#include <unordered_map>
39 for (
const auto& it : pids) {
41 mDpData[it].makeEmpty();
51 LOG(info) <<
"\n\nProcessing new DCS DP map\n-------------------------";
55 std::unordered_map<DPID, DPVAL> mapin;
56 for (
auto& it : dps) {
57 mapin[it.id] = it.data;
59 for (
auto& it : mPids) {
60 const auto& el = mapin.find(it.first);
61 if (el == mapin.end()) {
62 LOG(
debug) <<
"DP " << it.first <<
" not found in DPs from DCS";
64 LOG(
debug) <<
"DP " << it.first <<
" found in DPs from DCS";
70 for (
const auto& it : dps) {
72 const auto& el = mPids.find(it.id);
73 if (el == mPids.end()) {
74 LOG(info) <<
"DP " << it.id <<
" not found in FITDCSProcessor, we will not process it";
87 const auto& dpid = dpcom.
id;
93 LOG(info) <<
"Processing DP = " << dpcom <<
" (epoch " <<
val.get_epoch_time() <<
"), with value = " << o2::dcs::getValue<double>(dpcom);
95 LOG(info) <<
"Processing DP = " << dpcom <<
" (epoch " <<
val.get_epoch_time() <<
"), with value = " << o2::dcs::getValue<uint>(dpcom);
102 if (mDpData[dpid].
values.empty() ||
val.get_epoch_time() > mDpData[dpid].values.back().first) {
103 dpValueConverter.raw_data =
val.payload_pt1;
105 mDpData[dpid].add(
val.get_epoch_time(), llround(dpValueConverter.double_value * 1000));
107 mDpData[dpid].add(
val.get_epoch_time(), dpValueConverter.uint_value);
123 LOG(
debug) <<
"KEEP_ALIVE_FLAG active for DP " <<
pid;
144 LOG(
debug) <<
"OVERWRITE_FLAG active for DP " <<
pid;
150 LOG(
debug) <<
"DIM_ERROR_FLAG active for DP " <<
pid;
153 LOG(
debug) <<
"BAD_DPID_FLAG active for DP " <<
pid;
156 LOG(
debug) <<
"BAD_FLAGS_FLAG active for DP " <<
pid;
159 LOG(
debug) <<
"BAD_TIMESTAMP_FLAG active for DP " <<
pid;
162 LOG(
debug) <<
"BAD_PAYLOAD_FLAG active for DP " <<
pid;
165 LOG(
debug) <<
"BAD_FBI_FLAG active for DP " <<
pid;
175 for (
auto& dp : mDpData) {
179 LOG(info) <<
"PID = " << dp.first.get_alias();
184 std::map<std::string, std::string> metadata;
Utils and constants for calibration and related workflows.
DCS data point reader for FIT.
std::string ccdbPath(const std::string badChannelType)
static constexpr long DAY
static constexpr long INFINITE_TIMESTAMP
DeliveryType get_type() const noexcept
const std::string & getCcdbPath() const
bool getVerboseMode() const
uint64_t processFlags(uint64_t flag, const char *pid)
void setVerboseMode(bool verboseMode=true)
void resetStartValidity()
const CcdbObjectInfo & getccdbDPsInfo() const
void setStartValidity(long startValidity)
void init(const std::vector< DPID > &pids)
void updateCcdbObjectInfo()
int processDP(const DPCOM &dpcom)
const std::unordered_map< DPID, DCSDPValues > & getDpData() const
bool isStartValiditySet() const
int process(const gsl::span< const DPCOM > dps)
long getStartValidity() const
void setCcdbPath(const std::string &ccdbPath)
long getEndValidity() const
GLint GLint GLsizei GLint GLenum GLenum type
GLenum GLsizei GLsizei GLint * values
static void prepareCCDBobjectInfo(T &obj, o2::ccdb::CcdbObjectInfo &info, const std::string &path, const std::map< std::string, std::string > &md, long start, long end=-1)
const DataPointIdentifier id
static constexpr uint16_t BAD_TIMESTAMP_FLAG
static constexpr uint16_t WRITE_FLAG
static constexpr uint16_t DIRTY_FLAG
static constexpr uint64_t TURN_FLAG
static constexpr uint16_t END_FLAG
static constexpr uint16_t BAD_PAYLOAD_FLAG
static constexpr uint16_t BAD_DPID_FLAG
static constexpr uint16_t KEEP_ALIVE_FLAG
static constexpr uint16_t DIM_ERROR_FLAG
static constexpr uint16_t OVERWRITE_FLAG
static constexpr uint16_t BAD_FBI_FLAG
static constexpr uint16_t VICTIM_FLAG
static constexpr uint16_t BAD_FLAGS_FLAG
static constexpr uint16_t READ_FLAG
static constexpr uint16_t NEW_FLAG
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"