12#ifndef ALICEO2_EMCAL_CALIBDB
13#define ALICEO2_EMCAL_CALIBDB
19#include "RStringView.h"
34class GainCalibrationFactors;
89 ObjectNotFoundException(
const std::string_view server,
const std::string_view
path,
const std::map<std::string, std::string>& metadata, ULong_t timestamp) :
std::exception(),
95 mMessage =
"Not possible to access entry \"" + mPath +
"\" on " + mServ +
" for timestamp " +
std::to_string(mTimestamp);
103 const
char*
what() const noexcept final
105 return mMessage.data();
110 const std::map<std::string, std::string>
getMetaData()
const {
return mMetaDat; }
118 const std::string&
getPath()
const {
return mPath; }
125 const std::string mServ;
126 const std::string mPath;
127 std::string mMessage;
128 const std::map<std::string, std::string> mMetaDat;
146 mTypeObtained(obtained),
150 mMessage =
"Incorrect type, expected " + mTypeExpected +
", obtained " + mTypeObtained;
158 const
char*
what() const noexcept final
160 return mMessage.data();
172 const std::string mTypeObtained;
173 const std::string mTypeExpected;
174 std::string mMessage;
182 CalibDB(
const std::string_view server);
283 void storeFeeDCSData(
FeeDCS* dcs,
const std::map<std::string, std::string>& metadata, ULong_t timestart, ULong_t timeend);
311 void storePedestalData(
Pedestal* pedestals,
const std::map<std::string, std::string>& metadata, ULong_t timestart, ULong_t timeend);
328 mCCDBServer = server;
378 std::string mCCDBServer =
"emcccdb-test.cern.ch";
379 Bool_t mInit =
false;
Container for energy dependent scale factors for number of hits in a cell.
CCDB container for the temperature calibration coefficients per SM.
CCDB container for the temperature calibration coefficients.
CCDB container for the L1 phase shifts.
CCDB container for the time calibration coefficients.
CCDB container for masked cells in EMCAL.
Handling errors due to objects not found in the CCDB.
const std::string & getServer() const
Accessor to URL of the CCDB server.
const char * what() const noexcept final
Creating error message with relevant query paramters.
const std::map< std::string, std::string > getMetaData() const
Accessor to meta data.
~ObjectNotFoundException() noexcept final=default
destructor
const std::string & getPath() const
Accessor to the CCDB path in the query.
ULong_t getTimestamp() const
Accessor to timestamp used in the query.
ObjectNotFoundException(const std::string_view server, const std::string_view path, const std::map< std::string, std::string > &metadata, ULong_t timestamp)
Constructor with query parameters.
Class handling errors of wrong type of a query result.
const std::string & getObtainedType() const
Accessor to the type of the object obtained from the CCDB.
const char * what() const noexcept final
Creating error message.
TypeMismatchException(const std::string_view obtained, const std::string_view expected)
Constructor.
const std::string & getExpectedType() const
Accessor to expected type.
~TypeMismatchException() noexcept final=default
Destructor.
Interface to calibration data from CCDB for EMCAL.
TimeCalibParamL1Phase * readTimeCalibParamL1Phase(ULong_t timestamp, const std::map< std::string, std::string > &metadata)
Find L1 phase shifts in the CCDB for given timestamp.
ElmbData * readTemperatureSensorData(ULong_t timestamp, const std::map< std::string, std::string > &metadata)
Find Temperature Sensor data in the CCDB for given timestamp.
static const char * getCDBPathTemperatureSensor()
Get CDB path for the Temperature Sensor data.
EMCALChannelScaleFactors * readChannelScaleFactors(ULong_t timestamp, const std::map< std::string, std::string > &metadata)
Find scale factors used for bad channel calibration in the CCDB for given timestamp.
void storeBadChannelMap(BadChannelMap *bcm, const std::map< std::string, std::string > &metadata, ULong_t timestart, ULong_t timeend)
Store bad channel map in the CCDB.
static const char * getCDBPathTemperatureCalibrationParamsSM()
Get CDB path for the SM-dependent temperature calibration.
void storeTempCalibParam(TempCalibrationParams *tcp, const std::map< std::string, std::string > &metadata, ULong_t timestart, ULong_t timeend)
Store temperature calibration coefficiencts in the CCDB.
~CalibDB()=default
Destructor.
void setServer(const std::string_view server)
Set new CCDB server URL.
static const char * getCDBPathChannelPedestals()
Get CCDB path for the pedestal data.
void storeTempCalibParamSM(TempCalibParamSM *tcp, const std::map< std::string, std::string > &metadata, ULong_t timestart, ULong_t timeend)
Store temperature calibration coefficiencts per SM in the CCDB.
Pedestal * readPedestalData(ULong_t timestamp, const std::map< std::string, std::string > &metadata)
Find pedestal data in the CCDB for given timestamp.
FeeDCS * readFeeDCSData(ULong_t timestamp, const std::map< std::string, std::string > &metadata)
Find FEE DCS data in the CCDB for given timestamp.
TempCalibParamSM * readTempCalibParamSM(ULong_t timestamp, const std::map< std::string, std::string > &metadata)
Find temperature calibration coefficiencts per SM in the CCDB for given timestamp.
void storeTemperatureSensorData(ElmbData *dcs, const std::map< std::string, std::string > &metadata, ULong_t timestart, ULong_t timeend)
Store Temperature Sensor data in the CCDB.
static const char * getCDBPathTimeCalibrationParams()
Get CDB path for the time calibration.
GainCalibrationFactors * readGainCalibFactors(ULong_t timestamp, const std::map< std::string, std::string > &metadata)
Find gain calibration factors in the CCDB for given timestamp.
void storeTimeCalibParam(TimeCalibrationParams *tcp, const std::map< std::string, std::string > &metadata, ULong_t timestart, ULong_t timeend)
Store time calibration coefficiencts in the CCDB.
static const char * getCDBPathBadChannelMap()
Get CDB path for the bad channel map.
static const char * getCDBPathFeeDCS()
Get CDB path for the FEE DCS settings.
void storeTimeCalibParamL1Phase(TimeCalibParamL1Phase *tcp, const std::map< std::string, std::string > &metadata, ULong_t timestart, ULong_t timeend)
Store L1 phase shifts in the CCDB.
static const char * getCDBPathChannelScaleFactors()
Get CCDB path for the scale factors used in the bad channel calibration.
void storeFeeDCSData(FeeDCS *dcs, const std::map< std::string, std::string > &metadata, ULong_t timestart, ULong_t timeend)
Store FEE DCS data in the CCDB.
CalibDB()=default
Default constructor.
TempCalibrationParams * readTempCalibParam(ULong_t timestamp, const std::map< std::string, std::string > &metadata)
Find temperature calibration coefficiencts in the CCDB for given timestamp.
static const char * getCDBPathGainCalibrationParams()
Get CDB path for the gain calibration.
static const char * getCDBPathTemperatureCalibrationParams()
Get CDB path for the temperature calibration.
void storeGainCalibFactors(GainCalibrationFactors *gcf, const std::map< std::string, std::string > &metadata, ULong_t timestart, ULong_t timeend)
Store gain calibration factors in the CCDB.
void storePedestalData(Pedestal *pedestals, const std::map< std::string, std::string > &metadata, ULong_t timestart, ULong_t timeend)
Store pedestal data in the CCDB.
static const char * getCDBPathL1Phase()
Get CDB path for the L1 Phase.
TimeCalibrationParams * readTimeCalibParam(ULong_t timestamp, const std::map< std::string, std::string > &metadata)
Find time calibration coefficiencts in the CCDB for given timestamp.
BadChannelMap * readBadChannelMap(ULong_t timestamp, const std::map< std::string, std::string > &metadata)
Find bad channel map in the CCDB for given timestamp.
CCDB container for the gain calibration factors.
CCDB container for pedestal values.
GLsizei const GLchar *const * path
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
Defining DataPointCompositeObject explicitly as copiable.
std::string to_string(gsl::span< T, Size > span)
std::map< std::string, ID > expected