CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
HcalDbService Class Reference

#include <HcalDbService.h>

Public Member Functions

const HcalPedestalgetEffectivePedestal (const HcalGenericDetId &fId) const
 
const HcalPedestalWidthgetEffectivePedestalWidth (const HcalGenericDetId &fId) const
 
const HcalGaingetGain (const HcalGenericDetId &fId) const
 
const HcalGainWidthgetGainWidth (const HcalGenericDetId &fId) const
 
const HcalCalibrationsgetHcalCalibrations (const HcalGenericDetId &fId) const
 
const HcalCalibrationsSetgetHcalCalibrationsSet () const
 
const HcalCalibrationWidthsgetHcalCalibrationWidths (const HcalGenericDetId &fId) const
 
const HcalCalibrationWidthsSetgetHcalCalibrationWidthsSet () const
 
const HcalChannelStatusgetHcalChannelStatus (const HcalGenericDetId &fId) const
 
const HcalQIECodergetHcalCoder (const HcalGenericDetId &fId) const
 
const HcalFrontEndMapgetHcalFrontEndMapping () const
 
const HcalL1TriggerObjectgetHcalL1TriggerObject (const HcalGenericDetId &fId) const
 
const HcalLUTCorrgetHcalLUTCorr (const HcalGenericDetId &fId) const
 
const HcalLutMetadatagetHcalLutMetadata () const
 
const HcalElectronicsMapgetHcalMapping () const
 
const HcalMCParamgetHcalMCParam (const HcalGenericDetId &fId) const
 
const HcalPFCorrgetHcalPFCorr (const HcalGenericDetId &fId) const
 
const HcalQIETypegetHcalQIEType (const HcalGenericDetId &fId) const
 
const HcalRecoParamgetHcalRecoParam (const HcalGenericDetId &fId) const
 
const HcalRespCorrgetHcalRespCorr (const HcalGenericDetId &fId) const
 
const HcalQIEShapegetHcalShape (const HcalGenericDetId &fId) const
 
const HcalQIEShapegetHcalShape (const HcalQIECoder *coder) const
 
const HcalSiPMCharacteristicsgetHcalSiPMCharacteristics () const
 
const HcalSiPMParametergetHcalSiPMParameter (const HcalGenericDetId &fId) const
 
const HcalTimeCorrgetHcalTimeCorr (const HcalGenericDetId &fId) const
 
const HcalTPChannelParametergetHcalTPChannelParameter (const HcalGenericDetId &fId) const
 
const HcalTPParametersgetHcalTPParameters () const
 
const HcalZSThresholdgetHcalZSThreshold (const HcalGenericDetId &fId) const
 
const HcalPedestalgetPedestal (const HcalGenericDetId &fId) const
 
const HcalPedestalWidthgetPedestalWidth (const HcalGenericDetId &fId) const
 
const HcalTopologygetTopologyUsed () const
 
 HcalDbService (const edm::ParameterSet &)
 
void setData (const HcalPedestals *fItem, bool eff=false)
 
void setData (const HcalPedestalWidths *fItem, bool eff=false)
 
void setData (const HcalGains *fItem)
 
void setData (const HcalGainWidths *fItem)
 
void setData (const HcalQIEData *fItem)
 
void setData (const HcalQIETypes *fItem)
 
void setData (const HcalChannelQuality *fItem)
 
void setData (const HcalElectronicsMap *fItem)
 
void setData (const HcalFrontEndMap *fItem)
 
void setData (const HcalRespCorrs *fItem)
 
void setData (const HcalTimeCorrs *fItem)
 
void setData (const HcalZSThresholds *fItem)
 
void setData (const HcalL1TriggerObjects *fItem)
 
void setData (const HcalLUTCorrs *fItem)
 
void setData (const HcalPFCorrs *fItem)
 
void setData (const HcalLutMetadata *fItem)
 
void setData (const HcalSiPMParameters *fItem)
 
void setData (const HcalSiPMCharacteristics *fItem)
 
void setData (const HcalTPChannelParameters *fItem)
 
void setData (const HcalTPParameters *fItem)
 
void setData (const HcalMCParams *fItem)
 
void setData (const HcalRecoParams *fItem)
 
 ~HcalDbService ()
 

Private Member Functions

void buildCalibrations () const
 
void buildCalibWidths () const
 
bool convertPedestals (const HcalGenericDetId &fId, const HcalPedestal *pedestal, float *pedTrue, bool inADC) const
 
bool convertPedestalWidths (const HcalGenericDetId &fId, const HcalPedestalWidth *pedestalwidth, float *pedTrueWidth, bool inADC) const
 
bool makeHcalCalibration (const HcalGenericDetId &fId, HcalCalibrations *fObject, bool pedestalInADC, bool effPedestalInADC) const
 
bool makeHcalCalibrationWidth (const HcalGenericDetId &fId, HcalCalibrationWidths *fObject, bool pedestalInADC, bool effPedestalInADC) const
 

Private Attributes

std::atomic< HcalCalibrationsSet const * > mCalibSet
 
std::atomic< HcalCalibrationWidthsSet const * > mCalibWidthSet
 
const HcalChannelQualitymChannelQuality
 
const HcalPedestalsmEffectivePedestals
 
const HcalPedestalWidthsmEffectivePedestalWidths
 
const HcalElectronicsMapmElectronicsMap
 
const HcalFrontEndMapmFrontEndMap
 
const HcalGainsmGains
 
const HcalGainWidthsmGainWidths
 
const HcalL1TriggerObjectsmL1TriggerObjects
 
const HcalLUTCorrsmLUTCorrs
 
const HcalLutMetadatamLutMetadata
 
const HcalMCParamsmMCParams
 
const HcalPedestalsmPedestals
 
const HcalPedestalWidthsmPedestalWidths
 
const HcalPFCorrsmPFCorrs
 
const HcalQIEDatamQIEData
 
const HcalQIETypesmQIETypes
 
const HcalRecoParamsmRecoParams
 
const HcalRespCorrsmRespCorrs
 
const HcalSiPMCharacteristicsmSiPMCharacteristics
 
const HcalSiPMParametersmSiPMParameters
 
const HcalTimeCorrsmTimeCorrs
 
const HcalTPChannelParametersmTPChannelParameters
 
const HcalTPParametersmTPParameters
 
const HcalZSThresholdsmZSThresholds
 

Detailed Description

