Skip to content

Commit

Permalink
Merge pull request #25360 from DryRun/CMSSW_10_4_0_pre2_hcaldqm
Browse files Browse the repository at this point in the history
HCALDQM: Move channel quality lookup to dqmBeginLuminosityBlock (+increase pedestal RMS axis)
  • Loading branch information
cmsbuild committed Dec 6, 2018
2 parents 7a65e90 + fee7f43 commit 6c74072
Show file tree
Hide file tree
Showing 6 changed files with 63 additions and 42 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
16 changes: 12 additions & 4 deletions DQM/HcalCommon/src/DQClient.cc
Expand Up @@ -13,7 +13,7 @@ namespace hcaldqm
_name = name;
}

/* virtual */ void DQClient::beginRun(edm::Run const& r,
void DQClient::beginRun(edm::Run const& r,
edm::EventSetup const& es)
{
// TEMPORARY
Expand Down 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);
}

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 All @@ -110,7 +118,7 @@ namespace hcaldqm
}
}

/* virtual */ void DQClient::endLuminosityBlock(DQMStore::IBooker&,
void DQClient::endLuminosityBlock(DQMStore::IBooker&,
DQMStore::IGetter&, edm::LuminosityBlock const& lb,
edm::EventSetup const&)
{
Expand All @@ -120,7 +128,7 @@ namespace hcaldqm
_maxProcessedLS=_currentLS;
}

/* virtual */ std::vector<flag::Flag> DQClient::endJob(DQMStore::IBooker&,
std::vector<flag::Flag> DQClient::endJob(DQMStore::IBooker&,
DQMStore::IGetter&)
{
return std::vector<flag::Flag>();
Expand Down
15 changes: 11 additions & 4 deletions DQM/HcalCommon/src/DQHarvester.cc
Expand Up @@ -9,7 +9,7 @@ namespace hcaldqm
DQModule(ps)
{}

/* virtual */ void DQHarvester::beginRun(edm::Run const& r,
void DQHarvester::beginRun(edm::Run const& r,
edm::EventSetup const& es)
{
if (_ptype==fLocal)
Expand Down 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);
}

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 All @@ -113,7 +120,7 @@ namespace hcaldqm
}
}

/* virtual */ void DQHarvester::dqmEndLuminosityBlock(
void DQHarvester::dqmEndLuminosityBlock(
DQMStore::IBooker& ib, DQMStore::IGetter& ig,
edm::LuminosityBlock const& lb, edm::EventSetup const& es)
{
Expand All @@ -122,7 +129,7 @@ namespace hcaldqm
_totalLS++;
_dqmEndLuminosityBlock(ib, ig, lb, es);
}
/* virtual */ void DQHarvester::dqmEndJob(DQMStore::IBooker& ib,
void DQHarvester::dqmEndJob(DQMStore::IBooker& ib,
DQMStore::IGetter& ig)
{
_dqmEndJob(ib, ig);
Expand Down
64 changes: 32 additions & 32 deletions DQM/HcalCommon/src/DQTask.cc
Expand Up @@ -22,7 +22,7 @@ namespace hcaldqm
* By design, all the sources will ahve this function inherited and will
* never override.
*/
/* virtual */ void DQTask::analyze(edm::Event const& e,
void DQTask::analyze(edm::Event const& e,
edm::EventSetup const& es)
{
this->_resetMonitors(fEvent);
Expand All @@ -35,7 +35,7 @@ namespace hcaldqm
this->_process(e, es);
}

/* virtual */ void DQTask::bookHistograms(DQMStore::IBooker &ib,
void DQTask::bookHistograms(DQMStore::IBooker &ib,
edm::Run const& r,
edm::EventSetup const& es)
{
Expand Down 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 All @@ -110,7 +86,7 @@ namespace hcaldqm
_emap = _dbService->getHcalMapping();
}

/* virtual */ void DQTask::dqmBeginRun(edm::Run const& r,
void DQTask::dqmBeginRun(edm::Run const& r,
edm::EventSetup const& es)
{
this->_resetMonitors(fEvent);
Expand All @@ -120,7 +96,7 @@ namespace hcaldqm
this->_resetMonitors(f100LS);
}

/* virtual */ void DQTask::beginLuminosityBlock(
void DQTask::beginLuminosityBlock(
edm::LuminosityBlock const& lb,
edm::EventSetup const& es)
{
Expand All @@ -133,17 +109,41 @@ 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(
void DQTask::endLuminosityBlock(
edm::LuminosityBlock const& lb,
edm::EventSetup const& es)
{
_procLSs++;
}

/* virtual */ void DQTask::_resetMonitors(UpdateFreq uf)
void DQTask::_resetMonitors(UpdateFreq uf)
{
// reset per event
switch (uf)
Expand All @@ -164,7 +164,7 @@ namespace hcaldqm
}
}

/* virtual */ int DQTask::_getCalibType(edm::Event const&e)
int DQTask::_getCalibType(edm::Event const&e)
{
int calibType = 0;

Expand Down
4 changes: 2 additions & 2 deletions DQM/HcalTasks/plugins/PedestalTask.cc
Expand Up @@ -122,7 +122,7 @@ PedestalTask::PedestalTask(edm::ParameterSet const& ps):
new hcaldqm::quantity::ValueQuantity(hcaldqm::quantity::fADC_15),
new hcaldqm::quantity::ValueQuantity(hcaldqm::quantity::fN, true),0);
_cRMSTotal_Subdet.initialize(_name, "RMS", hcaldqm::hashfunctions::fSubdet,
new hcaldqm::quantity::ValueQuantity(hcaldqm::quantity::fADC_5),
new hcaldqm::quantity::ValueQuantity(hcaldqm::quantity::fADC_15),
new hcaldqm::quantity::ValueQuantity(hcaldqm::quantity::fN, true),0);
_cMeanTotal_depth.initialize(_name, "Mean", hcaldqm::hashfunctions::fdepth,
new hcaldqm::quantity::DetectorQuantity(hcaldqm::quantity::fieta),
Expand All @@ -131,7 +131,7 @@ PedestalTask::PedestalTask(edm::ParameterSet const& ps):
_cRMSTotal_depth.initialize(_name, "RMS", hcaldqm::hashfunctions::fdepth,
new hcaldqm::quantity::DetectorQuantity(hcaldqm::quantity::fieta),
new hcaldqm::quantity::DetectorQuantity(hcaldqm::quantity::fiphi),
new hcaldqm::quantity::ValueQuantity(hcaldqm::quantity::fADC_5),0);
new hcaldqm::quantity::ValueQuantity(hcaldqm::quantity::fADC_15),0);

_cMeanDBRef1LS_Subdet.initialize(_name, "MeanDBRef1LS", hcaldqm::hashfunctions::fSubdet,
new hcaldqm::quantity::ValueQuantity(hcaldqm::quantity::fAroundZero),
Expand Down

0 comments on commit 6c74072

Please sign in to comment.