Project
Loading...
Searching...
No Matches
FITDCSDataReader.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
16
17#ifndef O2_FIT_DCSDATAREADER_H
18#define O2_FIT_DCSDATAREADER_H
19
20#include "CCDB/CcdbObjectInfo.h"
25#include "Rtypes.h"
26
27#include <gsl/gsl>
28#include <string>
29#include <unordered_map>
30#include <vector>
31#include <unordered_map>
32
33namespace o2
34{
35namespace fit
36{
37
39{
40 public:
45
46 FITDCSDataReader() = default;
47 ~FITDCSDataReader() = default;
48
49 void init(const std::vector<DPID>& pids);
50 int process(const gsl::span<const DPCOM> dps);
51 int processDP(const DPCOM& dpcom);
52 uint64_t processFlags(uint64_t flag, const char* pid);
54
55 const std::unordered_map<DPID, DCSDPValues>& getDpData() const;
56 void resetDpData();
57 const std::string& getCcdbPath() const;
58 void setCcdbPath(const std::string& ccdbPath);
59 long getStartValidity() const;
60 void setStartValidity(long startValidity);
61 bool isStartValiditySet() const;
62 void resetStartValidity();
63 long getEndValidity() const;
64 const CcdbObjectInfo& getccdbDPsInfo() const;
66
67 bool getVerboseMode() const;
68 void setVerboseMode(bool verboseMode = true);
69
70 private:
71 std::unordered_map<DPID, o2::fit::DCSDPValues> mDpData; // the object that will go to the CCDB
72 std::unordered_map<DPID, bool> mPids; // contains all PIDs for the processor, the bool
73 // will be true if the DP was processed at least once
74 std::unordered_map<DPID, DPVAL> mDpsMap; // this is the map that will hold the DPs
75
76 std::string mCcdbPath;
77 long mStartValidity = o2::ccdb::CcdbObjectInfo::INFINITE_TIMESTAMP; // TF index for processing, used to store CCDB object for DPs
78 CcdbObjectInfo mCcdbDpInfo;
79
80 union DPValueConverter {
81 uint64_t raw_data;
82 double double_value;
83 uint uint_value;
84 } dpValueConverter;
85
86 bool mVerbose = false;
87
88 ClassDefNV(FITDCSDataReader, 0);
89}; // end class
90
91} // namespace fit
92} // namespace o2
93
94#endif // O2_FIT_DCSDATAREADER_H
std::string ccdbPath(const std::string badChannelType)
static constexpr long INFINITE_TIMESTAMP
const std::string & getCcdbPath() const
uint64_t processFlags(uint64_t flag, const char *pid)
void setVerboseMode(bool verboseMode=true)
const CcdbObjectInfo & getccdbDPsInfo() const
void setStartValidity(long startValidity)
void init(const std::vector< DPID > &pids)
int processDP(const DPCOM &dpcom)
const std::unordered_map< DPID, DCSDPValues > & getDpData() const
void setCcdbPath(const std::string &ccdbPath)
TFitResultPtr fit(const size_t nBins, const T *arr, const T xMin, const T xMax, TF1 &func, std::string_view option="")
Definition fit.h:59
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...