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::ESProxyFactoryProducer edm::eventsetup::DataProxyProvider

Public Types

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

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)
 
 ~HcalChannelPropertiesEP () override
 
- Public Member Functions inherited from edm::ESProducer
 ESProducer ()
 
 ESProducer (const ESProducer &)=delete
 
ESProxyIndex const * getTokenIndices (unsigned int iIndex) const
 
ESRecordIndex const * getTokenRecordIndices (unsigned int iIndex) const
 
bool hasMayConsumes () const noexcept
 
size_t numberOfTokenIndices (unsigned int iIndex) const
 
ESProducer const & operator= (const ESProducer &)=delete
 
SerialTaskQueueChainqueue ()
 
template<typename Record >
std::optional< std::vector< ESProxyIndex > > updateFromMayConsumes (unsigned int iIndex, const Record &iRecord) const
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &) final
 
 ~ESProducer () noexcept(false) override
 
- Public Member Functions inherited from edm::ESProxyFactoryProducer
 ESProxyFactoryProducer ()
 
 ESProxyFactoryProducer (const ESProxyFactoryProducer &)=delete
 
const ESProxyFactoryProduceroperator= (const ESProxyFactoryProducer &)=delete
 
 ~ESProxyFactoryProducer () noexcept(false) override
 
- Public Member Functions inherited from edm::eventsetup::DataProxyProvider
void createKeyedProxies (EventSetupRecordKey const &key, unsigned int nConcurrentIOVs)
 
 DataProxyProvider ()
 
 DataProxyProvider (const DataProxyProvider &)=delete
 
const ComponentDescriptiondescription () const
 
void fillRecordsNotAllowingConcurrentIOVs (std::set< EventSetupRecordKey > &recordsNotAllowingConcurrentIOVs) const
 
virtual void initConcurrentIOVs (EventSetupRecordKey const &key, unsigned int nConcurrentIOVs)
 
bool isUsingRecord (const EventSetupRecordKey &key) const
 
KeyedProxieskeyedProxies (const EventSetupRecordKey &iRecordKey, unsigned int iovIndex=0)
 
const DataProxyProvideroperator= (const DataProxyProvider &)=delete
 
void setAppendToDataLabel (const edm::ParameterSet &)
 
void setDescription (const ComponentDescription &iDescription)
 
std::set< EventSetupRecordKeyusingRecords () const
 
virtual ~DataProxyProvider () noexcept(false)
 

Private Attributes

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

Additional Inherited Members

- Static Public Member Functions inherited from edm::eventsetup::DataProxyProvider
static void prevalidate (ConfigurationDescriptions &)
 
- Protected Types inherited from edm::ESProxyFactoryProducer
using EventSetupRecordKey = eventsetup::EventSetupRecordKey
 
- Protected Types inherited from edm::eventsetup::DataProxyProvider
using KeyedProxiesVector = std::vector< std::pair< DataKey, std::shared_ptr< DataProxy > >>
 
- Protected Member Functions inherited from edm::ESProducer
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 TArg >
ESConsumesCollectorT< TRecord > setWhatProduced (T *iThis, TReturn(T ::*iMethod)(const TRecord &), const TArg &iDec, const es::Label &iLabel={})
 
void usesResources (std::vector< std::string > const &)
 
- Protected Member Functions inherited from edm::ESProxyFactoryProducer
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::ProxyFactoryBase > iFactory, const std::string &iLabel=std::string())
 
KeyedProxiesVector registerProxies (const EventSetupRecordKey &, unsigned int iovIndex) override
 
- Protected Member Functions inherited from edm::eventsetup::DataProxyProvider
template<class T >
void usingRecord ()
 
void usingRecordWithKey (const EventSetupRecordKey &key)
 

Detailed Description

Definition at line 25 of file HcalChannelPropertiesEP.cc.

Member Typedef Documentation

◆ ReturnType1

Definition at line 27 of file HcalChannelPropertiesEP.cc.

◆ ReturnType2

Definition at line 28 of file HcalChannelPropertiesEP.cc.

Constructor & Destructor Documentation

◆ HcalChannelPropertiesEP() [1/3]

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

Definition at line 30 of file HcalChannelPropertiesEP.cc.

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

30  {
32  topoToken_ = cc1.consumes();
33  paramsToken_ = cc1.consumes();
34 
36  edm::ESInputTag qTag("", "withTopo");
37  condToken_ = cc2.consumes();
38  myParamsToken_ = cc2.consumes();
39  sevToken_ = cc2.consumes();
40  qualToken_ = cc2.consumes(qTag);
41  geomToken_ = cc2.consumes();
42  }
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:163
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_
ReturnType1 produce1(const HcalChannelPropertiesAuxRecord &rcd)
edm::ESGetToken< HcalChannelQuality, HcalChannelQualityRcd > qualToken_

◆ ~HcalChannelPropertiesEP()

HcalChannelPropertiesEP::~HcalChannelPropertiesEP ( )
inlineoverride

Definition at line 44 of file HcalChannelPropertiesEP.cc.

44 {}

◆ 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 46 of file HcalChannelPropertiesEP.cc.

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

Referenced by HcalChannelPropertiesEP().

