Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added consumes to EcalNextToDeadChannelESProducer #27645

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -37,15 +37,13 @@ class EcalNextToDeadChannelESProducer : public edm::ESProducer {

edm::ReusableObjectHolder<HostType> holder_;

edm::ESGetToken<EcalChannelStatus, EcalChannelStatusRcd> const channelToken_;
// threshold above which a channel will be considered "dead"
int statusThreshold_;
};

EcalNextToDeadChannelESProducer::EcalNextToDeadChannelESProducer(const edm::ParameterSet& iConfig) {
//the following line is needed to tell the framework what
// data is being produced
setWhatProduced(this);

EcalNextToDeadChannelESProducer::EcalNextToDeadChannelESProducer(const edm::ParameterSet& iConfig)
: channelToken_(setWhatProduced(this).consumesFrom<EcalChannelStatus, EcalChannelStatusRcd>()) {
statusThreshold_ = iConfig.getParameter<int>("channelStatusThresholdForDead");
}

Expand All @@ -65,8 +63,7 @@ void EcalNextToDeadChannelESProducer::setupNextToDeadChannels(const EcalChannelS

// Find channels next to dead ones and fill corresponding record

edm::ESHandle<EcalChannelStatus> h;
chs.get(h);
EcalChannelStatus const& h = chs.get(channelToken_);

for (int ieta = -EBDetId::MAX_IETA; ieta <= EBDetId::MAX_IETA; ++ieta) {
if (ieta == 0)
Expand All @@ -75,7 +72,7 @@ void EcalNextToDeadChannelESProducer::setupNextToDeadChannels(const EcalChannelS
if (EBDetId::validDetId(ieta, iphi)) {
EBDetId detid(ieta, iphi);

if (EcalTools::isNextToDeadFromNeighbours(detid, *h, statusThreshold_)) {
if (EcalTools::isNextToDeadFromNeighbours(detid, h, statusThreshold_)) {
rcd->setValue(detid, 1);
};
}
Expand All @@ -89,15 +86,15 @@ void EcalNextToDeadChannelESProducer::setupNextToDeadChannels(const EcalChannelS
if (EEDetId::validDetId(iX, iY, 1)) {
EEDetId detid(iX, iY, 1);

if (EcalTools::isNextToDeadFromNeighbours(detid, *h, statusThreshold_)) {
if (EcalTools::isNextToDeadFromNeighbours(detid, h, statusThreshold_)) {
rcd->setValue(detid, 1);
};
}

if (EEDetId::validDetId(iX, iY, -1)) {
EEDetId detid(iX, iY, -1);

if (EcalTools::isNextToDeadFromNeighbours(detid, *h, statusThreshold_)) {
if (EcalTools::isNextToDeadFromNeighbours(detid, h, statusThreshold_)) {
rcd->setValue(detid, 1);
};
}
Expand Down