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