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 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 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)
 
void setData (const HcalPedestalWidths *fItem)
 
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)
 
 ~HcalDbService ()
 

Private Member Functions

void buildCalibrations () const
 
void buildCalibWidths () const
 
bool makeHcalCalibration (const HcalGenericDetId &fId, HcalCalibrations *fObject, bool pedestalInADC) const
 
bool makeHcalCalibrationWidth (const HcalGenericDetId &fId, HcalCalibrationWidths *fObject, bool pedestalInADC) const
 

Private Attributes

std::atomic< HcalCalibrationsSet const * > mCalibSet
 
std::atomic< HcalCalibrationWidthsSet const * > mCalibWidthSet
 
const HcalChannelQualitymChannelQuality
 
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 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 (0), mPedestalWidths (0),
18  mGains (0), mGainWidths (0),
19  mQIEData(0),
20  mQIETypes(0),
22  mRespCorrs(0),
24  mTimeCorrs(0),
25  mLUTCorrs(0),
26  mPFCorrs(0),
27  mLutMetadata(0),
30  mMCParams(0),
31  mCalibSet(nullptr), mCalibWidthSet(nullptr)
32  {}
const HcalLUTCorrs * mLUTCorrs
const HcalQIETypes * mQIETypes
Definition: HcalDbService.h:97
const HcalSiPMParameters * mSiPMParameters
const HcalMCParams * mMCParams
const HcalTPParameters * mTPParameters
std::atomic< HcalCalibrationWidthsSet const * > mCalibWidthSet
const HcalL1TriggerObjects * mL1TriggerObjects
const HcalPFCorrs * mPFCorrs
const HcalGains * mGains
Definition: HcalDbService.h:94
const HcalLutMetadata * mLutMetadata
const HcalTPChannelParameters * mTPChannelParameters
const HcalPedestalWidths * mPedestalWidths
Definition: HcalDbService.h:93
const HcalRespCorrs * mRespCorrs
const HcalElectronicsMap * mElectronicsMap
Definition: HcalDbService.h:99
const HcalGainWidths * mGainWidths
Definition: HcalDbService.h:95
const HcalTimeCorrs * mTimeCorrs
const HcalQIEData * mQIEData
Definition: HcalDbService.h:96
std::atomic< HcalCalibrationsSet const * > mCalibSet
const HcalFrontEndMap * mFrontEndMap
const HcalPedestals * mPedestals
Definition: HcalDbService.h:92
const HcalSiPMCharacteristics * mSiPMCharacteristics
HcalDbService::~HcalDbService ( )

Definition at line 34 of file HcalDbService.cc.

References mCalibSet, and mCalibWidthSet.

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

Member Function Documentation

void HcalDbService::buildCalibrations ( ) const
private

Definition at line 74 of file HcalDbService.cc.

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

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

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

Definition at line 104 of file HcalDbService.cc.

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

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

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

Definition at line 230 of file HcalDbService.cc.

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

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

230  {
231  if (mGains) {
232  return mGains->getValues(fId);
233  }
234  return 0;
235 }
const Item * getValues(DetId fId, bool throwOnFail=true) const
const HcalGains * mGains
Definition: HcalDbService.h:94
const HcalGainWidth * HcalDbService::getGainWidth ( const HcalGenericDetId fId) const

Definition at line 237 of file HcalDbService.cc.

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

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

237  {
238  if (mGainWidths) {
239  return mGainWidths->getValues (fId);
240  }
241  return 0;
242 }
const Item * getValues(DetId fId, bool throwOnFail=true) const
const HcalGainWidths * mGainWidths
Definition: HcalDbService.h:95
const HcalCalibrations & HcalDbService::getHcalCalibrations ( const HcalGenericDetId fId) const
const HcalCalibrationsSet * HcalDbService::getHcalCalibrationsSet ( ) const

Definition at line 62 of file HcalDbService.cc.

References buildCalibrations(), and mCalibSet.

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

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

