Skip to content

Commit

Permalink
Merge pull request #11579 from bsunanda/Run2-hcx34
Browse files Browse the repository at this point in the history
bsunanda:Run2-hcx34 Avoid the crashes in the DQM code
  • Loading branch information
cmsbuild committed Oct 7, 2015
2 parents 703919e + 232ee8b commit 8073ce3
Show file tree
Hide file tree
Showing 9 changed files with 233 additions and 268 deletions.
4 changes: 1 addition & 3 deletions DQM/HcalMonitorTasks/interface/HcalCoarsePedestalMonitor.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ class HcalCoarsePedestalMonitor: public HcalBaseDQMonitor {
const HFDigiCollection& hf,
const HcalUnpackerReport& report);


// Begin LumiBlock
void beginLuminosityBlock(const edm::LuminosityBlock& lumiSeg,
const edm::EventSetup& c) ;
Expand All @@ -45,10 +44,9 @@ class HcalCoarsePedestalMonitor: public HcalBaseDQMonitor {

private: ///Methods, variables accessible only within class code

void fill_Nevents();
void fill_Nevents(const HcalTopology&);
void zeroCounters();

const HcalTopology* topo_;
// Store sum of pedestal values over all events
EtaPhiHists CoarsePedestalsSumByDepth;
EtaPhiHists CoarsePedestalsOccByDepth;
Expand Down
8 changes: 4 additions & 4 deletions DQM/HcalMonitorTasks/interface/HcalDeadCellMonitor.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ class HcalDeadCellMonitor: public HcalBaseDQMonitor {
void setup(DQMStore::IBooker &);
void bookHistograms(DQMStore::IBooker &ib, const edm::Run& run, const edm::EventSetup& c);
void analyze(edm::Event const&e, edm::EventSetup const&s);

void endLuminosityBlock(const edm::LuminosityBlock& lumiSeg,
const edm::EventSetup& c);
void endRun(const edm::Run& run, const edm::EventSetup& c);
Expand All @@ -58,17 +59,16 @@ class HcalDeadCellMonitor: public HcalBaseDQMonitor {
template<class T> void process_Digi(T& digi);
template<class T> void process_RecHit(T& rechit);

const HcalTopology* topo_;
bool deadmon_makeDiagnostics_;
int minDeadEventCount_;

// Booleans to control which of the dead cell checking routines are used
bool deadmon_test_digis_;
bool deadmon_test_rechits_;

void fillNevents_problemCells(); // problemcells always checks for never-present digis, rechits
void fillNevents_recentdigis();
void fillNevents_recentrechits();
void fillNevents_problemCells(const HcalTopology&); // problemcells always checks for never-present digis, rechits
void fillNevents_recentdigis(const HcalTopology&);
void fillNevents_recentrechits(const HcalTopology&);

// specify minimum energy threshold for energy test
double energyThreshold_;
Expand Down
3 changes: 1 addition & 2 deletions DQM/HcalMonitorTasks/interface/HcalDigiMonitor.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,13 +97,12 @@ class HcalDigiMonitor: public HcalBaseDQMonitor {
void reset();

private: ///Methods, variables accessible only within class code
const HcalTopology* topo_;
bool passedMinBiasHLT_;
bool excludeHORing2_;
bool excludeHO1P02_;
bool excludeBadQPLLs_;

void fill_Nevents();
void fill_Nevents(const HcalTopology&);
void zeroCounters();
void setupSubdetHists(DQMStore::IBooker &ib, DigiHists& hist, std::string subdet); // enable this feature at some point

Expand Down
4 changes: 2 additions & 2 deletions DQM/HcalMonitorTasks/interface/HcalEtaPhiHists.h
Original file line number Diff line number Diff line change
Expand Up @@ -496,9 +496,9 @@ inline bool isSiPM(int ieta, int iphi, int depth)
return false;
} // bool isSiPM


// Checks whether (subdet, ieta, iphi, depth) value is a valid Hcal cell
/*
// Checks whether (subdet, ieta, iphi, depth) value is a valid Hcal cell
inline bool validDetId(HcalSubdetector sd, int ies, int ip, int dp)
{
// inputs are (subdetector, ieta, iphi, depth)
Expand Down
9 changes: 4 additions & 5 deletions DQM/HcalMonitorTasks/interface/HcalHotCellMonitor.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,13 @@ class HcalHotCellMonitor: public HcalBaseDQMonitor {


private:
void fillNevents_neighbor();
void fillNevents_energy();
void fillNevents_persistentenergy();
void fillNevents_neighbor(const HcalTopology&);
void fillNevents_energy(const HcalTopology&);
void fillNevents_persistentenergy(const HcalTopology&);

void fillNevents_problemCells();
void fillNevents_problemCells(const HcalTopology&);
void zeroCounters();

const HcalTopology* topo_;
int minEvents_; // minimum # of events in a lumi block before persistent test will be checked
// Booleans to control which of the three hot cell checking routines are used
bool test_neighbor_;
Expand Down
86 changes: 38 additions & 48 deletions DQM/HcalMonitorTasks/src/HcalCoarsePedestalMonitor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#include "FWCore/Framework/interface/LuminosityBlock.h"

// constructor
HcalCoarsePedestalMonitor::HcalCoarsePedestalMonitor(const edm::ParameterSet& ps) : HcalBaseDQMonitor(ps), topo_(0) {
HcalCoarsePedestalMonitor::HcalCoarsePedestalMonitor(const edm::ParameterSet& ps) : HcalBaseDQMonitor(ps) {
Online_ = ps.getUntrackedParameter<bool>("online",false);
mergeRuns_ = ps.getUntrackedParameter<bool>("mergeRuns",false);
enableCleanup_ = ps.getUntrackedParameter<bool>("enableCleanup",false);
Expand Down Expand Up @@ -42,7 +42,7 @@ HcalCoarsePedestalMonitor::HcalCoarsePedestalMonitor(const edm::ParameterSet& ps


// destructor
HcalCoarsePedestalMonitor::~HcalCoarsePedestalMonitor() {}
HcalCoarsePedestalMonitor::~HcalCoarsePedestalMonitor() { }


void HcalCoarsePedestalMonitor::endRun(const edm::Run& run, const edm::EventSetup& c)
Expand Down Expand Up @@ -104,10 +104,6 @@ void HcalCoarsePedestalMonitor::bookHistograms(DQMStore::IBooker &ib, const edm:
void HcalCoarsePedestalMonitor::analyze(edm::Event const&e, edm::EventSetup const&s) {
HcalBaseDQMonitor::analyze(e,s);

edm::ESHandle<HcalTopology> topo;
s.get<HcalRecNumberingRecord>().get(topo);
topo_ = &(*topo);

if (!IsAllowedCalibType()) return;
if (LumiInOrder(e.luminosityBlock())==false) return;

Expand Down Expand Up @@ -266,7 +262,6 @@ void HcalCoarsePedestalMonitor::processEvent(const HBHEDigiCollection& hbhe,
return;
} // void HcalCoarsePedestalMonitor::processEvent(...)


void HcalCoarsePedestalMonitor::beginLuminosityBlock(const edm::LuminosityBlock& lumiSeg,
const edm::EventSetup& c)
{
Expand All @@ -275,14 +270,16 @@ void HcalCoarsePedestalMonitor::beginLuminosityBlock(const edm::LuminosityBlock&
}

void HcalCoarsePedestalMonitor::endLuminosityBlock(const edm::LuminosityBlock& lumiSeg,
const edm::EventSetup& c)
{
const edm::EventSetup& c) {
if (LumiInOrder(lumiSeg.luminosityBlock())==false) return;
fill_Nevents();

edm::ESHandle<HcalTopology> topo;
c.get<HcalRecNumberingRecord>().get(topo);
fill_Nevents(*topo);
return;
}
void HcalCoarsePedestalMonitor::fill_Nevents()
{

void HcalCoarsePedestalMonitor::fill_Nevents(const HcalTopology& topology) {

// require minimum number of events before processing
if (ievt_<minEvents_)
Expand All @@ -299,49 +296,42 @@ void HcalCoarsePedestalMonitor::fill_Nevents()

int iphi=-1, ieta=-99, idepth=0, calcEta=-99;
// Loop over all depths, eta, phi
for (int d=0;d<4;++d)
{
idepth=d+1;
for (int phi=0;phi<72;++phi)
{
iphi=phi+1; // actual iphi value
for (int eta=0;eta<83;++eta)
{
ieta=eta-41; // actual ieta value;
if (topo_->validDetId(HcalBarrel, ieta, iphi, idepth))
{
calcEta = CalcEtaBin(HcalBarrel,ieta,idepth);
CoarsePedestalsSumByDepth.depth[d]->Fill(ieta,iphi,pedestalsum_[calcEta][phi][d]);
CoarsePedestalsOccByDepth.depth[d]->Fill(ieta,iphi,pedestalocc_[calcEta][phi][d]);
}
if (topo_->validDetId(HcalEndcap, ieta, iphi, idepth))
{
calcEta = CalcEtaBin(HcalEndcap,ieta,idepth);
CoarsePedestalsSumByDepth.depth[d]->Fill(ieta,iphi,pedestalsum_[calcEta][phi][d]);
CoarsePedestalsOccByDepth.depth[d]->Fill(ieta,iphi,pedestalocc_[calcEta][phi][d]);
}
if (topo_->validDetId(HcalOuter, ieta, iphi, idepth))
{
calcEta = CalcEtaBin(HcalOuter,ieta,idepth);
CoarsePedestalsSumByDepth.depth[d]->Fill(ieta,iphi,pedestalsum_[calcEta][phi][d]);
CoarsePedestalsOccByDepth.depth[d]->Fill(ieta,iphi,pedestalocc_[calcEta][phi][d]);
}
if (topo_->validDetId(HcalForward, ieta, iphi, idepth))
{
calcEta = CalcEtaBin(HcalBarrel,ieta,idepth);
int zside=ieta/abs(ieta);
CoarsePedestalsSumByDepth.depth[d]->Fill(ieta+zside,iphi,pedestalsum_[calcEta][phi][d]);
CoarsePedestalsOccByDepth.depth[d]->Fill(ieta+zside,iphi,pedestalocc_[calcEta][phi][d]);
}
}
for (int d=0;d<4;++d) {
idepth=d+1;
for (int phi=0;phi<72;++phi) {
iphi=phi+1; // actual iphi value
for (int eta=0;eta<83;++eta) {
ieta=eta-41; // actual ieta value;
if (topology.validDetId(HcalBarrel, ieta, iphi, idepth)) {
calcEta = CalcEtaBin(HcalBarrel,ieta,idepth);
CoarsePedestalsSumByDepth.depth[d]->Fill(ieta,iphi,pedestalsum_[calcEta][phi][d]);
CoarsePedestalsOccByDepth.depth[d]->Fill(ieta,iphi,pedestalocc_[calcEta][phi][d]);
}
if (topology.validDetId(HcalEndcap, ieta, iphi, idepth)) {
calcEta = CalcEtaBin(HcalEndcap,ieta,idepth);
CoarsePedestalsSumByDepth.depth[d]->Fill(ieta,iphi,pedestalsum_[calcEta][phi][d]);
CoarsePedestalsOccByDepth.depth[d]->Fill(ieta,iphi,pedestalocc_[calcEta][phi][d]);
}
if (topology.validDetId(HcalOuter, ieta, iphi, idepth)) {
calcEta = CalcEtaBin(HcalOuter,ieta,idepth);
CoarsePedestalsSumByDepth.depth[d]->Fill(ieta,iphi,pedestalsum_[calcEta][phi][d]);
CoarsePedestalsOccByDepth.depth[d]->Fill(ieta,iphi,pedestalocc_[calcEta][phi][d]);
}
if (topology.validDetId(HcalForward, ieta, iphi, idepth)) {
calcEta = CalcEtaBin(HcalBarrel,ieta,idepth);
int zside=ieta/abs(ieta);
CoarsePedestalsSumByDepth.depth[d]->Fill(ieta+zside,iphi,pedestalsum_[calcEta][phi][d]);
CoarsePedestalsOccByDepth.depth[d]->Fill(ieta+zside,iphi,pedestalocc_[calcEta][phi][d]);
}
}
}
}
// Fill unphysical bins
FillUnphysicalHEHFBins(CoarsePedestalsSumByDepth);
FillUnphysicalHEHFBins(CoarsePedestalsOccByDepth);

return;
} // void HcalCoarsePedestalMonitor::fill_Nevents()
} // void HcalCoarsePedestalMonitor::fill_Nevents(const HcalTopology&)


void HcalCoarsePedestalMonitor::reset()
Expand Down
Loading

0 comments on commit 8073ce3

Please sign in to comment.