CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Attributes
HcalChannelPropertiesEP Class Reference
Inheritance diagram for HcalChannelPropertiesEP:
edm::ESProducer edm::ESProductResolverFactoryProducer edm::eventsetup::ESProductResolverProvider

Public Types

typedef std::unique_ptr< HcalRecoParamsReturnType1
 
typedef std::unique_ptr< HcalChannelPropertiesVecReturnType2
 
typedef std::unique_ptr< HcalPFCutsReturnType3
 

Public Member Functions

 HcalChannelPropertiesEP (const edm::ParameterSet &)
 
 HcalChannelPropertiesEP ()=delete
 
 HcalChannelPropertiesEP (const HcalChannelPropertiesEP &)=delete
 
HcalChannelPropertiesEPoperator= (const HcalChannelPropertiesEP &)=delete
 
ReturnType1 produce1 (const HcalChannelPropertiesAuxRecord &rcd)
 
ReturnType2 produce2 (const HcalChannelPropertiesRecord &rcd)
 
ReturnType3 produce3 (const HcalPFCutsRcd &rcd)
 
 ~HcalChannelPropertiesEP () override
 
- Public Member Functions inherited from edm::ESProducer
 ESProducer ()
 
 ESProducer (const ESProducer &)=delete
 
 ESProducer (ESProducer &&)=delete
 
ESResolverIndex const * getTokenIndices (unsigned int iIndex) const
 
ESRecordIndex const * getTokenRecordIndices (unsigned int iIndex) const
 
bool hasMayConsumes () const noexcept
 
size_t numberOfTokenIndices (unsigned int iIndex) const
 
ESProduceroperator= (const ESProducer &)=delete
 
ESProduceroperator= (ESProducer &&)=delete
 
SerialTaskQueueChainqueue ()
 
template<typename Record >
std::optional< std::vector< ESResolverIndex > > updateFromMayConsumes (unsigned int iIndex, const Record &iRecord) const
 
void updateLookup (eventsetup::ESRecordsToProductResolverIndices const &) final
 
 ~ESProducer () noexcept(false) override
 
- Public Member Functions inherited from edm::ESProductResolverFactoryProducer
 ESProductResolverFactoryProducer ()
 
 ESProductResolverFactoryProducer (const ESProductResolverFactoryProducer &)=delete
 
const ESProductResolverFactoryProduceroperator= (const ESProductResolverFactoryProducer &)=delete
 
 ~ESProductResolverFactoryProducer () noexcept(false) override
 
- Public Member Functions inherited from edm::eventsetup::ESProductResolverProvider
void createKeyedResolvers (EventSetupRecordKey const &key, unsigned int nConcurrentIOVs)
 
const ComponentDescriptiondescription () const
 
 ESProductResolverProvider ()
 
 ESProductResolverProvider (const ESProductResolverProvider &)=delete
 
void fillRecordsNotAllowingConcurrentIOVs (std::set< EventSetupRecordKey > &recordsNotAllowingConcurrentIOVs) const
 
virtual void initConcurrentIOVs (EventSetupRecordKey const &key, unsigned int nConcurrentIOVs)
 
bool isUsingRecord (const EventSetupRecordKey &key) const
 
KeyedResolverskeyedResolvers (const EventSetupRecordKey &iRecordKey, unsigned int iovIndex=0)
 
const ESProductResolverProvideroperator= (const ESProductResolverProvider &)=delete
 
void setAppendToDataLabel (const edm::ParameterSet &)
 
void setDescription (const ComponentDescription &iDescription)
 
std::set< EventSetupRecordKeyusingRecords () const
 
virtual ~ESProductResolverProvider () noexcept(false)
 

Private Attributes

edm::ESGetToken< HcalDbService, HcalDbRecordcondToken_
 
edm::ESGetToken< CaloGeometry, CaloGeometryRecordgeomToken_
 
edm::ESGetToken< HcalRecoParams, HcalChannelPropertiesAuxRecordmyParamsToken_
 
edm::ESGetToken< HcalRecoParams, HcalRecoParamsRcdparamsToken_
 
edm::ESGetToken< HcalPFCuts, HcalPFCutsRcdpfcutsToken_
 
edm::ESGetToken< HcalChannelQuality, HcalChannelQualityRcdqualToken_
 