Definition at line 27 of file HcalDbService.h.

Constructor & Destructor Documentation

HcalDbService::HcalDbService ( const edm::ParameterSet cfg)

Definition at line 16 of file HcalDbService.cc.

16  :
17  mPedestals (nullptr), mPedestalWidths (nullptr),
18  mEffectivePedestals (nullptr), mEffectivePedestalWidths (nullptr),
19  mGains (nullptr), mGainWidths (nullptr),
20  mQIEData(nullptr),
21  mQIETypes(nullptr),
22  mElectronicsMap(nullptr), mFrontEndMap(nullptr),
23  mRespCorrs(nullptr),
24  mL1TriggerObjects(nullptr),
25  mTimeCorrs(nullptr),
26  mLUTCorrs(nullptr),
27  mPFCorrs(nullptr),
28  mLutMetadata(nullptr),
29  mSiPMParameters(nullptr), mSiPMCharacteristics(nullptr),
30  mTPChannelParameters(nullptr), mTPParameters(nullptr),
31  mMCParams(nullptr), mRecoParams(nullptr),
32  mCalibSet(nullptr), mCalibWidthSet(nullptr)
33  {}
const HcalLUTCorrs * mLUTCorrs
const HcalQIETypes * mQIETypes
const HcalPedestalWidths * mEffectivePedestalWidths
const HcalSiPMParameters * mSiPMParameters
const HcalMCParams * mMCParams
const HcalTPParameters * mTPParameters
std::atomic< HcalCalibrationWidthsSet const * > mCalibWidthSet
const HcalPedestals * mEffectivePedestals
const HcalL1TriggerObjects * mL1TriggerObjects
const HcalPFCorrs * mPFCorrs
const HcalGains * mGains
const HcalLutMetadata * mLutMetadata
const HcalTPChannelParameters * mTPChannelParameters
const HcalPedestalWidths * mPedestalWidths
const HcalRespCorrs * mRespCorrs
const HcalElectronicsMap * mElectronicsMap
const HcalGainWidths * mGainWidths
const HcalTimeCorrs * mTimeCorrs
const HcalQIEData * mQIEData
std::atomic< HcalCalibrationsSet const * > mCalibSet
const HcalFrontEndMap * mFrontEndMap
const HcalPedestals * mPedestals
const HcalRecoParams * mRecoParams
const HcalSiPMCharacteristics * mSiPMCharacteristics
HcalDbService::~HcalDbService ( )

Definition at line 35 of file HcalDbService.cc.

References mCalibSet, and mCalibWidthSet.

35  {
36  delete mCalibSet.load();
37  delete mCalibWidthSet.load();
38 }
std::atomic< HcalCalibrationWidthsSet const * > mCalibWidthSet
std::atomic< HcalCalibrationsSet const * > mCalibSet

Member Function Documentation

void HcalDbService::buildCalibrations ( ) const
private

Definition at line 76 of file HcalDbService.cc.

References HcalCondObjectContainer< Item >::getAllChannels(), triggerObjects_cff::id, electrons_cff::ids, HcalPedestals::isADC(), makeHcalCalibration(), mCalibSet, mEffectivePedestals, mGains, mLUTCorrs, mPedestals, mQIEData, mQIETypes, mRespCorrs, mTimeCorrs, and convertSQLiteXML::ok.

Referenced by getHcalCalibrations(), getHcalCalibrationsSet(), and setData().

76  {
77  // we use the set of ids for pedestals as the master list
78  if ((!mPedestals) || (!mEffectivePedestals) || (!mGains) || (!mQIEData) || (!mQIETypes) || (!mRespCorrs) || (!mTimeCorrs) || (!mLUTCorrs) ) return;
79 
80  if (!mCalibSet.load(std::memory_order_acquire)) {
81 
82  auto ptr = new HcalCalibrationsSet();
83 
84  std::vector<DetId> ids=mPedestals->getAllChannels();
85  bool pedsInADC = mPedestals->isADC();
86  bool effPedsInADC = mEffectivePedestals->isADC();
87  // loop!
88  HcalCalibrations tool;
89 
90  // std::cout << " length of id-vector: " << ids.size() << std::endl;
91  for (std::vector<DetId>::const_iterator id=ids.begin(); id!=ids.end(); ++id) {
92  // make
93  bool ok=makeHcalCalibration(*id,&tool,pedsInADC,effPedsInADC);
94  // store
95  if (ok) ptr->setCalibrations(*id,tool);
96  // std::cout << "Hcal calibrations built... detid no. " << HcalGenericDetId(*id) << std::endl;
97  }
98  HcalCalibrationsSet const * cptr = ptr;
99  HcalCalibrationsSet const * expect = nullptr;
100  bool exchanged = mCalibSet.compare_exchange_strong(expect, cptr, std::memory_order_acq_rel);
101  if(!exchanged) {
102  delete ptr;
103  }
104  }
105 }
const HcalLUTCorrs * mLUTCorrs
const HcalQIETypes * mQIETypes
bool makeHcalCalibration(const HcalGenericDetId &fId, HcalCalibrations *fObject, bool pedestalInADC, bool effPedestalInADC) const
bool isADC() const
Definition: HcalPedestals.h:28
const HcalPedestals * mEffectivePedestals
const HcalGains * mGains
std::vector< DetId > getAllChannels() const
const HcalRespCorrs * mRespCorrs
const HcalTimeCorrs * mTimeCorrs
const HcalQIEData * mQIEData
std::atomic< HcalCalibrationsSet const * > mCalibSet
const HcalPedestals * mPedestals
void HcalDbService::buildCalibWidths ( ) const
private

Definition at line 107 of file HcalDbService.cc.

References HcalCondObjectContainer< Item >::getAllChannels(), triggerObjects_cff::id, electrons_cff::ids, HcalPedestalWidths::isADC(), makeHcalCalibrationWidth(), mCalibWidthSet, mEffectivePedestalWidths, mGainWidths, mPedestalWidths, mQIEData, and convertSQLiteXML::ok.

Referenced by getHcalCalibrationWidths(), getHcalCalibrationWidthsSet(), and setData().

