Skip to content

Commit

Permalink
Move HcalChanneQualityRcd to beginLuminosityBlock, for upcoming LS gr…
Browse files Browse the repository at this point in the history
…anularity
  • Loading branch information
DryRun committed Nov 21, 2018
1 parent 081bd4b commit c11b9f7
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 27 deletions.
3 changes: 3 additions & 0 deletions DQM/HcalCommon/interface/DQClient.h
Expand Up @@ -30,6 +30,9 @@ namespace hcaldqm
~DQClient() override {}

virtual void beginRun(edm::Run const&, edm::EventSetup const&);
virtual void beginLuminosityBlock(DQMStore::IBooker&,
DQMStore::IGetter&, edm::LuminosityBlock const& lb,
edm::EventSetup const&);
virtual void endLuminosityBlock(DQMStore::IBooker&,
DQMStore::IGetter&,
edm::LuminosityBlock const&, edm::EventSetup const&);
Expand Down
3 changes: 3 additions & 0 deletions DQM/HcalCommon/interface/DQHarvester.h
Expand Up @@ -22,6 +22,9 @@ namespace hcaldqm
~DQHarvester() override {}

void beginRun(edm::Run const&, edm::EventSetup const&) override;
void dqmBeginLuminosityBlock(
DQMStore::IBooker& ib, DQMStore::IGetter& ig,
edm::LuminosityBlock const& lb, edm::EventSetup const& es);
void dqmEndLuminosityBlock(
DQMStore::IBooker&, DQMStore::IGetter&,
edm::LuminosityBlock const&, edm::EventSetup const&) override;
Expand Down
10 changes: 9 additions & 1 deletion DQM/HcalCommon/src/DQClient.cc
Expand Up @@ -87,8 +87,16 @@ namespace hcaldqm
}
}

// get the Channel Quality masks
// Initialize channel quality masks, but do not load (changed for 10_4_X, moving to LS granularity)
_xQuality.initialize(hashfunctions::fDChannel);
}

/* virtual */ void DQClient::beginLuminosityBlock(DQMStore::IBooker&,
DQMStore::IGetter&, edm::LuminosityBlock const& lb,
edm::EventSetup const& es)
{
// get the Channel Quality masks
_xQuality.reset();
edm::ESHandle<HcalChannelQuality> hcq;
es.get<HcalChannelQualityRcd>().get("withTopo", hcq);
const HcalChannelQuality *cq = hcq.product();
Expand Down
9 changes: 8 additions & 1 deletion DQM/HcalCommon/src/DQHarvester.cc
Expand Up @@ -90,8 +90,15 @@ namespace hcaldqm
}
}

// get the Hcal Channels Quality for channels that are not 0
// Initialize channel quality masks, but do not load (changed for 10_4_X, moving to LS granularity)
_xQuality.initialize(hashfunctions::fDChannel);
}

/* virtual */ void DQHarvester::dqmBeginLuminosityBlock(
DQMStore::IBooker& ib, DQMStore::IGetter& ig,
edm::LuminosityBlock const& lb, edm::EventSetup const& es)
{
// get the Hcal Channels Quality for channels that are not 0
edm::ESHandle<HcalChannelQuality> hcq;
es.get<HcalChannelQualityRcd>().get("withTopo", hcq);
const HcalChannelQuality *cq = hcq.product();
Expand Down
50 changes: 25 additions & 25 deletions DQM/HcalCommon/src/DQTask.cc
Expand Up @@ -69,30 +69,6 @@ namespace hcaldqm
}
}

// get the Channel Quality Status for all the channels
edm::ESHandle<HcalChannelQuality> hcq;
es.get<HcalChannelQualityRcd>().get("withTopo", hcq);
const HcalChannelQuality *cq = hcq.product();
std::vector<DetId> detids = cq->getAllChannels();
for (std::vector<DetId>::const_iterator it=detids.begin();
it!=detids.end(); ++it)
{
// if unknown skip
if (HcalGenericDetId(*it).genericSubdet()==
HcalGenericDetId::HcalGenUnknown)
continue;

if (HcalGenericDetId(*it).isHcalDetId())
{
HcalDetId did(*it);
uint32_t mask = (cq->getValues(did))->getValue();
if (mask!=0)
{
_xQuality.push(did, mask);
}
}
}

// book some base guys
_cEvsTotal.book(ib, _subsystem);
_cEvsPerLS.book(ib, _subsystem);
Expand Down Expand Up @@ -133,7 +109,31 @@ namespace hcaldqm
this->_resetMonitors(f50LS);
if (_procLSs%100==0)
this->_resetMonitors(f100LS);


// get the Channel Quality Status for all the channels
_xQuality.reset();
edm::ESHandle<HcalChannelQuality> hcq;
es.get<HcalChannelQualityRcd>().get("withTopo", hcq);
const HcalChannelQuality *cq = hcq.product();
std::vector<DetId> detids = cq->getAllChannels();
for (std::vector<DetId>::const_iterator it=detids.begin();
it!=detids.end(); ++it)
{
// if unknown skip
if (HcalGenericDetId(*it).genericSubdet()==
HcalGenericDetId::HcalGenUnknown)
continue;

if (HcalGenericDetId(*it).isHcalDetId())
{
HcalDetId did(*it);
uint32_t mask = (cq->getValues(did))->getValue();
if (mask!=0)
{
_xQuality.push(did, mask);
}
}
}
}

/* virtual */ void DQTask::endLuminosityBlock(
Expand Down

0 comments on commit c11b9f7

Please sign in to comment.