edm::ESGetToken< HcalSeverityLevelComputer, HcalSeverityLevelComputerRcdsevToken_
 
edm::ESGetToken< HcalTopology, HcalRecNumberingRecordtopoToken3_
 
edm::ESGetToken< HcalTopology, HcalRecNumberingRecordtopoToken_
 

Additional Inherited Members

- Static Public Member Functions inherited from edm::eventsetup::ESProductResolverProvider
static void prevalidate (ConfigurationDescriptions &)
 
- Protected Types inherited from edm::ESProductResolverFactoryProducer
using EventSetupRecordKey = eventsetup::EventSetupRecordKey
 
- Protected Types inherited from edm::eventsetup::ESProductResolverProvider
using KeyedResolversVector = std::vector< std::pair< DataKey, std::shared_ptr< ESProductResolver > >>
 
- Protected Member Functions inherited from edm::ESProducer
ESConsumesInfoconsumesInfoPushBackNew ()
 
unsigned int consumesInfoSize () const
 
template<typename CallbackT , typename TList , typename TRecord >
void registerProducts (std::shared_ptr< std::pair< unsigned int, std::shared_ptr< CallbackT >>> iCallback, const TList *, const TRecord *iRecord, const es::Label &iLabel)
 
template<typename CallbackT , typename TRecord >
void registerProducts (std::shared_ptr< std::pair< unsigned int, std::shared_ptr< CallbackT >>>, const eventsetup::produce::Null *, const TRecord *, const es::Label &)
 
template<typename T >
auto setWhatProduced (T *iThis, const es::Label &iLabel={})
 
template<typename T >
auto setWhatProduced (T *iThis, const char *iLabel)
 
template<typename T >
auto setWhatProduced (T *iThis, const std::string &iLabel)
 
template<typename T , typename TDecorator >
auto setWhatProduced (T *iThis, const TDecorator &iDec, const es::Label &iLabel={})
 
template<typename T , typename TReturn , typename TRecord >
auto setWhatProduced (T *iThis, TReturn(T::*iMethod)(const TRecord &), const es::Label &iLabel={})
 
template<typename T , typename TReturn , typename TRecord , typename TDecorator >
auto setWhatProduced (T *iThis, TReturn(T ::*iMethod)(const TRecord &), const TDecorator &iDec, const es::Label &iLabel={})
 
template<typename TFunc >
auto setWhatProduced (TFunc &&func, const es::Label &iLabel={})
 
template<typename TReturn , typename TRecord , typename TFunc , typename TDecorator >
ESConsumesCollectorT< TRecord > setWhatProduced (TFunc &&func, TDecorator &&iDec, const es::Label &iLabel={})
 
void usesResources (std::vector< std::string > const &)
 
- Protected Member Functions inherited from edm::ESProductResolverFactoryProducer
template<class TFactory >
void registerFactory (std::unique_ptr< TFactory > iFactory, const std::string &iLabel=std::string())
 
virtual void registerFactoryWithKey (const EventSetupRecordKey &iRecord, std::unique_ptr< eventsetup::ESProductResolverFactoryBase > iFactory, const std::string &iLabel=std::string())
 
KeyedResolversVector registerResolvers (const EventSetupRecordKey &, unsigned int iovIndex) override
 
- Protected Member Functions inherited from edm::eventsetup::ESProductResolverProvider
template<class T >
void usingRecord ()
 
void usingRecordWithKey (const EventSetupRecordKey &key)
 

Detailed Description

Definition at line 28 of file HcalChannelPropertiesEP.cc.

Member Typedef Documentation

◆ ReturnType1

Definition at line 30 of file HcalChannelPropertiesEP.cc.

◆ ReturnType2

Definition at line 31 of file HcalChannelPropertiesEP.cc.

◆ ReturnType3

Definition at line 32 of file HcalChannelPropertiesEP.cc.

Constructor & Destructor Documentation

◆ HcalChannelPropertiesEP() [1/3]

HcalChannelPropertiesEP::HcalChannelPropertiesEP ( const edm::ParameterSet )
inline

Definition at line 34 of file HcalChannelPropertiesEP.cc.