107  {
108  // we use the set of ids for pedestal widths as the master list
109  if ((!mPedestalWidths) || (!mEffectivePedestalWidths) || (!mGainWidths) || (!mQIEData) ) return;
110 
111  if (!mCalibWidthSet.load(std::memory_order_acquire)) {
112 
113  auto ptr = new HcalCalibrationWidthsSet();
114 
115  const std::vector<DetId>& ids=mPedestalWidths->getAllChannels();
116  bool pedsInADC = mPedestalWidths->isADC();
117  bool effPedsInADC = mEffectivePedestalWidths->isADC();
118  // loop!
120 
121  // std::cout << " length of id-vector: " << ids.size() << std::endl;
122  for (std::vector<DetId>::const_iterator id=ids.begin(); id!=ids.end(); ++id) {
123  // make
124  bool ok=makeHcalCalibrationWidth(*id,&tool,pedsInADC,effPedsInADC);
125  // store
126  if (ok) ptr->setCalibrationWidths(*id,tool);
127  // std::cout << "Hcal calibrations built... detid no. " << HcalGenericDetId(*id) << std::endl;
128  }
129  HcalCalibrationWidthsSet const * cptr = ptr;
130  HcalCalibrationWidthsSet const * expect = nullptr;
131  bool exchanged = mCalibWidthSet.compare_exchange_strong(expect, cptr, std::memory_order_acq_rel);
132  if(!exchanged) {
133  delete ptr;
134  }
135  }
136 }
const HcalPedestalWidths * mEffectivePedestalWidths
std::atomic< HcalCalibrationWidthsSet const * > mCalibWidthSet
std::vector< DetId > getAllChannels() const
const HcalPedestalWidths * mPedestalWidths
bool makeHcalCalibrationWidth(const HcalGenericDetId &fId, HcalCalibrationWidths *fObject, bool pedestalInADC, bool effPedestalInADC) const
const HcalGainWidths * mGainWidths
const HcalQIEData * mQIEData
bool HcalDbService::convertPedestals ( const HcalGenericDetId fId,
const HcalPedestal pedestal,
float *  pedTrue,
bool  inADC 
) const
private

Definition at line 138 of file HcalDbService.cc.

References HcalQIECoder::charge(), getHcalCoder(), getHcalShape(), HcalPedestal::getValues(), mps_fire::i, createfilelist::int, x, globals_cff::x1, and globals_cff::x2.

Referenced by makeHcalCalibration(), and setData().

138  {
139  if(!pedestal) return false;
140  const HcalQIECoder* coder = nullptr;
141  const HcalQIEShape* shape = nullptr;
142  if(inADC){
143  coder = getHcalCoder(fId);
144  shape = getHcalShape(coder);
145  if(!coder || !shape) return false;
146  }
147  for (int i=0; i<4; i++) {
148  float x=pedestal->getValues()[i];
149  if(!inADC){
150  pedTrue[i] = x;
151  continue;
152  }
153  int x1=(int)std::floor(x);
154  int x2=(int)std::floor(x+1);
155  float y2=coder->charge(*shape,x2,i);
156  float y1=coder->charge(*shape,x1,i);
157  pedTrue[i]=(y2-y1)*(x-x1)+y1;
158  }
159  return true;
160 }
const HcalQIECoder * getHcalCoder(const HcalGenericDetId &fId) const
const HcalQIEShape * getHcalShape(const HcalGenericDetId &fId) const
const float * getValues() const
get value for all capId = 0..3
Definition: HcalPedestal.h:19
float charge(const HcalQIEShape &fShape, unsigned fAdc, unsigned fCapId) const
ADC [0..127] + capid [0..3] -> fC conversion.
Definition: HcalQIECoder.cc:22
bool HcalDbService::convertPedestalWidths ( const HcalGenericDetId fId,
const HcalPedestalWidth pedestalwidth,
float *  pedTrueWidth,
bool  inADC 
) const
private

Definition at line 185 of file HcalDbService.cc.

References HcalQIECoder::charge(), getHcalCoder(), getHcalShape(), HcalPedestalWidth::getWidth(), mps_fire::i, and x.

Referenced by makeHcalCalibrationWidth(), and setData().

185  {
186  if(!pedestalwidth) return false;
187  const HcalQIECoder* coder = nullptr;
188  const HcalQIEShape* shape = nullptr;
189  if(inADC){
190  coder = getHcalCoder(fId);
191  shape = getHcalShape(coder);
192  if(!coder || !shape) return false;
193  }
194  for (int i=0; i<4; i++) {
195  float x=pedestalwidth->getWidth(i);
196  if(!inADC){
197  pedTrueWidth[i] = x;
198  continue;
199  }
200  // assume QIE is linear in low range and use x1=0 and x2=1
201  // y = (y2-y1) * (x) [do not add any constant, only scale!]
202  float y2=coder->charge(*shape,1,i);
203  float y1=coder->charge(*shape,0,i);
204  pedTrueWidth[i]=(y2-y1)*x;
205  }
206  return true;
207 }
float getWidth(int fCapId) const
get width (sqrt(sigma_i_i)) for capId = 0..3
const HcalQIECoder * getHcalCoder(const HcalGenericDetId &fId) const
const HcalQIEShape * getHcalShape(const HcalGenericDetId &fId) const
float charge(const HcalQIEShape &fShape, unsigned fAdc, unsigned fCapId) const
ADC [0..127] + capid [0..3] -> fC conversion.
Definition: HcalQIECoder.cc:22
const HcalPedestal * HcalDbService::getEffectivePedestal ( const HcalGenericDetId fId) const

Definition at line 258 of file HcalDbService.cc.

References HcalCondObjectContainer< Item >::getValues(), and mEffectivePedestals.

Referenced by makeHcalCalibration().

258  {
259  if (mEffectivePedestals) {
260  return mEffectivePedestals->getValues (fId);
261  }
262  return nullptr;
263 }
const HcalPedestals * mEffectivePedestals
const Item * getValues(DetId fId, bool throwOnFail=true) const
const HcalPedestalWidth * HcalDbService::getEffectivePedestalWidth ( const HcalGenericDetId fId) const

Definition at line 265 of file HcalDbService.cc.

References HcalCondObjectContainer< Item >::getValues(), and mEffectivePedestalWidths.

Referenced by makeHcalCalibrationWidth().

265  {
267  return mEffectivePedestalWidths->getValues (fId);
268  }
269  return nullptr;
270 }
const HcalPedestalWidths * mEffectivePedestalWidths
const Item * getValues(DetId fId, bool throwOnFail=true) const
const HcalGain * HcalDbService::getGain ( const HcalGenericDetId fId) const

Definition at line 272 of file HcalDbService.cc.

