Project
Loading...
Searching...
No Matches
CalibLoader.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
12#ifndef O2_EMCAL_CALIBLOADER
13#define O2_EMCAL_CALIBLOADER
14
15#include <bitset>
16#include <vector>
19#include "Framework/InputSpec.h"
20
21namespace o2
22{
23
24namespace emcal
25{
26class BadChannelMap;
27class FeeDCS;
30class GainCalibrationFactors;
32class SimParam;
33class RecoParam;
34
50{
51 public:
53 CalibLoader() = default;
54
56 ~CalibLoader() = default;
57
60 BadChannelMap* getBadChannelMap() const { return mBadChannelMap; }
61
64 EMCALChannelScaleFactors* getBCMScaleFactors() const { return mBCMScaleFactors; }
65
68 FeeDCS* getFEEDCS() const { return mFeeDCS; }
69
72 TimeCalibrationParams* getTimeCalibration() const { return mTimeCalibParams; }
73
76 GainCalibrationFactors* getGainCalibration() const { return mGainCalibParams; }
77
80 TempCalibrationParams* getTemperatureCalibration() const { return mTempCalibParams; }
81
84 bool hasBadChannelMap() const { return mEnableStatus.test(OBJ_BADCHANNELMAP); }
85
88 bool hasBCMScaleFactors() const { return mEnableStatus.test(OBJ_BCMSCALEFACTORS); }
89
92 bool hasFEEDCS() const { return mEnableStatus.test(OBJ_FEEDCS); }
93
96 bool hasTimeCalib() const { return mEnableStatus.test(OBJ_TIMECALIB); }
97
100 bool hasGainCalib() const { return mEnableStatus.test(OBJ_GAINCALIB); }
101
104 bool hasTemperatureCalib() const { return mEnableStatus.test(OBJ_TEMPCALIB); }
105
108 bool hasRecoParams() const { return mEnableStatus.test(OBJ_RECOPARAM); }
109
112 bool hasSimParams() const { return mEnableStatus.test(OBJ_SIMPARAM); }
113
116 bool hasUpdateBadChannelMap() const { return mUpdateStatus.test(OBJ_BADCHANNELMAP); }
117
120 bool hasUpdateBCMScaleFactors() const { return mUpdateStatus.test(OBJ_BCMSCALEFACTORS); }
121
124 bool hasUpdateFEEDCS() const { return mUpdateStatus.test(OBJ_FEEDCS); }
125
128 bool hasUpdateTimeCalib() const { return mUpdateStatus.test(OBJ_TIMECALIB); }
129
132 bool hasUpdateGainCalib() const { return mUpdateStatus.test(OBJ_GAINCALIB); }
133
136 bool hasUpdateTemperatureCalib() const { return mUpdateStatus.test(OBJ_TEMPCALIB); }
137
140 bool hasUpdateRecoParam() const { return mUpdateStatus.test(OBJ_RECOPARAM); }
141
144 bool hasUpdateSimParam() const { return mUpdateStatus.test(OBJ_SIMPARAM); }
145
148 void enableBadChannelMap(bool doEnable) { mEnableStatus.set(OBJ_BADCHANNELMAP, doEnable); }
149
152 void enableBCMScaleFactors(bool doEnable) { mEnableStatus.set(OBJ_BCMSCALEFACTORS, doEnable); }
153
156 void enableFEEDCS(bool doEnable) { mEnableStatus.set(OBJ_FEEDCS, doEnable); }
157
160 void enableTimeCalib(bool doEnable) { mEnableStatus.set(OBJ_TIMECALIB, doEnable); }
161
164 void enableGainCalib(bool doEnable) { mEnableStatus.set(OBJ_GAINCALIB, doEnable); }
165
168 void enableTemperatureCalib(bool doEnable) { mEnableStatus.set(OBJ_TEMPCALIB, doEnable); }
169
172 void enableRecoParams(bool doEnable) { mEnableStatus.set(OBJ_RECOPARAM, doEnable); }
173
176 void enableSimParams(bool doEnable) { mEnableStatus.set(OBJ_SIMPARAM, doEnable); }
177
179 void setUpdateBadChannelMap() { mUpdateStatus.set(OBJ_BADCHANNELMAP, true); }
180
182 void setUpdateBCMScaleFactors() { mUpdateStatus.set(OBJ_BCMSCALEFACTORS, true); }
183
185 void setUpdateFEEDCS() { mUpdateStatus.set(OBJ_FEEDCS, true); }
186
188 void setUpdateTimeCalib() { mUpdateStatus.set(OBJ_TIMECALIB, true); }
189
191 void setUpdateGainCalib() { mUpdateStatus.set(OBJ_GAINCALIB, true); }
192
194 void setUpdateTemperatureCalib() { mUpdateStatus.set(OBJ_TEMPCALIB, true); }
195
197 void setUpdateRecoParams() { mUpdateStatus.set(OBJ_RECOPARAM, true); }
198
200 void setUpdateSimParams() { mUpdateStatus.set(OBJ_SIMPARAM, true); }
201
203 void resetUpdateStatus() { mUpdateStatus.reset(); }
204
209 void defineInputSpecs(std::vector<framework::InputSpec>& ccdbInputs);
210
216
224 bool finalizeCCDB(framework::ConcreteDataMatcher& matcher, void* obj);
225
226 private:
227 enum CalibObject_t {
228 OBJ_BADCHANNELMAP,
229 OBJ_TIMECALIB,
230 OBJ_GAINCALIB,
231 OBJ_TEMPCALIB,
232 OBJ_TIMSLEWINGCORR,
233 OBJ_BCMSCALEFACTORS,
234 OBJ_FEEDCS,
235 OBJ_SIMPARAM,
236 OBJ_RECOPARAM,
237 OBJ_CALIBPARAM
238 };
239 o2::emcal::BadChannelMap* mBadChannelMap = nullptr;
240 o2::emcal::FeeDCS* mFeeDCS = nullptr;
241 o2::emcal::TimeCalibrationParams* mTimeCalibParams = nullptr;
242 o2::emcal::GainCalibrationFactors* mGainCalibParams = nullptr;
243 o2::emcal::TempCalibrationParams* mTempCalibParams = nullptr;
244 o2::emcal::EMCALChannelScaleFactors* mBCMScaleFactors = nullptr;
245 o2::emcal::RecoParam* mRecoParam;
246 o2::emcal::SimParam* mSimParam;
247 std::bitset<16> mEnableStatus;
248 std::bitset<16> mUpdateStatus;
249};
250
251} // namespace emcal
252
253} // namespace o2
254
255#endif // O2_EMCAL_CALIBLOADER
Container for energy dependent scale factors for number of hits in a cell.
CCDB container for the temperature calibration coefficients.
CCDB container for the time calibration coefficients.
CCDB container for masked cells in EMCAL.
Handler for EMCAL calibration objects in DPL workflows.
Definition CalibLoader.h:50
void enableTemperatureCalib(bool doEnable)
Enable loading of the temperature calibration params.
bool hasUpdateTimeCalib() const
Check whether the time calibration params have been updated.
void setUpdateGainCalib()
Mark gain calibration params as updated.
TimeCalibrationParams * getTimeCalibration() const
Access to current time calibration params.
Definition CalibLoader.h:72
~CalibLoader()=default
Destructor.
bool hasTimeCalib() const
Check whether the time calibration params are handled.
Definition CalibLoader.h:96
void enableRecoParams(bool doEnable)
Enable loading of the reconstruction params.
bool hasTemperatureCalib() const
Check whether the temperature calibration params are handled.
void setUpdateRecoParams()
Mark reconstruction params as updated.
FeeDCS * getFEEDCS() const
Access to current FEE DCS params.
Definition CalibLoader.h:68
void setUpdateTimeCalib()
Mark time calibration params as updated.
void enableBCMScaleFactors(bool doEnable)
Enable loading of the BCM scale factors.
void defineInputSpecs(std::vector< framework::InputSpec > &ccdbInputs)
Define input specs in workflow for calibration objects to be loaded from the CCDB.
bool hasGainCalib() const
Check whether the gain calibration factors are handled.
GainCalibrationFactors * getGainCalibration() const
Access to current gain calibration factors.
Definition CalibLoader.h:76
void setUpdateBCMScaleFactors()
Mark BCM scale factors as updated.
void setUpdateBadChannelMap()
Mark bad channel map as updated.
EMCALChannelScaleFactors * getBCMScaleFactors() const
Access to current BCM Scale factors.
Definition CalibLoader.h:64
bool hasBCMScaleFactors() const
Check whether the BCM scale factors are handled.
Definition CalibLoader.h:88
bool hasUpdateRecoParam() const
Check whether the reconstruction params have been updated.
void enableFEEDCS(bool doEnable)
Enable loading of the FEE DCS params.
bool hasUpdateBCMScaleFactors() const
Check whether the BCM scale factors have been updated.
void setUpdateFEEDCS()
Mark FEE DCS params as updated.
void setUpdateTemperatureCalib()
Mark temperature calibration params as updated.
bool hasUpdateGainCalib() const
Check whether the gain calibration params have been updated.
void checkUpdates(o2::framework::ProcessingContext &ctx)
Check for updates of the calibration objects in the processing context.
void resetUpdateStatus()
Reset the update status (all objects marked as false)
BadChannelMap * getBadChannelMap() const
Access to current bad channel map.
Definition CalibLoader.h:60
bool hasSimParams() const
Check whether the reconstruction params are handled.
void enableTimeCalib(bool doEnable)
Enable loading of the time calibration params.
TempCalibrationParams * getTemperatureCalibration() const
Access to current temperature calibration params.
Definition CalibLoader.h:80
bool hasUpdateFEEDCS() const
Check whether the FEE DCS params have been updated.
void enableGainCalib(bool doEnable)
Enable loading of the gain calibration factors.
bool hasRecoParams() const
Check whether the reconstruction params are handled.
void enableSimParams(bool doEnable)
Enable loading of the simulation params.
bool hasBadChannelMap() const
Check whether the bad channel map is handled.
Definition CalibLoader.h:84
bool finalizeCCDB(framework::ConcreteDataMatcher &matcher, void *obj)
Callback for objects loaded from CCDB.
bool hasFEEDCS() const
Check whether the FEE DCS params are handled.
Definition CalibLoader.h:92
bool hasUpdateSimParam() const
Check whether the simulation params have been updated.
bool hasUpdateBadChannelMap() const
Check whether the bad channel map has been updated.
bool hasUpdateTemperatureCalib() const
Check whether the temperature calibration params have been updated.
void setUpdateSimParams()
Mark simulation params as updated.
void enableBadChannelMap(bool doEnable)
Enable loading of the bad channel map.
CalibLoader()=default
Constructor.
CCDB container for the gain calibration factors.
EMCal reconstruction parameters.
Definition RecoParam.h:28
EMCal simulation parameters.
Definition SimParam.h:28
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...