References condToken_, geomToken_, myParamsToken_, paramsToken_, pfcutsToken_, produce1(), produce2(), produce3(), qualToken_, edm::ESProducer::setWhatProduced(), sevToken_, topoToken3_, and topoToken_.

34  {
36  topoToken_ = cc1.consumes();
37  paramsToken_ = cc1.consumes();
38 
40  edm::ESInputTag qTag("", "withTopo");
41  condToken_ = cc2.consumes();
42  myParamsToken_ = cc2.consumes();
43  sevToken_ = cc2.consumes();
44  qualToken_ = cc2.consumes(qTag);
45  geomToken_ = cc2.consumes();
46 
47  edm::es::Label productLabel("withTopo");
48  auto cc3 = setWhatProduced(this, &HcalChannelPropertiesEP::produce3, productLabel);
49  topoToken3_ = cc3.consumes();
50  pfcutsToken_ = cc3.consumes();
51  }
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:166
edm::ESGetToken< HcalDbService, HcalDbRecord > condToken_
ReturnType2 produce2(const HcalChannelPropertiesRecord &rcd)
edm::ESGetToken< HcalSeverityLevelComputer, HcalSeverityLevelComputerRcd > sevToken_
edm::ESGetToken< HcalRecoParams, HcalChannelPropertiesAuxRecord > myParamsToken_
edm::ESGetToken< HcalRecoParams, HcalRecoParamsRcd > paramsToken_
edm::ESGetToken< CaloGeometry, CaloGeometryRecord > geomToken_
edm::ESGetToken< HcalTopology, HcalRecNumberingRecord > topoToken_
edm::ESGetToken< HcalPFCuts, HcalPFCutsRcd > pfcutsToken_
edm::ESGetToken< HcalTopology, HcalRecNumberingRecord > topoToken3_
ReturnType1 produce1(const HcalChannelPropertiesAuxRecord &rcd)
edm::ESGetToken< HcalChannelQuality, HcalChannelQualityRcd > qualToken_
ReturnType3 produce3(const HcalPFCutsRcd &rcd)

◆ ~HcalChannelPropertiesEP()

HcalChannelPropertiesEP::~HcalChannelPropertiesEP ( )
inlineoverride

Definition at line 53 of file HcalChannelPropertiesEP.cc.

53 {}

◆ HcalChannelPropertiesEP() [2/3]

HcalChannelPropertiesEP::HcalChannelPropertiesEP ( )
delete

◆ HcalChannelPropertiesEP() [3/3]

HcalChannelPropertiesEP::HcalChannelPropertiesEP ( const HcalChannelPropertiesEP )
delete

Member Function Documentation

◆ operator=()

HcalChannelPropertiesEP& HcalChannelPropertiesEP::operator= ( const HcalChannelPropertiesEP )
delete

◆ produce1()

ReturnType1 HcalChannelPropertiesEP::produce1 ( const HcalChannelPropertiesAuxRecord rcd)
inline

Definition at line 55 of file HcalChannelPropertiesEP.cc.

References edm::eventsetup::DependentRecordImplementation< RecordT, ListT >::get(), submitPVValidationJobs::params, paramsToken_, dumpMFGeometry_cfg::prod, and topoToken_.

Referenced by HcalChannelPropertiesEP().

55  {
56  const HcalTopology& htopo = rcd.get(topoToken_);
57  const HcalRecoParams& params = rcd.get(paramsToken_);
58 
59  ReturnType1 prod = std::make_unique<HcalRecoParams>(params);
60  prod->setTopo(&htopo);
61  return prod;
62  }
std::unique_ptr< HcalRecoParams > ReturnType1
edm::ESGetToken< HcalRecoParams, HcalRecoParamsRcd > paramsToken_
edm::ESGetToken< HcalTopology, HcalRecNumberingRecord > topoToken_
ProductT const & get(ESGetToken< ProductT, DepRecordT > const &iToken) const

◆ produce2()

ReturnType2 HcalChannelPropertiesEP::produce2 ( const HcalChannelPropertiesRecord rcd)
inline

Definition at line 64 of file HcalChannelPropertiesEP.cc.