References HcalCondObjectContainer< Item >::getValues(), and mGains.

Referenced by HFSimParameters::fCtoGeV(), HcalSimParameters::fCtoGeV(), HPDIonFeedbackSim::fCtoGeV(), makeHcalCalibration(), and HcalDigisValidation::reco().

272  {
273  if (mGains) {
274  return mGains->getValues(fId);
275  }
276  return nullptr;
277 }
const Item * getValues(DetId fId, bool throwOnFail=true) const
const HcalGains * mGains
const HcalGainWidth * HcalDbService::getGainWidth ( const HcalGenericDetId fId) const

Definition at line 279 of file HcalDbService.cc.

References HcalCondObjectContainer< Item >::getValues(), and mGainWidths.

Referenced by HFSimParameters::fCtoGeV(), HcalSimParameters::fCtoGeV(), HPDIonFeedbackSim::fCtoGeV(), makeHcalCalibrationWidth(), and HcalDigisValidation::reco().

279  {
280  if (mGainWidths) {
281  return mGainWidths->getValues (fId);
282  }
283  return nullptr;
284 }
const Item * getValues(DetId fId, bool throwOnFail=true) const
const HcalGainWidths * mGainWidths
const HcalCalibrations & HcalDbService::getHcalCalibrations ( const HcalGenericDetId fId) const
const HcalCalibrationsSet * HcalDbService::getHcalCalibrationsSet ( ) const

Definition at line 64 of file HcalDbService.cc.

References buildCalibrations(), and mCalibSet.

Referenced by edmtest::HcalDumpConditions::analyze().

65 {
67  return mCalibSet.load(std::memory_order_acquire);
68 }
void buildCalibrations() const
std::atomic< HcalCalibrationsSet const * > mCalibSet
const HcalCalibrationWidths & HcalDbService::getHcalCalibrationWidths ( const HcalGenericDetId fId) const

Definition at line 58 of file HcalDbService.cc.

References buildCalibWidths(), and mCalibWidthSet.

Referenced by HcalAmplifier::addPedestals(), HcalTDC::getThreshold(), and HBHEPhase1Reconstructor::processData().

59 {
61  return (*mCalibWidthSet.load(std::memory_order_acquire)).getCalibrationWidths(fId);
62 }
std::atomic< HcalCalibrationWidthsSet const * > mCalibWidthSet
void buildCalibWidths() const
const HcalCalibrationWidthsSet * HcalDbService::getHcalCalibrationWidthsSet ( ) const

Definition at line 70 of file HcalDbService.cc.

References buildCalibWidths(), and mCalibWidthSet.

Referenced by edmtest::HcalDumpConditions::analyze().

71 {
73  return mCalibWidthSet.load(std::memory_order_acquire);
74 }
std::atomic< HcalCalibrationWidthsSet const * > mCalibWidthSet
void buildCalibWidths() const
const HcalChannelStatus * HcalDbService::getHcalChannelStatus ( const HcalGenericDetId fId) const

Definition at line 322 of file HcalDbService.cc.

References HcalCondObjectContainer< Item >::getValues(), and mChannelQuality.

Referenced by WriteL1TriggerObjectsTxt::analyze(), and HcaluLUTTPGCoder::update().

323 {
324  return mChannelQuality->getValues (fId);
325 }
const Item * getValues(DetId fId, bool throwOnFail=true) const
const HcalChannelQuality * mChannelQuality
const HcalQIECoder * HcalDbService::getHcalCoder ( const HcalGenericDetId fId) const
const HcalFrontEndMap * HcalDbService::getHcalFrontEndMapping ( ) const

Definition at line 313 of file HcalDbService.cc.

References mFrontEndMap.

313  {
314  return mFrontEndMap;
315 }
const HcalFrontEndMap * mFrontEndMap
const HcalL1TriggerObject * HcalDbService::getHcalL1TriggerObject ( const HcalGenericDetId fId) const

Definition at line 317 of file HcalDbService.cc.

References HcalCondObjectContainer< Item >::getValues(), and mL1TriggerObjects.

Referenced by HcaluLUTTPGCoder::update().

318 {
319  return mL1TriggerObjects->getValues (fId);
320 }
const HcalL1TriggerObjects * mL1TriggerObjects
const Item * getValues(DetId fId, bool throwOnFail=true) const
const HcalLUTCorr * HcalDbService::getHcalLUTCorr ( const HcalGenericDetId fId) const

Definition at line 339 of file HcalDbService.cc.

References HcalCondObjectContainer< Item >::getValues(), and mLUTCorrs.

Referenced by makeHcalCalibration().

339  {
340  if (mLUTCorrs) {
341  return mLUTCorrs->getValues (fId);
342  }
343  return nullptr;
344 }
const HcalLUTCorrs * mLUTCorrs
const Item * getValues(DetId fId, bool throwOnFail=true) const
const HcalLutMetadata * HcalDbService::getHcalLutMetadata ( ) const

Definition at line 353 of file HcalDbService.cc.

References mLutMetadata.

Referenced by WriteL1TriggerObjectsTxt::analyze(), and HcaluLUTTPGCoder::update().

353  {
354  return mLutMetadata;
355 }
const HcalLutMetadata * mLutMetadata
const HcalElectronicsMap * HcalDbService::getHcalMapping ( ) const
const HcalMCParam * HcalDbService::getHcalMCParam ( const HcalGenericDetId fId) const

Definition at line 375 of file HcalDbService.cc.

References HcalCondObjectContainer< Item >::getValues(), and mMCParams.

Referenced by HcalShapes::shape(), HcalPulseShapes::shape(), and HcalSimParameters::signalShape().

375  {
376  if (mMCParams) {
377  return mMCParams->getValues (fId);
378  }
379  return nullptr;
380 }
const HcalMCParams * mMCParams
const Item * getValues(DetId fId, bool throwOnFail=true) const
const HcalPFCorr * HcalDbService::getHcalPFCorr ( const HcalGenericDetId fId) const

Definition at line 346 of file HcalDbService.cc.

References HcalCondObjectContainer< Item >::getValues(), and mPFCorrs.

346  {
347  if (mPFCorrs) {
348  return mPFCorrs->getValues (fId);
349  }
350  return nullptr;
351 }
const HcalPFCorrs * mPFCorrs
const Item * getValues(DetId fId, bool throwOnFail=true) const
const HcalQIEType * HcalDbService::getHcalQIEType ( const HcalGenericDetId fId) const

