test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
HcalHotCellMonitor.cc
Go to the documentation of this file.
4 
6  // Standard information, inherited from base class
7  Online_ = ps.getUntrackedParameter<bool>("online",false);
8  mergeRuns_ = ps.getUntrackedParameter<bool>("mergeRuns",false);
9  enableCleanup_ = ps.getUntrackedParameter<bool>("enableCleanup",false);
10  debug_ = ps.getUntrackedParameter<int>("debug",0);
11  makeDiagnostics_ = ps.getUntrackedParameter<bool>("makeDiagnostics",false);
12  prefixME_ = ps.getUntrackedParameter<std::string>("subSystemFolder","Hcal/");
13  if (prefixME_.substr(prefixME_.size()-1,prefixME_.size())!="/")
14  prefixME_.append("/");
15  subdir_ = ps.getUntrackedParameter<std::string>("TaskFolder","HotCellMonitor_Hcal/"); // HotCellMonitor_Hcal
16  if (subdir_.size()>0 && subdir_.substr(subdir_.size()-1,subdir_.size())!="/")
17  subdir_.append("/");
18  subdir_=prefixME_+subdir_;
19  AllowedCalibTypes_ = ps.getUntrackedParameter<std::vector<int> > ("AllowedCalibTypes");
20  skipOutOfOrderLS_ = ps.getUntrackedParameter<bool>("skipOutOfOrderLS",true);
21  NLumiBlocks_ = ps.getUntrackedParameter<int>("NLumiBlocks",4000);
22 
23  // Collection type info
24  hbheRechitLabel_ = ps.getUntrackedParameter<edm::InputTag>("hbheRechitLabel");
25  hoRechitLabel_ = ps.getUntrackedParameter<edm::InputTag>("hoRechitLabel");
26  hfRechitLabel_ = ps.getUntrackedParameter<edm::InputTag>("hfRechitLabel");
27 
28  // register for data access
29  tok_hbhe_ = consumes<HBHERecHitCollection>(hbheRechitLabel_);
30  tok_ho_ = consumes<HORecHitCollection>(hoRechitLabel_);
31  tok_hf_ = consumes<HFRecHitCollection>(hfRechitLabel_);
32 
33  // Hot Cell-specific tests
34  minEvents_ = ps.getUntrackedParameter<int>("minEvents");
35  minErrorFlag_ = ps.getUntrackedParameter<double>("minErrorFlag",1);
36 
37  // exclude HO ring 2
38  excludeHORing2_ = ps.getUntrackedParameter<bool>("excludeHORing2",false);
39 
40 
41  // Set which hot cell checks will be performed
42  test_persistent_ = ps.getUntrackedParameter<bool>("test_persistent"); // true by default
43  test_neighbor_ = ps.getUntrackedParameter<bool>("test_neighbor"); // false by default; test disabled
44  test_energy_ = ps.getUntrackedParameter<bool>("test_energy"); // true by default
45  test_et_ = ps.getUntrackedParameter<bool>("test_et"); // true by default
46 
47 
48  // rechit energy test -- cell must be above threshold value for a number of consecutive events to be considered hot
49  energyThreshold_ = ps.getUntrackedParameter<double>("energyThreshold");
50  ETThreshold_ = ps.getUntrackedParameter<double>("ETThreshold");
51 
52  HBenergyThreshold_ = ps.getUntrackedParameter<double>("energyThreshold_HB",energyThreshold_);
53  HEenergyThreshold_ = ps.getUntrackedParameter<double>("energyThreshold_HE",energyThreshold_);
54  HOenergyThreshold_ = ps.getUntrackedParameter<double>("energyThreshold_HO",energyThreshold_);
55  HFenergyThreshold_ = ps.getUntrackedParameter<double>("energyThreshold_HF",energyThreshold_);
56 
57  HBETThreshold_ = ps.getUntrackedParameter<double>("ETThreshold_HB",ETThreshold_);
58  HEETThreshold_ = ps.getUntrackedParameter<double>("ETThreshold_HE",ETThreshold_);
59  HOETThreshold_ = ps.getUntrackedParameter<double>("ETThreshold_HO",ETThreshold_);
60  HFETThreshold_ = ps.getUntrackedParameter<double>("ETThreshold_HF",ETThreshold_);
61 
62  // rechit event-by-event energy test -- cell must be above threshold to be considered hot
63  persistentThreshold_ = ps.getUntrackedParameter<double>("persistentThreshold");
64 
65  HBpersistentThreshold_ = ps.getUntrackedParameter<double>("persistentThreshold_HB",persistentThreshold_);
66  HEpersistentThreshold_ = ps.getUntrackedParameter<double>("persistentThreshold_HE",persistentThreshold_);
67  HOpersistentThreshold_ = ps.getUntrackedParameter<double>("persistentThreshold_HO",persistentThreshold_);
68  HFpersistentThreshold_ = ps.getUntrackedParameter<double>("persistentThreshold_HF",persistentThreshold_);
69 
70  persistentETThreshold_ = ps.getUntrackedParameter<double>("persistentETThreshold");
71 
72  HBpersistentETThreshold_ = ps.getUntrackedParameter<double>("persistentETThreshold_HB",persistentETThreshold_);
73  HEpersistentETThreshold_ = ps.getUntrackedParameter<double>("persistentETThreshold_HE",persistentETThreshold_);
74  HOpersistentETThreshold_ = ps.getUntrackedParameter<double>("persistentETThreshold_HO",persistentETThreshold_);
75  HFpersistentETThreshold_ = ps.getUntrackedParameter<double>("persistentETThreshold_HF",persistentETThreshold_);
76 
77  HFfarfwdScale_ = ps.getUntrackedParameter<double>("HFfwdScale",2.);
78  SiPMscale_ = ps.getUntrackedParameter<double>("HO_SiPMscalefactor",1.); // default scale factor of 4?
79 
80  // neighboring-cell tests
81  HBHENeighborParams_.DeltaIphi = ps.getUntrackedParameter<int>("HBHE_neighbor_deltaIphi", 1);
82  HBHENeighborParams_.DeltaIeta = ps.getUntrackedParameter<int>("HBHE_neighbor_deltaIeta", 1);
83  HBHENeighborParams_.DeltaDepth = ps.getUntrackedParameter<int>("HBHE_neighbor_deltaDepth", 2);
84  HBHENeighborParams_.minCellEnergy = ps.getUntrackedParameter<double>("HBHE_neighbor_minCellEnergy",3.);
85  HBHENeighborParams_.minNeighborEnergy = ps.getUntrackedParameter<double>("HBHE_neighbor_minNeighborEnergy",0.);
86  HBHENeighborParams_.maxEnergy = ps.getUntrackedParameter<double>("HBHE_neighbor_maxEnergy",100);
87  HBHENeighborParams_.HotEnergyFrac = ps.getUntrackedParameter<double>("HBHE_neighbor_HotEnergyFrac",0.05);
88 
89  HONeighborParams_.DeltaIphi = ps.getUntrackedParameter<int>("HO_neighbor_deltaIphi", 1);
90  HONeighborParams_.DeltaIeta = ps.getUntrackedParameter<int>("HO_neighbor_deltaIeta", 1);
91  HONeighborParams_.DeltaDepth = ps.getUntrackedParameter<int>("HO_neighbor_deltaDepth", 0);
92  HONeighborParams_.minCellEnergy = ps.getUntrackedParameter<double>("HO_neighbor_minCellEnergy",10.);
93  HONeighborParams_.minNeighborEnergy = ps.getUntrackedParameter<double>("HO_neighbor_minNeighborEnergy",0.);
94  HONeighborParams_.maxEnergy = ps.getUntrackedParameter<double>("HO_neighbor_maxEnergy",100);
95  HONeighborParams_.HotEnergyFrac = ps.getUntrackedParameter<double>("HO_neighbor_HotEnergyFrac",0.01);
96 
97  HFNeighborParams_.DeltaIphi = ps.getUntrackedParameter<int>("HF_neighbor_deltaIphi", 1);
98  HFNeighborParams_.DeltaIeta = ps.getUntrackedParameter<int>("HF_neighbor_deltaIeta", 1);
99  HFNeighborParams_.DeltaDepth = ps.getUntrackedParameter<int>("HF_neighbor_deltaDepth", 1);
100  HFNeighborParams_.minCellEnergy = ps.getUntrackedParameter<double>("HF_neighbor_minCellEnergy",10.);
101  HFNeighborParams_.minNeighborEnergy = ps.getUntrackedParameter<double>("HF_neighbor_minNeighborEnergy",0.);
102  HFNeighborParams_.maxEnergy = ps.getUntrackedParameter<double>("HF_neighbor_maxEnergy",100);
103  HFNeighborParams_.HotEnergyFrac = ps.getUntrackedParameter<double>("HF_neighbor_HotEnergyFrac",0.01);
104  setupDone_=false;
105 } //constructor
106 
108 
109 
110 /* ------------------------------------ */
111 
113 {
114  if (setupDone_)
115  return;
116  setupDone_ = true;
117  // Call base class setup
119 
120  if (debug_>1)
121  std::cout <<"<HcalHotCellMonitor::setup> Setting up histograms"<<std::endl;
122 
124 
125  MonitorElement* me;
126  me=ib.bookFloat("minErrorFractionPerLumiSection");
127  me->Fill(minErrorFlag_);
128  // Create plots of problems vs LB
129 
130  // 1D plots count number of bad cells vs. luminosity block
131  ProblemsVsLB=ib.bookProfile("TotalHotCells_HCAL_vs_LS",
132  "Total Number of Hot Hcal Cells vs lumi section",
133  NLumiBlocks_,0.5,NLumiBlocks_+0.5,100,0,10000);
134 
135  ProblemsVsLB_HB=ib.bookProfile("TotalHotCells_HB_vs_LS",
136  "Total Number of Hot HB Cells vs lumi section",
137  NLumiBlocks_,0.5,NLumiBlocks_+0.5,100,0,3000);
138  ProblemsVsLB_HE=ib.bookProfile("TotalHotCells_HE_vs_LS",
139  "Total Number of Hot HE Cells vs lumi section",
140  NLumiBlocks_,0.5,NLumiBlocks_+0.5,100,0,3000);
141  ProblemsVsLB_HO=ib.bookProfile("TotalHotCells_HO_vs_LS",
142  "Total Number of Hot HO Cells vs lumi section",
143  NLumiBlocks_,0.5,NLumiBlocks_+0.5,100,0,3000);
144  ProblemsVsLB_HF=ib.bookProfile("TotalHotCells_HF_vs_LS",
145  "Total Number of Hot HF Cells vs lumi section",
146  NLumiBlocks_,0.5,NLumiBlocks_+0.5,100,0,2000);
147  ProblemsVsLB_HBHEHF=ib.bookProfile("TotalHotCells_HBHEHF_vs_LS",
148  "Total Number of Hot HBHEHF Cells vs lumi section",
149  NLumiBlocks_,0.5,NLumiBlocks_+0.5,100,0,2000);
150 
151  ProblemsVsLB->getTProfile()->SetMarkerStyle(20);
152  ProblemsVsLB_HB->getTProfile()->SetMarkerStyle(20);
153  ProblemsVsLB_HE->getTProfile()->SetMarkerStyle(20);
154  ProblemsVsLB_HO->getTProfile()->SetMarkerStyle(20);
155  ProblemsVsLB_HF->getTProfile()->SetMarkerStyle(20);
156  ProblemsVsLB_HBHEHF->getTProfile()->SetMarkerStyle(20);
157 
158  // Set up plots for each failure mode of hot cells
159  std::stringstream units; // We'll need to set the titles individually, rather than passing units to SetupEtaPhiHists (since this also would affect the name of the histograms)
160 
161  ib.setCurrentFolder(subdir_+"hot_rechit_above_threshold");
162  me=ib.bookInt("HotCellAboveThresholdTestEnabled");
163  me->Fill(0);
164 
165  if (test_energy_)
166  {
167  me->Fill(1);
169  "Hot Cells Above Energy Threshold","");
170  //setMinMaxHists2D(AboveEnergyThresholdCellsByDepth,0.,1.);
171 
172  // set more descriptive titles for plots
173  units.str("");
174  units<<"Hot Cells: Depth 1 -- HB > "<<HBenergyThreshold_<<" GeV, HE > "<<HEenergyThreshold_<<" GeV, HF > "<<HFenergyThreshold_<<" GeV";
175  AboveEnergyThresholdCellsByDepth.depth[0]->setTitle(units.str().c_str());
176  units.str("");
177  units<<"Hot Cells: Depth 2 -- HB > "<<HBenergyThreshold_<<" GeV, HE > "<<HEenergyThreshold_<<" GeV, HF > "<<HFenergyThreshold_<<" GeV";
178  AboveEnergyThresholdCellsByDepth.depth[1]->setTitle(units.str().c_str());
179  units.str("");
180  units<<"Hot Cells: Depth 3 -- HE > "<<HEenergyThreshold_<<" GeV";
181  AboveEnergyThresholdCellsByDepth.depth[2]->setTitle(units.str().c_str());
182  units.str("");
183  units<<"Hot Cells: HO > "<<HOenergyThreshold_<<" GeV";
184  AboveEnergyThresholdCellsByDepth.depth[3]->setTitle(units.str().c_str());
185  units.str("");
186  }
187  if (test_et_)
188  {
189  me->Fill(1);
191  "Hot Cells Above ET Threshold","");
192  //setMinMaxHists2D(AboveETThresholdCellsByDepth,0.,1.);
193 
194  // set more descriptive titles for plots
195  units.str("");
196  units<<"Hot Cells: Depth 1 -- HB > "<<HBETThreshold_<<" GeV (ET), HE > "<<HEETThreshold_<<" GeV (ET), HF > "<<HFETThreshold_<<" GeV (ET)";
197  AboveETThresholdCellsByDepth.depth[0]->setTitle(units.str().c_str());
198  units.str("");
199  units<<"Hot Cells: Depth 2 -- HB > "<<HBETThreshold_<<" GeV (ET), HE > "<<HEETThreshold_<<" GeV (ET), HF > "<<HFETThreshold_<<" GeV (ET)";
200  AboveETThresholdCellsByDepth.depth[1]->setTitle(units.str().c_str());
201  units.str("");
202  units<<"Hot Cells: Depth 3 -- HE > "<<HEETThreshold_<<" GeV (ET)";
203  AboveETThresholdCellsByDepth.depth[2]->setTitle(units.str().c_str());
204  units.str("");
205  units<<"Hot Cells: HO > "<<HOETThreshold_<<" GeV (ET)";
206  AboveETThresholdCellsByDepth.depth[3]->setTitle(units.str().c_str());
207  units.str("");
208  }
209 
210  ib.setCurrentFolder(subdir_+"hot_rechit_always_above_threshold");
211  me=ib.bookInt("PersistentHotCellTestEnabled");
212  me->Fill(0);
213  if (test_persistent_)
214  {
215  me->Fill(1);
216  me=ib.bookInt("minEventsPerLS");
217  me->Fill(minEvents_);
218 
219  if (test_energy_) {
221  "Hot Cells Persistently Above Energy Threshold","");
222  //setMinMaxHists2D(AbovePersistentThresholdCellsByDepth,0.,1.);
223 
224  // set more descriptive titles for plots
225  units.str("");
226  units<<"Hot Cells: Depth 1 -- HB > "<<HBpersistentThreshold_<<" GeV, HE > "<<HEpersistentThreshold_<<", HF > "<<HFpersistentThreshold_<<" GeV for 1 full Lumi Block";
227  AbovePersistentThresholdCellsByDepth.depth[0]->setTitle(units.str().c_str());
228  units.str("");
229  units<<"Hot Cells: Depth 2 -- HB > "<<HBpersistentThreshold_<<" GeV, HE > "<<HEpersistentThreshold_<<", HF > "<<HFpersistentThreshold_<<" GeV for 1 full Lumi Block";
230  AbovePersistentThresholdCellsByDepth.depth[1]->setTitle(units.str().c_str());
231  units.str("");
232  units<<"Hot Cells: Depth 3 -- HE > "<<HEpersistentThreshold_<<" GeV for 1 full Lumi Block";
233  AbovePersistentThresholdCellsByDepth.depth[2]->setTitle(units.str().c_str());
234  units.str("");
235  units<<"Hot Cells: HO > "<<HOpersistentThreshold_<<" GeV for 1 full Lumi Block";
236  AbovePersistentThresholdCellsByDepth.depth[3]->setTitle(units.str().c_str());
237  units.str("");
238  }
239 
240  if (test_et_) {
242  "Hot Cells Persistently Above ET Threshold","");
243  //setMinMaxHists2D(AbovePersistentThresholdCellsByDepth,0.,1.);
244 
245  // set more descriptive titles for plots
246  units.str("");
247  units<<"Hot Cells: Depth 1 -- HB > "<<HBpersistentETThreshold_<<" GeV (ET), HE > "<<HEpersistentETThreshold_<<" GeV (ET), HF > "<<HFpersistentETThreshold_<<" GeV (ET) for 1 full Lumi Block";
248  AbovePersistentETThresholdCellsByDepth.depth[0]->setTitle(units.str().c_str());
249  units.str("");
250  units<<"Hot Cells: Depth 2 -- HB > "<<HBpersistentETThreshold_<<" GeV (ET), HE > "<<HEpersistentETThreshold_<<" GeV (ET), HF > "<<HFpersistentETThreshold_<<" GeV (ET) for 1 full Lumi Block";
251  AbovePersistentETThresholdCellsByDepth.depth[1]->setTitle(units.str().c_str());
252  units.str("");
253  units<<"Hot Cells: Depth 3 -- HE > "<<HEpersistentETThreshold_<<" GeV (ET) for 1 full Lumi Block";
254  AbovePersistentETThresholdCellsByDepth.depth[2]->setTitle(units.str().c_str());
255  units.str("");
256  units<<"Hot Cells: HO > "<<HOpersistentETThreshold_<<" GeV (ET) for 1 full Lumi Block";
257  AbovePersistentETThresholdCellsByDepth.depth[3]->setTitle(units.str().c_str());
258  units.str("");
259  }
260  }
261 
262  ib.setCurrentFolder(subdir_+"hot_neighbortest");
263  me=ib.bookInt("NeighborTestEnabled");
264  me->Fill(0);
265  if (test_neighbor_)
266  me->Fill(1);
268  {
269  SetupEtaPhiHists(ib,AboveNeighborsHotCellsByDepth,"Hot Cells Failing Neighbor Test","");
270  if (makeDiagnostics_)
271  {
272  d_HBenergyVsNeighbor=ib.book1D("NeighborSumOverEnergyHB","HB Neighbor Sum Energy/Cell Energy;sum(neighbors)/E_cell",500,0,10);
273  d_HEenergyVsNeighbor=ib.book1D("NeighborSumOverEnergyHE","HE Neighbor Sum Energy/Cell Energy;sum(neighbors)/E_cell",500,0,10);
274  d_HOenergyVsNeighbor=ib.book1D("NeighborSumOverEnergyHO","HO Neighbor Sum Energy/Cell Energy;sum(neighbors)/E_cell",500,0,10);
275  d_HFenergyVsNeighbor=ib.book1D("NeighborSumOverEnergyHF","HF Neighbor Sum Energy/Cell Energy;sum(neighbors)/E_cell",500,0,10);
276  }
277  } // if (test_neighbor_ || makeDiagnostics_)
278 
279  this->reset();
280 } // void HcalHotCellMonitor::setup(...)
281 
283 {
284  if (debug_>1) std::cout <<"HcalHotCellMonitor::bookHistograms"<<std::endl;
286 
287  if (tevt_==0) this->setup(ib); // set up histograms if they have not been created before
288  if (mergeRuns_==false)
289  this->reset();
290 
291  return;
292 } //void HcalHotCellMonitor::bookHistograms(...)
293 
294 
295 /* --------------------------- */
296 
298 {
300  zeroCounters();
301 
302  // now reset all the MonitorElements
303 
304  // resetting eta-phi histograms
307 
308  if (test_energy_ )
310 
311  if ( test_et_ )
313 
314  if (test_persistent_)
315  {
318  }
319  if (makeDiagnostics_)
320  {
325  }
326 }
327 
329  const edm::EventSetup& c)
330 {
331  if (LumiInOrder(lumiSeg.luminosityBlock())==false) return;
333  zeroCounters(); // zero hot cell counters at the start of each luminosity block
335  return;
336 } // beginLuminosityBlock(...)
337 
338 
340  const edm::EventSetup& c)
341 {
342  //FIX with check on whether LB already processed
343 
344  if (LumiInOrder(lumiSeg.luminosityBlock())==false) return;
345 
347  c.get<HcalRecNumberingRecord>().get(topo);
348 
350  fillNevents_neighbor(*topo);
351 
352  if (test_energy_ || test_et_)
353  fillNevents_energy(*topo);
354 
355  if (test_persistent_)
357 
359  return;
360 } //endLuminosityBlock(...)
361 
362 
363 
364 /* ------------------------- */
365 
367 {
368  // moved database dumps to client; we want to be able to sum over results in offline
369  return;
370 
371 } // void HcalHotCellMonitor::done()
372 
373 
375 {
377  if (!IsAllowedCalibType()) return;
378  if (LumiInOrder(e.luminosityBlock())==false) return;
379 
380  // try to get rechits
384 
385  if (!(e.getByToken(tok_hbhe_,hbhe_rechit)))
386  {
387  edm::LogWarning("HcalHotCellMonitor")<< hbheRechitLabel_<<" hbhe_rechit not available";
388  return;
389  }
390 
391  if (!(e.getByToken(tok_hf_,hf_rechit)))
392  {
393  edm::LogWarning("HcalHotCellMonitor")<< hfRechitLabel_<<" hf_rechit not available";
394  return;
395  }
396  if (!(e.getByToken(tok_ho_,ho_rechit)))
397  {
398  edm::LogWarning("HcalHotCellMonitor")<< hoRechitLabel_<<" ho_rechit not available";
399  return;
400  }
401 
402  // Good event found; increment counter (via base class analyze method)
404  s.get<HcalRecNumberingRecord>().get(topo);
405 
406  // HcalBaseDQMonitor::analyze(e,s);
407  if (debug_>1) std::cout <<"\t<HcalHotCellMonitor::analyze> Processing good event! event # = "<<ievt_<<std::endl;
408 
409  processEvent(*hbhe_rechit, *ho_rechit, *hf_rechit, *topo);
410 
411 } // void HcalHotCellMonitor::analyze(...)
412 
413 
414 
415 
416 /* -------------------------------- */
417 
418 
420  const HORecHitCollection& hoHits,
421  const HFRecHitCollection& hfHits,
422  const HcalTopology& topology) {
423 
424  if (debug_>1) std::cout <<"<HcalHotCellMonitor::processEvent> Processing event..."<<std::endl;
425 
426  // Search for hot cells above a certain energy
428  processEvent_rechitenergy(hbHits, hoHits,hfHits, topology);
429  }
430 
431  return;
432 } // void HcalHotCellMonitor::processEvent(...)
433 
434 
435 /* --------------------------------------- */
436 
437 
439  const HORecHitCollection& hoHits,
440  const HFRecHitCollection& hfHits,
441  const HcalTopology& topology) {
442 
443  // Looks at rechits of cells and compares to threshold energies.
444  // Cells above thresholds get marked as hot candidates
445 
446  if (debug_>1) std::cout <<"<HcalHotCellMonitor::processEvent_rechitenergy> Processing rechits..."<<std::endl;
447 
448  // loop over HBHE
449  for (HBHERecHitCollection::const_iterator HBHEiter=hbheHits.begin(); HBHEiter!=hbheHits.end(); ++HBHEiter) { // loop over all hits
450  float en = HBHEiter->energy();
451  //float ti = HBHEiter->time();
452 
453  HcalDetId id(HBHEiter->detid().rawId());
454  int ieta = id.ieta();
455  int iphi = id.iphi();
456  int depth = id.depth();
457  std::pair<double,double> etas = topology.etaRange(id.subdet(),abs(ieta));
458  double fEta=fabs(0.5*(etas.first+etas.second));
459  float et = en/cosh(fEta);
460 
462  processHit_rechitNeighbors(HBHEiter, hbheHits, HBHENeighborParams_, topology);
463  }
464  if (id.subdet()==HcalBarrel) {
465  if (en>=HBenergyThreshold_)
466  ++aboveenergy[CalcEtaBin(id.subdet(),ieta,depth)][iphi-1][depth-1];
467  if (et>=HBETThreshold_)
468  ++aboveet[CalcEtaBin(id.subdet(),ieta,depth)][iphi-1][depth-1];
470  ++abovepersistent[CalcEtaBin(id.subdet(),ieta,depth)][iphi-1][depth-1];
472  ++abovepersistentET[CalcEtaBin(id.subdet(),ieta,depth)][iphi-1][depth-1];
473  } else if (id.subdet()==HcalEndcap) {
474  if (en>=HEenergyThreshold_)
475  ++aboveenergy[CalcEtaBin(id.subdet(),ieta,depth)][iphi-1][depth-1];
476  if (et>=HEETThreshold_)
477  ++aboveet[CalcEtaBin(id.subdet(),ieta,depth)][iphi-1][depth-1];
478  if (test_energy_)
479  if (en>=HEpersistentThreshold_)
480  ++abovepersistent[CalcEtaBin(id.subdet(),ieta,depth)][iphi-1][depth-1];
481  if (test_et_)
482  if (et>=HEpersistentETThreshold_)
483  ++abovepersistentET[CalcEtaBin(id.subdet(),ieta,depth)][iphi-1][depth-1];
484  }
485  } //for (HBHERecHitCollection::const_iterator HBHEiter=...)
486 
487  // loop over HO
488  for (HORecHitCollection::const_iterator HOiter=hoHits.begin(); HOiter!=hoHits.end(); ++HOiter) { // loop over all hits
489  float en = HOiter->energy();
490 
491  HcalDetId id(HOiter->detid().rawId());
492  int ieta = id.ieta();
493  int iphi = id.iphi();
494  int depth = id.depth();
495  std::pair<double,double> etas = topology.etaRange(id.subdet(),abs(ieta));
496  double fEta=fabs(0.5*(etas.first+etas.second));
497  float et = en/cosh(fEta);
498 
500  processHit_rechitNeighbors(HOiter, hoHits, HONeighborParams_, topology);
501 
502  if (isSiPM(ieta,iphi,depth)) {
504  ++aboveenergy[CalcEtaBin(id.subdet(),ieta,depth)][iphi-1][depth-1];
505  if (et>=HOETThreshold_*SiPMscale_)
506  ++aboveet[CalcEtaBin(id.subdet(),ieta,depth)][iphi-1][depth-1];
507  if (test_energy_)
508  if (en>=HOpersistentThreshold_*SiPMscale_)
509  ++abovepersistent[CalcEtaBin(id.subdet(),ieta,depth)][iphi-1][depth-1];
510  if (test_et_)
511  if (et>=HOpersistentETThreshold_*SiPMscale_)
512  ++abovepersistentET[CalcEtaBin(id.subdet(),ieta,depth)][iphi-1][depth-1];
513  } else {
514  // Skip HO ring 2 when required
515  if (abs(ieta)>10 && excludeHORing2_==true)
516  continue;
517 
518  if (en>=HOenergyThreshold_)
519  ++aboveenergy[CalcEtaBin(id.subdet(),ieta,depth)][iphi-1][depth-1];
520  if (et>=HOETThreshold_)
521  ++aboveet[CalcEtaBin(id.subdet(),ieta,depth)][iphi-1][depth-1];
522  if (test_energy_)
523  if (en>=HOpersistentThreshold_)
524  ++abovepersistent[CalcEtaBin(id.subdet(),ieta,depth)][iphi-1][depth-1];
525  if (test_et_)
526  if (en>=HOpersistentETThreshold_)
527  ++abovepersistentET[CalcEtaBin(id.subdet(),ieta,depth)][iphi-1][depth-1];
528  }
529  }
530 
531  // loop over HF
532  for (HFRecHitCollection::const_iterator HFiter=hfHits.begin(); HFiter!=hfHits.end(); ++HFiter) { // loop over all hits
533  float en = HFiter->energy();
535  float threshold_pers = HFpersistentThreshold_;
536  float etthreshold=HFETThreshold_;
537  HcalDetId id(HFiter->detid().rawId());
538  int ieta = id.ieta();
539  int iphi = id.iphi();
540  int depth = id.depth();
541  std::pair<double,double> etas = topology.etaRange(id.subdet(),abs(ieta));
542  double fEta=fabs(0.5*(etas.first+etas.second));
543  float et = en/cosh(fEta);
544 
546  processHit_rechitNeighbors(HFiter, hfHits, HFNeighborParams_, topology);
547 
548  if (abs(ieta)>39) { // increase the thresholds in far-forward part of HF
549  threshold*=HFfarfwdScale_;
550  threshold_pers*=HFfarfwdScale_;
551  }
552 
553  if (en>=threshold)
554  ++aboveenergy[CalcEtaBin(id.subdet(),ieta,depth)][iphi-1][depth-1];
555  if (et>=etthreshold)
556  ++aboveet[CalcEtaBin(id.subdet(),ieta,depth)][iphi-1][depth-1];
557  if (test_energy_) {
558  if (en>=threshold_pers)
559  ++abovepersistent[CalcEtaBin(id.subdet(),ieta,depth)][iphi-1][depth-1];
560  }
561  if (test_et_) {
562  if (et>=HFpersistentETThreshold_)
563  ++abovepersistentET[CalcEtaBin(id.subdet(),ieta,depth)][iphi-1][depth-1];
564  }
565  }
566 
567  // call update every event -- still necessary?
568 
569  for (unsigned int i=0;i<AbovePersistentThresholdCellsByDepth.depth.size();++i)
571  for (unsigned int i=0;i<AboveEnergyThresholdCellsByDepth.depth.size();++i)
573  for (unsigned int i=0;i<AboveETThresholdCellsByDepth.depth.size();++i)
575  for (unsigned int i=0;i<AboveNeighborsHotCellsByDepth.depth.size();++i)
577 
578  return;
579 } // void HcalHotCellMonitor::processEvent_rechitenergy
580 
581 /* --------------------------------------- */
582 
583 
584 template <class RECHIT, class RECHITCOLLECTION>
586  RECHITCOLLECTION& coll,
587  hotNeighborParams& params,
588  const HcalTopology& topology) {
589  // Compares energy to energy of neighboring cells.
590  // This is a slightly simplified version of D0's NADA algorithm
591  // 17 June 2009 -- this needs major work. I'm not sure I have the [eta][phi][depth] array mapping correct everywhere.
592  // Maybe even tear it apart and start again?
593 
594  int ieta, iphi, depth;
595  float en;
596 
597  int neighborsfound=0;
598  float enNeighbor=0;
599 
600  en = rechit->energy();
601  HcalDetId id(rechit->detid().rawId());
602  ieta = id.ieta();
603  iphi = id.iphi();
604  depth = id.depth();
605 
606  std::pair<double,double> etas = topology.etaRange(id.subdet(),abs(ieta));
607  double fEta=fabs(0.5*(etas.first+etas.second));
608 
609  float et = en/cosh(fEta);
610 
611  // Case 0: ET too low to trigger hot cell check
612  if (et<=params.minCellEnergy) return;
613 
614  // Case 1: above threshold energy; always count as hot
615  if (et>params.maxEnergy) {
616  if (makeDiagnostics_) {
617  // fill overflow bin when energy > max threshold
618  if (id.subdet()==HcalBarrel) d_HBenergyVsNeighbor->Fill(1000);
619  else if (id.subdet()==HcalEndcap) d_HEenergyVsNeighbor->Fill(1000);
620  else if (id.subdet()==HcalOuter) d_HOenergyVsNeighbor->Fill(1000);
621  else if (id.subdet()==HcalForward) d_HFenergyVsNeighbor->Fill(1000);
622  }
623  return;
624  }
625 
626  // Case 2: Search keys for neighboring cells
627 
628  neighborsfound=0;
629  enNeighbor=0;
630 
631  int mydeltaphi=params.DeltaIphi;
632  // scale appropriately for larger cells at higher eta values
633  if (abs(ieta)>39) mydeltaphi*=4;
634  else if (abs(ieta)>20) mydeltaphi*=2;
635 
636  for (int nD=-1*params.DeltaDepth;nD<=params.DeltaDepth;++nD) {
637  for (int nP =-1*mydeltaphi;nP<=mydeltaphi;++nP) {
638  for (int nE =-1*params.DeltaIeta;nE<=params.DeltaIeta;++nE) {
639  if (nD==0 && nE==0 && nP==0)
640  continue; // don't count the cell itself
641  int myphi=(nP+iphi)%72;
642  HcalDetId myid((HcalSubdetector)(1), nE+ieta, myphi, nD+depth); // HB
643  RECHIT part=coll.find(myid);
644  if (part==coll.end())
645  continue;
646  if (part->energy()<params.minNeighborEnergy)
647  continue;
648  ++neighborsfound;
649  enNeighbor+=part->energy();
650  } // loop over nE (neighbor eta)
651  } // loop over nP (neighbor phi)
652  } // loop over nD depths
653 
654  // Case 2a: Not enough good neighbors found -- do we want to implement this?
655  //if (neighborsfound==0)
656  // return;
657 
658  // Case 2b: (avg. neighbor energy)/energy too large for cell to be considered hot
659  if (makeDiagnostics_) {
660  int myval=(int)(enNeighbor/en*50);
661  if (myval<0) myval=0;
662  if (myval>499) myval=499;
663  if (enNeighbor/en<0 || enNeighbor/en>=10) return;
664  if (id.subdet()==HcalBarrel) ++hbVsNeighbor[myval];
665  else if (id.subdet()==HcalEndcap) ++heVsNeighbor[myval];
666  else if (id.subdet()==HcalOuter) ++hoVsNeighbor[myval];
667  else if (id.subdet()==HcalForward) ++hfVsNeighbor[myval];
668  }
669  if ((1.*enNeighbor/en)>params.HotEnergyFrac && en>0 && enNeighbor>0)
670  return;
671 
672  // Case 2c: Tests passed; cell marked as hot
673  aboveneighbors[CalcEtaBin(id.subdet(),ieta,depth)][iphi-1][depth-1]++;
674 
675  return;
676 } // void HcalHotCellMonitor::processEvent_rechitneighbor
677 
678 
679 /* --------------------------------------- */
680 
681 
683  // Fill Histograms showing rechits with energies > some threshold for N consecutive events
684 
685  if (levt_<minEvents_) return;
686 
687  if (debug_>0)
688  std::cout <<"<HcalHotCellMonitor::fillNevents_persistentenergy> FILLING PERSISTENT ENERGY PLOTS"<<std::endl;
689 
690  if (test_energy_) {
691  for (unsigned int h=0;h<AbovePersistentThresholdCellsByDepth.depth.size();++h)
692  AbovePersistentThresholdCellsByDepth.depth[h]->setBinContent(0,0,ievt_);
693 
694  int ieta=0;
695  int iphi=0;
696  int etabins=0;
697  int phibins=0;
698 
699  for (unsigned int depth=0;depth<AbovePersistentThresholdCellsByDepth.depth.size();++depth) {
700  etabins=AbovePersistentThresholdCellsByDepth.depth[depth]->getNbinsX();
701  phibins=AbovePersistentThresholdCellsByDepth.depth[depth]->getNbinsY();
702 
703  for (int eta=0;eta<etabins;++eta) {
704  for (int phi=0;phi<phibins;++phi) {
705  iphi=phi+1;
706  for (int subdet=1;subdet<=4;++subdet) {
707  ieta=CalcIeta((HcalSubdetector)subdet,eta,depth+1); //converts bin to ieta
708  if (ieta==-9999) continue;
709  if (!(topology.validDetId((HcalSubdetector)subdet, ieta, iphi, depth+1)))
710  continue;
711  if (subdet==HcalForward) // shift HcalForward ieta by 1 for filling purposes
712  ieta<0 ? ieta-- : ieta++;
713 
714  // MUST BE ABOVE ENERGY THRESHOLD FOR ALL N EVENTS in a luminosity block
715  if (abovepersistent[eta][phi][depth]<levt_) {
717  continue;
718  }
719  if (debug_>0) std::cout <<"HOT CELL; PERSISTENT ENERGY at subdet = "<<subdet<<", eta = "<<ieta<<", phi = "<<iphi<<" depth = "<<depth<<std::endl;
722  abovepersistent[eta][phi][depth]=0; // reset counter
723  } // for (int subdet=1; subdet<=4;++subdet)
724  } // for (int phi=0;...)
725  } // for (int eta=0;...)
726  } // for (unsigned int depth=0;...)
728  } // if (test_energy_)
729 
730  if (test_et_) {
731  for (unsigned int h=0;h<AbovePersistentETThresholdCellsByDepth.depth.size();++h)
733 
734  int ieta=0;
735  int iphi=0;
736  int etabins=0;
737  int phibins=0;
738 
739  for (unsigned int depth=0;depth<AbovePersistentETThresholdCellsByDepth.depth.size();++depth) {
740  etabins=AbovePersistentETThresholdCellsByDepth.depth[depth]->getNbinsX();
741  phibins=AbovePersistentETThresholdCellsByDepth.depth[depth]->getNbinsY();
742 
743  for (int eta=0;eta<etabins;++eta) {
744  for (int phi=0;phi<phibins;++phi) {
745  iphi=phi+1;
746  for (int subdet=1;subdet<=4;++subdet) {
747  ieta=CalcIeta((HcalSubdetector)subdet,eta,depth+1); //converts bin to ieta
748  if (ieta==-9999) continue;
749  if (!(topology.validDetId((HcalSubdetector)subdet, ieta, iphi, depth+1)))
750  continue;
751  if (subdet==HcalForward) // shift HcalForward ieta by 1 for filling purposes
752  ieta<0 ? ieta-- : ieta++;
753 
754  // MUST BE ABOVE ET THRESHOLD FOR ALL N EVENTS in a luminosity block
757  continue;
758  }
759  if (debug_>0) std::cout <<"HOT CELL; PERSISTENT ENERGY at subdet = "<<subdet<<", eta = "<<ieta<<", phi = "<<iphi<<" depth = "<<depth<<std::endl;
762  abovepersistentET[eta][phi][depth]=0; // reset counter
763  } // for (int subdet=1; subdet<=4;++subdet)
764  } // for (int phi=0;...)
765  } // for (int eta=0;...)
766  } // for (unsigned int depth=0;...)
768 
769  } // if (test_et_)
770  // Add test_ET
771  return;
772 } // void HcalHotCellMonitor::fillNevents_persistentenergy(const HcalTopology&)
773 
774 
775 
776 /* ----------------------------------- */
777 
779  // Fill Histograms showing rec hits that are above some energy value
780  // (Fill for each instance when cell is above energy; don't require it to be hot for a number of consecutive events)
781 
782  if (debug_>0)
783  std::cout <<"<HcalHotCellMonitor::fillNevents_energy> ABOVE-ENERGY-THRESHOLD PLOTS"<<std::endl;
784 
785  if (test_energy_) {
786  for (unsigned int h=0;h<AboveEnergyThresholdCellsByDepth.depth.size();++h)
787  AboveEnergyThresholdCellsByDepth.depth[h]->setBinContent(0,0,ievt_);
788  }
789  if (test_et_) {
790  for (unsigned int h=0;h<AboveETThresholdCellsByDepth.depth.size();++h)
791  AboveETThresholdCellsByDepth.depth[h]->setBinContent(0,0,ievt_);
792  }
793 
794  int ieta=0;
795  int iphi=0;
796  int etabins=0;
797  int phibins=0;
798  unsigned int maxdepth=0;
799 
800  if (test_energy_)
801  maxdepth = AboveEnergyThresholdCellsByDepth.depth.size();
802  if (maxdepth==0 && test_et_)
803  maxdepth = AboveETThresholdCellsByDepth.depth.size();
804  for (unsigned int depth=0;depth<maxdepth;++depth) {
805  if (test_energy_) {
806  etabins=AboveEnergyThresholdCellsByDepth.depth[depth]->getNbinsX();
807  phibins=AboveEnergyThresholdCellsByDepth.depth[depth]->getNbinsY();
808  }
809  if (test_et_) {
810  etabins=AboveETThresholdCellsByDepth.depth[depth]->getNbinsX();
811  phibins=AboveETThresholdCellsByDepth.depth[depth]->getNbinsY();
812  }
813  for (int eta=0;eta<etabins;++eta) {
814  for (int phi=0;phi<phibins;++phi) {
815  iphi=phi+1;
816  for (int subdet=1;subdet<=4;++subdet) {
817  ieta=CalcIeta((HcalSubdetector)subdet,eta,depth+1); //converts bin to ieta
818  if (ieta==-9999) continue;
819  if (!(topology.validDetId((HcalSubdetector)subdet, ieta, iphi, depth+1)))
820  continue;
821  if (subdet==HcalForward) // shift HcalForward ieta by 1 for filling purposes
822  ieta<0 ? ieta-- : ieta++;
823 
824  if (test_energy_) {
825  if (aboveenergy[eta][phi][depth]>0) {
826  if (debug_>2)
827  std::cout <<"HOT CELL; ABOVE ENERGY THRESHOLD at subdet = "<<subdet<<", eta = "<<ieta<<", phi = "<<iphi<<" depth = "<<depth+1<<" ABOVE THRESHOLD IN "<<aboveenergy[eta][phi][depth]<<" EVENTS"<<std::endl;
829  aboveenergy[eta][phi][depth]=0;
830  } // if (aboveenergy[eta][phi][depth])
831  } // if (test_energy_)
832  if (test_et_) {
833  if (aboveet[eta][phi][depth]>0) {
834  if (debug_>2)
835  std::cout <<"HOT CELL; ABOVE ET THRESHOLD at subdet = "<<subdet<<", eta = "<<ieta<<", phi = "<<iphi<<" depth = "<<depth+1<<" ABOVE THRESHOLD IN "<<aboveet[eta][phi][depth]<<" EVENTS"<<std::endl;
837  aboveet[eta][phi][depth]=0;
838  } // if (aboveet[eta][phi][depth])
839  } // if (test_et_)
840  } // for (int subdet=0)
841  } // for (int phi=0;...)
842  } // for (int eta=0;...)
843  } // for (int depth=0;...)
844 
845  if (test_energy_)
847 
848  if (test_et_)
850 
851  return;
852 
853 
854 } // void HcalHotCellMonitor::fillNevents_energy(const HcalTopology&)
855 
856 
857 
858 /* ----------------------------------- */
859 
861  // Fill Histograms showing rec hits with energy much less than neighbors' average
862 
863  if (debug_>0)
864  std::cout <<"<HcalHotCellMonitor::fillNevents_neighbor> FILLING ABOVE-NEIGHBOR-ENERGY PLOTS"<<std::endl;
865 
866  for (unsigned int h=0;h<AboveNeighborsHotCellsByDepth.depth.size();++h)
867  AboveNeighborsHotCellsByDepth.depth[h]->setBinContent(0,0,ievt_);
868 
869  int ieta=0;
870  int iphi=0;
871  int etabins=0;
872  int phibins=0;
873 
874  for (unsigned int depth=0;depth<AboveNeighborsHotCellsByDepth.depth.size();++depth) {
875  etabins=AboveNeighborsHotCellsByDepth.depth[depth]->getNbinsX();
876  phibins=AboveNeighborsHotCellsByDepth.depth[depth]->getNbinsY();
877 
878  for (int eta=0;eta<etabins;++eta) {
879  for (int phi=0;phi<phibins;++phi) {
880  iphi=phi+1;
881  for (int subdet=1;subdet<=4;++subdet) {
882  ieta=CalcIeta((HcalSubdetector)subdet,eta,depth+1); //converts bin to ieta
883  if (ieta==-9999) continue;
884  if (!(topology.validDetId((HcalSubdetector)subdet, ieta, iphi, depth+1)))
885  continue;
886  if (subdet==HcalForward) // shift HcalForward ieta by 1 for filling purposes
887  ieta<0 ? ieta-- : ieta++;
888 
889  if (aboveneighbors[eta][phi][depth]>0) {
890  if (debug_>2) std::cout <<"HOT CELL; ABOVE NEIGHBORS at eta = "<<ieta<<", phi = "<<iphi<<" depth = "<<(depth>4 ? depth+1 : depth-3)<<std::endl;
892  //reset counter
894  } // if (aboveneighbors[eta][phi][mydepth]>0)
895  } // for (int subdet=1;...)
896  } // for (int phi=0;...)
897  } // for (int eta=0;...)
898  } // for (unsigned int depth=0;...)
900 
901  if (!makeDiagnostics_) return;
902  for (int i=0;i<500;++i) {
904  hbVsNeighbor[i]=0;
906  heVsNeighbor[i]=0;
908  hoVsNeighbor[i]=0;
910  hfVsNeighbor[i]=0;
911  }
912 
913  return;
914 
915 } // void HcalHotCellMonitor::fillNevents_neighbor(const HcalTopology&)
916 
917 
918 
919 
920 
921 
923  if (debug_>0)
924  std::cout <<"<HcalHotCellMonitor::fillNevents_problemCells> FILLING PROBLEM CELL PLOTS"<<std::endl;
925 
926  if (ievt_==0) return; // no events; no need to bother with this
927 
928  int ieta=0;
929  int etabins=0;
930  int phibins=0;
931  bool problemvalue=false;
932 
933  // Count problem cells in each subdetector
934  int NumBadHB=0;
935  int NumBadHE=0;
936  int NumBadHO=0;
937  int NumBadHF=0;
938  int NumBadHO0=0;
939  int NumBadHO12=0;
940  int NumBadHFLUMI=0;
941 
942  unsigned int DEPTH = 0;
943 
944  if (test_persistent_)
945  {
946  if (test_energy_)
948  else if (test_et_)
950  }
951  else if (test_energy_ && DEPTH==0) DEPTH = AboveEnergyThresholdCellsByDepth.depth.size();
952  else if (test_et_ && DEPTH==0) DEPTH = AboveETThresholdCellsByDepth.depth.size();
953  else if (test_neighbor_ && DEPTH==0) DEPTH = AboveNeighborsHotCellsByDepth.depth.size();
954 
955  if (DEPTH==0) return;
956 
957  for (unsigned int depth=0;depth<DEPTH;++depth)
958  {
959  if (test_persistent_)
960  {
961  if (test_energy_)
962  {
963  etabins=AbovePersistentThresholdCellsByDepth.depth[depth]->getNbinsX();
964  phibins=AbovePersistentThresholdCellsByDepth.depth[depth]->getNbinsY();
965  }
966  else if (test_et_)
967  {
968  etabins=AbovePersistentETThresholdCellsByDepth.depth[depth]->getNbinsX();
969  phibins=AbovePersistentETThresholdCellsByDepth.depth[depth]->getNbinsY();
970  }
971  }
972 
973  if (test_neighbor_ && (etabins==0 || phibins==0))
974  {
975  etabins=AboveNeighborsHotCellsByDepth.depth[depth]->getNbinsX();
976  phibins=AboveNeighborsHotCellsByDepth.depth[depth]->getNbinsY();
977  }
978 
979  if (test_energy_ && (etabins==0 || phibins==0))
980  {
981  etabins=AboveEnergyThresholdCellsByDepth.depth[depth]->getNbinsX();
982  phibins=AboveEnergyThresholdCellsByDepth.depth[depth]->getNbinsY();
983  }
984 
985  if (test_et_ && (etabins==0 || phibins==0))
986  {
987  etabins=AboveETThresholdCellsByDepth.depth[depth]->getNbinsX();
988  phibins=AboveETThresholdCellsByDepth.depth[depth]->getNbinsY();
989  }
990 
991  for (int eta=0;eta<etabins;++eta)
992  {
993  ieta=CalcIeta(eta,depth+1);
994  if (ieta==-9999) continue;
995  for (int phi=0;phi<phibins;++phi)
996  {
997  if (abs(ieta)>20 && phi%2==1) continue; //skip non-physical cells
998  else if (abs(ieta)>39 && (phi+1)%4!=3) continue;
999  // find problem rate for particular cell
1000  problemvalue=false;
1002  problemvalue=true;
1004  problemvalue=true;
1006  problemvalue=true;
1008  problemvalue=true;
1010  problemvalue=true;
1011  if (problemvalue==false) continue;
1012  if (isHB(eta,depth+1)) ++NumBadHB;
1013  else if (isHE(eta,depth+1))
1014  ++NumBadHE;
1015  else if (isHO(eta,depth+1))
1016  {
1017  ++NumBadHO;
1018  if (abs(ieta)<5) ++NumBadHO0;
1019  else ++NumBadHO12;
1020  }
1021  else if (isHF(eta,depth+1))
1022  {
1023  ++NumBadHF;
1024  if (depth+1==1 && (abs(ieta)==33 || abs(ieta)==34)) ++NumBadHFLUMI;
1025  else if (depth+1==2 && (abs(ieta)==35 || abs(ieta)==36)) ++NumBadHFLUMI;
1026  }
1027  } // for (int phi=0;...)
1028  } //for (int eta=0;...)
1029  } // for (int depth=0;...)
1030 
1031  if (debug_>2) std::cout <<"<HcalHotCellMonitor::fillNevents_problemCells> Num Bad HB = "<<NumBadHB<<" Num Bad HE = "<<NumBadHE<<" Num Bad HO = "<<NumBadHO<<" Num Bad HF = "<<NumBadHF<<" CURRENT LS = "<<currentLS<<std::endl;
1032  // Fill number of problem cells
1033  ProblemsVsLB_HB->Fill(currentLS,NumBadHB);
1034  ProblemsVsLB_HE->Fill(currentLS,NumBadHE);
1035  ProblemsVsLB_HO->Fill(currentLS,NumBadHO);
1036  ProblemsVsLB_HF->Fill(currentLS,NumBadHF);
1037  ProblemsVsLB_HBHEHF->Fill(currentLS,NumBadHB+NumBadHE+NumBadHF);
1038  ProblemsVsLB->Fill(currentLS,NumBadHB+NumBadHE+NumBadHO+NumBadHF);
1039 
1040  ProblemsCurrentLB->Fill(-1,-1,levt_);
1041  ProblemsCurrentLB->Fill(0,0,NumBadHB);
1042  ProblemsCurrentLB->Fill(1,0,NumBadHE);
1043  ProblemsCurrentLB->Fill(2,0,NumBadHO);
1044  ProblemsCurrentLB->Fill(3,0,NumBadHF);
1045  ProblemsCurrentLB->Fill(4,0,NumBadHO0);
1046  ProblemsCurrentLB->Fill(5,0,NumBadHO12);
1047  ProblemsCurrentLB->Fill(6,0,NumBadHFLUMI);
1048 
1049 } // void HcalHotCellMonitor::fillNevents_problemCells(const HcalTopology&)
1050 
1051 
1053 {
1054 
1055  // zero all counters
1056  for (int i=0;i<85;++i)
1057  {
1058  for (int j=0;j<72;++j)
1059  {
1060  for (int k=0;k<4;++k)
1061  {
1062  abovepersistent[i][j][k]=0;
1063  abovepersistentET[i][j][k]=0;
1064  aboveneighbors[i][j][k]=0;
1065  aboveenergy[i][j][k]=0;
1066  aboveet[i][j][k]=0;
1067  rechit_occupancy_sum[i][j][k]=0;
1068  }
1069  }
1070  }
1071 
1072  for (int i=0;i<500;++i)
1073  {
1074  hbVsNeighbor[i]=0;
1075  heVsNeighbor[i]=0;
1076  hoVsNeighbor[i]=0;
1077  hfVsNeighbor[i]=0;
1078  }
1079  return;
1080 
1081 } // void HcalHotCellMonitor::zeroCounters()
1082 
1084 {
1085  // Anything to do here?
1086 }
1087 
1089 {
1090  if (debug_>0) std::cout <<"HcalHotCellMonitor::endJob()"<<std::endl;
1091  if (enableCleanup_) cleanup(); // when do we force cleanup?
1092 }
1093 
1094 /*void HcalHotCellMonitor::cleanup()
1095 {
1096  if (debug_>0) std::cout <<"HcalHotCellMonitor::cleanup()"<<std::endl;
1097  if (!enableCleanup_) return;
1098  if (dbe_)
1099  {
1100  // removeContents doesn't remove subdirectories
1101  dbe_->setCurrentFolder(subdir_);
1102  dbe_->removeContents();
1103  dbe_->setCurrentFolder(subdir_+"hot_rechit_above_threshold");
1104  dbe_->removeContents();
1105  dbe_->setCurrentFolder(subdir_+"hot_rechit_always_above_threshold");
1106  dbe_->removeContents();
1107  dbe_->setCurrentFolder(subdir_+"hot_neighbortest");
1108  dbe_->removeContents();
1109  dbe_->setCurrentFolder(subdir_+"LSvalues");
1110  dbe_->removeContents();
1111  }
1112 }*/ // cleanup
1113 
1115 {
1116 
1117  // first reset base class objects
1118  //FIX HcalBaseMonitor::periodicReset();
1119 
1120  // then reset the temporary histograms
1121  zeroCounters();
1122 
1123  // now reset all the MonitorElements
1124 
1125  // resetting eta-phi histograms
1126  if (test_neighbor_)
1130  if (test_et_ || makeDiagnostics_)
1132  if (test_persistent_)
1133  {
1135  if (test_et_)
1137  }
1138  return;
1139 }
bool isHO(int etabin, int depth)
void processEvent(const HBHERecHitCollection &hbHits, const HORecHitCollection &hoHits, const HFRecHitCollection &hfHits, const HcalTopology &topology)
int abovepersistent[85][72][4]
T getUntrackedParameter(std::string const &, T const &) const
int i
Definition: DBlmapReader.cc:9
EtaPhiHists AboveEnergyThresholdCellsByDepth
bool LumiInOrder(int lumisec)
void bookHistograms(DQMStore::IBooker &ib, const edm::Run &run, const edm::EventSetup &c)
MonitorElement * ProblemsCurrentLB
int aboveneighbors[85][72][4]
edm::InputTag hoRechitLabel_
int ib
Definition: cuy.py:660
hotNeighborParams HONeighborParams_
virtual void analyze(const edm::Event &e, const edm::EventSetup &c)
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
CaloTopology const * topology(0)
MonitorElement * bookProfile(Args &&...args)
Definition: DQMStore.h:157
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:462
MonitorElement * ProblemsVsLB_HF
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
bool validDetId(HcalSubdetector subdet, int ieta, int iphi, int depth) const
std::vector< int > AllowedCalibTypes_
int abovepersistentET[85][72][4]
void Reset(void)
int rechit_occupancy_sum[85][72][4]
virtual void cleanup(void)
virtual void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &)
MonitorElement * bookInt(Args &&...args)
Definition: DQMStore.h:103
std::vector< HBHERecHit >::const_iterator const_iterator
void fillNevents_problemCells(const HcalTopology &)
edm::LuminosityBlockNumber_t luminosityBlock() const
Definition: EventBase.h:62
EtaPhiHists AbovePersistentThresholdCellsByDepth
edm::EDGetTokenT< HORecHitCollection > tok_ho_
int aboveenergy[85][72][4]
void fillNevents_energy(const HcalTopology &)
edm::EDGetTokenT< HFRecHitCollection > tok_hf_
EtaPhiHists AbovePersistentETThresholdCellsByDepth
bool isHE(int etabin, int depth)
void Fill(long long x)
void processEvent_rechitenergy(const HBHERecHitCollection &hbheHits, const HORecHitCollection &hoHits, const HFRecHitCollection &hfHits, const HcalTopology &topology)
LuminosityBlockNumber_t luminosityBlock() const
HcalHotCellMonitor(const edm::ParameterSet &ps)
void SetupEtaPhiHists(DQMStore::IBooker &ib, EtaPhiHists &hh, std::string Name, std::string Units)
bool isSiPM(int ieta, int iphi, int depth)
std::vector< MonitorElement * > depth
MonitorElement * d_HFenergyVsNeighbor
int CalcIeta(int subdet, int eta, int depth)
edm::EDGetTokenT< HBHERecHitCollection > tok_hbhe_
MonitorElement * ProblemsVsLB_HBHEHF
MonitorElement * ProblemsVsLB_HB
void analyze(edm::Event const &e, edm::EventSetup const &s)
EtaPhiHists AboveETThresholdCellsByDepth
int ieta() const
get the cell ieta
Definition: HcalDetId.h:56
virtual void beginLuminosityBlock(const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &c)
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:115
HcalSubdetector
Definition: HcalAssistant.h:31
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
int j
Definition: DBlmapReader.cc:9
hotNeighborParams HBHENeighborParams_
bool isHB(int etabin, int depth)
void endLuminosityBlock(const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &c)
void fillNevents_neighbor(const HcalTopology &)
MonitorElement * d_HBenergyVsNeighbor
const_iterator end() const
void endRun(const edm::Run &run, const edm::EventSetup &c)
void setup(DQMStore::IBooker &)
edm::InputTag hbheRechitLabel_
bool isHF(int etabin, int depth)
void processHit_rechitNeighbors(R &rechititer, C &collection, hotNeighborParams &params, const HcalTopology &topology)
JetCorrectorParametersCollection coll
Definition: classes.h:10
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:276
void beginLuminosityBlock(const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &c)
part
Definition: HCALResponse.h:20
const T & get() const
Definition: EventSetup.h:56
void fillNevents_persistentenergy(const HcalTopology &)
virtual void reset(void)
MonitorElement * ProblemsVsLB_HE
void FillUnphysicalHEHFBins(std::vector< TH2F > &hh)
int aboveet[85][72][4]
int CalcEtaBin(int subdet, int ieta, int depth)
edm::InputTag hfRechitLabel_
MonitorElement * d_HOenergyVsNeighbor
EtaPhiHists AboveNeighborsHotCellsByDepth
std::pair< double, double > etaRange(HcalSubdetector subdet, int ieta) const
TString units(TString variable, Char_t axis)
TProfile * getTProfile(void) const
tuple cout
Definition: gather_cfg.py:145
MonitorElement * ProblemsVsLB_HO
MonitorElement * bookFloat(Args &&...args)
Definition: DQMStore.h:109
MonitorElement * ProblemsVsLB
hotNeighborParams HFNeighborParams_
void Reset(void)
reset ME (ie. contents, errors, etc)
virtual void setup(DQMStore::IBooker &)
const_iterator begin() const
Definition: Run.h:43
MonitorElement * d_HEenergyVsNeighbor