References condToken_, HcalCalibrationWidths::effpedestal(), HcalCalibrationWidths::gain(), relativeConstraints::geom, geomToken_, edm::eventsetup::DependentRecordImplementation< RecordT, ListT >::get(), edm::eventsetup::DependentRecordImplementation< RecordT, ListT >::getRecord(), HcalGeometry::getValidDetIds(), HcalChannelStatus::getValue(), HcalCondObjectContainer< Item >::getValues(), DetId::Hcal, HcalBarrel, HcalEndcap, HcalForward, myParamsToken_, submitPVValidationJobs::params, HcalCalibrationWidths::pedestal(), dumpMFGeometry_cfg::prod, qualToken_, nano_mu_digi_cff::rawId, ErrorSummaryFilter_cfi::severity, sevToken_, l1trig_cff::shape, and TrackingMonitor_cfi::subdetectors.

Referenced by HcalChannelPropertiesEP().

64  {
65  // There appears to be no easy way to trace the internal
66  // dependencies of HcalDbService. So, rebuild the product
67  // every time anything changes in the parent records.
68  // This means that we are sometimes going to rebuild the
69  // whole table on the lumi block boundaries instead of
70  // just updating the list of bad channels.
71  //
72  // Retrieve various event setup records and data products
73  const HcalDbRecord& dbRecord = rcd.getRecord<HcalDbRecord>();
74  const HcalDbService& cond = dbRecord.get(condToken_);
77  const HcalChannelQuality& qual = dbRecord.get(qualToken_);
78  const CaloGeometry& geom = rcd.get(geomToken_);
79 
80  // HcalTopology is taken from "params" created by the "produce1" method
81  const HcalTopology& htopo(*params.topo());
82 
83  // Build the product
84  ReturnType2 prod = std::make_unique<HcalChannelPropertiesVec>(htopo.ncells());
85  std::array<HcalPipelinePedestalAndGain, 4> pedsAndGains;
87 
88  for (HcalSubdetector subd : subdetectors) {
89  const HcalGeometry* hcalGeom = static_cast<const HcalGeometry*>(geom.getSubdetectorGeometry(DetId::Hcal, subd));
90  const std::vector<DetId>& ids = hcalGeom->getValidDetIds(DetId::Hcal, subd);
91 
92  for (const auto cell : ids) {
93  const auto rawId = cell.rawId();
94 
95  // ADC decoding tools, etc
96  const HcalRecoParam* param_ts = params.getValues(rawId);
97  const HcalQIECoder* channelCoder = cond.getHcalCoder(cell);
98  const HcalQIEShape* shape = cond.getHcalShape(channelCoder);
99  const HcalSiPMParameter* siPMParameter = cond.getHcalSiPMParameter(cell);
100 
101  // Pedestals and gains
102  const HcalCalibrations& calib = cond.getHcalCalibrations(cell);
103  const HcalCalibrationWidths& calibWidth = cond.getHcalCalibrationWidths(cell);
104  for (int capid = 0; capid < 4; ++capid) {
105  pedsAndGains[capid] = HcalPipelinePedestalAndGain(calib.pedestal(capid),
106  calibWidth.pedestal(capid),
107  calib.effpedestal(capid),
108  calibWidth.effpedestal(capid),
109  calib.respcorrgain(capid),
110  calibWidth.gain(capid));
111  }
112 
113  // Channel quality
114  const HcalChannelStatus* digistatus = qual.getValues(rawId);
115  const bool taggedBadByDb = severity.dropChannel(digistatus->getValue());
116 
117  // Fill the table entry
118  const unsigned linearId = htopo.detId2denseId(cell);
119  prod->at(linearId) =
120  HcalChannelProperties(&calib, param_ts, channelCoder, shape, siPMParameter, pedsAndGains, taggedBadByDb);
121  }
122  }
123 
124  return prod;
125  }
double pedestal(int fCapId) const
get pedestal width for capid=0..3
const std::vector< DetId > & getValidDetIds(DetId::Detector det=DetId::Detector(0), int subdet=0) const override
Get a list of valid detector ids (for the given subdetector)
Definition: HcalGeometry.cc:76
edm::ESGetToken< HcalDbService, HcalDbRecord > condToken_
edm::ESGetToken< HcalSeverityLevelComputer, HcalSeverityLevelComputerRcd > sevToken_
double effpedestal(int fCapId) const
get effective pedestal width for capid=0..3
edm::ESGetToken< HcalRecoParams, HcalChannelPropertiesAuxRecord > myParamsToken_
const Item * getValues(DetId fId, bool throwOnFail=true) const
edm::ESGetToken< CaloGeometry, CaloGeometryRecord > geomToken_
std::unique_ptr< HcalChannelPropertiesVec > ReturnType2
HcalSubdetector
Definition: HcalAssistant.h:31
uint32_t getValue() const
double gain(int fCapId) const
get gain width for capid=0..3
edm::ESGetToken< HcalChannelQuality, HcalChannelQualityRcd > qualToken_
ProductT const & get(ESGetToken< ProductT, DepRecordT > const &iToken) const