Definition at line 230 of file HcalDbService.cc.

References HcalCondObjectContainer< Item >::getValues(), and mQIETypes.

Referenced by HcaluLUTTPGCoder::update().

230  {
231  if (mQIETypes) {
232  return mQIETypes->getValues (fId);
233  }
234  return nullptr;
235 }
const HcalQIETypes * mQIETypes
const Item * getValues(DetId fId, bool throwOnFail=true) const
const HcalRecoParam * HcalDbService::getHcalRecoParam ( const HcalGenericDetId fId) const

Definition at line 382 of file HcalDbService.cc.

References HcalCondObjectContainer< Item >::getValues(), and mRecoParams.

Referenced by HcalPulseShapes::shapeForReco(), and HcaluLUTTPGCoder::update().

382  {
383  if (mRecoParams) {
384  return mRecoParams->getValues (fId);
385  }
386  return nullptr;
387 }
const Item * getValues(DetId fId, bool throwOnFail=true) const
const HcalRecoParams * mRecoParams
const HcalRespCorr * HcalDbService::getHcalRespCorr ( const HcalGenericDetId fId) const

Definition at line 237 of file HcalDbService.cc.

References HcalCondObjectContainer< Item >::getValues(), and mRespCorrs.

Referenced by makeHcalCalibration().

237  {
238  if (mRespCorrs) {
239  return mRespCorrs->getValues (fId);
240  }
241  return nullptr;
242 }
const Item * getValues(DetId fId, bool throwOnFail=true) const
const HcalRespCorrs * mRespCorrs
const HcalQIEShape * HcalDbService::getHcalShape ( const HcalGenericDetId fId) const

Definition at line 293 of file HcalDbService.cc.

References HcalQIEData::getShape(), HcalQIEType::getValue(), HcalCondObjectContainer< Item >::getValues(), mQIEData, and mQIETypes.

Referenced by HGCalDigiValidation::analyze(), HcalCoderFactory::coder(), convertPedestals(), convertPedestalWidths(), reco::HcalNoiseInfoProducer::filldigis(), GlobalDigisProducer::fillHCal(), GlobalDigisAnalyzer::fillHCal(), HFPreReconstructor::fillInfos(), HcalFeatureHFEMBit::getE(), getHcalShape(), PFHBHERecHitCreatorMaxSample::importRecHits(), ZSEnergy_impl::keepMe(), HcalLedAnalysis::LedHBHEHists(), HcalLedAnalysis::LedHFHists(), HcalLedAnalysis::LedHOHists(), hcaldqm::utilities::loadADC2fCDB(), HcalPedestalAnalysis::per2CapsHists(), HcalSimpleReconstructor::process(), HBHEPhase1Reconstructor::processData(), HcalPedestalAnalysis::processEvent(), ZdcSimpleReconstructor::produce(), ZdcHitReconstructor::produce(), HcalHitReconstructor::produce(), edm::DataMixingHcalDigiWorker::putHcal(), HcalDigisValidation::reco(), and HcaluLUTTPGCoder::update().

293  {
294  if (mQIEData && mQIETypes) {
295  //currently 3 types of QIEs exist: QIE8, QIE10, QIE11
296  int qieType = mQIETypes->getValues(fId)->getValue();
297  //QIE10 and QIE11 have same shape (ADC ladder)
298  if(qieType>0) qieType = 1;
299  return &mQIEData->getShape(qieType);
300  }
301  return nullptr;
302 }
const HcalQIETypes * mQIETypes
const HcalQIEShape & getShape(int qieType) const
get basic shape
Definition: HcalQIEData.h:37
int getValue() const
Definition: HcalQIEType.h:20
const Item * getValues(DetId fId, bool throwOnFail=true) const
const HcalQIEData * mQIEData
const HcalQIEShape * HcalDbService::getHcalShape ( const HcalQIECoder coder) const

Definition at line 304 of file HcalDbService.cc.

References getHcalShape(), and HcalQIECoder::rawId().

304  {
305  HcalGenericDetId fId(coder->rawId());
306  return getHcalShape(fId);
307 }
uint32_t rawId() const
Definition: HcalQIECoder.h:37
const HcalQIEShape * getHcalShape(const HcalGenericDetId &fId) const
const HcalSiPMCharacteristics * HcalDbService::getHcalSiPMCharacteristics ( ) const

Definition at line 364 of file HcalDbService.cc.

References mSiPMCharacteristics.

Referenced by HBHEPhase1Reconstructor::processData(), HcalSimParameters::setDbService(), and HcaluLUTTPGCoder::update().

364  {
365  return mSiPMCharacteristics;
366 }
const HcalSiPMCharacteristics * mSiPMCharacteristics
const HcalSiPMParameter * HcalDbService::getHcalSiPMParameter ( const HcalGenericDetId fId) const
const HcalTimeCorr * HcalDbService::getHcalTimeCorr ( const HcalGenericDetId fId) const

Definition at line 332 of file HcalDbService.cc.

References HcalCondObjectContainer< Item >::getValues(), and mTimeCorrs.

Referenced by makeHcalCalibration().

332  {
333  if (mTimeCorrs) {
334  return mTimeCorrs->getValues (fId);
335  }
336  return nullptr;
337 }
const Item * getValues(DetId fId, bool throwOnFail=true) const
const HcalTimeCorrs * mTimeCorrs
const HcalTPChannelParameter * HcalDbService::getHcalTPChannelParameter ( const HcalGenericDetId fId) const

Definition at line 368 of file HcalDbService.cc.

References HcalCondObjectContainer< Item >::getValues(), and mTPChannelParameters.

Referenced by HcaluLUTTPGCoder::update(), and HcalTriggerPrimitiveAlgo::validChannel().

368  {
369  if (mTPChannelParameters) {
370  return mTPChannelParameters->getValues (fId);
371  }
372  return nullptr;
373 }
const Item * getValues(DetId fId, bool throwOnFail=true) const
const HcalTPChannelParameters * mTPChannelParameters
const HcalTPParameters * HcalDbService::getHcalTPParameters ( ) const

Definition at line 389 of file HcalDbService.cc.

References mTPParameters.

Referenced by HcalTriggerPrimitiveAlgo::run(), and HcalTriggerPrimitiveAlgo::validChannel().

