CMS 3D CMS Logo

HcalChannelPropertiesEP.cc
Go to the documentation of this file.
4 
7 
10 
13 
18 
24 
26 public:
27  typedef std::unique_ptr<HcalRecoParams> ReturnType1;
28  typedef std::unique_ptr<HcalChannelPropertiesVec> ReturnType2;
29 
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  }
43 
44  inline ~HcalChannelPropertiesEP() override {}
45 
47  using namespace edm;
48 
51 
52  ReturnType1 prod = std::make_unique<HcalRecoParams>(params);
53  prod->setTopo(&htopo);
54  return prod;
55  }
56 
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_);
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  }
120 
121  HcalChannelPropertiesEP() = delete;
124 
125 private:
133 };
134 
edm::eventsetup::DependentRecordImplementation::getRecord
const DepRecordT getRecord() const
Definition: DependentRecordImplementation.h:50
HcalChannelProperties.h
edm::ESInputTag
Definition: ESInputTag.h:87
HcalRecoParams.h
HcalChannelPropertiesEP::produce2
ReturnType2 produce2(const HcalChannelPropertiesRecord &rcd)
Definition: HcalChannelPropertiesEP.cc:57
HcalChannelQualityRcd
Definition: HcalChannelQualityRcd.h:8
HcalChannelPropertiesEP::sevToken_
edm::ESGetToken< HcalSeverityLevelComputer, HcalSeverityLevelComputerRcd > sevToken_
Definition: HcalChannelPropertiesEP.cc:129
CalibrationSummaryClient_cfi.params
params
Definition: CalibrationSummaryClient_cfi.py:14
CaloGeometryRecord
Definition: CaloGeometryRecord.h:30
edm
HLT enums.
Definition: AlignableModifier.h:19
HcalCalibrationWidths::effpedestal
double effpedestal(int fCapId) const
get effective pedestal width for capid=0..3
Definition: HcalCalibrationWidths.h:18
HcalTopology
Definition: HcalTopology.h:26
DetId::Hcal
Definition: DetId.h:28
edm::ESProducer::setWhatProduced
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:163
ESProducer.h
HcalChannelPropertiesEP
Definition: HcalChannelPropertiesEP.cc:25
HcalGenericDetId.h
HcalChannelQuality
Definition: HcalChannelQuality.h:17
HcalBarrel
Definition: HcalAssistant.h:33
HcalChannelPropertiesRecord
Definition: HcalChannelPropertiesRecord.h:11
HcalChannelPropertiesEP::ReturnType1
std::unique_ptr< HcalRecoParams > ReturnType1
Definition: HcalChannelPropertiesEP.cc:27
ESGetToken.h
HcalChannelPropertiesRecord.h
HcalCondObjectContainer::getValues
const Item * getValues(DetId fId, bool throwOnFail=true) const
Definition: HcalCondObjectContainer.h:159
HcalGeometry.h
HcalGeometry::getValidDetIds
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
HcalChannelProperties
Definition: HcalChannelProperties.h:18
TrackingMonitor_cfi.subdetectors
subdetectors
Definition: TrackingMonitor_cfi.py:181
HcalChannelPropertiesEP::geomToken_
edm::ESGetToken< CaloGeometry, CaloGeometryRecord > geomToken_
Definition: HcalChannelPropertiesEP.cc:131
CaloGeometry
Definition: CaloGeometry.h:21
HcalChannelPropertiesEP::ReturnType2
std::unique_ptr< HcalChannelPropertiesVec > ReturnType2
Definition: HcalChannelPropertiesEP.cc:28
HcalRecoParam
Definition: HcalRecoParam.h:16
HcalChannelPropertiesEP::myParamsToken_
edm::ESGetToken< HcalRecoParams, HcalChannelPropertiesAuxRecord > myParamsToken_
Definition: HcalChannelPropertiesEP.cc:132
HcalChannelStatus
Definition: HcalChannelStatus.h:13
HcalChannelPropertiesEP::paramsToken_
edm::ESGetToken< HcalRecoParams, HcalRecoParamsRcd > paramsToken_
Definition: HcalChannelPropertiesEP.cc:128
HcalSeverityLevelComputer
Definition: HcalSeverityLevelComputer.h:24
dumpMFGeometry_cfg.prod
prod
Definition: dumpMFGeometry_cfg.py:24
relativeConstraints.geom
geom
Definition: relativeConstraints.py:72
HcalChannelPropertiesEP::topoToken_
edm::ESGetToken< HcalTopology, HcalRecNumberingRecord > topoToken_
Definition: HcalChannelPropertiesEP.cc:127
HcalDbRecord.h
HcalCalibrations
Definition: HcalCalibrations.h:9
edm::eventsetup::DependentRecordImplementation::get
ProductT const & get(ESGetToken< ProductT, DepRecordT > const &iToken) const
Definition: DependentRecordImplementation.h:103
HcalChannelPropertiesEP::~HcalChannelPropertiesEP
~HcalChannelPropertiesEP() override
Definition: HcalChannelPropertiesEP.cc:44
HcalRecNumberingRecord
Definition: HcalRecNumberingRecord.h:23
CaloGeometryRecord.h
calib
Definition: CalibElectron.h:12
HcalSeverityLevelComputerRcd.h
cond
Definition: plugin.cc:23
HcalChannelStatus::getValue
uint32_t getValue() const
Definition: HcalChannelStatus.h:60
edm::ParameterSet
Definition: ParameterSet.h:47
HcalChannelPropertiesEP::operator=
HcalChannelPropertiesEP & operator=(const HcalChannelPropertiesEP &)=delete
HcalChannelPropertiesEP::HcalChannelPropertiesEP
HcalChannelPropertiesEP()=delete
HcalSubdetector.h
get
#define get
edm::ESGetToken< HcalDbService, HcalDbRecord >
HcalQIECoder
Definition: HcalQIECoder.h:20
HcalSubdetector
HcalSubdetector
Definition: HcalAssistant.h:31
HcalChannelPropertiesAuxRecord
Definition: HcalChannelPropertiesAuxRecord.h:10
HcalForward
Definition: HcalAssistant.h:36
HcalTopology.h
HcalDbService
Definition: HcalDbService.h:26
HcalCalibrationWidths::pedestal
double pedestal(int fCapId) const
get pedestal width for capid=0..3
Definition: HcalCalibrationWidths.h:16
HcalChannelPropertiesEP::qualToken_
edm::ESGetToken< HcalChannelQuality, HcalChannelQualityRcd > qualToken_
Definition: HcalChannelPropertiesEP.cc:130
HcalEndcap
Definition: HcalAssistant.h:34
DEFINE_FWK_EVENTSETUP_MODULE
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition: ModuleFactory.h:60
HcalCalibrationWidths::gain
double gain(int fCapId) const
get gain width for capid=0..3
Definition: HcalCalibrationWidths.h:14
ErrorSummaryFilter_cfi.severity
severity
Definition: ErrorSummaryFilter_cfi.py:5
CaloGeometry.h
HcalRecoParams
Definition: HcalRecoParams.h:9
HcalChannelPropertiesAuxRecord.h
HcalRecoParamsRcd
Definition: HcalRecoParamsRcd.h:6
HcalRecoParamsRcd.h
HcalSeverityLevelComputer.h
HcalPipelinePedestalAndGain
Definition: HcalPipelinePedestalAndGain.h:5
HcalQIEShape
Definition: HcalQIEShape.h:17
HcalDbService.h
edm::ESProducer
Definition: ESProducer.h:104
HcalDbRecord
Definition: HcalDbRecord.h:30
ParameterSet.h
HcalCalibrationWidths
Definition: HcalCalibrationWidths.h:9
HcalGeometry
Definition: HcalGeometry.h:17
HcalSiPMParameter
Definition: HcalSiPMParameter.h:7
HcalChannelPropertiesEP::HcalChannelPropertiesEP
HcalChannelPropertiesEP(const edm::ParameterSet &)
Definition: HcalChannelPropertiesEP.cc:30
HcalSeverityLevelComputerRcd
Definition: HcalSeverityLevelComputerRcd.h:23
HcalChannelPropertiesEP::condToken_
edm::ESGetToken< HcalDbService, HcalDbRecord > condToken_
Definition: HcalChannelPropertiesEP.cc:126
HcalChannelPropertiesEP::produce1
ReturnType1 produce1(const HcalChannelPropertiesAuxRecord &rcd)
Definition: HcalChannelPropertiesEP.cc:46