◆ produce3()

ReturnType3 HcalChannelPropertiesEP::produce3 ( const HcalPFCutsRcd rcd)
inline

Definition at line 127 of file HcalChannelPropertiesEP.cc.

References pfcutsToken_, dumpMFGeometry_cfg::prod, and topoToken3_.

Referenced by HcalChannelPropertiesEP().

127  {
128  const HcalTopology& htopo = rcd.get(topoToken3_);
129  const HcalPFCuts& cuts = rcd.get(pfcutsToken_);
130 
131  ReturnType3 prod = std::make_unique<HcalPFCuts>(cuts);
132  prod->setTopo(&htopo);
133  return prod;
134  }
std::unique_ptr< HcalPFCuts > ReturnType3
edm::ESGetToken< HcalPFCuts, HcalPFCutsRcd > pfcutsToken_
edm::ESGetToken< HcalTopology, HcalRecNumberingRecord > topoToken3_

Member Data Documentation

◆ condToken_

edm::ESGetToken<HcalDbService, HcalDbRecord> HcalChannelPropertiesEP::condToken_
private

Definition at line 141 of file HcalChannelPropertiesEP.cc.

Referenced by HcalChannelPropertiesEP(), and produce2().

◆ geomToken_

edm::ESGetToken<CaloGeometry, CaloGeometryRecord> HcalChannelPropertiesEP::geomToken_
private

Definition at line 146 of file HcalChannelPropertiesEP.cc.

Referenced by HcalChannelPropertiesEP(), and produce2().

◆ myParamsToken_

edm::ESGetToken<HcalRecoParams, HcalChannelPropertiesAuxRecord> HcalChannelPropertiesEP::myParamsToken_
private

Definition at line 147 of file HcalChannelPropertiesEP.cc.

Referenced by HcalChannelPropertiesEP(), and produce2().

◆ paramsToken_

edm::ESGetToken<HcalRecoParams, HcalRecoParamsRcd> HcalChannelPropertiesEP::paramsToken_
private

Definition at line 143 of file HcalChannelPropertiesEP.cc.

Referenced by HcalChannelPropertiesEP(), and produce1().

◆ pfcutsToken_

edm::ESGetToken<HcalPFCuts, HcalPFCutsRcd> HcalChannelPropertiesEP::pfcutsToken_
private

Definition at line 148 of file HcalChannelPropertiesEP.cc.

Referenced by HcalChannelPropertiesEP(), and produce3().

◆ qualToken_

edm::ESGetToken<HcalChannelQuality, HcalChannelQualityRcd> HcalChannelPropertiesEP::qualToken_
private

Definition at line 145 of file HcalChannelPropertiesEP.cc.

Referenced by HcalChannelPropertiesEP(), and produce2().

◆ sevToken_

edm::ESGetToken<HcalSeverityLevelComputer, HcalSeverityLevelComputerRcd> HcalChannelPropertiesEP::sevToken_
private

Definition at line 144 of file HcalChannelPropertiesEP.cc.

Referenced by HcalChannelPropertiesEP(), and produce2().

◆ topoToken3_

edm::ESGetToken<HcalTopology, HcalRecNumberingRecord> HcalChannelPropertiesEP::topoToken3_
private

Definition at line 142 of file HcalChannelPropertiesEP.cc.

Referenced by HcalChannelPropertiesEP(), and produce3().

◆ topoToken_

edm::ESGetToken<HcalTopology, HcalRecNumberingRecord> HcalChannelPropertiesEP::topoToken_
private

Definition at line 142 of file HcalChannelPropertiesEP.cc.

Referenced by HcalChannelPropertiesEP(), and produce1().