389  {
390  return mTPParameters;
391 }
const HcalTPParameters * mTPParameters
const HcalZSThreshold * HcalDbService::getHcalZSThreshold ( const HcalGenericDetId fId) const

Definition at line 327 of file HcalDbService.cc.

References HcalCondObjectContainer< Item >::getValues(), and mZSThresholds.

Referenced by HcalZSAlgoRealistic::keepMe().

328 {
329  return mZSThresholds->getValues (fId);
330 }
const Item * getValues(DetId fId, bool throwOnFail=true) const
const HcalZSThresholds * mZSThresholds
const HcalPedestal * HcalDbService::getPedestal ( const HcalGenericDetId fId) const

Definition at line 244 of file HcalDbService.cc.

References HcalCondObjectContainer< Item >::getValues(), and mPedestals.

Referenced by PedestalTask::bookHistograms(), ZSEnergy_impl::keepMe(), HcalLedAnalysis::LedHBHEHists(), HcalLedAnalysis::LedHFHists(), HcalLedAnalysis::LedHOHists(), makeHcalCalibration(), and HcalDigisValidation::reco().

244  {
245  if (mPedestals) {
246  return mPedestals->getValues (fId);
247  }
248  return nullptr;
249 }
const Item * getValues(DetId fId, bool throwOnFail=true) const
const HcalPedestals * mPedestals
const HcalPedestalWidth * HcalDbService::getPedestalWidth ( const HcalGenericDetId fId) const

Definition at line 251 of file HcalDbService.cc.

References HcalCondObjectContainer< Item >::getValues(), and mPedestalWidths.

Referenced by makeHcalCalibrationWidth().

251  {
252  if (mPedestalWidths) {
253  return mPedestalWidths->getValues (fId);
254  }
255  return nullptr;
256 }
const Item * getValues(DetId fId, bool throwOnFail=true) const
const HcalPedestalWidths * mPedestalWidths
const HcalTopology * HcalDbService::getTopologyUsed ( ) const

Definition at line 40 of file HcalDbService.cc.

References mEffectivePedestals, mGains, mL1TriggerObjects, mLutMetadata, mPedestals, mQIETypes, mRespCorrs, and HcalCondObjectContainerBase::topo().

40  {
41  if (mPedestals && mPedestals->topo()) return mPedestals->topo();
43  if (mGains && mGains->topo()) return mGains->topo();
44  if (mRespCorrs && mRespCorrs->topo()) return mRespCorrs->topo();
45  if (mQIETypes && mQIETypes->topo()) return mQIETypes->topo();
47  if (mLutMetadata && mLutMetadata->topo()) return mLutMetadata->topo();
48  return nullptr;
49 }
const HcalQIETypes * mQIETypes
const HcalPedestals * mEffectivePedestals
const HcalL1TriggerObjects * mL1TriggerObjects
const HcalGains * mGains
const HcalLutMetadata * mLutMetadata
const HcalRespCorrs * mRespCorrs
const HcalPedestals * mPedestals
const HcalTopology * topo() const
bool HcalDbService::makeHcalCalibration ( const HcalGenericDetId fId,
HcalCalibrations fObject,
bool  pedestalInADC,
bool  effPedestalInADC 
) const
private

Definition at line 162 of file HcalDbService.cc.

References convertPedestals(), muonCSCDigis_cfi::gain, getEffectivePedestal(), getGain(), getHcalLUTCorr(), getHcalRespCorr(), getHcalTimeCorr(), getPedestal(), HcalRespCorr::getValue(), HcalTimeCorr::getValue(), HcalLUTCorr::getValue(), HcalGain::getValues(), and muonCSCDigis_cfi::pedestal.

Referenced by buildCalibrations(), and setData().

162  {
163  if (fObject) {
164  const HcalPedestal* pedestal = getPedestal (fId);
165  const HcalPedestal* effpedestal = getEffectivePedestal (fId);
166  const HcalGain* gain = getGain (fId);
167  const HcalRespCorr* respcorr = getHcalRespCorr (fId);
168  const HcalTimeCorr* timecorr = getHcalTimeCorr (fId);
169  const HcalLUTCorr* lutcorr = getHcalLUTCorr (fId);
170 
171  float pedTrue[4];
172  bool converted = convertPedestals(fId,pedestal,pedTrue,pedestalInADC);
173 
174  float effPedTrue[4];
175  bool effconverted = convertPedestals(fId,effpedestal,effPedTrue,effPedestalInADC);
176 
177  if (pedestal && effpedestal && converted && effconverted && gain && respcorr && timecorr && lutcorr) {
178  *fObject = HcalCalibrations (gain->getValues(), pedTrue, effPedTrue, respcorr->getValue(), timecorr->getValue(), lutcorr->getValue() );
179  return true;
180  }
181  }
182  return false;
183 }
const HcalRespCorr * getHcalRespCorr(const HcalGenericDetId &fId) const
const HcalLUTCorr * getHcalLUTCorr(const HcalGenericDetId &fId) const
const HcalTimeCorr * getHcalTimeCorr(const HcalGenericDetId &fId) const
const HcalPedestal * getEffectivePedestal(const HcalGenericDetId &fId) const
const float * getValues() const
get value for all capId = 0..3
Definition: HcalGain.h:20
float getValue() const
Definition: HcalLUTCorr.h:20
float getValue() const
Definition: HcalTimeCorr.h:20
const HcalGain * getGain(const HcalGenericDetId &fId) const
bool convertPedestals(const HcalGenericDetId &fId, const HcalPedestal *pedestal, float *pedTrue, bool inADC) const
float getValue() const
Definition: HcalRespCorr.h:20
const HcalPedestal * getPedestal(const HcalGenericDetId &fId) const
bool HcalDbService::makeHcalCalibrationWidth ( const HcalGenericDetId fId,
HcalCalibrationWidths fObject,
bool  pedestalInADC,
bool  effPedestalInADC 
) const
private

Definition at line 210 of file HcalDbService.cc.

References convertPedestalWidths(), getEffectivePedestalWidth(), getGainWidth(), getPedestalWidth(), and HcalGainWidth::getValues().

Referenced by buildCalibWidths(), and setData().