Definition at line 56 of file HcalDbService.cc.

References buildCalibWidths(), and mCalibWidthSet.

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

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

Definition at line 68 of file HcalDbService.cc.

References buildCalibWidths(), and mCalibWidthSet.

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

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

Definition at line 280 of file HcalDbService.cc.

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

Referenced by HcaluLUTTPGCoder::update().

281 {
282  return mChannelQuality->getValues (fId);
283 }
const Item * getValues(DetId fId, bool throwOnFail=true) const
const HcalChannelQuality * mChannelQuality
Definition: HcalDbService.h:98
const HcalQIECoder * HcalDbService::getHcalCoder ( const HcalGenericDetId fId) const
const HcalFrontEndMap * HcalDbService::getHcalFrontEndMapping ( ) const

Definition at line 271 of file HcalDbService.cc.

References mFrontEndMap.

271  {
272  return mFrontEndMap;
273 }
const HcalFrontEndMap * mFrontEndMap
const HcalL1TriggerObject * HcalDbService::getHcalL1TriggerObject ( const HcalGenericDetId fId) const

Definition at line 275 of file HcalDbService.cc.

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

Referenced by HcaluLUTTPGCoder::update().

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

Definition at line 297 of file HcalDbService.cc.

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

Referenced by makeHcalCalibration().

297  {
298  if (mLUTCorrs) {
299  return mLUTCorrs->getValues (fId);
300  }
301  return 0;
302 }
const HcalLUTCorrs * mLUTCorrs
const Item * getValues(DetId fId, bool throwOnFail=true) const
const HcalLutMetadata * HcalDbService::getHcalLutMetadata ( ) const

Definition at line 311 of file HcalDbService.cc.

References mLutMetadata.

Referenced by HcaluLUTTPGCoder::update().

311  {
312  return mLutMetadata;
313 }
const HcalLutMetadata * mLutMetadata
const HcalElectronicsMap * HcalDbService::getHcalMapping ( ) const
const HcalMCParam * HcalDbService::getHcalMCParam ( const HcalGenericDetId fId) const

Definition at line 333 of file HcalDbService.cc.

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

Referenced by HcalSimParameters::signalShape().

333  {
334  if (mMCParams) {
335  return mMCParams->getValues (fId);
336  }
337  return 0;
338 }
const HcalMCParams * mMCParams
const Item * getValues(DetId fId, bool throwOnFail=true) const
const HcalPFCorr * HcalDbService::getHcalPFCorr ( const HcalGenericDetId fId) const

Definition at line 304 of file HcalDbService.cc.

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

304  {
305  if (mPFCorrs) {
306  return mPFCorrs->getValues (fId);
307  }
308  return 0;
309 }
const HcalPFCorrs * mPFCorrs
const Item * getValues(DetId fId, bool throwOnFail=true) const
const HcalQIEType * HcalDbService::getHcalQIEType ( const HcalGenericDetId fId) const

Definition at line 202 of file HcalDbService.cc.

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

Referenced by HcaluLUTTPGCoder::update().

202  {
203  if (mQIETypes) {
204  return mQIETypes->getValues (fId);
205  }
206  return 0;
207 }
const HcalQIETypes * mQIETypes
Definition: HcalDbService.h:97
const Item * getValues(DetId fId, bool throwOnFail=true) const
const HcalRespCorr * HcalDbService::getHcalRespCorr ( const HcalGenericDetId fId) const

Definition at line 209 of file HcalDbService.cc.

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

Referenced by makeHcalCalibration().

209  {
210  if (mRespCorrs) {
211  return mRespCorrs->getValues (fId);
212  }
213  return 0;
214 }
const Item * getValues(DetId fId, bool throwOnFail=true) const
const HcalRespCorrs * mRespCorrs
const HcalQIEShape * HcalDbService::getHcalShape ( const HcalGenericDetId fId) const

Definition at line 251 of file HcalDbService.cc.

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

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

