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