46  {
47  using namespace edm;
48 
49  const HcalTopology& htopo = rcd.getRecord<HcalRecNumberingRecord>().get(topoToken_);
51 
52  ReturnType1 prod = std::make_unique<HcalRecoParams>(params);
53  prod->setTopo(&htopo);
54  return prod;
55  }
std::unique_ptr< HcalRecoParams > ReturnType1
edm::ESGetToken< HcalRecoParams, HcalRecoParamsRcd > paramsToken_
edm::ESGetToken< HcalTopology, HcalRecNumberingRecord > topoToken_
HLT enums.

◆ produce2()

ReturnType2 HcalChannelPropertiesEP::produce2 ( const HcalChannelPropertiesRecord rcd)
inline

Definition at line 57 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_, ErrorSummaryFilter_cfi::severity, sevToken_, and TrackingMonitor_cfi::subdetectors.

Referenced by HcalChannelPropertiesEP().

57  {
58  // There appears to be no easy way to trace the internal
59  // dependencies of HcalDbService. So, rebuild the product
60  // every time anything changes in the parent records.
61  // This means that we are sometimes going to rebuild the
62  // whole table on the lumi block boundaries instead of
63  // just updating the list of bad channels.
64  using namespace edm;
65 
66  // Retrieve various event setup records and data products
67  const HcalDbRecord& dbRecord = rcd.getRecord<HcalDbRecord>();
68  const HcalDbService& cond = dbRecord.get(condToken_);
71  const HcalChannelQuality& qual = dbRecord.getRecord<HcalChannelQualityRcd>().get(qualToken_);
73 
74  // HcalTopology is taken from "params" created by the "produce1" method
75  const HcalTopology& htopo(*params.topo());
76 
77  // Build the product
78  ReturnType2 prod = std::make_unique<HcalChannelPropertiesVec>(htopo.ncells());
79  std::array<HcalPipelinePedestalAndGain, 4> pedsAndGains;
81 
82  for (HcalSubdetector subd : subdetectors) {
83  const HcalGeometry* hcalGeom = static_cast<const HcalGeometry*>(geom.getSubdetectorGeometry(DetId::Hcal, subd));
84  const std::vector<DetId>& ids = hcalGeom->getValidDetIds(DetId::Hcal, subd);
85 
86  for (const auto cell : ids) {
87  const auto rawId = cell.rawId();
88 
89  // ADC decoding tools, etc
90  const HcalRecoParam* param_ts = params.getValues(rawId);
91  const HcalQIECoder* channelCoder = cond.getHcalCoder(cell);
92  const HcalQIEShape* shape = cond.getHcalShape(channelCoder);
93  const HcalSiPMParameter* siPMParameter = cond.getHcalSiPMParameter(cell);
94 
95  // Pedestals and gains
96  const HcalCalibrations& calib = cond.getHcalCalibrations(cell);
97  const HcalCalibrationWidths& calibWidth = cond.getHcalCalibrationWidths(cell);
98  for (int capid = 0; capid < 4; ++capid) {
99  pedsAndGains[capid] = HcalPipelinePedestalAndGain(calib.pedestal(capid),
100  calibWidth.pedestal(capid),
101  calib.effpedestal(capid),
102  calibWidth.effpedestal(capid),
103  calib.respcorrgain(capid),
104  calibWidth.gain(capid));
105  }
106 
107  // Channel quality
108  const HcalChannelStatus* digistatus = qual.getValues(rawId);
109  const bool taggedBadByDb = severity.dropChannel(digistatus->getValue());
110 
111  // Fill the table entry
112  const unsigned linearId = htopo.detId2denseId(cell);
113  prod->at(linearId) =
114  HcalChannelProperties(&calib, param_ts, channelCoder, shape, siPMParameter, pedsAndGains, taggedBadByDb);
115  }
116  }
117 
118  return prod;
119  }
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
Definition: plugin.cc:23
HLT enums.
edm::ESGetToken< HcalChannelQuality, HcalChannelQualityRcd > qualToken_
ProductT const & get(ESGetToken< ProductT, DepRecordT > const &iToken) const

Member Data Documentation

◆ condToken_

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

Definition at line 126 of file HcalChannelPropertiesEP.cc.

Referenced by HcalChannelPropertiesEP(), and produce2().

◆ geomToken_

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

Definition at line 131 of file HcalChannelPropertiesEP.cc.

Referenced by HcalChannelPropertiesEP(), and produce2().

◆ myParamsToken_

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

Definition at line 132 of file HcalChannelPropertiesEP.cc.

Referenced by HcalChannelPropertiesEP(), and produce2().

◆ paramsToken_

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

Definition at line 128 of file HcalChannelPropertiesEP.cc.

Referenced by HcalChannelPropertiesEP(), and produce1().

◆ qualToken_

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

Definition at line 130 of file HcalChannelPropertiesEP.cc.

Referenced by HcalChannelPropertiesEP(), and produce2().

◆ sevToken_

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

Definition at line 129 of file HcalChannelPropertiesEP.cc.

Referenced by HcalChannelPropertiesEP(), and produce2().

◆ topoToken_

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

Definition at line 127 of file HcalChannelPropertiesEP.cc.

Referenced by HcalChannelPropertiesEP(), and produce1().