CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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
< HcalRecoParams
ReturnType1
 
typedef std::unique_ptr
< HcalChannelPropertiesVec
ReturnType2
 

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,
HcalDbRecord
condToken_
 
edm::ESGetToken< CaloGeometry,
CaloGeometryRecord
geomToken_
 
edm::ESGetToken
< HcalRecoParams,
HcalChannelPropertiesAuxRecord
myParamsToken_
 
edm::ESGetToken
< HcalRecoParams,
HcalRecoParamsRcd
paramsToken_
 
edm::ESGetToken
< HcalChannelQuality,
HcalChannelQualityRcd
qualToken_
 
edm::ESGetToken
< HcalSeverityLevelComputer,
HcalSeverityLevelComputerRcd
sevToken_
 
edm::ESGetToken< HcalTopology,
HcalRecNumberingRecord
topoToken_
 

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

Definition at line 27 of file HcalChannelPropertiesEP.cc.

Definition at line 28 of file HcalChannelPropertiesEP.cc.

Constructor & Destructor Documentation

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 ( )
inlineoverride

Definition at line 44 of file HcalChannelPropertiesEP.cc.

44 {}
HcalChannelPropertiesEP::HcalChannelPropertiesEP ( )
delete
HcalChannelPropertiesEP::HcalChannelPropertiesEP ( const HcalChannelPropertiesEP )
delete

Member Function Documentation

HcalChannelPropertiesEP& HcalChannelPropertiesEP::operator= ( const HcalChannelPropertiesEP )
delete
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_, 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_
ReturnType2 HcalChannelPropertiesEP::produce2 ( const HcalChannelPropertiesRecord rcd)
inline

Definition at line 57 of file HcalChannelPropertiesEP.cc.

References condToken_, HcalCalibrationWidths::effpedestal(), HcalCalibrations::effpedestal(), HcalCalibrationWidths::gain(), relativeConstraints::geom, geomToken_, edm::eventsetup::DependentRecordImplementation< RecordT, ListT >::getRecord(), HcalGeometry::getValidDetIds(), HcalChannelStatus::getValue(), DetId::Hcal, HcalBarrel, HcalEndcap, HcalForward, myParamsToken_, submitPVValidationJobs::params, HcalCalibrationWidths::pedestal(), HcalCalibrations::pedestal(), qualToken_, HcalCalibrations::respcorrgain(), and sevToken_.

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;
80  const HcalSubdetector subdetectors[3] = {HcalBarrel, HcalEndcap, HcalForward};
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 gain(int fCapId) const
get gain 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_
double effpedestal(int fCapId) const
get effective pedestal width for capid=0..3
edm::ESGetToken< HcalSeverityLevelComputer, HcalSeverityLevelComputerRcd > sevToken_
edm::ESGetToken< HcalRecoParams, HcalChannelPropertiesAuxRecord > myParamsToken_
double pedestal(int fCapId) const
get pedestal width for capid=0..3
edm::ESGetToken< CaloGeometry, CaloGeometryRecord > geomToken_
std::unique_ptr< HcalChannelPropertiesVec > ReturnType2
constexpr double effpedestal(int fCapId) const
get effective pedestal for capid=0..3
HcalSubdetector
Definition: HcalAssistant.h:31
constexpr double pedestal(int fCapId) const
get pedestal for capid=0..3
edm::ESGetToken< HcalChannelQuality, HcalChannelQualityRcd > qualToken_
uint32_t getValue() const
constexpr double respcorrgain(int fCapId) const
get response corrected gain for capid=0..3

Member Data Documentation

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

Definition at line 126 of file HcalChannelPropertiesEP.cc.

Referenced by HcalChannelPropertiesEP(), and produce2().

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

Definition at line 131 of file HcalChannelPropertiesEP.cc.

Referenced by HcalChannelPropertiesEP(), and produce2().

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

Definition at line 132 of file HcalChannelPropertiesEP.cc.

Referenced by HcalChannelPropertiesEP(), and produce2().

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

Definition at line 128 of file HcalChannelPropertiesEP.cc.

Referenced by HcalChannelPropertiesEP(), and produce1().

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

Definition at line 130 of file HcalChannelPropertiesEP.cc.

Referenced by HcalChannelPropertiesEP(), and produce2().

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

Definition at line 129 of file HcalChannelPropertiesEP.cc.

Referenced by HcalChannelPropertiesEP(), and produce2().

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

Definition at line 127 of file HcalChannelPropertiesEP.cc.

Referenced by HcalChannelPropertiesEP(), and produce1().