251  {
252  if (mQIEData && mQIETypes) {
253  //currently 3 types of QIEs exist: QIE8, QIE10, QIE11
254  int qieType = mQIETypes->getValues(fId)->getValue();
255  //QIE10 and QIE11 have same shape (ADC ladder)
256  if(qieType>0) qieType = 1;
257  return &mQIEData->getShape(qieType);
258  }
259  return 0;
260 }
const HcalQIETypes * mQIETypes
Definition: HcalDbService.h:97
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
Definition: HcalDbService.h:96
const HcalQIEShape * HcalDbService::getHcalShape ( const HcalQIECoder coder) const

Definition at line 262 of file HcalDbService.cc.

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

262  {
263  HcalGenericDetId fId(coder->rawId());
264  return getHcalShape(fId);
265 }
uint32_t rawId() const
Definition: HcalQIECoder.h:37
const HcalQIEShape * getHcalShape(const HcalGenericDetId &fId) const
const HcalSiPMCharacteristics * HcalDbService::getHcalSiPMCharacteristics ( ) const

Definition at line 322 of file HcalDbService.cc.

References mSiPMCharacteristics.

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

322  {
323  return mSiPMCharacteristics;
324 }
const HcalSiPMCharacteristics * mSiPMCharacteristics
const HcalSiPMParameter * HcalDbService::getHcalSiPMParameter ( const HcalGenericDetId fId) const
const HcalTimeCorr * HcalDbService::getHcalTimeCorr ( const HcalGenericDetId fId) const

Definition at line 290 of file HcalDbService.cc.

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

Referenced by makeHcalCalibration().

290  {
291  if (mTimeCorrs) {
292  return mTimeCorrs->getValues (fId);
293  }
294  return 0;
295 }
const Item * getValues(DetId fId, bool throwOnFail=true) const
const HcalTimeCorrs * mTimeCorrs
const HcalTPChannelParameter * HcalDbService::getHcalTPChannelParameter ( const HcalGenericDetId fId) const

Definition at line 326 of file HcalDbService.cc.

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

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

326  {
327  if (mTPChannelParameters) {
328  return mTPChannelParameters->getValues (fId);
329  }
330  return 0;
331 }
const Item * getValues(DetId fId, bool throwOnFail=true) const
const HcalTPChannelParameters * mTPChannelParameters
const HcalTPParameters * HcalDbService::getHcalTPParameters ( ) const

Definition at line 340 of file HcalDbService.cc.

References mTPParameters.

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

340  {
341  return mTPParameters;
342 }
const HcalTPParameters * mTPParameters
const HcalZSThreshold * HcalDbService::getHcalZSThreshold ( const HcalGenericDetId fId) const

Definition at line 285 of file HcalDbService.cc.

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

Referenced by HcalZSAlgoRealistic::keepMe().

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

Definition at line 216 of file HcalDbService.cc.

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

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

216  {
217  if (mPedestals) {
218  return mPedestals->getValues (fId);
219  }
220  return 0;
221 }
const Item * getValues(DetId fId, bool throwOnFail=true) const
const HcalPedestals * mPedestals
Definition: HcalDbService.h:92
const HcalPedestalWidth * HcalDbService::getPedestalWidth ( const HcalGenericDetId fId) const

Definition at line 223 of file HcalDbService.cc.

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

Referenced by makeHcalCalibrationWidth().

223  {
224  if (mPedestalWidths) {
225  return mPedestalWidths->getValues (fId);
226  }
227  return 0;
228 }
const Item * getValues(DetId fId, bool throwOnFail=true) const
const HcalPedestalWidths * mPedestalWidths
Definition: HcalDbService.h:93
const HcalTopology * HcalDbService::getTopologyUsed ( ) const

Definition at line 39 of file HcalDbService.cc.

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

