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;
61  const HcalTPParameters* getHcalTPParameters () 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) mEffectivePedestals = fItem;
67  else mPedestals = fItem;
68  mCalibSet = nullptr;
69  }
70  void setData (const HcalPedestalWidths* fItem, bool eff=false) {
71  if(eff) mEffectivePedestalWidths = fItem;
72  else mPedestalWidths = fItem;
73  mCalibWidthSet = nullptr;
74  }
75  void setData (const HcalGains* fItem) {mGains = fItem; mCalibSet = nullptr; }
76  void setData (const HcalGainWidths* fItem) {mGainWidths = fItem; mCalibWidthSet = nullptr; }
77  void setData (const HcalQIEData* fItem) {mQIEData = fItem; mCalibSet=nullptr; mCalibWidthSet=nullptr;}
78  void setData (const HcalQIETypes* fItem) {mQIETypes = fItem; mCalibSet = nullptr; }
79  void setData (const HcalChannelQuality* fItem) {mChannelQuality = fItem;}
80  void setData (const HcalElectronicsMap* fItem) {mElectronicsMap = fItem;}
81  void setData (const HcalFrontEndMap* fItem) {mFrontEndMap = fItem;}
82  void setData (const HcalRespCorrs* fItem) {mRespCorrs = fItem; mCalibSet = nullptr; }
83  void setData (const HcalTimeCorrs* fItem) {mTimeCorrs = fItem; mCalibSet = nullptr; }
84  void setData (const HcalZSThresholds* fItem) {mZSThresholds = fItem;}
85  void setData (const HcalL1TriggerObjects* fItem) {mL1TriggerObjects = fItem;}
86  void setData (const HcalLUTCorrs* fItem) {mLUTCorrs = fItem; mCalibSet = nullptr; }
87  void setData (const HcalPFCorrs* fItem) {mPFCorrs = fItem; }
88  void setData (const HcalLutMetadata* fItem) {mLutMetadata = fItem;}
89  void setData (const HcalSiPMParameters* fItem) {mSiPMParameters = fItem; mCalibSet = nullptr;}
90  void setData (const HcalSiPMCharacteristics* fItem) {mSiPMCharacteristics = fItem;}
91  void setData (const HcalTPChannelParameters* fItem) {mTPChannelParameters = fItem; mCalibSet = nullptr;}
92  void setData (const HcalTPParameters* fItem) {mTPParameters = fItem;}
93  void setData (const HcalMCParams* fItem) {mMCParams = fItem;}
94  void setData (const HcalRecoParams* fItem) {mRecoParams = fItem;}
95 
96  private:
97  bool makeHcalCalibration (const HcalGenericDetId& fId, HcalCalibrations* fObject,
98  bool pedestalInADC, bool effPedestalInADC) const;
99  void buildCalibrations() const;
101  bool pedestalInADC, bool effPedestalInADC) const;
102  void buildCalibWidths() const;
103  bool convertPedestals(const HcalGenericDetId& fId, const HcalPedestal* pedestal, float* pedTrue, bool inADC) const;
104  bool convertPedestalWidths(const HcalGenericDetId& fId, const HcalPedestalWidth* pedestalwidth, float* pedTrueWidth, bool inADC) const;
129  // bool mPedestalInADC;
130  mutable std::atomic<HcalCalibrationsSet const *> mCalibSet;
131  mutable std::atomic<HcalCalibrationWidthsSet const *> mCalibWidthSet;
132 };
133 
134 #endif
135 
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)
Definition: HcalDbService.h:93
bool makeHcalCalibration(const HcalGenericDetId &fId, HcalCalibrations *fObject, bool pedestalInADC, bool effPedestalInADC) const
const HcalMCParams * mMCParams
const HcalTPParameters * mTPParameters
std::atomic< HcalCalibrationWidthsSet const * > mCalibWidthSet
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)
Definition: HcalDbService.h:94
const HcalChannelQuality * mChannelQuality
const HcalLutMetadata * mLutMetadata
const HcalTPChannelParameters * mTPChannelParameters
void setData(const HcalQIETypes *fItem)
Definition: HcalDbService.h:78
void setData(const HcalSiPMParameters *fItem)
Definition: HcalDbService.h:89
const HcalPedestalWidth * getPedestalWidth(const HcalGenericDetId &fId) const
const HcalRespCorr * getHcalRespCorr(const HcalGenericDetId &fId) const
void setData(const HcalElectronicsMap *fItem)
Definition: HcalDbService.h:80
const HcalLUTCorr * getHcalLUTCorr(const HcalGenericDetId &fId) const
void setData(const HcalGainWidths *fItem)
Definition: HcalDbService.h:76
const HcalTimeCorr * getHcalTimeCorr(const HcalGenericDetId &fId) const
void setData(const HcalPFCorrs *fItem)
Definition: HcalDbService.h:87
void buildCalibWidths() const
void setData(const HcalFrontEndMap *fItem)
Definition: HcalDbService.h:81
void setData(const HcalTimeCorrs *fItem)
Definition: HcalDbService.h:83
void setData(const HcalSiPMCharacteristics *fItem)
Definition: HcalDbService.h:90
void setData(const HcalTPParameters *fItem)
Definition: HcalDbService.h:92
void setData(const HcalZSThresholds *fItem)
Definition: HcalDbService.h:84
void setData(const HcalRespCorrs *fItem)
Definition: HcalDbService.h:82
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)
Definition: HcalDbService.h:88
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:75
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)
Definition: HcalDbService.h:86
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:70
const HcalQIEShape * getHcalShape(const HcalGenericDetId &fId) const
void setData(const HcalL1TriggerObjects *fItem)
Definition: HcalDbService.h:85
bool convertPedestals(const HcalGenericDetId &fId, const HcalPedestal *pedestal, float *pedTrue, bool inADC) const
void buildCalibrations() const
void setData(const HcalChannelQuality *fItem)
Definition: HcalDbService.h:79
const HcalElectronicsMap * getHcalMapping() const
std::atomic< HcalCalibrationsSet const * > mCalibSet
const HcalFrontEndMap * mFrontEndMap
const HcalPedestals * mPedestals
const HcalCalibrations & getHcalCalibrations(const HcalGenericDetId &fId) const
bool convertPedestalWidths(const HcalGenericDetId &fId, const HcalPedestalWidth *pedestalwidth, float *pedTrueWidth, bool inADC) const
void setData(const HcalQIEData *fItem)
Definition: HcalDbService.h:77
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)
Definition: HcalDbService.h:91
const HcalCalibrationWidthsSet * getHcalCalibrationWidthsSet() const