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 
19 
21 
22 class HcalCalibrations;
24 class HcalTopology;
25 
27 public:
28  HcalDbService();
30 
31  const HcalTopology* getTopologyUsed() const;
32 
33  const HcalCalibrations& getHcalCalibrations(const HcalGenericDetId& fId) const;
37 
38  const HcalPedestal* getPedestal(const HcalGenericDetId& fId) const;
39  const HcalPedestalWidth* getPedestalWidth(const HcalGenericDetId& fId) const;
40  const HcalPedestal* getEffectivePedestal(const HcalGenericDetId& fId) const;
42  const HcalGain* getGain(const HcalGenericDetId& fId) const;
43  const HcalGainWidth* getGainWidth(const HcalGenericDetId& fId) const;
44  const HcalQIECoder* getHcalCoder(const HcalGenericDetId& fId) const;
45  const HcalQIEShape* getHcalShape(const HcalGenericDetId& fId) const;
46  const HcalQIEShape* getHcalShape(const HcalQIECoder* coder) const;
47  const HcalElectronicsMap* getHcalMapping() const;
49  const HcalRespCorr* getHcalRespCorr(const HcalGenericDetId& fId) const;
50  const HcalTimeCorr* getHcalTimeCorr(const HcalGenericDetId& fId) const;
53  const HcalZSThreshold* getHcalZSThreshold(const HcalGenericDetId& fId) const;
54  const HcalLUTCorr* getHcalLUTCorr(const HcalGenericDetId& fId) const;
55  const HcalPFCorr* getHcalPFCorr(const HcalGenericDetId& fId) const;
56  const HcalLutMetadata* getHcalLutMetadata() const;
57  const HcalQIEType* getHcalQIEType(const HcalGenericDetId& fId) const;
62  const HcalMCParam* getHcalMCParam(const HcalGenericDetId& fId) const;
63  const HcalRecoParam* getHcalRecoParam(const HcalGenericDetId& fId) const;
64 
65  void setData(const HcalPedestals* fItem, bool eff = false) {
66  if (eff)
67  mEffectivePedestals = fItem;
68  else
69  mPedestals = fItem;
70  mCalibSet = nullptr;
71  }
72  void setData(const HcalPedestalWidths* fItem, bool eff = false) {
73  if (eff)
75  else
76  mPedestalWidths = fItem;
77  mCalibWidthSet = nullptr;
78  }
79  void setData(const HcalGains* fItem) {
80  mGains = fItem;
81  mCalibSet = nullptr;
82  }
83  void setData(const HcalGainWidths* fItem) {
84  mGainWidths = fItem;
85  mCalibWidthSet = nullptr;
86  }
87  void setData(const HcalQIEData* fItem) {
88  mQIEData = fItem;
89  mCalibSet = nullptr;
90  mCalibWidthSet = nullptr;
91  }
92  void setData(const HcalQIETypes* fItem) {
93  mQIETypes = fItem;
94  mCalibSet = nullptr;
95  }
96  void setData(const HcalChannelQuality* fItem) { mChannelQuality = fItem; }
97  void setData(const HcalElectronicsMap* fItem) { mElectronicsMap = fItem; }
98  void setData(const HcalFrontEndMap* fItem) { mFrontEndMap = fItem; }
99  void setData(const HcalRespCorrs* fItem) {
100  mRespCorrs = fItem;
101  mCalibSet = nullptr;
102  }
103  void setData(const HcalTimeCorrs* fItem) {
104  mTimeCorrs = fItem;
105  mCalibSet = nullptr;
106  }
107  void setData(const HcalZSThresholds* fItem) { mZSThresholds = fItem; }
108  void setData(const HcalL1TriggerObjects* fItem) { mL1TriggerObjects = fItem; }
109  void setData(const HcalLUTCorrs* fItem) {
110  mLUTCorrs = fItem;
111  mCalibSet = nullptr;
112  }
113  void setData(const HcalPFCorrs* fItem) { mPFCorrs = fItem; }
114  void setData(const HcalLutMetadata* fItem) { mLutMetadata = fItem; }
115  void setData(const HcalSiPMParameters* fItem) {
116  mSiPMParameters = fItem;
117  mCalibSet = nullptr;
118  }
119  void setData(const HcalSiPMCharacteristics* fItem) { mSiPMCharacteristics = fItem; }
120  void setData(const HcalTPChannelParameters* fItem) {
121  mTPChannelParameters = fItem;
122  mCalibSet = nullptr;
123  }
124  void setData(const HcalTPParameters* fItem) { mTPParameters = fItem; }
125  void setData(const HcalMCParams* fItem) { mMCParams = fItem; }
126  void setData(const HcalRecoParams* fItem) { mRecoParams = fItem; }
127 
128 private:
129  bool makeHcalCalibration(const HcalGenericDetId& fId,
130  HcalCalibrations* fObject,
131  bool pedestalInADC,
132  bool effPedestalInADC) const;
133  void buildCalibrations() const;
135  HcalCalibrationWidths* fObject,
136  bool pedestalInADC,
137  bool effPedestalInADC) const;
138  void buildCalibWidths() const;
139  bool convertPedestals(const HcalGenericDetId& fId, const HcalPedestal* pedestal, float* pedTrue, bool inADC) const;
140  bool convertPedestalWidths(const HcalGenericDetId& fId,
141  const HcalPedestalWidth* pedestalwidth,
142  const HcalPedestal* pedestal,
143  float* pedTrueWidth,
144  bool inADC) const;
169  // bool mPedestalInADC;
170  mutable std::atomic<HcalCalibrationsSet const*> mCalibSet;
171  mutable std::atomic<HcalCalibrationWidthsSet const*> mCalibWidthSet;
172 };
173 
174 #endif
HcalDbService::mFrontEndMap
const HcalFrontEndMap * mFrontEndMap
Definition: HcalDbService.h:155
HcalDbService::mZSThresholds
const HcalZSThresholds * mZSThresholds
Definition: HcalDbService.h:157
HcalDbService::mTPParameters
const HcalTPParameters * mTPParameters
Definition: HcalDbService.h:166
HcalDbService::setData
void setData(const HcalChannelQuality *fItem)
Definition: HcalDbService.h:96
HcalRespCorrs
Definition: HcalRespCorrs.h:17
HcalDbService::mL1TriggerObjects
const HcalL1TriggerObjects * mL1TriggerObjects
Definition: HcalDbService.h:158
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:149
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:99
AllObjects.h
HcalDbService::mSiPMParameters
const HcalSiPMParameters * mSiPMParameters
Definition: HcalDbService.h:163
HcalTopology
Definition: HcalTopology.h:26
HcalTimeCorr
Definition: HcalTimeCorr.h:12
HcalCoder.h
HcalDbService::mTPChannelParameters
const HcalTPChannelParameters * mTPChannelParameters
Definition: HcalDbService.h:165
HcalDbService::getPedestal
const HcalPedestal * getPedestal(const HcalGenericDetId &fId) const
Definition: HcalDbService.cc:277
HcalDbService::mElectronicsMap
const HcalElectronicsMap * mElectronicsMap
Definition: HcalDbService.h:154
HcalDbService::setData
void setData(const HcalFrontEndMap *fItem)
Definition: HcalDbService.h:98
ESProducer.h
HcalDbService::setData
void setData(const HcalMCParams *fItem)
Definition: HcalDbService.h:125
HcalDbService::setData
void setData(const HcalL1TriggerObjects *fItem)
Definition: HcalDbService.h:108
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:115
HcalDbService::mPFCorrs
const HcalPFCorrs * mPFCorrs
Definition: HcalDbService.h:161
HcalDbService::setData
void setData(const HcalQIEData *fItem)
Definition: HcalDbService.h:87
HcalChannelQuality
Definition: HcalChannelQuality.h:17
HcalDbService::setData
void setData(const HcalPedestalWidths *fItem, bool eff=false)
Definition: HcalDbService.h:72
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:159
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:103
HcalDbService::getHcalMCParam
const HcalMCParam * getHcalMCParam(const HcalGenericDetId &fId) const
Definition: HcalDbService.cc:398
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:156
HcalDbService::setData
void setData(const HcalGainWidths *fItem)
Definition: HcalDbService.h:83
HcalDbService::mCalibWidthSet
std::atomic< HcalCalibrationWidthsSet const * > mCalibWidthSet
Definition: HcalDbService.h:171
HcalDbService::mEffectivePedestalWidths
const HcalPedestalWidths * mEffectivePedestalWidths
Definition: HcalDbService.h:148
HcalDbService::mEffectivePedestals
const HcalPedestals * mEffectivePedestals
Definition: HcalDbService.h:147
HcalPedestal
Definition: HcalPedestal.h:15
HcalCalibrations
Definition: HcalCalibrations.h:9
HcalDbService::getHcalTPParameters
const HcalTPParameters * getHcalTPParameters() const
Definition: HcalDbService.cc:412
HcalDbService::mLutMetadata
const HcalLutMetadata * mLutMetadata
Definition: HcalDbService.h:162
HcalDbService::setData
void setData(const HcalQIETypes *fItem)
Definition: HcalDbService.h:92
HcalDbService::getHcalRecoParam
const HcalRecoParam * getHcalRecoParam(const HcalGenericDetId &fId) const
Definition: HcalDbService.cc:405
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:168
HcalDbService::setData
void setData(const HcalLutMetadata *fItem)
Definition: HcalDbService.h:114
HcalGain
Definition: HcalGain.h:16
HcalL1TriggerObject
Definition: HcalL1TriggerObject.h:13
HcalDbService::mMCParams
const HcalMCParams * mMCParams
Definition: HcalDbService.h:167
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:145
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:126
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:150
EcalCondDBWriter_cfi.pedestal
pedestal
Definition: EcalCondDBWriter_cfi.py:49
HcalDbService::mCalibSet
std::atomic< HcalCalibrationsSet const * > mCalibSet
Definition: HcalDbService.h:170
HcalCalibrationWidthsSet.h
HcalDbService::mQIEData
const HcalQIEData * mQIEData
Definition: HcalDbService.h:151
HcalQIETypes
Definition: HcalQIETypes.h:17
HcalDbService::setData
void setData(const HcalSiPMCharacteristics *fItem)
Definition: HcalDbService.h:119
HcalLUTCorr
Definition: HcalLUTCorr.h:15
HcalQIEData
Definition: HcalQIEData.h:24
HcalQIECoder
Definition: HcalQIECoder.h:20
HcalDbService::mPedestalWidths
const HcalPedestalWidths * mPedestalWidths
Definition: HcalDbService.h:146
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:153
HcalCalibrationsSet.h
ModuleFactory.h
HcalDbService
Definition: HcalDbService.h:26
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:160
HcalDbService::getHcalLutMetadata
const HcalLutMetadata * getHcalLutMetadata() const
Definition: HcalDbService.cc:380
HcalGains
Definition: HcalGains.h:17
HcalDbService::mSiPMCharacteristics
const HcalSiPMCharacteristics * mSiPMCharacteristics
Definition: HcalDbService.h:164
HcalRecoParams
Definition: HcalRecoParams.h:9
HcalDbService::setData
void setData(const HcalElectronicsMap *fItem)
Definition: HcalDbService.h:97
HcalFrontEndMap
Definition: HcalFrontEndMap.h:23
HcalDbService::setData
void setData(const HcalPedestals *fItem, bool eff=false)
Definition: HcalDbService.h:65
HcalDbService::setData
void setData(const HcalGains *fItem)
Definition: HcalDbService.h:79
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:120
HcalPedestalWidth
Definition: HcalPedestalWidth.h:15
HcalQIEType
Definition: HcalQIEType.h:12
HcalDbService::setData
void setData(const HcalPFCorrs *fItem)
Definition: HcalDbService.h:113
HcalDbService::setData
void setData(const HcalTPParameters *fItem)
Definition: HcalDbService.h:124
HcalZSThresholds
Definition: HcalZSThresholds.h:17
HcalCalibrationWidths
Definition: HcalCalibrationWidths.h:9
HcalCalibrationWidthsSet
Definition: HcalCalibrationWidthsSet.h:16
HcalSiPMParameters
Definition: HcalSiPMParameters.h:8
HcalDbService::getHcalTPChannelParameter
const HcalTPChannelParameter * getHcalTPChannelParameter(const HcalGenericDetId &fId) const
Definition: HcalDbService.cc:391
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:109
HcalDbService::mQIETypes
const HcalQIETypes * mQIETypes
Definition: HcalDbService.h:152
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:107
HcalSiPMCharacteristics
Definition: HcalSiPMCharacteristics.h:18