39  {
40  if (mPedestals && mPedestals->topo()) return mPedestals->topo();
41  if (mGains && mGains->topo()) return mGains->topo();
42  if (mRespCorrs && mRespCorrs->topo()) return mRespCorrs->topo();
43  if (mQIETypes && mQIETypes->topo()) return mQIETypes->topo();
45  if (mLutMetadata && mLutMetadata->topo()) return mLutMetadata->topo();
46  return 0;
47 }
const HcalQIETypes * mQIETypes
Definition: HcalDbService.h:97
const HcalL1TriggerObjects * mL1TriggerObjects
const HcalGains * mGains
Definition: HcalDbService.h:94
const HcalLutMetadata * mLutMetadata
const HcalRespCorrs * mRespCorrs
const HcalPedestals * mPedestals
Definition: HcalDbService.h:92
const HcalTopology * topo() const
bool HcalDbService::makeHcalCalibration ( const HcalGenericDetId fId,
HcalCalibrations fObject,
bool  pedestalInADC 
) const
private

Definition at line 134 of file HcalDbService.cc.

References HcalQIECoder::charge(), muonCSCDigis_cfi::gain, getGain(), getHcalCoder(), getHcalLUTCorr(), getHcalRespCorr(), getHcalShape(), getHcalTimeCorr(), getPedestal(), HcalRespCorr::getValue(), HcalTimeCorr::getValue(), HcalLUTCorr::getValue(), HcalPedestal::getValues(), HcalGain::getValues(), mps_fire::i, createfilelist::int, muonCSCDigis_cfi::pedestal, and x.

Referenced by buildCalibrations(), and setData().