211  {
212  if (fObject) {
213  const HcalPedestalWidth* pedestalwidth = getPedestalWidth (fId);
214  const HcalPedestalWidth* effpedestalwidth = getEffectivePedestalWidth (fId);
215  const HcalGainWidth* gainwidth = getGainWidth (fId);
216 
217  float pedTrueWidth[4];
218  bool converted = convertPedestalWidths(fId,pedestalwidth,pedTrueWidth,pedestalInADC);
219 
220  float effPedTrueWidth[4];
221  bool effconverted = convertPedestalWidths(fId,effpedestalwidth,effPedTrueWidth,effPedestalInADC);
222  if (pedestalwidth && effpedestalwidth&& gainwidth && converted && effconverted) {
223  *fObject = HcalCalibrationWidths (gainwidth->getValues (), pedTrueWidth, effPedTrueWidth);
224  return true;
225  }
226  }
227  return false;
228 }
const HcalGainWidth * getGainWidth(const HcalGenericDetId &fId) const
const float * getValues() const
get value for all capId = 0..3
Definition: HcalGainWidth.h:19
const HcalPedestalWidth * getPedestalWidth(const HcalGenericDetId &fId) const
const HcalPedestalWidth * getEffectivePedestalWidth(const HcalGenericDetId &fId) const
bool convertPedestalWidths(const HcalGenericDetId &fId, const HcalPedestalWidth *pedestalwidth, float *pedTrueWidth, bool inADC) const
void HcalDbService::setData ( const HcalPedestals fItem,
bool  eff = false 
)
inline

Definition at line 66 of file HcalDbService.h.

References mCalibSet, mEffectivePedestals, and mPedestals.

66  {
67  if(eff) mEffectivePedestals = fItem;
68  else mPedestals = fItem;
69  mCalibSet = nullptr;
70  }
const HcalPedestals * mEffectivePedestals
std::atomic< HcalCalibrationsSet const * > mCalibSet
const HcalPedestals * mPedestals
void HcalDbService::setData ( const HcalPedestalWidths fItem,
bool  eff = false 
)
inline

Definition at line 71 of file HcalDbService.h.

References mCalibWidthSet, mEffectivePedestalWidths, and mPedestalWidths.

71  {
72  if(eff) mEffectivePedestalWidths = fItem;
73  else mPedestalWidths = fItem;
74  mCalibWidthSet = nullptr;
75  }
const HcalPedestalWidths * mEffectivePedestalWidths
std::atomic< HcalCalibrationWidthsSet const * > mCalibWidthSet
const HcalPedestalWidths * mPedestalWidths
void HcalDbService::setData ( const HcalGains fItem)
inline

Definition at line 76 of file HcalDbService.h.

References mCalibSet, and mGains.

76 {mGains = fItem; mCalibSet = nullptr; }
const HcalGains * mGains
std::atomic< HcalCalibrationsSet const * > mCalibSet
void HcalDbService::setData ( const HcalGainWidths fItem)
inline

Definition at line 77 of file HcalDbService.h.

References mCalibWidthSet, and mGainWidths.

77 {mGainWidths = fItem; mCalibWidthSet = nullptr; }
std::atomic< HcalCalibrationWidthsSet const * > mCalibWidthSet
const HcalGainWidths * mGainWidths
void HcalDbService::setData ( const HcalQIEData fItem)
inline

Definition at line 78 of file HcalDbService.h.

References mCalibSet, mCalibWidthSet, and mQIEData.

78 {mQIEData = fItem; mCalibSet=nullptr; mCalibWidthSet=nullptr;}
std::atomic< HcalCalibrationWidthsSet const * > mCalibWidthSet
const HcalQIEData * mQIEData
std::atomic< HcalCalibrationsSet const * > mCalibSet
void HcalDbService::setData ( const HcalQIETypes fItem)
inline

Definition at line 79 of file HcalDbService.h.

References mCalibSet, and mQIETypes.

79 {mQIETypes = fItem; mCalibSet = nullptr; }
const HcalQIETypes * mQIETypes
std::atomic< HcalCalibrationsSet const * > mCalibSet
void HcalDbService::setData ( const HcalChannelQuality fItem)
inline

Definition at line 80 of file HcalDbService.h.

References mChannelQuality.

80 {mChannelQuality = fItem;}
const HcalChannelQuality * mChannelQuality
void HcalDbService::setData ( const HcalElectronicsMap fItem)
inline

Definition at line 81 of file HcalDbService.h.

References mElectronicsMap.

81 {mElectronicsMap = fItem;}
const HcalElectronicsMap * mElectronicsMap
void HcalDbService::setData ( const HcalFrontEndMap fItem)
inline

Definition at line 82 of file HcalDbService.h.

References mFrontEndMap.

82 {mFrontEndMap = fItem;}
const HcalFrontEndMap * mFrontEndMap
void HcalDbService::setData ( const HcalRespCorrs fItem)
inline

Definition at line 83 of file HcalDbService.h.

References mCalibSet, and mRespCorrs.

83 {mRespCorrs = fItem; mCalibSet = nullptr; }
const HcalRespCorrs * mRespCorrs
std::atomic< HcalCalibrationsSet const * > mCalibSet
void HcalDbService::setData ( const HcalTimeCorrs fItem)
inline

Definition at line 84 of file HcalDbService.h.

References mCalibSet, and mTimeCorrs.

84 {mTimeCorrs = fItem; mCalibSet = nullptr; }
const HcalTimeCorrs * mTimeCorrs
std::atomic< HcalCalibrationsSet const * > mCalibSet
void HcalDbService::setData ( const HcalZSThresholds fItem)
inline

Definition at line 85 of file HcalDbService.h.

References mZSThresholds.

85 {mZSThresholds = fItem;}
const HcalZSThresholds * mZSThresholds
void HcalDbService::setData ( const HcalL1TriggerObjects fItem)
inline

Definition at line 86 of file HcalDbService.h.

References mL1TriggerObjects.

86 {mL1TriggerObjects = fItem;}
const HcalL1TriggerObjects * mL1TriggerObjects
void HcalDbService::setData ( const HcalLUTCorrs fItem)
inline

Definition at line 87 of file HcalDbService.h.

References mCalibSet, and mLUTCorrs.

87 {mLUTCorrs = fItem; mCalibSet = nullptr; }
const HcalLUTCorrs * mLUTCorrs
std::atomic< HcalCalibrationsSet const * > mCalibSet
void HcalDbService::setData ( const HcalPFCorrs fItem)
inline

Definition at line 88 of file HcalDbService.h.

References mPFCorrs.

