diff --git a/DQM/HcalMonitorTasks/interface/HcalCoarsePedestalMonitor.h b/DQM/HcalMonitorTasks/interface/HcalCoarsePedestalMonitor.h index f2deebe774ada..543473c6dfd7c 100644 --- a/DQM/HcalMonitorTasks/interface/HcalCoarsePedestalMonitor.h +++ b/DQM/HcalMonitorTasks/interface/HcalCoarsePedestalMonitor.h @@ -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) ; @@ -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; diff --git a/DQM/HcalMonitorTasks/interface/HcalDeadCellMonitor.h b/DQM/HcalMonitorTasks/interface/HcalDeadCellMonitor.h index bacb92a7155ce..dbc471db8a267 100644 --- a/DQM/HcalMonitorTasks/interface/HcalDeadCellMonitor.h +++ b/DQM/HcalMonitorTasks/interface/HcalDeadCellMonitor.h @@ -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); @@ -58,7 +59,6 @@ class HcalDeadCellMonitor: public HcalBaseDQMonitor { template void process_Digi(T& digi); template void process_RecHit(T& rechit); - const HcalTopology* topo_; bool deadmon_makeDiagnostics_; int minDeadEventCount_; @@ -66,9 +66,9 @@ class HcalDeadCellMonitor: public HcalBaseDQMonitor { 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_; diff --git a/DQM/HcalMonitorTasks/interface/HcalDigiMonitor.h b/DQM/HcalMonitorTasks/interface/HcalDigiMonitor.h index 9514895047047..fdca3002c2bd5 100644 --- a/DQM/HcalMonitorTasks/interface/HcalDigiMonitor.h +++ b/DQM/HcalMonitorTasks/interface/HcalDigiMonitor.h @@ -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 diff --git a/DQM/HcalMonitorTasks/interface/HcalEtaPhiHists.h b/DQM/HcalMonitorTasks/interface/HcalEtaPhiHists.h index 80b18c09e732c..fe80b30ae02f7 100644 --- a/DQM/HcalMonitorTasks/interface/HcalEtaPhiHists.h +++ b/DQM/HcalMonitorTasks/interface/HcalEtaPhiHists.h @@ -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) diff --git a/DQM/HcalMonitorTasks/interface/HcalHotCellMonitor.h b/DQM/HcalMonitorTasks/interface/HcalHotCellMonitor.h index 98cdc72e92760..010a0682fbd3d 100644 --- a/DQM/HcalMonitorTasks/interface/HcalHotCellMonitor.h +++ b/DQM/HcalMonitorTasks/interface/HcalHotCellMonitor.h @@ -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_; diff --git a/DQM/HcalMonitorTasks/src/HcalCoarsePedestalMonitor.cc b/DQM/HcalMonitorTasks/src/HcalCoarsePedestalMonitor.cc index b763880cd98aa..ab41584989cc5 100644 --- a/DQM/HcalMonitorTasks/src/HcalCoarsePedestalMonitor.cc +++ b/DQM/HcalMonitorTasks/src/HcalCoarsePedestalMonitor.cc @@ -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("online",false); mergeRuns_ = ps.getUntrackedParameter("mergeRuns",false); enableCleanup_ = ps.getUntrackedParameter("enableCleanup",false); @@ -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) @@ -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 topo; - s.get().get(topo); - topo_ = &(*topo); - if (!IsAllowedCalibType()) return; if (LumiInOrder(e.luminosityBlock())==false) return; @@ -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) { @@ -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 topo; + c.get().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_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() diff --git a/DQM/HcalMonitorTasks/src/HcalDeadCellMonitor.cc b/DQM/HcalMonitorTasks/src/HcalDeadCellMonitor.cc index 4a8e253798ea9..8dce2bf5b21f6 100644 --- a/DQM/HcalMonitorTasks/src/HcalDeadCellMonitor.cc +++ b/DQM/HcalMonitorTasks/src/HcalDeadCellMonitor.cc @@ -3,7 +3,7 @@ #include "CondFormats/HcalObjects/interface/HcalLogicalMap.h" #include "Geometry/Records/interface/HcalRecNumberingRecord.h" -HcalDeadCellMonitor::HcalDeadCellMonitor(const edm::ParameterSet& ps):HcalBaseDQMonitor(ps), topo_(0) { +HcalDeadCellMonitor::HcalDeadCellMonitor(const edm::ParameterSet& ps):HcalBaseDQMonitor(ps) { Online_ = ps.getUntrackedParameter("online",false); mergeRuns_ = ps.getUntrackedParameter("mergeRuns",false); enableCleanup_ = ps.getUntrackedParameter("enableCleanup",false); @@ -75,9 +75,7 @@ HcalDeadCellMonitor::HcalDeadCellMonitor(const edm::ParameterSet& ps):HcalBaseDQ } //constructor -HcalDeadCellMonitor::~HcalDeadCellMonitor() -{ -} //destructor +HcalDeadCellMonitor::~HcalDeadCellMonitor() { } //destructor /* ------------------------------------ */ @@ -389,11 +387,10 @@ void HcalDeadCellMonitor::setup(DQMStore::IBooker &ib) } // void HcalDeadCellMonitor::setup(...) -void HcalDeadCellMonitor::bookHistograms(DQMStore::IBooker &ib, const edm::Run& run, const edm::EventSetup& c) -{ +void HcalDeadCellMonitor::bookHistograms(DQMStore::IBooker &ib, const edm::Run& run, const edm::EventSetup& c) { if (debug_>1) std::cout <<"HcalDeadCellMonitor::bookHistograms"<setup(ib); // set up histograms if they have not been created before if (mergeRuns_==false) this->reset(); @@ -533,12 +530,15 @@ void HcalDeadCellMonitor::endLuminosityBlock(const edm::LuminosityBlock& lumiSeg // Here is where we determine whether or not to process an event // Not enough events // there are less than minDeadEventCount_ in this LS, but RBXloss is found + + edm::ESHandle topo; + c.get().get(topo); if (deadevt_>=10 && deadevt_ topo; + c.get().get(topo); + + if (endLumiProcessed_==false) fillNevents_problemCells(*topo); // always check for never-present cells return; } @@ -606,10 +610,6 @@ void HcalDeadCellMonitor::analyze(edm::Event const&e, edm::EventSetup const&s) { HcalBaseDQMonitor::analyze(e,s); - edm::ESHandle topo; - s.get().get(topo); - topo_ = &(*topo); - if (!IsAllowedCalibType()) return; endLumiProcessed_=false; @@ -1021,8 +1021,7 @@ void HcalDeadCellMonitor::process_RecHit(RECHIT& rechit) } } -void HcalDeadCellMonitor::fillNevents_recentdigis() -{ +void HcalDeadCellMonitor::fillNevents_recentdigis(const HcalTopology& topology){ // Fill Histograms showing digi cells with no occupancy for the past few lumiblocks if (!deadmon_test_digis_) return; // extra protection here against calling histograms than don't exist @@ -1051,7 +1050,7 @@ void HcalDeadCellMonitor::fillNevents_recentdigis() { ieta=CalcIeta((HcalSubdetector)subdet,eta,depth+1); if (ieta==-9999) continue; - if (!(topo_->validDetId((HcalSubdetector)subdet, ieta, iphi, depth+1))) + if (!(topology.validDetId((HcalSubdetector)subdet, ieta, iphi, depth+1))) continue; // now check which dead cell tests failed; increment counter if any failed HcalDetId TempID((HcalSubdetector)subdet, ieta, iphi, (int)depth+1); @@ -1086,7 +1085,7 @@ void HcalDeadCellMonitor::fillNevents_recentdigis() { iphi=phi+1; - if (!(topo_->validDetId((HcalSubdetector)subdet, ieta, iphi, depth+1))) + if (!(topology.validDetId((HcalSubdetector)subdet, ieta, iphi, depth+1))) continue; // Ignore subdetectors that weren't in run? @@ -1124,14 +1123,13 @@ void HcalDeadCellMonitor::fillNevents_recentdigis() return; -} // void HcalDeadCellMonitor::fillNevents_recentdigis() +} // void HcalDeadCellMonitor::fillNevents_recentdigis(const HcalTopology&) /* ----------------------------------- */ -void HcalDeadCellMonitor::fillNevents_recentrechits() -{ +void HcalDeadCellMonitor::fillNevents_recentrechits(const HcalTopology& topology) { // Fill Histograms showing unoccupied rechits, or rec hits with low energy // This test is a bit pointless, unless the energy threshold is greater than the ZS threshold. @@ -1168,7 +1166,7 @@ void HcalDeadCellMonitor::fillNevents_recentrechits() { ieta=CalcIeta((HcalSubdetector)subdet,eta,depth+1); if (ieta==-9999) continue; - if (!(topo_->validDetId((HcalSubdetector)subdet, ieta, iphi, depth+1))) + if (!(topology.validDetId((HcalSubdetector)subdet, ieta, iphi, depth+1))) continue; // now check which dead cell tests failed; increment counter if any failed HcalDetId TempID((HcalSubdetector)subdet, ieta, iphi, (int)depth+1); @@ -1202,7 +1200,7 @@ void HcalDeadCellMonitor::fillNevents_recentrechits() for (int phi=0;phivalidDetId((HcalSubdetector)subdet, ieta, iphi, depth+1))) + if (!(topology.validDetId((HcalSubdetector)subdet, ieta, iphi, depth+1))) continue; if (recentoccupancy_rechit[eta][phi][depth]>0) continue; // cell exceeded energy at least once, so it's not dead @@ -1235,11 +1233,10 @@ void HcalDeadCellMonitor::fillNevents_recentrechits() FillUnphysicalHEHFBins(RecentMissingRecHitsByDepth); return; -} // void HcalDeadCellMonitor::fillNevents_recentrechits() +} // void HcalDeadCellMonitor::fillNevents_recentrechits(const HcalTopology&) -void HcalDeadCellMonitor::fillNevents_problemCells() -{ +void HcalDeadCellMonitor::fillNevents_problemCells(const HcalTopology& topology) { //fillNevents_problemCells now only performs checks of never-present cells if (debug_>0) @@ -1373,7 +1370,7 @@ void HcalDeadCellMonitor::fillNevents_problemCells() { ieta=CalcIeta((HcalSubdetector)subdet,eta,depth+1); if (ieta==-9999) continue; - if (!(topo_->validDetId((HcalSubdetector)subdet, ieta, iphi, depth+1))) + if (!(topology.validDetId((HcalSubdetector)subdet, ieta, iphi, depth+1))) continue; // Ignore subdetectors that weren't in run? /* @@ -1610,7 +1607,7 @@ void HcalDeadCellMonitor::fillNevents_problemCells() } return; -} // void HcalDeadCellMonitor::fillNevents_problemCells(void) +} // void HcalDeadCellMonitor::fillNevents_problemCells(const HcalTopology&) void HcalDeadCellMonitor::zeroCounters(bool resetpresent) diff --git a/DQM/HcalMonitorTasks/src/HcalDigiMonitor.cc b/DQM/HcalMonitorTasks/src/HcalDigiMonitor.cc index 131dae4047c26..d266af74d3d27 100644 --- a/DQM/HcalMonitorTasks/src/HcalDigiMonitor.cc +++ b/DQM/HcalMonitorTasks/src/HcalDigiMonitor.cc @@ -9,7 +9,7 @@ #include "CondFormats/HcalObjects/interface/HcalChannelQuality.h" // constructor -HcalDigiMonitor::HcalDigiMonitor(const edm::ParameterSet& ps):HcalBaseDQMonitor(ps), topo_(0) { +HcalDigiMonitor::HcalDigiMonitor(const edm::ParameterSet& ps):HcalBaseDQMonitor(ps) { Online_ = ps.getUntrackedParameter("online",false); mergeRuns_ = ps.getUntrackedParameter("mergeRuns",false); enableCleanup_ = ps.getUntrackedParameter("enableCleanup",false); @@ -99,7 +99,7 @@ HcalDigiMonitor::HcalDigiMonitor(const edm::ParameterSet& ps):HcalBaseDQMonitor( } // destructor -HcalDigiMonitor::~HcalDigiMonitor() {} +HcalDigiMonitor::~HcalDigiMonitor() { } // Checks capid rotation; returns false if no problems with rotation static bool bitUpset(int last, int now){ @@ -455,10 +455,6 @@ void HcalDigiMonitor::analyze(edm::Event const&e, edm::EventSetup const&s) // Get HLT trigger information for HF timing study passedMinBiasHLT_=false; - edm::ESHandle topo; - s.get().get(topo); - topo_ = &(*topo); - ///////////////////////////////////////////////////////////////// // check if detectors whether they were ON edm::Handle dcsStatus; @@ -498,6 +494,9 @@ void HcalDigiMonitor::analyze(edm::Event const&e, edm::EventSetup const&s) } } } //else + + edm::ESHandle topo; + s.get().get(topo); // Now get collections we need HT_HFP_=0; @@ -510,7 +509,7 @@ void HcalDigiMonitor::analyze(edm::Event const&e, edm::EventSetup const&s) float en=HF->energy(); int ieta=HF->id().ieta(); // ieta for HF starts at 29, so subtract away 29 when computing fEta - std::pair etas = topo_->etaRange(HF->id().subdet(),abs(ieta)); + std::pair etas = topo->etaRange(HF->id().subdet(),abs(ieta)); double fEta=fabs(0.5*(etas.first+etas.second)); ieta>0 ? HT_HFP_+=en/cosh(fEta) : HT_HFM_+=en/cosh(fEta); } @@ -1160,8 +1159,7 @@ int HcalDigiMonitor::process_Digi(DIGI& digi, DigiHists& h, int& firstcap) } // template int HcalDigiMonitor::process_Digi void HcalDigiMonitor::beginLuminosityBlock(const edm::LuminosityBlock& lumiSeg, - const edm::EventSetup& c) -{ + const edm::EventSetup& c) { HcalBaseDQMonitor::beginLuminosityBlock(lumiSeg,c); ProblemsCurrentLB->Reset(); } @@ -1183,15 +1181,17 @@ void HcalDigiMonitor::endLuminosityBlock(const edm::LuminosityBlock& lumiSeg, else alarmer_counter_ = 0; - fill_Nevents(); + edm::ESHandle topo; + c.get().get(topo); + + fill_Nevents(*topo); zeroCounters(); // reset counters of good/bad digis return; } -void HcalDigiMonitor::fill_Nevents() -{ +void HcalDigiMonitor::fill_Nevents(const HcalTopology& topology) { if (debug_>0) std::cout <<" Calling fill_Nevents for event "<setBinContent(0,0,ievt_); // underflow bin contains event counter - DigiOccupancyByDepth.depth[d]->setBinContent(0,0,ievt_); - DigiErrorsBadDigiSize.depth[d]->setBinContent(0,0,ievt_); - DigiErrorsUnpacker.depth[d]->setBinContent(0,0,ievt_); - DigiErrorsBadFibBCNOff.depth[d]->setBinContent(0,0,ievt_); - - for (int phi=0;phi<72;++phi) - { - iPhi=phi+1; - DigiOccupancyPhi->Fill(iPhi,occupancyPhi[phi]); - for (int eta=0;eta<83;++eta) - { - // DigiOccupanyEta uses 'true' ieta (included the overlap at +/- 29) - iEta=eta-41; - if (phi==0) - DigiOccupancyEta->Fill(iEta,occupancyEta[eta]); - // valid=false; + for (int d=0;d<4;++d) { + iDepth=d+1; + DigiErrorsByDepth.depth[d]->setBinContent(0,0,ievt_); // underflow bin contains event counter + DigiOccupancyByDepth.depth[d]->setBinContent(0,0,ievt_); + DigiErrorsBadDigiSize.depth[d]->setBinContent(0,0,ievt_); + DigiErrorsUnpacker.depth[d]->setBinContent(0,0,ievt_); + DigiErrorsBadFibBCNOff.depth[d]->setBinContent(0,0,ievt_); + + for (int phi=0;phi<72;++phi) { + iPhi=phi+1; + DigiOccupancyPhi->Fill(iPhi,occupancyPhi[phi]); + for (int eta=0;eta<83;++eta) { + // DigiOccupanyEta uses 'true' ieta (included the overlap at +/- 29) + iEta=eta-41; + if (phi==0) + DigiOccupancyEta->Fill(iEta,occupancyEta[eta]); + // valid=false; - // HB - if (topo_->validDetId(HcalBarrel, iEta, iPhi, iDepth)) - { - // valid=true; - if (HBpresent_) - { - int calcEta = CalcEtaBin(HcalBarrel,iEta,iDepth); - - DigiOccupancyByDepth.depth[d]->Fill(iEta, iPhi, - occupancyEtaPhi[calcEta][phi][d]); - - if (makeDiagnostics_) - { - DigiErrorsBadCapID.depth[d]->Fill(iEta, iPhi, - badcapID[calcEta][phi][d]); - DigiErrorsDVErr.depth[d]->Fill(iEta, iPhi, - digierrorsdverr[calcEta][phi][d]); - } - DigiErrorsBadDigiSize.depth[d]->Fill(iEta, iPhi, - baddigisize[calcEta][phi][d]); - DigiErrorsBadFibBCNOff.depth[d]->Fill(iEta, iPhi, - badFibBCNOff[calcEta][phi][d]); - DigiErrorsUnpacker.depth[d]->Fill(iEta, iPhi, - badunpackerreport[calcEta][phi][d]); - DigiErrorsByDepth.depth[d]->Fill(iEta, iPhi, - baddigis[calcEta][phi][d]); - // Use this for testing purposes only - //DigiErrorsByDepth[d]->Fill(iEta, iPhi, ievt_); - } // if (HBpresent_) - } // validDetId(HB) - // HE - if (topo_->validDetId(HcalEndcap, iEta, iPhi, iDepth)) - { - // valid=true; - if (HEpresent_) - { - int calcEta = CalcEtaBin(HcalEndcap,iEta,iDepth); - - DigiOccupancyByDepth.depth[d]->Fill(iEta, iPhi, - occupancyEtaPhi[calcEta][phi][d]); - - if (makeDiagnostics_) - { - DigiErrorsBadCapID.depth[d]->Fill(iEta, iPhi, - badcapID[calcEta][phi][d]); - DigiErrorsDVErr.depth[d]->Fill(iEta, iPhi, - digierrorsdverr[calcEta][phi][d]); - } - DigiErrorsBadDigiSize.depth[d]->Fill(iEta, iPhi, - baddigisize[calcEta][phi][d]); - DigiErrorsBadFibBCNOff.depth[d]->Fill(iEta, iPhi, - badFibBCNOff[calcEta][phi][d]); - DigiErrorsUnpacker.depth[d]->Fill(iEta, iPhi, - badunpackerreport[calcEta][phi][d]); - DigiErrorsByDepth.depth[d]->Fill(iEta, iPhi, - baddigis[calcEta][phi][d]); - } // if (HEpresent_) - } // valid HE found - // HO - if (topo_->validDetId(HcalOuter,iEta,iPhi,iDepth)) - { - // valid=true; - if (HOpresent_) - { - int calcEta = CalcEtaBin(HcalOuter,iEta,iDepth); - DigiOccupancyByDepth.depth[d]->Fill(iEta, iPhi, - occupancyEtaPhi[calcEta][phi][d]); - if (makeDiagnostics_) - { - DigiErrorsBadCapID.depth[d]->Fill(iEta, iPhi, - badcapID[calcEta][phi][d]); - DigiErrorsDVErr.depth[d]->Fill(iEta, iPhi, - digierrorsdverr[calcEta][phi][d]); - } - DigiErrorsBadDigiSize.depth[d]->Fill(iEta, iPhi, - baddigisize[calcEta][phi][d]); - DigiErrorsBadFibBCNOff.depth[d]->Fill(iEta, iPhi, - badFibBCNOff[calcEta][phi][d]); - DigiErrorsUnpacker.depth[d]->Fill(iEta, iPhi, - badunpackerreport[calcEta][phi][d]); + // HB + if (topology.validDetId(HcalBarrel, iEta, iPhi, iDepth)) { + // valid=true; + if (HBpresent_) { + int calcEta = CalcEtaBin(HcalBarrel,iEta,iDepth); + + DigiOccupancyByDepth.depth[d]->Fill(iEta, iPhi, + occupancyEtaPhi[calcEta][phi][d]); - DigiErrorsByDepth.depth[d]->Fill(iEta,iPhi, - baddigis[calcEta][phi][d]); - } // if (HOpresent_) - }//validDetId(HO) - // HF - if (topo_->validDetId(HcalForward,iEta,iPhi,iDepth)) - { - // valid=true; - if (HFpresent_) - { - int calcEta = CalcEtaBin(HcalForward,iEta,iDepth); - int zside = iEta/abs(iEta); - DigiOccupancyByDepth.depth[d]->Fill(iEta+zside, iPhi, - occupancyEtaPhi[calcEta][phi][d]); - - if (makeDiagnostics_) - { - DigiErrorsBadCapID.depth[d]->Fill(iEta+zside, iPhi, - badcapID[calcEta][phi][d]); - DigiErrorsDVErr.depth[d]->Fill(iEta+zside, iPhi, - digierrorsdverr[calcEta][phi][d]); - } - DigiErrorsBadDigiSize.depth[d]->Fill(iEta+zside, iPhi, - baddigisize[calcEta][phi][d]); - DigiErrorsBadFibBCNOff.depth[d]->Fill(iEta+zside, iPhi, - badFibBCNOff[calcEta][phi][d]); - DigiErrorsUnpacker.depth[d]->Fill(iEta+zside, iPhi, - badunpackerreport[calcEta][phi][d]); - DigiErrorsByDepth.depth[d]->Fill(iEta+zside, iPhi, - baddigis[calcEta][phi][d]); + if (makeDiagnostics_) { + DigiErrorsBadCapID.depth[d]->Fill(iEta, iPhi, + badcapID[calcEta][phi][d]); + DigiErrorsDVErr.depth[d]->Fill(iEta, iPhi, + digierrorsdverr[calcEta][phi][d]); + } + DigiErrorsBadDigiSize.depth[d]->Fill(iEta, iPhi, + baddigisize[calcEta][phi][d]); + DigiErrorsBadFibBCNOff.depth[d]->Fill(iEta, iPhi, + badFibBCNOff[calcEta][phi][d]); + DigiErrorsUnpacker.depth[d]->Fill(iEta, iPhi, + badunpackerreport[calcEta][phi][d]); + DigiErrorsByDepth.depth[d]->Fill(iEta, iPhi, + baddigis[calcEta][phi][d]); + // Use this for testing purposes only + //DigiErrorsByDepth[d]->Fill(iEta, iPhi, ievt_); + } // if (HBpresent_) + } // validDetId(HB) + // HE + if (topology.validDetId(HcalEndcap, iEta, iPhi, iDepth)) { + // valid=true; + if (HEpresent_) { + int calcEta = CalcEtaBin(HcalEndcap,iEta,iDepth); + + DigiOccupancyByDepth.depth[d]->Fill(iEta, iPhi, + occupancyEtaPhi[calcEta][phi][d]); + + if (makeDiagnostics_) { + DigiErrorsBadCapID.depth[d]->Fill(iEta, iPhi, + badcapID[calcEta][phi][d]); + DigiErrorsDVErr.depth[d]->Fill(iEta, iPhi, + digierrorsdverr[calcEta][phi][d]); + } + DigiErrorsBadDigiSize.depth[d]->Fill(iEta, iPhi, + baddigisize[calcEta][phi][d]); + DigiErrorsBadFibBCNOff.depth[d]->Fill(iEta, iPhi, + badFibBCNOff[calcEta][phi][d]); + DigiErrorsUnpacker.depth[d]->Fill(iEta, iPhi, + badunpackerreport[calcEta][phi][d]); + DigiErrorsByDepth.depth[d]->Fill(iEta, iPhi, + baddigis[calcEta][phi][d]); + } // if (HEpresent_) + } // valid HE found + // HO + if (topology.validDetId(HcalOuter,iEta,iPhi,iDepth)) { + // valid=true; + if (HOpresent_) { + int calcEta = CalcEtaBin(HcalOuter,iEta,iDepth); + DigiOccupancyByDepth.depth[d]->Fill(iEta, iPhi, + occupancyEtaPhi[calcEta][phi][d]); + if (makeDiagnostics_) { + DigiErrorsBadCapID.depth[d]->Fill(iEta, iPhi, + badcapID[calcEta][phi][d]); + DigiErrorsDVErr.depth[d]->Fill(iEta, iPhi, + digierrorsdverr[calcEta][phi][d]); + } + DigiErrorsBadDigiSize.depth[d]->Fill(iEta, iPhi, + baddigisize[calcEta][phi][d]); + DigiErrorsBadFibBCNOff.depth[d]->Fill(iEta, iPhi, + badFibBCNOff[calcEta][phi][d]); + DigiErrorsUnpacker.depth[d]->Fill(iEta, iPhi, + badunpackerreport[calcEta][phi][d]); - } // if (HFpresent_) - } - } // for (int eta=0;...) - } // for (int phi=0;...) - } // for (int d=0;...) + DigiErrorsByDepth.depth[d]->Fill(iEta,iPhi, + baddigis[calcEta][phi][d]); + } // if (HOpresent_) + }//validDetId(HO) + // HF + if (topology.validDetId(HcalForward,iEta,iPhi,iDepth)) { + // valid=true; + if (HFpresent_) { + int calcEta = CalcEtaBin(HcalForward,iEta,iDepth); + int zside = iEta/abs(iEta); + DigiOccupancyByDepth.depth[d]->Fill(iEta+zside, iPhi, + occupancyEtaPhi[calcEta][phi][d]); + + if (makeDiagnostics_) { + DigiErrorsBadCapID.depth[d]->Fill(iEta+zside, iPhi, + badcapID[calcEta][phi][d]); + DigiErrorsDVErr.depth[d]->Fill(iEta+zside, iPhi, + digierrorsdverr[calcEta][phi][d]); + } + DigiErrorsBadDigiSize.depth[d]->Fill(iEta+zside, iPhi, + baddigisize[calcEta][phi][d]); + DigiErrorsBadFibBCNOff.depth[d]->Fill(iEta+zside, iPhi, + badFibBCNOff[calcEta][phi][d]); + DigiErrorsUnpacker.depth[d]->Fill(iEta+zside, iPhi, + badunpackerreport[calcEta][phi][d]); + DigiErrorsByDepth.depth[d]->Fill(iEta+zside, iPhi, + baddigis[calcEta][phi][d]); + + } // if (HFpresent_) + } + } // for (int eta=0;...) + } // for (int phi=0;...) + } // for (int d=0;...) // Now fill all the unphysical cell values FillUnphysicalHEHFBins(DigiErrorsByDepth); @@ -1521,7 +1506,7 @@ void HcalDigiMonitor::fill_Nevents() // zeroCounters(); // reset counters of good/bad digis return; -} // void HcalDigiMonitor::fill_Nevents() +} // void HcalDigiMonitor::fill_Nevents(const HcalTopology&) void HcalDigiMonitor::zeroCounters() diff --git a/DQM/HcalMonitorTasks/src/HcalHotCellMonitor.cc b/DQM/HcalMonitorTasks/src/HcalHotCellMonitor.cc index 3c57f78102fe8..c0dea3cd0fbdf 100644 --- a/DQM/HcalMonitorTasks/src/HcalHotCellMonitor.cc +++ b/DQM/HcalMonitorTasks/src/HcalHotCellMonitor.cc @@ -2,7 +2,7 @@ #include "DQM/HcalMonitorTasks/interface/HcalHotCellMonitor.h" #include "FWCore/Framework/interface/LuminosityBlock.h" -HcalHotCellMonitor::HcalHotCellMonitor(const edm::ParameterSet& ps):HcalBaseDQMonitor(ps), topo_(0) { +HcalHotCellMonitor::HcalHotCellMonitor(const edm::ParameterSet& ps):HcalBaseDQMonitor(ps) { // Standard information, inherited from base class Online_ = ps.getUntrackedParameter("online",false); mergeRuns_ = ps.getUntrackedParameter("mergeRuns",false); @@ -104,9 +104,7 @@ HcalHotCellMonitor::HcalHotCellMonitor(const edm::ParameterSet& ps):HcalBaseDQMo setupDone_=false; } //constructor -HcalHotCellMonitor::~HcalHotCellMonitor() -{ -} //destructor +HcalHotCellMonitor::~HcalHotCellMonitor() { } //destructor /* ------------------------------------ */ @@ -327,8 +325,6 @@ void HcalHotCellMonitor::reset() } } - - void HcalHotCellMonitor::beginLuminosityBlock(const edm::LuminosityBlock& lumiSeg, const edm::EventSetup& c) { @@ -347,16 +343,19 @@ void HcalHotCellMonitor::endLuminosityBlock(const edm::LuminosityBlock& lumiSeg, if (LumiInOrder(lumiSeg.luminosityBlock())==false) return; + edm::ESHandle topo; + c.get().get(topo); + if (test_neighbor_ || makeDiagnostics_) - fillNevents_neighbor(); + fillNevents_neighbor(*topo); if (test_energy_ || test_et_) - fillNevents_energy(); + fillNevents_energy(*topo); if (test_persistent_) - fillNevents_persistentenergy(); + fillNevents_persistentenergy(*topo); - fillNevents_problemCells(); + fillNevents_problemCells(*topo); return; } //endLuminosityBlock(...) @@ -403,7 +402,6 @@ void HcalHotCellMonitor::analyze(edm::Event const&e, edm::EventSetup const&s) // Good event found; increment counter (via base class analyze method) edm::ESHandle topo; s.get().get(topo); - topo_ = &(*topo); // HcalBaseDQMonitor::analyze(e,s); if (debug_>1) std::cout <<"\t Processing good event! event # = "< some threshold for N consecutive events if (levt_validDetId((HcalSubdetector)subdet, ieta, iphi, depth+1))) + if (!(topology.validDetId((HcalSubdetector)subdet, ieta, iphi, depth+1))) continue; if (subdet==HcalForward) // shift HcalForward ieta by 1 for filling purposes ieta<0 ? ieta-- : ieta++; @@ -748,7 +746,7 @@ void HcalHotCellMonitor::fillNevents_persistentenergy(void) { for (int subdet=1;subdet<=4;++subdet) { ieta=CalcIeta((HcalSubdetector)subdet,eta,depth+1); //converts bin to ieta if (ieta==-9999) continue; - if (!(topo_->validDetId((HcalSubdetector)subdet, ieta, iphi, depth+1))) + if (!(topology.validDetId((HcalSubdetector)subdet, ieta, iphi, depth+1))) continue; if (subdet==HcalForward) // shift HcalForward ieta by 1 for filling purposes ieta<0 ? ieta-- : ieta++; @@ -771,13 +769,13 @@ void HcalHotCellMonitor::fillNevents_persistentenergy(void) { } // if (test_et_) // Add test_ET return; -} // void HcalHotCellMonitor::fillNevents_persistentenergy(void) +} // void HcalHotCellMonitor::fillNevents_persistentenergy(const HcalTopology&) /* ----------------------------------- */ -void HcalHotCellMonitor::fillNevents_energy(void) { +void HcalHotCellMonitor::fillNevents_energy(const HcalTopology& topology) { // Fill Histograms showing rec hits that are above some energy value // (Fill for each instance when cell is above energy; don't require it to be hot for a number of consecutive events) @@ -818,7 +816,7 @@ void HcalHotCellMonitor::fillNevents_energy(void) { for (int subdet=1;subdet<=4;++subdet) { ieta=CalcIeta((HcalSubdetector)subdet,eta,depth+1); //converts bin to ieta if (ieta==-9999) continue; - if (!(topo_->validDetId((HcalSubdetector)subdet, ieta, iphi, depth+1))) + if (!(topology.validDetId((HcalSubdetector)subdet, ieta, iphi, depth+1))) continue; if (subdet==HcalForward) // shift HcalForward ieta by 1 for filling purposes ieta<0 ? ieta-- : ieta++; @@ -853,13 +851,13 @@ void HcalHotCellMonitor::fillNevents_energy(void) { return; -} // void HcalHotCellMonitor::fillNevents_energy(void) +} // void HcalHotCellMonitor::fillNevents_energy(const HcalTopology&) /* ----------------------------------- */ -void HcalHotCellMonitor::fillNevents_neighbor(void) { +void HcalHotCellMonitor::fillNevents_neighbor(const HcalTopology& topology) { // Fill Histograms showing rec hits with energy much less than neighbors' average if (debug_>0) @@ -883,7 +881,7 @@ void HcalHotCellMonitor::fillNevents_neighbor(void) { for (int subdet=1;subdet<=4;++subdet) { ieta=CalcIeta((HcalSubdetector)subdet,eta,depth+1); //converts bin to ieta if (ieta==-9999) continue; - if (!(topo_->validDetId((HcalSubdetector)subdet, ieta, iphi, depth+1))) + if (!(topology.validDetId((HcalSubdetector)subdet, ieta, iphi, depth+1))) continue; if (subdet==HcalForward) // shift HcalForward ieta by 1 for filling purposes ieta<0 ? ieta-- : ieta++; @@ -914,15 +912,14 @@ void HcalHotCellMonitor::fillNevents_neighbor(void) { return; -} // void HcalHotCellMonitor::fillNevents_neighbor(void) +} // void HcalHotCellMonitor::fillNevents_neighbor(const HcalTopology&) -void HcalHotCellMonitor::fillNevents_problemCells(void) -{ +void HcalHotCellMonitor::fillNevents_problemCells(const HcalTopology& topology){ if (debug_>0) std::cout <<" FILLING PROBLEM CELL PLOTS"<Fill(5,0,NumBadHO12); ProblemsCurrentLB->Fill(6,0,NumBadHFLUMI); -} // void HcalHotCellMonitor::fillNevents_problemCells(void) +} // void HcalHotCellMonitor::fillNevents_problemCells(const HcalTopology&) void HcalHotCellMonitor::zeroCounters(void)