134  {
135  if (fObject) {
136  const HcalPedestal* pedestal = getPedestal (fId);
137  const HcalGain* gain = getGain (fId);
138  const HcalRespCorr* respcorr = getHcalRespCorr (fId);
139  const HcalTimeCorr* timecorr = getHcalTimeCorr (fId);
140  const HcalLUTCorr* lutcorr = getHcalLUTCorr (fId);
141 
142  if (pedestalInADC) {
143  const HcalQIECoder* coder=getHcalCoder(fId);
144  const HcalQIEShape* shape=getHcalShape(coder);
145  if (pedestal && gain && shape && coder && respcorr && timecorr && lutcorr) {
146  float pedTrue[4];
147  for (int i=0; i<4; i++) {
148  float x=pedestal->getValues()[i];
149  int x1=(int)std::floor(x);
150  int x2=(int)std::floor(x+1);
151  // y = (y2-y1)/(x2-x1) * (x - x1) + y1 [note: x2-x1=1]
152  float y2=coder->charge(*shape,x2,i);
153  float y1=coder->charge(*shape,x1,i);
154  pedTrue[i]=(y2-y1)*(x-x1)+y1;
155  }
156  *fObject = HcalCalibrations (gain->getValues (), pedTrue, respcorr->getValue(), timecorr->getValue(), lutcorr->getValue() );
157  return true;
158  }
159  } else {
160  if (pedestal && gain && respcorr && timecorr && lutcorr) {
161  *fObject = HcalCalibrations (gain->getValues (), pedestal->getValues (), respcorr->getValue(), timecorr->getValue(), lutcorr->getValue() );
162  return true;
163  }
164  }
165  }
166  return false;
167 }
const HcalRespCorr * getHcalRespCorr(const HcalGenericDetId &fId) const
const HcalLUTCorr * getHcalLUTCorr(const HcalGenericDetId &fId) const
const HcalTimeCorr * getHcalTimeCorr(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
const HcalQIECoder * getHcalCoder(const HcalGenericDetId &fId) const
const HcalQIEShape * getHcalShape(const HcalGenericDetId &fId) const
float getValue() const
Definition: HcalRespCorr.h:20
const float * getValues() const
get value for all capId = 0..3
Definition: HcalPedestal.h:19
const HcalPedestal * getPedestal(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
bool HcalDbService::makeHcalCalibrationWidth ( const HcalGenericDetId fId,
HcalCalibrationWidths fObject,
bool  pedestalInADC 
) const
private

Definition at line 169 of file HcalDbService.cc.

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

Referenced by buildCalibWidths(), and setData().

170  {
171  if (fObject) {
172  const HcalPedestalWidth* pedestalwidth = getPedestalWidth (fId);
173  const HcalGainWidth* gainwidth = getGainWidth (fId);
174  if (pedestalInADC) {
175  const HcalQIECoder* coder=getHcalCoder(fId);
176  const HcalQIEShape* shape=getHcalShape(coder);
177  if (pedestalwidth && gainwidth && shape && coder) {
178  float pedTrueWidth[4];
179  for (int i=0; i<4; i++) {
180  float x=pedestalwidth->getWidth(i);
181  // assume QIE is linear in low range and use x1=0 and x2=1
182  // y = (y2-y1) * (x) [do not add any constant, only scale!]
183  float y2=coder->charge(*shape,1,i);
184  float y1=coder->charge(*shape,0,i);
185  pedTrueWidth[i]=(y2-y1)*x;
186  }
187  *fObject = HcalCalibrationWidths (gainwidth->getValues (), pedTrueWidth);
188  return true;
189  }
190  } else {
191  if (pedestalwidth && gainwidth) {
192  float pedestalWidth [4];
193  for (int i = 0; i < 4; i++) pedestalWidth [i] = pedestalwidth->getWidth (i);
194  *fObject = HcalCalibrationWidths (gainwidth->getValues (), pedestalWidth);
195  return true;
196  }
197  }
198  }
199  return false;
200 }
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
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
void HcalDbService::setData ( const HcalPedestals fItem)
inline

Definition at line 63 of file HcalDbService.h.

References mCalibSet, and mPedestals.

63 {mPedestals = fItem; mCalibSet = nullptr;}
std::atomic< HcalCalibrationsSet const * > mCalibSet
const HcalPedestals * mPedestals
Definition: HcalDbService.h:92
void HcalDbService::setData ( const HcalPedestalWidths fItem)
inline

Definition at line 64 of file HcalDbService.h.

References mCalibWidthSet, and mPedestalWidths.

64 {mPedestalWidths = fItem; mCalibWidthSet = nullptr;}
std::atomic< HcalCalibrationWidthsSet const * > mCalibWidthSet
const HcalPedestalWidths * mPedestalWidths
Definition: HcalDbService.h:93
void HcalDbService::setData ( const HcalGains fItem)
inline

Definition at line 65 of file HcalDbService.h.

References mCalibSet, and mGains.

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

Definition at line 66 of file HcalDbService.h.

References mCalibWidthSet, and mGainWidths.

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

Definition at line 67 of file HcalDbService.h.

References mCalibSet, mCalibWidthSet, and mQIEData.

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

Definition at line 68 of file HcalDbService.h.

References mCalibSet, and mQIETypes.

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

Definition at line 69 of file HcalDbService.h.

References mChannelQuality.

69 {mChannelQuality = fItem;}
const HcalChannelQuality * mChannelQuality
Definition: HcalDbService.h:98
void HcalDbService::setData ( const HcalElectronicsMap fItem)
inline

Definition at line 70 of file HcalDbService.h.

References mElectronicsMap.

70 {mElectronicsMap = fItem;}
const HcalElectronicsMap * mElectronicsMap
Definition: HcalDbService.h:99
void HcalDbService::setData ( const HcalFrontEndMap fItem)
inline

Definition at line 71 of file HcalDbService.h.

References mFrontEndMap.

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

Definition at line 72 of file HcalDbService.h.

References mCalibSet, and mRespCorrs.

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

Definition at line 73 of file HcalDbService.h.

References mCalibSet, and mTimeCorrs.

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

Definition at line 74 of file HcalDbService.h.

References mZSThresholds.

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

Definition at line 75 of file HcalDbService.h.

References mL1TriggerObjects.

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

Definition at line 76 of file HcalDbService.h.

References mCalibSet, and mLUTCorrs.

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

Definition at line 77 of file HcalDbService.h.

References mPFCorrs.

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

Definition at line 78 of file HcalDbService.h.

References mLutMetadata.

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

Definition at line 79 of file HcalDbService.h.

References mCalibSet, and mSiPMParameters.

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

Definition at line 80 of file HcalDbService.h.

References mSiPMCharacteristics.

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

Definition at line 81 of file HcalDbService.h.

References mCalibSet, and mTPChannelParameters.

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

Definition at line 82 of file HcalDbService.h.

References mTPParameters.

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

Definition at line 83 of file HcalDbService.h.

References buildCalibrations(), buildCalibWidths(), makeHcalCalibration(), makeHcalCalibrationWidth(), and mMCParams.

83 {mMCParams = fItem;}
const HcalMCParams * mMCParams

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 98 of file HcalDbService.h.

Referenced by getHcalChannelStatus(), and setData().

const HcalElectronicsMap* HcalDbService::mElectronicsMap
private

Definition at line 99 of file HcalDbService.h.

Referenced by getHcalMapping(), and setData().

const HcalFrontEndMap* HcalDbService::mFrontEndMap
private

Definition at line 100 of file HcalDbService.h.

Referenced by getHcalFrontEndMapping(), and setData().

const HcalGains* HcalDbService::mGains
private

Definition at line 94 of file HcalDbService.h.

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

const HcalGainWidths* HcalDbService::mGainWidths
private

Definition at line 95 of file HcalDbService.h.

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

const HcalL1TriggerObjects* HcalDbService::mL1TriggerObjects
private

Definition at line 103 of file HcalDbService.h.

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

const HcalLUTCorrs* HcalDbService::mLUTCorrs
private

Definition at line 105 of file HcalDbService.h.

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

const HcalLutMetadata* HcalDbService::mLutMetadata
private

Definition at line 107 of file HcalDbService.h.

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

const HcalMCParams* HcalDbService::mMCParams
private

Definition at line 112 of file HcalDbService.h.

Referenced by getHcalMCParam(), and setData().

const HcalPedestals* HcalDbService::mPedestals
private

Definition at line 92 of file HcalDbService.h.

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

const HcalPedestalWidths* HcalDbService::mPedestalWidths
private

Definition at line 93 of file HcalDbService.h.

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

const HcalPFCorrs* HcalDbService::mPFCorrs
private

Definition at line 106 of file HcalDbService.h.

Referenced by getHcalPFCorr(), and setData().

const HcalQIEData* HcalDbService::mQIEData
private
const HcalQIETypes* HcalDbService::mQIETypes
private
const HcalRespCorrs* HcalDbService::mRespCorrs
private

Definition at line 101 of file HcalDbService.h.

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

const HcalSiPMCharacteristics* HcalDbService::mSiPMCharacteristics
private

Definition at line 109 of file HcalDbService.h.

Referenced by getHcalSiPMCharacteristics(), and setData().

const HcalSiPMParameters* HcalDbService::mSiPMParameters
private

Definition at line 108 of file HcalDbService.h.

Referenced by getHcalSiPMParameter(), and setData().

const HcalTimeCorrs* HcalDbService::mTimeCorrs
private

Definition at line 104 of file HcalDbService.h.

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

const HcalTPChannelParameters* HcalDbService::mTPChannelParameters
private

Definition at line 110 of file HcalDbService.h.

Referenced by getHcalTPChannelParameter(), and setData().

const HcalTPParameters* HcalDbService::mTPParameters
private

Definition at line 111 of file HcalDbService.h.

Referenced by getHcalTPParameters(), and setData().

const HcalZSThresholds* HcalDbService::mZSThresholds
private

Definition at line 102 of file HcalDbService.h.

Referenced by getHcalZSThreshold(), and setData().