88 {mPFCorrs = fItem; }
const HcalPFCorrs * mPFCorrs
void HcalDbService::setData ( const HcalLutMetadata fItem)
inline

Definition at line 89 of file HcalDbService.h.

References mLutMetadata.

89 {mLutMetadata = fItem;}
const HcalLutMetadata * mLutMetadata
void HcalDbService::setData ( const HcalSiPMParameters fItem)
inline

Definition at line 90 of file HcalDbService.h.

References mCalibSet, and mSiPMParameters.

90 {mSiPMParameters = fItem; mCalibSet = nullptr;}
const HcalSiPMParameters * mSiPMParameters
std::atomic< HcalCalibrationsSet const * > mCalibSet
void HcalDbService::setData ( const HcalSiPMCharacteristics fItem)
inline

Definition at line 91 of file HcalDbService.h.

References mSiPMCharacteristics.

91 {mSiPMCharacteristics = fItem;}
const HcalSiPMCharacteristics * mSiPMCharacteristics
void HcalDbService::setData ( const HcalTPChannelParameters fItem)
inline

Definition at line 92 of file HcalDbService.h.

References mCalibSet, and mTPChannelParameters.

92 {mTPChannelParameters = fItem; mCalibSet = nullptr;}
const HcalTPChannelParameters * mTPChannelParameters
std::atomic< HcalCalibrationsSet const * > mCalibSet
void HcalDbService::setData ( const HcalTPParameters fItem)
inline

Definition at line 93 of file HcalDbService.h.

References mTPParameters.

93 {mTPParameters = fItem;}
const HcalTPParameters * mTPParameters
void HcalDbService::setData ( const HcalMCParams fItem)
inline

Definition at line 94 of file HcalDbService.h.

References mMCParams.

94 {mMCParams = fItem;}
const HcalMCParams * mMCParams
void HcalDbService::setData ( const HcalRecoParams fItem)
inline

Member Data Documentation

std::atomic<HcalCalibrationsSet const *> HcalDbService::mCalibSet
mutableprivate
std::atomic<HcalCalibrationWidthsSet const *> HcalDbService::mCalibWidthSet
mutableprivate
const HcalChannelQuality* HcalDbService::mChannelQuality
private

Definition at line 114 of file HcalDbService.h.

Referenced by getHcalChannelStatus(), and setData().

const HcalPedestals* HcalDbService::mEffectivePedestals
private

Definition at line 108 of file HcalDbService.h.

Referenced by buildCalibrations(), getEffectivePedestal(), getTopologyUsed(), and setData().

const HcalPedestalWidths* HcalDbService::mEffectivePedestalWidths
private

Definition at line 109 of file HcalDbService.h.

Referenced by buildCalibWidths(), getEffectivePedestalWidth(), and setData().

const HcalElectronicsMap* HcalDbService::mElectronicsMap
private

Definition at line 115 of file HcalDbService.h.

Referenced by getHcalMapping(), and setData().

const HcalFrontEndMap* HcalDbService::mFrontEndMap
private

Definition at line 116 of file HcalDbService.h.

Referenced by getHcalFrontEndMapping(), and setData().

const HcalGains* HcalDbService::mGains
private

Definition at line 110 of file HcalDbService.h.

Referenced by buildCalibrations(), getGain(), getTopologyUsed(), and setData().

const HcalGainWidths* HcalDbService::mGainWidths
private

Definition at line 111 of file HcalDbService.h.

Referenced by buildCalibWidths(), getGainWidth(), and setData().

const HcalL1TriggerObjects* HcalDbService::mL1TriggerObjects
private

Definition at line 119 of file HcalDbService.h.

Referenced by getHcalL1TriggerObject(), getTopologyUsed(), and setData().

const HcalLUTCorrs* HcalDbService::mLUTCorrs
private

Definition at line 121 of file HcalDbService.h.

Referenced by buildCalibrations(), getHcalLUTCorr(), and setData().

const HcalLutMetadata* HcalDbService::mLutMetadata
private

Definition at line 123 of file HcalDbService.h.

Referenced by getHcalLutMetadata(), getTopologyUsed(), and setData().

const HcalMCParams* HcalDbService::mMCParams
private

Definition at line 128 of file HcalDbService.h.

Referenced by getHcalMCParam(), and setData().

const HcalPedestals* HcalDbService::mPedestals
private

Definition at line 106 of file HcalDbService.h.

Referenced by buildCalibrations(), getPedestal(), getTopologyUsed(), and setData().

const HcalPedestalWidths* HcalDbService::mPedestalWidths
private

Definition at line 107 of file HcalDbService.h.

Referenced by buildCalibWidths(), getPedestalWidth(), and setData().

const HcalPFCorrs* HcalDbService::mPFCorrs
private

Definition at line 122 of file HcalDbService.h.

Referenced by getHcalPFCorr(), and setData().

const HcalQIEData* HcalDbService::mQIEData
private
const HcalQIETypes* HcalDbService::mQIETypes
private
const HcalRecoParams* HcalDbService::mRecoParams
private

Definition at line 129 of file HcalDbService.h.

Referenced by getHcalRecoParam(), and setData().

const HcalRespCorrs* HcalDbService::mRespCorrs
private

Definition at line 117 of file HcalDbService.h.

Referenced by buildCalibrations(), getHcalRespCorr(), getTopologyUsed(), and setData().

const HcalSiPMCharacteristics* HcalDbService::mSiPMCharacteristics
private

Definition at line 125 of file HcalDbService.h.

Referenced by getHcalSiPMCharacteristics(), and setData().

const HcalSiPMParameters* HcalDbService::mSiPMParameters
private

Definition at line 124 of file HcalDbService.h.

Referenced by getHcalSiPMParameter(), and setData().

const HcalTimeCorrs* HcalDbService::mTimeCorrs
private

Definition at line 120 of file HcalDbService.h.

Referenced by buildCalibrations(), getHcalTimeCorr(), and setData().

const HcalTPChannelParameters* HcalDbService::mTPChannelParameters
private

Definition at line 126 of file HcalDbService.h.

Referenced by getHcalTPChannelParameter(), and setData().

const HcalTPParameters* HcalDbService::mTPParameters
private

Definition at line 127 of file HcalDbService.h.

Referenced by getHcalTPParameters(), and setData().

const HcalZSThresholds* HcalDbService::mZSThresholds
private

Definition at line 118 of file HcalDbService.h.

Referenced by getHcalZSThreshold(), and setData().