CMS 3D CMS Logo

HcalDbService.h
Go to the documentation of this file.
1 #ifndef CalibFormats_HcalObjects_HcalDbService_h
2 #define CalibFormats_HcalObjects_HcalDbService_h
3 
4 //
5 // F.Ratnikov (UMd), Aug. 9, 2005
6 //
7 
8 #include <memory>
9 #include <map>
10 #include <atomic>
11 
16 
18 
19 class HcalCalibrations;
21 class HcalTopology;
22 
24 public:
25  HcalDbService();
27 
28  const HcalTopology* getTopologyUsed() const;
29 
30  const HcalCalibrations& getHcalCalibrations(const HcalGenericDetId& fId) const;
34 
35  const HcalPedestal* getPedestal(const HcalGenericDetId& fId) const;
36  const HcalPedestalWidth* getPedestalWidth(const HcalGenericDetId& fId) const;
37  const HcalPedestal* getEffectivePedestal(const HcalGenericDetId& fId) const;
39  const HcalGain* getGain(const HcalGenericDetId& fId) const;
40  const HcalGainWidth* getGainWidth(const HcalGenericDetId& fId) const;
41  const HcalQIECoder* getHcalCoder(const HcalGenericDetId& fId) const;
42  const HcalQIEShape* getHcalShape(const HcalGenericDetId& fId) const;
43  const HcalQIEShape* getHcalShape(const HcalQIECoder* coder) const;
44  const HcalElectronicsMap* getHcalMapping() const;
46  const HcalRespCorr* getHcalRespCorr(const HcalGenericDetId& fId) const;
47  const HcalTimeCorr* getHcalTimeCorr(const HcalGenericDetId& fId) const;
50  const HcalZSThreshold* getHcalZSThreshold(const HcalGenericDetId& fId) const;
51  const HcalLUTCorr* getHcalLUTCorr(const HcalGenericDetId& fId) const;
52  const HcalPFCorr* getHcalPFCorr(const HcalGenericDetId& fId) const;
53  const HcalLutMetadata* getHcalLutMetadata() const;
54  const HcalQIEType* getHcalQIEType(const HcalGenericDetId& fId) const;
57  const HcalTPChannelParameter* getHcalTPChannelParameter(const HcalGenericDetId& fId, bool throwOnFail = true) const;
59  const HcalMCParam* getHcalMCParam(const HcalGenericDetId& fId) const;
60  const HcalRecoParam* getHcalRecoParam(const HcalGenericDetId& fId) const;
61 
62  void setData(const HcalPedestals* fItem, bool eff = false) {
63  if (eff)
64  mEffectivePedestals = fItem;
65  else
66  mPedestals = fItem;
67  mCalibSet = nullptr;
68  }
69  void setData(const HcalPedestalWidths* fItem, bool eff = false) {
70  if (eff)
72  else
73  mPedestalWidths = fItem;
74  mCalibWidthSet = nullptr;
75  }
76  void setData(const HcalGains* fItem) {
77  mGains = fItem;
78  mCalibSet = nullptr;
79  }
80  void setData(const HcalGainWidths* fItem) {
81  mGainWidths = fItem;
82  mCalibWidthSet = nullptr;
83  }
84  void setData(const HcalQIEData* fItem) {
85  mQIEData = fItem;
86  mCalibSet = nullptr;
87  mCalibWidthSet = nullptr;
88  }
89  void setData(const HcalQIETypes* fItem) {
90  mQIETypes = fItem;
91  mCalibSet = nullptr;
92  }
93  void setData(const HcalChannelQuality* fItem) { mChannelQuality = fItem; }
94  void setData(const HcalElectronicsMap* fItem) { mElectronicsMap = fItem; }
95  void setData(const HcalFrontEndMap* fItem) { mFrontEndMap = fItem; }
96  void setData(const HcalRespCorrs* fItem) {
97  mRespCorrs = fItem;
98  mCalibSet = nullptr;
99  }
100  void setData(const HcalTimeCorrs* fItem) {
101  mTimeCorrs = fItem;
102  mCalibSet = nullptr;
103  }
104  void setData(const HcalZSThresholds* fItem) { mZSThresholds = fItem; }
105  void setData(const HcalL1TriggerObjects* fItem) { mL1TriggerObjects = fItem; }
106  void setData(const HcalLUTCorrs* fItem) {
107  mLUTCorrs = fItem;
108  mCalibSet = nullptr;
109  }
110  void setData(const HcalPFCorrs* fItem) { mPFCorrs = fItem; }
111  void setData(const HcalLutMetadata* fItem) { mLutMetadata = fItem; }
112  void setData(const HcalSiPMParameters* fItem) {
113  mSiPMParameters = fItem;
114  mCalibSet = nullptr;
115  }
116  void setData(const HcalSiPMCharacteristics* fItem) { mSiPMCharacteristics = fItem; }
117  void setData(const HcalTPChannelParameters* fItem) {
118  mTPChannelParameters = fItem;
119  mCalibSet = nullptr;
120  }
121  void setData(const HcalTPParameters* fItem) { mTPParameters = fItem; }
122  void setData(const HcalMCParams* fItem) { mMCParams = fItem; }
123  void setData(const HcalRecoParams* fItem) { mRecoParams = fItem; }
124 
125 private:
126  bool makeHcalCalibration(const HcalGenericDetId& fId,
127  HcalCalibrations* fObject,
128  bool pedestalInADC,
129  bool effPedestalInADC) const;
130  void buildCalibrations() const;
132  HcalCalibrationWidths* fObject,
133  bool pedestalInADC,
134  bool effPedestalInADC) const;
135  void buildCalibWidths() const;
136  bool convertPedestals(const HcalGenericDetId& fId, const HcalPedestal* pedestal, float* pedTrue, bool inADC) const;
137  bool convertPedestalWidths(const HcalGenericDetId& fId,
138  const HcalPedestalWidth* pedestalwidth,
139  const HcalPedestal* pedestal,
140  float* pedTrueWidth,
141  bool inADC) const;
166  // bool mPedestalInADC;
167  mutable std::atomic<HcalCalibrationsSet const*> mCalibSet;
168  mutable std::atomic<HcalCalibrationWidthsSet const*> mCalibWidthSet;
169 };
170 
171 #endif
HcalDbService::mFrontEndMap
const HcalFrontEndMap * mFrontEndMap
Definition: HcalDbService.h:152
HcalDbService::mZSThresholds
const HcalZSThresholds * mZSThresholds
Definition: HcalDbService.h:154
HcalDbService::mTPParameters
const HcalTPParameters * mTPParameters
Definition: HcalDbService.h:163
HcalDbService::setData
void setData(const HcalChannelQuality *fItem)
Definition: HcalDbService.h:93
HcalRespCorrs
Definition: HcalRespCorrs.h:17
HcalDbService::mL1TriggerObjects
const HcalL1TriggerObjects * mL1TriggerObjects
Definition: HcalDbService.h:155
HcalDbService::getHcalCalibrationWidths
const HcalCalibrationWidths & getHcalCalibrationWidths(const HcalGenericDetId &fId) const
Definition: HcalDbService.cc:70
HcalMCParams
Definition: HcalMCParams.h:9
HcalDbService::getHcalTimeCorr
const HcalTimeCorr * getHcalTimeCorr(const HcalGenericDetId &fId) const
Definition: HcalDbService.cc:359
HcalDbService::getGainWidth
const HcalGainWidth * getGainWidth(const HcalGenericDetId &fId) const
Definition: HcalDbService.cc:312
HcalGenericDetId
Definition: HcalGenericDetId.h:15
HcalDbService::getHcalSiPMCharacteristics
const HcalSiPMCharacteristics * getHcalSiPMCharacteristics() const
Definition: HcalDbService.cc:389
HcalCalibrationsSet
Definition: HcalCalibrationsSet.h:16
HcalDbService::mGains
const HcalGains * mGains
Definition: HcalDbService.h:146
HcalRespCorr
Definition: HcalRespCorr.h:12
HcalDbService::makeHcalCalibration
bool makeHcalCalibration(const HcalGenericDetId &fId, HcalCalibrations *fObject, bool pedestalInADC, bool effPedestalInADC) const
Definition: HcalDbService.cc:179
HcalTPParameters
Definition: HcalTPParameters.h:10
HcalTPChannelParameters
Definition: HcalTPChannelParameters.h:8
HcalDbService::setData
void setData(const HcalRespCorrs *fItem)
Definition: HcalDbService.h:96
AllObjects.h
HcalDbService::mSiPMParameters
const HcalSiPMParameters * mSiPMParameters
Definition: HcalDbService.h:160
HcalTopology
Definition: HcalTopology.h:26
HcalTimeCorr
Definition: HcalTimeCorr.h:12
HcalCoder.h
HcalDbService::mTPChannelParameters
const HcalTPChannelParameters * mTPChannelParameters
Definition: HcalDbService.h:162
HcalDbService::getPedestal
const HcalPedestal * getPedestal(const HcalGenericDetId &fId) const
Definition: HcalDbService.cc:277
HcalDbService::mElectronicsMap
const HcalElectronicsMap * mElectronicsMap
Definition: HcalDbService.h:151
HcalDbService::setData
void setData(const HcalFrontEndMap *fItem)
Definition: HcalDbService.h:95
HcalDbService::setData
void setData(const HcalMCParams *fItem)
Definition: HcalDbService.h:122
HcalDbService::setData
void setData(const HcalL1TriggerObjects *fItem)
Definition: HcalDbService.h:105
HcalDbService::getGain
const HcalGain * getGain(const HcalGenericDetId &fId) const
Definition: HcalDbService.cc:305
HcalGenericDetId.h
HcalDbService::setData
void setData(const HcalSiPMParameters *fItem)
Definition: HcalDbService.h:112
HcalDbService::mPFCorrs
const HcalPFCorrs * mPFCorrs
Definition: HcalDbService.h:158
HcalDbService::setData
void setData(const HcalQIEData *fItem)
Definition: HcalDbService.h:84
HcalChannelQuality
Definition: HcalChannelQuality.h:17
HcalDbService::setData
void setData(const HcalPedestalWidths *fItem, bool eff=false)
Definition: HcalDbService.h:69
HcalZSThreshold
Definition: HcalZSThreshold.h:13
HcalDbService::getHcalShape
const HcalQIEShape * getHcalShape(const HcalGenericDetId &fId) const
Definition: HcalDbService.cc:326
HcalDbService::mTimeCorrs
const HcalTimeCorrs * mTimeCorrs
Definition: HcalDbService.h:156
HcalDbService::getHcalMapping
const HcalElectronicsMap * getHcalMapping() const
Definition: HcalDbService.cc:343
HcalDbService::getHcalCalibrations
const HcalCalibrations & getHcalCalibrations(const HcalGenericDetId &fId) const
Definition: HcalDbService.cc:65
HcalDbService::setData
void setData(const HcalTimeCorrs *fItem)
Definition: HcalDbService.h:100
HcalDbService::getHcalMCParam
const HcalMCParam * getHcalMCParam(const HcalGenericDetId &fId) const
Definition: HcalDbService.cc:399
HcalDbService::getHcalCoder
const HcalQIECoder * getHcalCoder(const HcalGenericDetId &fId) const
Definition: HcalDbService.cc:319
HcalPedestalWidths
Definition: HcalPedestalWidths.h:17
HcalPFCorrs
Definition: HcalPFCorrs.h:17
HcalPedestals
Definition: HcalPedestals.h:20
HcalLUTCorrs
Definition: HcalLUTCorrs.h:20
HcalL1TriggerObjects
Definition: HcalL1TriggerObjects.h:14
HcalDbService::getHcalCalibrationWidthsSet
const HcalCalibrationWidthsSet * getHcalCalibrationWidthsSet() const
Definition: HcalDbService.cc:80
HcalDbService::getPedestalWidth
const HcalPedestalWidth * getPedestalWidth(const HcalGenericDetId &fId) const
Definition: HcalDbService.cc:284
HcalRecoParam
Definition: HcalRecoParam.h:16
HcalDbService::convertPedestalWidths
bool convertPedestalWidths(const HcalGenericDetId &fId, const HcalPedestalWidth *pedestalwidth, const HcalPedestal *pedestal, float *pedTrueWidth, bool inADC) const
Definition: HcalDbService.cc:206
HcalDbService::getHcalZSThreshold
const HcalZSThreshold * getHcalZSThreshold(const HcalGenericDetId &fId) const
Definition: HcalDbService.cc:355
HcalChannelStatus
Definition: HcalChannelStatus.h:13
HcalDbService::mRespCorrs
const HcalRespCorrs * mRespCorrs
Definition: HcalDbService.h:153
HcalDbService::setData
void setData(const HcalGainWidths *fItem)
Definition: HcalDbService.h:80
HcalDbService::mCalibWidthSet
std::atomic< HcalCalibrationWidthsSet const * > mCalibWidthSet
Definition: HcalDbService.h:168
HcalDbService::mEffectivePedestalWidths
const HcalPedestalWidths * mEffectivePedestalWidths
Definition: HcalDbService.h:145
HcalDbService::mEffectivePedestals
const HcalPedestals * mEffectivePedestals
Definition: HcalDbService.h:144
HcalPedestal
Definition: HcalPedestal.h:15
HcalCalibrations
Definition: HcalCalibrations.h:9
HcalDbService::getHcalTPParameters
const HcalTPParameters * getHcalTPParameters() const
Definition: HcalDbService.cc:413
HcalDbService::mLutMetadata
const HcalLutMetadata * mLutMetadata
Definition: HcalDbService.h:159
HcalDbService::setData
void setData(const HcalQIETypes *fItem)
Definition: HcalDbService.h:89
HcalDbService::getHcalRecoParam
const HcalRecoParam * getHcalRecoParam(const HcalGenericDetId &fId) const
Definition: HcalDbService.cc:406
HcalDbService::getHcalQIEType
const HcalQIEType * getHcalQIEType(const HcalGenericDetId &fId) const
Definition: HcalDbService.cc:263
HcalTPChannelParameter
Definition: HcalTPChannelParameter.h:7
HcalDbService::mRecoParams
const HcalRecoParams * mRecoParams
Definition: HcalDbService.h:165
HcalDbService::setData
void setData(const HcalLutMetadata *fItem)
Definition: HcalDbService.h:111
HcalGain
Definition: HcalGain.h:16
HcalL1TriggerObject
Definition: HcalL1TriggerObject.h:13
HcalDbService::mMCParams
const HcalMCParams * mMCParams
Definition: HcalDbService.h:164
HcalDbService::getHcalPFCorr
const HcalPFCorr * getHcalPFCorr(const HcalGenericDetId &fId) const
Definition: HcalDbService.cc:373
HcalDbService::makeHcalCalibrationWidth
bool makeHcalCalibrationWidth(const HcalGenericDetId &fId, HcalCalibrationWidths *fObject, bool pedestalInADC, bool effPedestalInADC) const
Definition: HcalDbService.cc:238
HcalDbService::mPedestals
const HcalPedestals * mPedestals
Definition: HcalDbService.h:142
HcalDbService::HcalDbService
HcalDbService()
Definition: HcalDbService.cc:16
HcalDbService::buildCalibrations
void buildCalibrations() const
Definition: HcalDbService.cc:85
HcalDbService::getHcalRespCorr
const HcalRespCorr * getHcalRespCorr(const HcalGenericDetId &fId) const
Definition: HcalDbService.cc:270
HcalGainWidths
Definition: HcalGainWidths.h:17
HcalDbService::convertPedestals
bool convertPedestals(const HcalGenericDetId &fId, const HcalPedestal *pedestal, float *pedTrue, bool inADC) const
Definition: HcalDbService.cc:150
HcalDbService::setData
void setData(const HcalRecoParams *fItem)
Definition: HcalDbService.h:123
HcalDbService::getHcalCalibrationsSet
const HcalCalibrationsSet * getHcalCalibrationsSet() const
Definition: HcalDbService.cc:75
HcalDbService::buildCalibWidths
void buildCalibWidths() const
Definition: HcalDbService.cc:118
HcalDbService::getTopologyUsed
const HcalTopology * getTopologyUsed() const
Definition: HcalDbService.cc:47
HcalTimeCorrs
Definition: HcalTimeCorrs.h:17
HcalDbService::mGainWidths
const HcalGainWidths * mGainWidths
Definition: HcalDbService.h:147
EcalCondDBWriter_cfi.pedestal
pedestal
Definition: EcalCondDBWriter_cfi.py:49
HcalDbService::mCalibSet
std::atomic< HcalCalibrationsSet const * > mCalibSet
Definition: HcalDbService.h:167
HcalCalibrationWidthsSet.h
HcalDbService::mQIEData
const HcalQIEData * mQIEData
Definition: HcalDbService.h:148
HcalQIETypes
Definition: HcalQIETypes.h:17
HcalDbService::setData
void setData(const HcalSiPMCharacteristics *fItem)
Definition: HcalDbService.h:116
HcalLUTCorr
Definition: HcalLUTCorr.h:15
HcalQIEData
Definition: HcalQIEData.h:24
HcalQIECoder
Definition: HcalQIECoder.h:20
HcalDbService::mPedestalWidths
const HcalPedestalWidths * mPedestalWidths
Definition: HcalDbService.h:143
HcalDbService::getEffectivePedestal
const HcalPedestal * getEffectivePedestal(const HcalGenericDetId &fId) const
Definition: HcalDbService.cc:291
HcalElectronicsMap
Definition: HcalElectronicsMap.h:31
HcalMCParam
Definition: HcalMCParam.h:29
HcalDbService::mChannelQuality
const HcalChannelQuality * mChannelQuality
Definition: HcalDbService.h:150
HcalCalibrationsSet.h
HcalDbService
Definition: HcalDbService.h:23
HcalDbService::getEffectivePedestalWidth
const HcalPedestalWidth * getEffectivePedestalWidth(const HcalGenericDetId &fId) const
Definition: HcalDbService.cc:298
HcalDbService::getHcalSiPMParameter
const HcalSiPMParameter * getHcalSiPMParameter(const HcalGenericDetId &fId) const
Definition: HcalDbService.cc:382
HcalLutMetadata
Definition: HcalLutMetadata.h:15
HcalDbService::~HcalDbService
~HcalDbService()
Definition: HcalDbService.cc:42
HcalDbService::getHcalChannelStatus
const HcalChannelStatus * getHcalChannelStatus(const HcalGenericDetId &fId) const
Definition: HcalDbService.cc:351
HcalDbService::mLUTCorrs
const HcalLUTCorrs * mLUTCorrs
Definition: HcalDbService.h:157
HcalDbService::getHcalLutMetadata
const HcalLutMetadata * getHcalLutMetadata() const
Definition: HcalDbService.cc:380
HcalGains
Definition: HcalGains.h:17
HcalDbService::mSiPMCharacteristics
const HcalSiPMCharacteristics * mSiPMCharacteristics
Definition: HcalDbService.h:161
HcalDbService::getHcalTPChannelParameter
const HcalTPChannelParameter * getHcalTPChannelParameter(const HcalGenericDetId &fId, bool throwOnFail=true) const
Definition: HcalDbService.cc:391
HcalRecoParams
Definition: HcalRecoParams.h:9
HcalDbService::setData
void setData(const HcalElectronicsMap *fItem)
Definition: HcalDbService.h:94
HcalFrontEndMap
Definition: HcalFrontEndMap.h:23
HcalDbService::setData
void setData(const HcalPedestals *fItem, bool eff=false)
Definition: HcalDbService.h:62
HcalDbService::setData
void setData(const HcalGains *fItem)
Definition: HcalDbService.h:76
HcalQIEShape
Definition: HcalQIEShape.h:17
HcalDbService::getHcalLUTCorr
const HcalLUTCorr * getHcalLUTCorr(const HcalGenericDetId &fId) const
Definition: HcalDbService.cc:366
HcalDbService::setData
void setData(const HcalTPChannelParameters *fItem)
Definition: HcalDbService.h:117
HcalPedestalWidth
Definition: HcalPedestalWidth.h:15
HcalQIEType
Definition: HcalQIEType.h:12
HcalDbService::setData
void setData(const HcalPFCorrs *fItem)
Definition: HcalDbService.h:110
HcalDbService::setData
void setData(const HcalTPParameters *fItem)
Definition: HcalDbService.h:121
HcalZSThresholds
Definition: HcalZSThresholds.h:17
HcalCalibrationWidths
Definition: HcalCalibrationWidths.h:9
HcalCalibrationWidthsSet
Definition: HcalCalibrationWidthsSet.h:16
HcalSiPMParameters
Definition: HcalSiPMParameters.h:8
HcalDbService::getHcalL1TriggerObject
const HcalL1TriggerObject * getHcalL1TriggerObject(const HcalGenericDetId &fId) const
Definition: HcalDbService.cc:347
HcalSiPMParameter
Definition: HcalSiPMParameter.h:7
HcalDbService::setData
void setData(const HcalLUTCorrs *fItem)
Definition: HcalDbService.h:106
HcalDbService::mQIETypes
const HcalQIETypes * mQIETypes
Definition: HcalDbService.h:149
HcalDbService::getHcalFrontEndMapping
const HcalFrontEndMap * getHcalFrontEndMapping() const
Definition: HcalDbService.cc:345
HcalGainWidth
Definition: HcalGainWidth.h:15
HcalPFCorr
Definition: HcalPFCorr.h:12
HcalDbService::setData
void setData(const HcalZSThresholds *fItem)
Definition: HcalDbService.h:104
HcalSiPMCharacteristics
Definition: HcalSiPMCharacteristics.h:18