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
const HcalLUTCorrs * mLUTCorrs
const HcalQIETypes * mQIETypes
const HcalPedestalWidths * mEffectivePedestalWidths
const HcalGainWidth * getGainWidth(const HcalGenericDetId &fId) const
const HcalSiPMParameters * mSiPMParameters
const HcalZSThreshold * getHcalZSThreshold(const HcalGenericDetId &fId) const
void setData(const HcalMCParams *fItem)
const HcalPedestal * getPedestal(const HcalGenericDetId &fId) const
const HcalMCParams * mMCParams
const HcalTPParameters * mTPParameters
const HcalPedestals * mEffectivePedestals
bool convertPedestalWidths(const HcalGenericDetId &fId, const HcalPedestalWidth *pedestalwidth, const HcalPedestal *pedestal, float *pedTrueWidth, bool inADC) const
bool convertPedestals(const HcalGenericDetId &fId, const HcalPedestal *pedestal, float *pedTrue, bool inADC) const
const HcalL1TriggerObjects * mL1TriggerObjects
const HcalCalibrationWidthsSet * getHcalCalibrationWidthsSet() const
const HcalPFCorrs * mPFCorrs
const HcalElectronicsMap * getHcalMapping() const
const HcalGains * mGains
void setData(const HcalRecoParams *fItem)
const HcalChannelQuality * mChannelQuality
const HcalPedestalWidth * getPedestalWidth(const HcalGenericDetId &fId) const
const HcalLutMetadata * mLutMetadata
const HcalTPChannelParameters * mTPChannelParameters
void setData(const HcalQIETypes *fItem)
Definition: HcalDbService.h:89
const HcalSiPMCharacteristics * getHcalSiPMCharacteristics() const
const HcalCalibrationWidths & getHcalCalibrationWidths(const HcalGenericDetId &fId) const
void setData(const HcalSiPMParameters *fItem)
std::atomic< HcalCalibrationsSet const * > mCalibSet
const HcalMCParam * getHcalMCParam(const HcalGenericDetId &fId) const
const HcalCalibrationsSet * getHcalCalibrationsSet() const
void setData(const HcalElectronicsMap *fItem)
Definition: HcalDbService.h:94
void setData(const HcalGainWidths *fItem)
Definition: HcalDbService.h:80
void setData(const HcalPFCorrs *fItem)
void buildCalibrations() const
void setData(const HcalFrontEndMap *fItem)
Definition: HcalDbService.h:95
const HcalCalibrations & getHcalCalibrations(const HcalGenericDetId &fId) const
void setData(const HcalTimeCorrs *fItem)
void setData(const HcalSiPMCharacteristics *fItem)
const HcalRespCorr * getHcalRespCorr(const HcalGenericDetId &fId) const
void setData(const HcalTPParameters *fItem)
const HcalLutMetadata * getHcalLutMetadata() const
void setData(const HcalZSThresholds *fItem)
void setData(const HcalRespCorrs *fItem)
Definition: HcalDbService.h:96
bool makeHcalCalibrationWidth(const HcalGenericDetId &fId, HcalCalibrationWidths *fObject, bool pedestalInADC, bool effPedestalInADC) const
const HcalTopology * getTopologyUsed() const
const HcalL1TriggerObject * getHcalL1TriggerObject(const HcalGenericDetId &fId) const
const HcalLUTCorr * getHcalLUTCorr(const HcalGenericDetId &fId) const
const HcalTPChannelParameter * getHcalTPChannelParameter(const HcalGenericDetId &fId, bool throwOnFail=true) const
void setData(const HcalLutMetadata *fItem)
const HcalPedestalWidths * mPedestalWidths
const HcalPFCorr * getHcalPFCorr(const HcalGenericDetId &fId) const
const HcalRespCorrs * mRespCorrs
void buildCalibWidths() const
void setData(const HcalPedestals *fItem, bool eff=false)
Definition: HcalDbService.h:62
const HcalTPParameters * getHcalTPParameters() const
void setData(const HcalGains *fItem)
Definition: HcalDbService.h:76
const HcalElectronicsMap * mElectronicsMap
const HcalGainWidths * mGainWidths
const HcalTimeCorrs * mTimeCorrs
const HcalRecoParam * getHcalRecoParam(const HcalGenericDetId &fId) const
void setData(const HcalLUTCorrs *fItem)
const HcalPedestal * getEffectivePedestal(const HcalGenericDetId &fId) const
const HcalPedestalWidth * getEffectivePedestalWidth(const HcalGenericDetId &fId) const
const HcalZSThresholds * mZSThresholds
bool makeHcalCalibration(const HcalGenericDetId &fId, HcalCalibrations *fObject, bool pedestalInADC, bool effPedestalInADC) const
const HcalQIEData * mQIEData
const HcalGain * getGain(const HcalGenericDetId &fId) const
void setData(const HcalPedestalWidths *fItem, bool eff=false)
Definition: HcalDbService.h:69
void setData(const HcalL1TriggerObjects *fItem)
const HcalQIEShape * getHcalShape(const HcalGenericDetId &fId) const
void setData(const HcalChannelQuality *fItem)
Definition: HcalDbService.h:93
const HcalQIECoder * getHcalCoder(const HcalGenericDetId &fId) const
const HcalFrontEndMap * mFrontEndMap
const HcalPedestals * mPedestals
const HcalSiPMParameter * getHcalSiPMParameter(const HcalGenericDetId &fId) const
void setData(const HcalQIEData *fItem)
Definition: HcalDbService.h:84
const HcalRecoParams * mRecoParams
const HcalFrontEndMap * getHcalFrontEndMapping() const
const HcalTimeCorr * getHcalTimeCorr(const HcalGenericDetId &fId) const
const HcalSiPMCharacteristics * mSiPMCharacteristics
void setData(const HcalTPChannelParameters *fItem)
std::atomic< HcalCalibrationWidthsSet const * > mCalibWidthSet
const HcalQIEType * getHcalQIEType(const HcalGenericDetId &fId) const
const HcalChannelStatus * getHcalChannelStatus(const HcalGenericDetId &fId) const