CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
HcalDeadCellMonitor.cc
Go to the documentation of this file.
3 
5 {
6  Online_ = ps.getUntrackedParameter<bool>("online",false);
7  mergeRuns_ = ps.getUntrackedParameter<bool>("mergeRuns",false);
8  enableCleanup_ = ps.getUntrackedParameter<bool>("enableCleanup",false);
9  debug_ = ps.getUntrackedParameter<int>("debug",0);
10  makeDiagnostics_ = ps.getUntrackedParameter<bool>("makeDiagnostics",false);
11  prefixME_ = ps.getUntrackedParameter<std::string>("subSystemFolder","Hcal/");
12  if (prefixME_.substr(prefixME_.size()-1,prefixME_.size())!="/")
13  prefixME_.append("/");
14  subdir_ = ps.getUntrackedParameter<std::string>("TaskFolder","DeadCellMonitor_Hcal"); // DeadCellMonitor_Hcal
15  if (subdir_.size()>0 && subdir_.substr(subdir_.size()-1,subdir_.size())!="/")
16  subdir_.append("/");
17  subdir_=prefixME_+subdir_;
18  AllowedCalibTypes_ = ps.getUntrackedParameter<std::vector<int> > ("AllowedCalibTypes");
19  skipOutOfOrderLS_ = ps.getUntrackedParameter<bool>("skipOutOfOrderLS",true);
20  NLumiBlocks_ = ps.getUntrackedParameter<int>("NLumiBlocks",4000);
21 
22  badChannelStatusMask_ = ps.getUntrackedParameter<int>("BadChannelStatusMask",
23  ps.getUntrackedParameter<int>("BadChannelStatusMask",
24  (1<<HcalChannelStatus::HcalCellDead))); // identify channel status values to mask
25  // DeadCell-specific parameters
26 
27  // Collection type info
29  hbheRechitLabel_ = ps.getUntrackedParameter<edm::InputTag>("hbheRechitLabel");
30  hoRechitLabel_ = ps.getUntrackedParameter<edm::InputTag>("hoRechitLabel");
31  hfRechitLabel_ = ps.getUntrackedParameter<edm::InputTag>("hfRechitLabel");
32 
33  // minimum number of events required for lumi section-based dead cell checks
34  minDeadEventCount_ = ps.getUntrackedParameter<int>("minDeadEventCount",1000);
35  excludeHORing2_ = ps.getUntrackedParameter<bool>("excludeHORing2",false);
36  excludeHO1P02_ = ps.getUntrackedParameter<bool>("excludeHO1P02",false);
37  endLumiProcessed_ = false;
38 
39  // Set which dead cell checks will be performed
40  /* Dead cells can be defined in the following ways:
41  1) never present digi -- digi is never present in run
42  2) digis -- digi is absent for one or more lumi section
43  3) never present rechit -- rechit > threshold energy never present (NOT redundant, since it requires not just that a rechit be present, but that it be above threshold as well. )
44  4) rechits -- rechit is present, but rechit energy below threshold for one or more lumi sections
45 
46  Of these tests, never-present digis are always checked.
47  Occasional digis are checked only if deadmon_test_digis_ is true,
48  and both rechit tests are made only if deadmon_test_rechits_ is true
49  */
50 
51  deadmon_test_digis_ = ps.getUntrackedParameter<bool>("test_digis",true);
52  deadmon_test_rechits_ = ps.getUntrackedParameter<bool>("test_rechits",false);
53 
54  // rechit energy test -- cell must be below threshold value for a number of consecutive events to be considered dead
55  energyThreshold_ = ps.getUntrackedParameter<double>("MissingRechitEnergyThreshold",0);
56  HBenergyThreshold_ = ps.getUntrackedParameter<double>("HB_energyThreshold",energyThreshold_);
57  HEenergyThreshold_ = ps.getUntrackedParameter<double>("HE_energyThreshold",energyThreshold_);
58  HOenergyThreshold_ = ps.getUntrackedParameter<double>("HO_energyThreshold",energyThreshold_);
59  HFenergyThreshold_ = ps.getUntrackedParameter<double>("HF_energyThreshold",energyThreshold_);
60 
62  logicalMap_=new HcalLogicalMap(gen.createMap());
63 } //constructor
64 
66 {
67  if (logicalMap_ == 0) delete logicalMap_;
68 } //destructor
69 
70 
71 /* ------------------------------------ */
72 
74 {
76  zeroCounters(1); // make sure arrays are set up
77  if (debug_>0)
78  std::cout <<"<HcalDeadCellMonitor::setup> Setting up histograms"<<std::endl;
79 
80  if (!dbe_) return;
81 
83  MonitorElement* excludeHO2=dbe_->bookInt("ExcludeHOring2");
84  // Fill with 0 if ring is not to be excluded; fill with 1 if it is to be excluded
85  if (excludeHO2) excludeHO2->Fill(excludeHORing2_==true ? 1 : 0);
86 
87  Nevents = dbe_->book1D("NumberOfDeadCellEvents","Number of Events Seen by DeadCellMonitor",2,0,2);
88  Nevents->setBinLabel(1,"allEvents");
89  Nevents->setBinLabel(2,"lumiCheck");
90  // 1D plots count number of bad cells vs. luminosity block
91  ProblemsVsLB=dbe_->bookProfile("TotalDeadCells_HCAL_vs_LS",
92  "Total Number of Dead Hcal Cells (excluding known problems) vs LS;Lumi Section;Dead Cells",
93  NLumiBlocks_,0.5,NLumiBlocks_+0.5,
94  100,0,10000);
95  ProblemsVsLB_HB=dbe_->bookProfile("TotalDeadCells_HB_vs_LS",
96  "Total Number of Dead HB Cells (excluding known problems) vs LS;Lumi Section;Dead Cells",
97  NLumiBlocks_,0.5,NLumiBlocks_+0.5,
98  100,0,10000);
99  ProblemsVsLB_HE=dbe_->bookProfile("TotalDeadCells_HE_vs_LS",
100  "Total Number of Dead HE Cells (excluding known problems) vs LS;Lumi Section;Dead Cells",
101  NLumiBlocks_,0.5,NLumiBlocks_+0.5,100,0,10000);
102  ProblemsVsLB_HO=dbe_->bookProfile("TotalDeadCells_HO_vs_LS",
103  "Total Number of Dead HO Cells Ring 0,1 |ieta|<=10 (excluding known problems) vs LS;Lumi Section;Dead Cells",
104  NLumiBlocks_,0.5,NLumiBlocks_+0.5,100,0,10000);
105  ProblemsVsLB_HO2=dbe_->bookProfile("TotalDeadCells_HO2_vs_LS",
106  "Total Number of Dead HO Cells Ring 2 |ieta|>10 (excluding known problems) vs LS;Lumi Section;Dead Cells",
107  NLumiBlocks_,0.5,NLumiBlocks_+0.5,100,0,10000);
108  ProblemsVsLB_HF=dbe_->bookProfile("TotalDeadCells_HF_vs_LS",
109  "Total Number of Dead HF Cells (excluding known problems) vs LS;Lumi Section;Dead Cells",
110  NLumiBlocks_,0.5,NLumiBlocks_+0.5,100,0,10000);
111  ProblemsVsLB_HBHEHF=dbe_->bookProfile("TotalDeadCells_HBHEHF_vs_LS",
112  "Total Number of Dead HBHEHF Cells (excluding known problems) vs LS;Lumi Section;Dead Cells",
113  NLumiBlocks_,0.5,NLumiBlocks_+0.5,100,0,10000);
114 
115  (ProblemsVsLB->getTProfile())->SetMarkerStyle(20);
116  (ProblemsVsLB_HB->getTProfile())->SetMarkerStyle(20);
117  (ProblemsVsLB_HE->getTProfile())->SetMarkerStyle(20);
118  (ProblemsVsLB_HO->getTProfile())->SetMarkerStyle(20);
119  (ProblemsVsLB_HO2->getTProfile())->SetMarkerStyle(20);
120  (ProblemsVsLB_HF->getTProfile())->SetMarkerStyle(20);
121  (ProblemsVsLB_HBHEHF->getTProfile())->SetMarkerStyle(20);
122 
123  RBX_loss_VS_LB=dbe_->book2D("RBX_loss_VS_LB",
124  "RBX loss vs LS; Lumi Section; Index of lost RBX",
125  NLumiBlocks_,0.5,NLumiBlocks_+0.5,156,0,156);
126 
127  ProblemsInLastNLB_HBHEHF_alarm=dbe_->book1D("ProblemsInLastNLB_HBHEHF_alarm",
128  "Total Number of Dead HBHEHF Cells in last 10 LS. Last bin contains OverFlow",
129  100,0,100);
130  ProblemsInLastNLB_HO01_alarm=dbe_->book1D("ProblemsInLastNLB_HO01_alarm",
131  "Total Number of Dead Cells Ring 0,1 (abs(ieta)<=10) in last 10 LS. Last bin contains OverFlow",
132  100,0,100);
133 
134 
135  dbe_->setCurrentFolder(subdir_+"dead_cell_parameters");
136  MonitorElement* me=dbe_->bookInt("Test_NeverPresent_Digis");
137  me->Fill(1);
138  me=dbe_->bookInt("Test_DigiMissing_Periodic_Lumi_Check");
140  me->Fill(1);
141  else
142  me->Fill(0);
143  me=dbe_->bookInt("Min_Events_Required_Periodic_Lumi_Check");
145  me=dbe_->bookInt("Test_NeverPresent_RecHits");
146  deadmon_test_rechits_>0 ? me->Fill(1) : me->Fill(0);
147  me=dbe_->bookFloat("HBMinimumRecHitEnergy");
149  me=dbe_->bookFloat("HEMinimumRecHitEnergy");
151  me=dbe_->bookFloat("HOMinimumRecHitEnergy");
153  me=dbe_->bookFloat("HFMinimumRecHitEnergy");
155  me=dbe_->bookInt("Test_RecHitsMissing_Periodic_Lumi_Check");
156  deadmon_test_rechits_>0 ? me->Fill(1) : me->Fill(0);
157 
158  // ProblemCells plots are in HcalDeadCellClient!
159 
160  // Set up plots for each failure mode of dead cells
161  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)
162  std::stringstream name;
163 
164  // Never-present test will always be called, by definition of dead cell
165 
166  dbe_->setCurrentFolder(subdir_+"dead_digi_never_present");
168  "Digi Present At Least Once","");
169  // 1D plots count number of bad cells
170  NumberOfNeverPresentDigis=dbe_->bookProfile("Problem_NeverPresentDigis_HCAL_vs_LS",
171  "Total Number of Never-Present Hcal Cells vs LS;Lumi Section;Dead Cells",
172  NLumiBlocks_,0.5,NLumiBlocks_+0.5,100,0,10000);
173 
174  NumberOfNeverPresentDigisHB=dbe_->bookProfile("Problem_NeverPresentDigis_HB_vs_LS",
175  "Total Number of Never-Present HB Cells vs LS;Lumi Section;Dead Cells",
176  NLumiBlocks_,0.5,NLumiBlocks_+0.5,100,0,10000);
177 
178  NumberOfNeverPresentDigisHE=dbe_->bookProfile("Problem_NeverPresentDigis_HE_vs_LS",
179  "Total Number of Never-Present HE Cells vs LS;Lumi Section;Dead Cells",
180  NLumiBlocks_,0.5,NLumiBlocks_+0.5,100,0,10000);
181 
182  NumberOfNeverPresentDigisHO=dbe_->bookProfile("Problem_NeverPresentDigis_HO_vs_LS",
183  "Total Number of Never-Present HO Cells vs LS;Lumi Section;Dead Cells",
184  NLumiBlocks_,0.5,NLumiBlocks_+0.5,100,0,10000);
185 
186  NumberOfNeverPresentDigisHF=dbe_->bookProfile("Problem_NeverPresentDigis_HF_vs_LS",
187  "Total Number of Never-Present HF Cells vs LS;Lumi Section;Dead Cells",
188  NLumiBlocks_,0.5,NLumiBlocks_+0.5,100,0,10000);
189  (NumberOfNeverPresentDigis->getTProfile())->SetMarkerStyle(20);
190  (NumberOfNeverPresentDigisHB->getTProfile())->SetMarkerStyle(20);
191  (NumberOfNeverPresentDigisHE->getTProfile())->SetMarkerStyle(20);
192  (NumberOfNeverPresentDigisHO->getTProfile())->SetMarkerStyle(20);
193  (NumberOfNeverPresentDigisHF->getTProfile())->SetMarkerStyle(20);
194 
196 
198  {
199  dbe_->setCurrentFolder(subdir_+"dead_digi_often_missing");
200  //units<<"("<<deadmon_checkNevents_<<" consec. events)";
201  name<<"Dead Cells with No Digis";
203  name.str(),
204  "");
205  name.str("");
206  name<<"HB HE HF Depth 1 Dead Cells with No Digis for at least 1 Full Luminosity Block";
207  RecentMissingDigisByDepth.depth[0]->setTitle(name.str().c_str());
208 
209  name.str("");
210  name<<"HB HE HF Depth 2 Dead Cells with No Digis for at least 1 Full Luminosity Block";
211  RecentMissingDigisByDepth.depth[1]->setTitle(name.str().c_str());
212 
213  name.str("");
214  name<<"HE Depth 3 Dead Cells with No Digis for at least 1 Full Luminosity Block";
215  RecentMissingDigisByDepth.depth[2]->setTitle(name.str().c_str());
216 
217  name.str("");
218  name<<"HO Depth 4 Dead Cells with No Digis for at least 1 Full Luminosity Block";
219  RecentMissingDigisByDepth.depth[3]->setTitle(name.str().c_str());
220  name.str("");
221 
222  // 1D plots count number of bad cells
223  name<<"Total Number of Hcal Digis Unoccupied for at least 1 Full Luminosity Block";
224  NumberOfRecentMissingDigis=dbe_->bookProfile("Problem_RecentMissingDigis_HCAL_vs_LS",
225  name.str(),
226  NLumiBlocks_,0.5,NLumiBlocks_+0.5,100,0,10000);
227  name.str("");
228  name<<"Total Number of HB Digis Unoccupied for at least 1 Full LS vs LS;Lumi Section; Dead Cells";
229  NumberOfRecentMissingDigisHB=dbe_->bookProfile("Problem_RecentMissingDigis_HB_vs_LS",
230  name.str(),
231  NLumiBlocks_,0.5,NLumiBlocks_+0.5,100,0,10000);
232  name.str("");
233  name<<"Total Number of HE Digis Unoccupied for at least 1 Full LS vs LS;Lumi Section; Dead Cells";
234  NumberOfRecentMissingDigisHE=dbe_->bookProfile("Problem_RecentMissingDigis_HE_vs_LS",
235  name.str(),
236  NLumiBlocks_,0.5,NLumiBlocks_+0.5,100,0,10000);
237  name.str("");
238  name<<"Total Number of HO Digis Unoccupied for at least 1 Full LS vs LS;Lumi Section; Dead Cells";
239  NumberOfRecentMissingDigisHO=dbe_->bookProfile("Problem_RecentMissingDigis_HO_vs_LS",
240  name.str(),
241  NLumiBlocks_,0.5,NLumiBlocks_+0.5,100,0,10000);
242  name.str("");
243  name<<"Total Number of HF Digis Unoccupied for at least 1 Full LS vs LS;Lumi Section; Dead Cells";
244  NumberOfRecentMissingDigisHF=dbe_->bookProfile("Problem_RecentMissingDigis_HF_vs_LS",
245  name.str(),
246  NLumiBlocks_,0.5,NLumiBlocks_+0.5,100,0,10000);
247  (NumberOfRecentMissingDigis->getTProfile())->SetMarkerStyle(20);
248  (NumberOfRecentMissingDigisHB->getTProfile())->SetMarkerStyle(20);
249  (NumberOfRecentMissingDigisHE->getTProfile())->SetMarkerStyle(20);
250  (NumberOfRecentMissingDigisHO->getTProfile())->SetMarkerStyle(20);
251  (NumberOfRecentMissingDigisHF->getTProfile())->SetMarkerStyle(20);
252 
253  }
254 
256  {
257  // test 1: energy never above threshold
258  dbe_->setCurrentFolder(subdir_+"dead_rechit_neverpresent");
259  SetupEtaPhiHists(RecHitPresentByDepth,"RecHit Above Threshold At Least Once","");
260  // set more descriptive titles for threshold plots
261  units.str("");
262  units<<"Cells Above Energy Threshold At Least Once: Depth 1 -- HB >="<<HBenergyThreshold_<<" GeV, HE >= "<<HEenergyThreshold_<<", HF >="<<HFenergyThreshold_<<" GeV";
263  RecHitPresentByDepth.depth[0]->setTitle(units.str().c_str());
264  units.str("");
265  units<<"Cells Above Energy Threshold At Least Once: Depth 2 -- HB >="<<HBenergyThreshold_<<" GeV, HE >= "<<HEenergyThreshold_<<", HF >="<<HFenergyThreshold_<<" GeV";
266  RecHitPresentByDepth.depth[1]->setTitle(units.str().c_str());
267  units.str("");
268  units<<"Cells Above Energy Threshold At Least Once: Depth 3 -- HE >="<<HEenergyThreshold_<<" GeV";
269  RecHitPresentByDepth.depth[2]->setTitle(units.str().c_str());
270  units.str("");
271  units<<"Cells Above Energy Threshold At Least Once: Depth 4 -- HO >="<<HOenergyThreshold_<<" GeV";
272  RecHitPresentByDepth.depth[3]->setTitle(units.str().c_str());
273  units.str("");
274 
275  // 1D plots count number of bad cells
276  NumberOfNeverPresentRecHits=dbe_->bookProfile("Problem_RecHitsNeverPresent_HCAL_vs_LS",
277  "Total Number of Hcal Rechits with Low Energy;Lumi Section;Dead Cells",
278  NLumiBlocks_,0.5,NLumiBlocks_+0.5,100,0,10000);
279  name.str("");
280  name<<"Total Number of HB RecHits with Energy Never >= "<<HBenergyThreshold_<<" GeV;Lumi Section;Dead Cells";
281  NumberOfNeverPresentRecHitsHB=dbe_->bookProfile("Problem_RecHitsNeverPresent_HB_vs_LS",
282  name.str(),
283  NLumiBlocks_,0.5,NLumiBlocks_+0.5,100,0,10000);
284  name.str("");
285  name<<"Total Number of HE RecHits with Energy Never >= "<<HEenergyThreshold_<<" GeV;Lumi Section;Dead Cells";
286  NumberOfNeverPresentRecHitsHE=dbe_->bookProfile("Problem_RecHitsNeverPresent_HE_vs_LS",
287  name.str(),
288  NLumiBlocks_,0.5,NLumiBlocks_+0.5,100,0,10000);
289  name.str("");
290  name<<"Total Number of HO RecHits with Energy Never >= "<<HOenergyThreshold_<<" GeV;Lumi Section;Dead Cells";
291  NumberOfNeverPresentRecHitsHO=dbe_->bookProfile("Problem_RecHitsNeverPresent_HO_vs_LS",
292  name.str(),
293  NLumiBlocks_,0.5,NLumiBlocks_+0.5,100,0,10000);
294  name.str("");
295  name<<"Total Number of HF RecHits with Energy Never >= "<<HFenergyThreshold_<<" GeV;Lumi Section;Dead Cells";
296  NumberOfNeverPresentRecHitsHF=dbe_->bookProfile("Problem_RecHitsNeverPresent_HF_vs_LS",
297  name.str(),
298  NLumiBlocks_,0.5,NLumiBlocks_+0.5,100,0,10000);
299  (NumberOfNeverPresentRecHits->getTProfile())->SetMarkerStyle(20);
300  (NumberOfNeverPresentRecHitsHB->getTProfile())->SetMarkerStyle(20);
301  (NumberOfNeverPresentRecHitsHE->getTProfile())->SetMarkerStyle(20);
302  (NumberOfNeverPresentRecHitsHO->getTProfile())->SetMarkerStyle(20);
303  (NumberOfNeverPresentRecHitsHF->getTProfile())->SetMarkerStyle(20);
304 
305  dbe_->setCurrentFolder(subdir_+"dead_rechit_often_missing");
306  SetupEtaPhiHists(RecentMissingRecHitsByDepth,"RecHits Failing Energy Threshold Test","");
307  // set more descriptive titles for threshold plots
308  units.str("");
309  units<<"RecHits with Consistent Low Energy Depth 1 -- HB <"<<HBenergyThreshold_<<" GeV, HE < "<<HEenergyThreshold_<<", HF <"<<HFenergyThreshold_<<" GeV";
310  RecentMissingRecHitsByDepth.depth[0]->setTitle(units.str().c_str());
311  units.str("");
312  units<<"RecHits with Consistent Low Energy Depth 2 -- HB <"<<HBenergyThreshold_<<" GeV, HE < "<<HEenergyThreshold_<<", HF <"<<HFenergyThreshold_<<" GeV";
313  RecentMissingRecHitsByDepth.depth[1]->setTitle(units.str().c_str());
314  units.str("");
315  units<<"RecHits with Consistent Low Energy Depth 3 -- HE <"<<HEenergyThreshold_<<" GeV";
316  RecentMissingRecHitsByDepth.depth[2]->setTitle(units.str().c_str());
317  units.str("");
318  units<<"RecHits with Consistent Low Energy Depth 4 -- HO <"<<HOenergyThreshold_<<" GeV";
319  RecentMissingRecHitsByDepth.depth[3]->setTitle(units.str().c_str());
320  units.str("");
321 
322 
323  // 1D plots count number of bad cells
324  name.str("");
325  name<<"Total Number of Hcal RecHits with Consistent Low Energy;Lumi Section;Dead Cells";
326  NumberOfRecentMissingRecHits=dbe_->bookProfile("Problem_BelowEnergyRecHits_HCAL_vs_LS",
327  name.str(),
328  NLumiBlocks_,0.5,NLumiBlocks_+0.5,100,0,10000);
329  name.str("");
330  name<<"Total Number of HB RecHits with Consistent Low Energy < "<<HBenergyThreshold_<<" GeV;Lumi Section;Dead Cells";
331  NumberOfRecentMissingRecHitsHB=dbe_->bookProfile("Problem_BelowEnergyRecHits_HB_vs_LS",
332  name.str(),
333  NLumiBlocks_,0.5,NLumiBlocks_+0.5,100,0,10000);
334  name.str("");
335  name<<"Total Number of HE RecHits with Consistent Low Energy < "<<HEenergyThreshold_<<" GeV;Lumi Section;Dead Cells";
336  NumberOfRecentMissingRecHitsHE=dbe_->bookProfile("Problem_BelowEnergyRecHits_HE_vs_LS",
337  name.str(),
338  NLumiBlocks_,0.5,NLumiBlocks_+0.5,100,0,10000);
339  name.str("");
340  name<<"Total Number of HO RecHits with Consistent Low Energy < "<<HOenergyThreshold_<<" GeV;Lumi Section;Dead Cells";
341  NumberOfRecentMissingRecHitsHO=dbe_->bookProfile("Problem_BelowEnergyRecHits_HO_vs_LS",
342  name.str(),
343  NLumiBlocks_,0.5,NLumiBlocks_+0.5,100,0,10000);
344  name.str("");
345  name<<"Total Number of HF RecHits with Consistent Low Energy < "<<HFenergyThreshold_<<" GeV;Lumi Section;Dead Cells";
346  NumberOfRecentMissingRecHitsHF=dbe_->bookProfile("Problem_BelowEnergyRecHits_HF_vs_LS",
347  name.str(),
348  NLumiBlocks_,0.5,NLumiBlocks_+0.5,100,0,10000);
349  (NumberOfRecentMissingRecHits->getTProfile())->SetMarkerStyle(20);
350  (NumberOfRecentMissingRecHitsHB->getTProfile())->SetMarkerStyle(20);
351  (NumberOfRecentMissingRecHitsHE->getTProfile())->SetMarkerStyle(20);
352  (NumberOfRecentMissingRecHitsHO->getTProfile())->SetMarkerStyle(20);
353  (NumberOfRecentMissingRecHitsHF->getTProfile())->SetMarkerStyle(20);
354 
355  } // if (deadmon_test_rechits)
356 
357 
358  if (makeDiagnostics_)
359  {
360  dbe_->setCurrentFolder(subdir_+"DiagnosticPlots");
361  HBDeadVsEvent=dbe_->book1D("HBDeadVsEvent","HB Total Dead Cells Vs Event", NLumiBlocks_/10,-0.5,NLumiBlocks_-0.5);
362  HEDeadVsEvent=dbe_->book1D("HEDeadVsEvent","HE Total Dead Cells Vs Event", NLumiBlocks_/10,-0.5,NLumiBlocks_-0.5);
363  HODeadVsEvent=dbe_->book1D("HODeadVsEvent","HO Total Dead Cells Vs Event", NLumiBlocks_/10,-0.5,NLumiBlocks_-0.5);
364  HFDeadVsEvent=dbe_->book1D("HFDeadVsEvent","HF Total Dead Cells Vs Event", NLumiBlocks_/10,-0.5,NLumiBlocks_-0.5);
365  }
366 
367  this->reset();
368  return;
369 
370 } // void HcalDeadCellMonitor::setup(...)
371 
373 {
374  if (debug_>1) std::cout <<"HcalDeadCellMonitor::beginRun"<<std::endl;
376 
377  if (tevt_==0) this->setup(); // set up histograms if they have not been created before
378  if (mergeRuns_==false)
379  this->reset();
380 
381  doReset_ = true;
382 
383  // Get known dead cells for this run
384  KnownBadCells_.clear();
385  if (badChannelStatusMask_>0)
386  {
388  c.get<HcalChannelQualityRcd>().get(p);
389  HcalChannelQuality* chanquality= new HcalChannelQuality(*p.product());
390  std::vector<DetId> mydetids = chanquality->getAllChannels();
391  for (std::vector<DetId>::const_iterator i = mydetids.begin();
392  i!=mydetids.end();
393  ++i)
394  {
395  if (i->det()!=DetId::Hcal) continue; // not an hcal cell
396  HcalDetId id=HcalDetId(*i);
397  int status=(chanquality->getValues(id))->getValue();
398  if ((status & badChannelStatusMask_))
399  KnownBadCells_[id.rawId()]=status;
400  }
401  delete chanquality;
402  } // if (badChannelStatusMask_>0)
403  return;
404 } //void HcalDeadCellMonitor::beginRun(...)
405 
407 {
408  if (debug_>1) std::cout <<"HcalDeadCellMonitor::reset()"<<std::endl;
409  doReset_ = false;
410 
412  zeroCounters();
413  deadevt_=0;
414  is_RBX_loss_ = 0;
415  beamMode_ = 0 ;
416  alarmer_counter_ = 0;
418  is_stable_beam = true;
419  hbhedcsON = true; hfdcsON = true; hodcsON = true;
425 
426  for (unsigned int depth=0;depth<DigiPresentByDepth.depth.size();++depth)
427  DigiPresentByDepth.depth[depth]->Reset();
428 
429  // Mark HORing2 channels as present (fill with a 2, rather than a 1, to distinguish between this setting and actual presence)
430  if (excludeHORing2_==true && DigiPresentByDepth.depth.size()>3)
431  {
432  for (int ieta=11;ieta<=15;++ieta)
433  for (int iphi=1;iphi<=72;++iphi)
434  {
435  // Don't fill ring2 SiPMs, since they will still be active even if the rest of HO is excluded.
436  if (isSiPM(ieta,iphi,4)==false)
437  DigiPresentByDepth.depth[3]->Fill(ieta,iphi,2);
438  //std::cout <<" FILLING ("<<-1*ieta<<", "<<iphi<<") with '2'"<<std::endl;
439  DigiPresentByDepth.depth[3]->Fill(-1*ieta,iphi,2);
440  }
441  }
443 
444 
446  {
449  }
451  {
464 
465  // Mark HORing2 channels as present (fill with a 2, rather than a 1, to distinguish between this setting and actual presence)
466  if (excludeHORing2_==true && RecHitPresentByDepth.depth.size()>3)
467  {
468  for (int ieta=11;ieta<=15;++ieta)
469  for (int iphi=1;iphi<=72;++iphi)
470  {
471  RecHitPresentByDepth.depth[3]->Fill(ieta,iphi,2);
472  RecHitPresentByDepth.depth[3]->Fill(-1*ieta,iphi,2);
473  }
474  }
476  }
477 
478  Nevents->Reset();
479 } // reset function is empty for now
480 
481 /* ------------------------------------------------------------------------- */
482 
483 
485 {
486  if (!enableCleanup_) return;
487  if (dbe_)
488  {
490  dbe_->removeContents();
491  dbe_->setCurrentFolder(subdir_+"dead_digi_never_present");
492  dbe_->removeContents();
493  dbe_->setCurrentFolder(subdir_+"dead_digi_often_missing");
494  dbe_->removeContents();
495  dbe_->setCurrentFolder(subdir_+"dead_rechit_neverpresent");
496  dbe_->removeContents();
497  dbe_->setCurrentFolder(subdir_+"dead_rechit_often_missing");
498  dbe_->removeContents();
499  dbe_->setCurrentFolder(subdir_+"dead_cell_parameters");
500  dbe_->removeContents();
501  dbe_->setCurrentFolder(subdir_+"LSvalues");
502  dbe_->removeContents();
503  }
504  return;
505 } // void HcalDeadCellMonitor::cleanup()
506 
507 /* ------------------------------------------------------------------------- */
508 
510  const edm::EventSetup& c)
511 {
512  // skip old lumi sections
513  if (this->LumiInOrder(lumiSeg.luminosityBlock())==false) return;
514 
515  // Reset current LS histogram
516  if (ProblemsCurrentLB)
518 
521 
522  //increase the number of LS counting, for alarmer. Only make alarms for HBHE
523  if(hbhedcsON == true && hfdcsON == true && HBpresent_ == 1 && HEpresent_ == 1 && HFpresent_ == 1)
525  else
526  alarmer_counter_ = 0;
527 
528  if(hodcsON==true && HOpresent_ == 1)
530  else
532 
533  if (!is_stable_beam)
534  {
535  alarmer_counter_ = 0;
537  }
538 
539  // Here is where we determine whether or not to process an event
540  // Not enough events
541  // there are less than minDeadEventCount_ in this LS, but RBXloss is found
542 
544  {
548 
549  endLumiProcessed_=true;
550  is_RBX_loss_=0;
551 
552  for (unsigned int i=0;i<156;++i)
553  rbxlost[i] = 0;
554 
555  if (ProblemsCurrentLB)
556  {
557  ProblemsCurrentLB->setBinContent(0,0, levt_); // underflow bin contains number of events
565  }
566  }
567 
568  if (deadevt_<minDeadEventCount_) // perform normal tasks, since no RBX loss is detected in this lumisections
569  return;
570 
571  endLumiProcessed_=true;
572  // fillNevents_problemCells checks for never-present cells
576 
577  if (ProblemsCurrentLB)
578  {
579  ProblemsCurrentLB->setBinContent(0,0, levt_); // underflow bin contains number of events
587  }
588  zeroCounters();
589  deadevt_=0;
590  is_RBX_loss_=0;
591  beamMode_ = 0;
592  return;
593 } //endLuminosityBlock()
594 
596 {
597  // Always carry out overall occupancy test at endRun, regardless minimum number of events?
598  // Or should we require an absolute lower bound?
599  // We can always run this test; we'll use the summary client to implement a lower bound before calculating reportSummary values
600  if (endLumiProcessed_==false) fillNevents_problemCells(); // always check for never-present cells
601 
602  return;
603 }
604 
606 {
607  if (debug_>0) std::cout <<"HcalDeadCellMonitor::endJob()"<<std::endl;
608  if (enableCleanup_) cleanup(); // when do we force cleanup?
609 }
610 
612 {
613  if (!IsAllowedCalibType()) return;
614  endLumiProcessed_=false;
615 
616  if(doReset_)
617  this->reset();
618 
619  Nevents->Fill(0,1); // count all events of allowed calibration type, even if their lumi block is not in the right order
620  if (LumiInOrder(e.luminosityBlock())==false) return;
621  // try to get rechits and digis
625 
629 
631 
633  // check if detectors whether they were ON
635  e.getByLabel("scalersRawToDigi", dcsStatus);
636 
637  if (dcsStatus.isValid() && dcsStatus->size() != 0)
638  {
639  if ((*dcsStatus)[0].ready(DcsStatus::HBHEa) &&
640  (*dcsStatus)[0].ready(DcsStatus::HBHEb) &&
641  (*dcsStatus)[0].ready(DcsStatus::HBHEc))
642  {
643  hbhedcsON = true;
644  if (debug_) std::cout << "hbhe on" << std::endl;
645  }
646  else hbhedcsON = false;
647 
648  if ((*dcsStatus)[0].ready(DcsStatus::HF))
649  {
650  hfdcsON = true;
651  if (debug_) std::cout << "hf on" << std::endl;
652  }
653  else hfdcsON = false;
654 
655  if ((*dcsStatus)[0].ready(DcsStatus::HO))
656  {
657  hodcsON = true;
658  if (debug_) std::cout << "ho on" << std::endl;
659  }
660  else hodcsON = false;
661  }
663 
664  if (!(e.getByLabel(digiLabel_,hbhe_digi)))
665  {
666  edm::LogWarning("HcalDeadCellMonitor")<< digiLabel_<<" hbhe_digi not available";
667  return;
668  }
669  if (!(e.getByLabel(digiLabel_,ho_digi)))
670  {
671  edm::LogWarning("HcalDeadCellMonitor")<< digiLabel_<<" ho_digi not available";
672  return;
673  }
674  if (!(e.getByLabel(digiLabel_,hf_digi)))
675  {
676  edm::LogWarning("HcalDeadCellMonitor")<< digiLabel_<<" hf_digi not available";
677  return;
678  }
679 
680  if (!(e.getByLabel(hbheRechitLabel_,hbhe_rechit)))
681  {
682  edm::LogWarning("HcalDeadCellMonitor")<< hbheRechitLabel_<<" hbhe_rechit not available";
683  return;
684  }
685 
686  if (!(e.getByLabel(hfRechitLabel_,hf_rechit)))
687  {
688  edm::LogWarning("HcalDeadCellMonitor")<< hfRechitLabel_<<" hf_rechit not available";
689  return;
690  }
691  if (!(e.getByLabel(hoRechitLabel_,ho_rechit)))
692  {
693  edm::LogWarning("HcalDeadCellMonitor")<< hoRechitLabel_<<" ho_rechit not available";
694  return;
695  }
696  if (!(e.getByLabel("gtEvmDigis", gtEvm_handle)))
697  {
698  edm::LogWarning("HcalDeadCellMonitor")<< "gtEvmDigis"<<" gtEvmDigis not available";
699  return;
700  }
701  L1GtfeExtWord gtfeEvmExtWord = gtEvm_handle.product()->gtfeWord();
702 
703  if (debug_>1) std::cout <<"\t<HcalDeadCellMonitor::analyze> Processing good event! event # = "<<ievt_<<std::endl;
704  // Good event found; increment counter (via base class analyze method)
705  // This also runs the allowed calibration /lumi in order tests again; remove?
707 
708  ++deadevt_; //increment local counter
709 
710  processEvent(*hbhe_rechit, *ho_rechit, *hf_rechit, *hbhe_digi, *ho_digi, *hf_digi);
711 
712  // check for presence of an RBX data loss
713  if(levt_>10 && tevt_ % 10 == 0 ) //levt_ counts events perLS, but excludes
714  { //"wrong", calibration-type events. Compare with tevt_ instead...
715  for(int i=71; i<132; i++)
716  {
717  // These RBXs in HO are excluded, set to 1 to ignore
718  // HO0: 96-107 (all)
719  // HO1: 85-95, 109-119 (all odd)
720  // HO2: 73, 75, 79, 81, 83, 121-131 (all odd)
721  if(i >= 72 && i < 95 && i%2==0)
722  occupancy_RBX[i] = 1;
723  if(i >=108 && i <= 131 && i%2==0)
724  occupancy_RBX[i] = 1;
725 
726  if(i==117 || i==131) // HO SiPMs have much less hits, 10 events not enough.
727  occupancy_RBX[i] = 1; // Also no RBX loss for SiPMs, so ignore for now.
728  if(i==77)
729  occupancy_RBX[i] = 1;
730  }
731 
732  // RBX loss detected
733  for (unsigned int i=0;i<132;++i)
734  if(occupancy_RBX[i] == 0)
735  {
736  is_RBX_loss_ = 1;
737  rbxlost[i] = 1;
738  }
739 
740  int intensity1_ = gtfeEvmExtWord.totalIntensityBeam1();
741  int intensity2_ = gtfeEvmExtWord.totalIntensityBeam2();
742 
743  is_stable_beam = gtfeEvmExtWord.beamMode() == 11 ? true : false;
744 
745  for (unsigned int i=132;i<156;++i)
746  if(occupancy_RBX[i] == 0 && gtfeEvmExtWord.beamMode() == 11)
747  if(intensity1_>100 && intensity2_>100) // only in stable beam mode (11) and with circulating beams, otherwise
748  { // this check is too sensitive in HF
749  is_RBX_loss_ = 1;
750  rbxlost[i] = 1;
751  }
752 
753  // no RBX loss, reset the counters
754  if (is_RBX_loss_ == 0)
755  for (unsigned int i=0;i<156;++i)
756  occupancy_RBX[i] = 0;
757  }
758 
759  // if RBX is lost any time during the LS, don't allow the counters to increment
760  if(is_RBX_loss_ == 1)
761  for (unsigned int i=0;i<156;++i)
762  if(rbxlost[i]==1) occupancy_RBX[i] = 0;
763 
764 } // void HcalDeadCellMonitor::analyze(...)
765 
766 /* --------------------------------------- */
767 
768 
770  const HORecHitCollection& hoHits,
771  const HFRecHitCollection& hfHits,
772  const HBHEDigiCollection& hbhedigi,
773  const HODigiCollection& hodigi,
774  const HFDigiCollection& hfdigi)
775 {
776  if (debug_>1) std::cout <<"<HcalDeadCellMonitor::processEvent> Processing event..."<<std::endl;
777 
778  // Do Digi-Based dead cell searches
779 
780  // Make sure histograms update
781  for (unsigned int i=0;i<DigiPresentByDepth.depth.size();++i)
782  DigiPresentByDepth.depth[i]->update();
783 
789 
791  {
792 
793  for (unsigned int i=0;i<RecentMissingDigisByDepth.depth.size();++i)
794  RecentMissingDigisByDepth.depth[i]->update();
795 
801  }
802 
804  j!=hbhedigi.end(); ++j)
805  {
806  const HBHEDataFrame digi = (const HBHEDataFrame)(*j);
807  processEvent_HBHEdigi(digi);
808  }
809 
811  j!=hodigi.end(); ++j)
812  {
813  const HODataFrame digi = (const HODataFrame)(*j);
814  process_Digi(digi);
815  }
817  j!=hfdigi.end(); ++j)
818  {
819  const HFDataFrame digi = (const HFDataFrame)(*j);
820  process_Digi(digi);
821  }
823 
824  // Search for "dead" cells below a certain energy
826  {
827  // Normalization Fill
828  for (unsigned int i=0;i<RecentMissingRecHitsByDepth.depth.size();++i)
830 
836 
838  j!=hbHits.end(); ++j)
839  process_RecHit(j);
840 
842  k!=hoHits.end(); ++k)
843  process_RecHit(k);
844 
846  j!=hfHits.end(); ++j)
847  process_RecHit(j);
848 
849  } // if (deadmon_test_rechits)
850 
851  if (!makeDiagnostics_) return;
852  if (tevt_>=NLumiBlocks_) return;
853  // Diagnostic plots -- add number of missing channels vs event number
854  int hbpresent=0;
855  int hepresent=0;
856  int hopresent=0;
857  int hfpresent=0;
858  int ieta=0;
859  for (int d=0;d<4;++d)
860  {
861  for (int phi=0;phi<72;++phi)
862  {
863  for (int eta=0;eta<85;++eta)
864  {
865  if (!present_digi[eta][phi][d]) continue;
866  if (d==3) ++hopresent;
867  else if (d==2) ++hepresent;
868  else if (d==1)
869  {
870  ieta=binmapd2[eta];
871  //if (abs(ieta)>29) continue;
872  if (abs(ieta)>29) ++hfpresent;
873  else if (abs(ieta)<17) ++hbpresent; //depths 15&16
874  else ++hepresent;
875  }
876  else if (d==0)
877  {
878  ieta=eta-42;
879  if (abs(ieta)>29) ++hfpresent;
880  else if (abs(ieta)<17) ++hbpresent;
881  else ++hepresent;
882  }
883  }
884  }
885  } // for (int d=0;d<4;++d)
886  HBDeadVsEvent->Fill(tevt_,2592-hbpresent);
887  HEDeadVsEvent->Fill(tevt_,2592-hepresent);
888  HODeadVsEvent->Fill(tevt_,2160-hopresent);
889  HFDeadVsEvent->Fill(tevt_,1728-hfpresent);
890  return;
891 } // void HcalDeadCellMonitor::processEvent(...)
892 
893 /************************************/
894 
895 
896 // Digi-based dead cell checks
897 
899 {
900  // Simply check whether a digi is present. If so, increment occupancy counter.
901  process_Digi(digi);
902  return;
903 } //void HcalDeadCellMonitor::processEvent_HBHEdigi(HBHEDigiCollection::const_iterator j)
904 
905 template<class DIGI>
907 {
908  // Remove the validate check when we figure out how to access bad digis in digi monitor
909  //if (!digi.validate()) return; // digi must be good to be counted
910  int ieta=digi.id().ieta();
911  int iphi=digi.id().iphi();
912  int depth=digi.id().depth();
913 
914  // Fill occupancy counter
915  ++recentoccupancy_digi[CalcEtaBin(digi.id().subdet(),ieta,depth)][iphi-1][depth-1];
916 
917  // If previously-missing digi found, change boolean status and fill histogram
918  if (present_digi[CalcEtaBin(digi.id().subdet(),ieta,depth)][iphi-1][depth-1]==false)
919  {
920  if (DigiPresentByDepth.depth[depth-1])
921  {
922  DigiPresentByDepth.depth[depth-1]->setBinContent(CalcEtaBin(digi.id().subdet(),ieta,depth)+1,iphi,1);
923  }
924  present_digi[CalcEtaBin(digi.id().subdet(),ieta,depth)][iphi-1][depth-1]=true;
925  }
926  return;
927 }
928 
929 //RecHit-based dead cell checks
930 
931 template<class RECHIT>
933 {
934  float en = rechit->energy();
935  HcalDetId id(rechit->detid().rawId());
936  int ieta = id.ieta();
937  int iphi = id.iphi();
938  int depth = id.depth();
939 
940  if (id.subdet()==HcalBarrel)
941  {
942  if (en>=HBenergyThreshold_)
943  {
944  ++recentoccupancy_rechit[CalcEtaBin(id.subdet(),ieta,depth)][iphi-1][depth-1];
945  present_rechit[CalcEtaBin(id.subdet(),ieta,depth)][iphi-1][depth-1]=true;
946  if (RecHitPresentByDepth.depth[depth-1])
947  RecHitPresentByDepth.depth[depth-1]->setBinContent(CalcEtaBin(id.subdet(),ieta,depth)+1,iphi,1);
948  }
950  // RBX index, HB RBX indices are 0-35
951  int RBXindex = logicalMap_->getHcalFrontEndId(rechit->detid()).rbxIndex();
952 
953  occupancy_RBX[RBXindex]++;
955  }
956  else if (id.subdet()==HcalEndcap)
957  {
958  if (en>=HEenergyThreshold_)
959  {
960  ++recentoccupancy_rechit[CalcEtaBin(id.subdet(),ieta,depth)][iphi-1][depth-1];
961  present_rechit[CalcEtaBin(id.subdet(),ieta,depth)][iphi-1][depth-1]=true;
962  if (RecHitPresentByDepth.depth[depth-1])
963  RecHitPresentByDepth.depth[depth-1]->setBinContent(CalcEtaBin(id.subdet(),ieta,depth)+1,iphi,1);
964  }
966  // RBX index, HE RBX indices are 36-71
967  int RBXindex = logicalMap_->getHcalFrontEndId(rechit->detid()).rbxIndex();
968 
969  occupancy_RBX[RBXindex]++;
971  }
972  else if (id.subdet()==HcalForward)
973  {
974  if (en>=HFenergyThreshold_)
975  {
976  ++recentoccupancy_rechit[CalcEtaBin(id.subdet(),ieta,depth)][iphi-1][depth-1];
977 
978  present_rechit[CalcEtaBin(id.subdet(),ieta,depth)][iphi-1][depth-1]=true;
979  if (RecHitPresentByDepth.depth[depth-1])
980  RecHitPresentByDepth.depth[depth-1]->setBinContent(CalcEtaBin(id.subdet(),ieta,depth)+1,iphi,1);
981  }
983  // RBX index, HF RBX indices are 132-155
984  int RBXindex = logicalMap_->getHcalFrontEndId(rechit->detid()).rbxIndex();
985 
986  occupancy_RBX[RBXindex]++;
988  }
989  else if (id.subdet()==HcalOuter)
990  {
991  if (en>=HOenergyThreshold_)
992  {
993  ++recentoccupancy_rechit[CalcEtaBin(id.subdet(),ieta,depth)][iphi-1][depth-1];
994  present_rechit[CalcEtaBin(id.subdet(),ieta,depth)][iphi-1][depth-1]=true;
995  if (RecHitPresentByDepth.depth[depth-1])
996  RecHitPresentByDepth.depth[depth-1]->setBinContent(CalcEtaBin(id.subdet(),ieta,depth)+1,iphi,1);
997  }
999  // RBX index, HO RBX indices are 73-95 (odd), 96-107 (all), 108-119 (odd), 120-130 (EXCL), 131
1000  int RBXindex = logicalMap_->getHcalFrontEndId(rechit->detid()).rbxIndex();
1001 
1002  occupancy_RBX[RBXindex]++;
1004  }
1005 }
1006 
1008 {
1009  // Fill Histograms showing digi cells with no occupancy for the past few lumiblocks
1010  if (!deadmon_test_digis_) return; // extra protection here against calling histograms than don't exist
1011 
1012  if (debug_>0)
1013  std::cout <<"<HcalDeadCellMonitor::fillNevents_recentdigis> CHECKING FOR RECENT MISSING DIGIS evtcount = "<<deadevt_<<std::endl;
1014 
1015  int ieta=0;
1016  int iphi=0;
1017 
1018  int etabins=0;
1019  int phibins=0;
1020 
1022  if ((deadevt_ >= 10 && deadevt_<minDeadEventCount_) || (deadevt_ >= 10 && is_RBX_loss_==1)) // maybe not enough events to run the standard test
1023  // if( is_RBX_loss_ == 1 ) // but enough to detect RBX loss
1024  for (unsigned int depth=0;depth<RecentMissingDigisByDepth.depth.size();++depth)
1025  {
1026  RecentMissingDigisByDepth.depth[depth]->setBinContent(0,0,ievt_);
1027  etabins=RecentMissingDigisByDepth.depth[depth]->getNbinsX();
1028  phibins=RecentMissingDigisByDepth.depth[depth]->getNbinsY();
1029  for (int eta=0;eta<etabins;++eta)
1030  for (int phi=0;phi<phibins;++phi)
1031  {
1032  iphi=phi+1;
1033  for (int subdet=1;subdet<=4;++subdet)
1034  {
1035  ieta=CalcIeta((HcalSubdetector)subdet,eta,depth+1);
1036  if (ieta==-9999) continue;
1037  if (!validDetId((HcalSubdetector)subdet, ieta, iphi, depth+1))
1038  continue;
1039  // now check which dead cell tests failed; increment counter if any failed
1040  HcalDetId TempID((HcalSubdetector)subdet, ieta, iphi, (int)depth+1);
1041 
1042  int index = logicalMap_->getHcalFrontEndId(TempID).rbxIndex();
1043  // if(subdet==HcalForward) continue;
1044 
1045  if(occupancy_RBX[index]==0)
1046  {
1047  recentoccupancy_digi[eta][phi][depth] = 0;
1048  RecentMissingDigisByDepth.depth[depth]->Fill(ieta,iphi,deadevt_);
1049  }
1050  }
1051  }
1052  }
1054 
1055  if (deadevt_ < minDeadEventCount_) return; // not enough entries to make a determination for this LS
1056 
1057  for (unsigned int depth=0;depth<RecentMissingDigisByDepth.depth.size();++depth)
1058  {
1059  RecentMissingDigisByDepth.depth[depth]->setBinContent(0,0,ievt_);
1060  etabins=RecentMissingDigisByDepth.depth[depth]->getNbinsX();
1061  phibins=RecentMissingDigisByDepth.depth[depth]->getNbinsY();
1062  for (int eta=0;eta<etabins;++eta)
1063  {
1064  for (int subdet=1;subdet<=4;++subdet)
1065  {
1066  ieta=CalcIeta((HcalSubdetector)subdet,eta,depth+1);
1067  if (ieta==-9999) continue;
1068  for (int phi=0;phi<phibins;++phi)
1069  {
1070  iphi=phi+1;
1071 
1072  if (!validDetId((HcalSubdetector)subdet, ieta, iphi, depth+1))
1073  continue;
1074 
1075  // Ignore subdetectors that weren't in run?
1076  /*
1077  if ((subdet==HcalBarrel && !HBpresent_) ||
1078  (subdet==HcalEndcap &&!HEpresent_) ||
1079  (subdet==HcalOuter &&!HOpresent_) ||
1080  (subdet==HcalForward &&!HFpresent_)) continue;
1081  */
1082  int zside=0;
1083  if (subdet==HcalForward) // shift HcalForward ieta
1084  ieta<0 ? zside=-1 : zside=+1;
1085 
1086  if (recentoccupancy_digi[eta][phi][depth]==0)
1087  {
1088  if (debug_>0)
1089  {
1090  std::cout <<"DEAD CELL; NO RECENT OCCUPANCY: subdet = "<<subdet<<", ieta = "<<ieta<<", iphi = "<<iphi<<" depth = "<<depth+1<<std::endl;
1091  std::cout <<"\t RAW COORDINATES: eta = "<<eta<< " phi = "<<phi<<" depth = "<<depth<<std::endl;
1092  std::cout <<"\t Present? "<<present_digi[eta][phi][depth]<<std::endl;
1093  }
1094 
1095  // Don't fill HORing2 if boolean enabled
1096  if (excludeHORing2_==true && abs(ieta)>10 && isSiPM(ieta,iphi,depth+1)==false)
1097  continue;
1098 
1099  // no digi was found for the N events; Fill cell as bad for all N events (N = checkN);
1100  if (RecentMissingDigisByDepth.depth[depth]) RecentMissingDigisByDepth.depth[depth]->Fill(ieta+zside,iphi,deadevt_);
1101  }
1102  } // for (int subdet=1;subdet<=4;++subdet)
1103  } // for (int phi=0;...)
1104  } // for (int eta=0;...)
1105  } //for (int depth=1;...)
1107 
1108  return;
1109 
1110 } // void HcalDeadCellMonitor::fillNevents_recentdigis()
1111 
1112 
1113 
1114 /* ----------------------------------- */
1115 
1117 {
1118  // Fill Histograms showing unoccupied rechits, or rec hits with low energy
1119 
1120  // This test is a bit pointless, unless the energy threshold is greater than the ZS threshold.
1121  // If we require that cells are always < thresh to be flagged by this test, and if
1122  // thresh < ZS, then we will never catch any cells, since they'll show up as dead in the
1123  // neverpresent/occupancy test plots first.
1124  // Only exception is if something strange is going on between ZS ADC value an RecHit energy?
1125 
1126  if (!deadmon_test_rechits_) return;
1128 
1129  if (debug_>0)
1130  std::cout <<"<HcalDeadCellMonitor::fillNevents_energy> BELOW-ENERGY-THRESHOLD PLOTS"<<std::endl;
1131 
1132  int ieta=0;
1133  int iphi=0;
1134 
1135  int etabins=0;
1136  int phibins=0;
1137 
1139  if ((deadevt_ >= 10 && deadevt_<minDeadEventCount_) || (deadevt_ >= 10 && is_RBX_loss_==1)) // maybe not enough events to run the standard test
1140  // if( is_RBX_loss_ == 1 ) // but enough to detect RBX loss
1141  for (unsigned int depth=0;depth<RecentMissingRecHitsByDepth.depth.size();++depth)
1142  {
1143  RecentMissingRecHitsByDepth.depth[depth]->setBinContent(0,0,ievt_);
1144  etabins=RecentMissingRecHitsByDepth.depth[depth]->getNbinsX();
1145  phibins=RecentMissingRecHitsByDepth.depth[depth]->getNbinsY();
1146  for (int eta=0;eta<etabins;++eta)
1147  for (int phi=0;phi<phibins;++phi)
1148  {
1149  iphi=phi+1;
1150  for (int subdet=1;subdet<=4;++subdet)
1151  {
1152  ieta=CalcIeta((HcalSubdetector)subdet,eta,depth+1);
1153  if (ieta==-9999) continue;
1154  if (!validDetId((HcalSubdetector)subdet, ieta, iphi, depth+1))
1155  continue;
1156  // now check which dead cell tests failed; increment counter if any failed
1157  HcalDetId TempID((HcalSubdetector)subdet, ieta, iphi, (int)depth+1);
1158 
1159  int index = logicalMap_->getHcalFrontEndId(TempID).rbxIndex();
1160  // if(subdet==HcalForward) continue;
1161 
1162  if(occupancy_RBX[index]==0)
1163  {
1164  recentoccupancy_rechit[eta][phi][depth] = 0;
1165  RecentMissingRecHitsByDepth.depth[depth]->Fill(ieta,iphi,deadevt_);
1166  }
1167  }
1168  }
1169  }
1171 
1172  if (deadevt_ < minDeadEventCount_) return; // not enough entries to make a determination for this LS
1173 
1174  for (unsigned int depth=0;depth<RecentMissingRecHitsByDepth.depth.size();++depth)
1175  {
1176  RecentMissingRecHitsByDepth.depth[depth]->setBinContent(0,0,ievt_);
1177  etabins=RecentMissingRecHitsByDepth.depth[depth]->getNbinsX();
1178  phibins=RecentMissingRecHitsByDepth.depth[depth]->getNbinsY();
1179  for (int eta=0;eta<etabins;++eta)
1180  {
1181  for (int subdet=1;subdet<=4;++subdet)
1182  {
1183  ieta=CalcIeta((HcalSubdetector)subdet,eta,depth+1);
1184  if (ieta==-9999) continue;
1185  for (int phi=0;phi<phibins;++phi)
1186  {
1187  iphi=phi+1;
1188  if (!validDetId((HcalSubdetector)subdet, ieta, iphi, depth+1))
1189  continue;
1190 
1191  if (recentoccupancy_rechit[eta][phi][depth]>0) continue; // cell exceeded energy at least once, so it's not dead
1192 
1193  // Ignore subdetectors that weren't in run?
1194  /*
1195  if ((subdet==HcalBarrel && !HBpresent_) ||
1196  (subdet==HcalEndcap &&!HEpresent_) ||
1197  (subdet==HcalOuter &&!HOpresent_) ||
1198  (subdet==HcalForward &&!HFpresent_)) continue;
1199  */
1200 
1201  int zside=0;
1202  if (subdet==HcalForward) // shift HcalForward ieta
1203  {
1204  ieta<0 ? zside=-1 : zside=+1;
1205  }
1206 
1207  if (debug_>2)
1208  std::cout <<"DEAD CELL; BELOW ENERGY THRESHOLD; subdet = "<<subdet<<" ieta = "<<ieta<<", phi = "<<iphi<<" depth = "<<depth+1<<std::endl;
1209  if (excludeHORing2_==true && abs(ieta)>10 && isSiPM(ieta,iphi,depth+1)==false)
1210  continue;
1211 
1212  if (RecentMissingRecHitsByDepth.depth[depth]) RecentMissingRecHitsByDepth.depth[depth]->Fill(ieta+zside,iphi,deadevt_);
1213  } // loop on phi bins
1214  } // for (unsigned int depth=1;depth<=4;++depth)
1215  } // // loop on subdetectors
1216  } // for (int eta=0;...)
1217 
1219 
1220  return;
1221 } // void HcalDeadCellMonitor::fillNevents_recentrechits()
1222 
1223 
1225 {
1226  //fillNevents_problemCells now only performs checks of never-present cells
1227 
1228  if (debug_>0)
1229  std::cout <<"<HcalDeadCellMonitor::fillNevents_problemCells> FILLING PROBLEM CELL PLOTS"<<std::endl;
1230 
1231  int ieta=0;
1232  int iphi=0;
1233 
1234  // Count problem cells in each subdetector
1235 
1236  NumBadHB=0;
1237  NumBadHE=0;
1238  NumBadHO=0;
1239  NumBadHF=0;
1240  NumBadHFLUMI=0;
1241  NumBadHO01=0;
1242  NumBadHO2=0;
1243  NumBadHO12=0;
1244  NumBadHO1P02=0;
1245 
1246  int knownBadHB=0;
1247  int knownBadHE=0;
1248  int knownBadHF=0;
1249  int knownBadHO=0;
1250  int knownBadHFLUMI=0;
1251  int knownBadHO01=0;
1252  int knownBadHO2=0;
1253  int knownBadHO12=0;
1254 
1255 
1256  unsigned int neverpresentHB=0;
1257  unsigned int neverpresentHE=0;
1258  unsigned int neverpresentHO=0;
1259  unsigned int neverpresentHF=0;
1260 
1261  unsigned int unoccupiedHB=0;
1262  unsigned int unoccupiedHE=0;
1263  unsigned int unoccupiedHO=0;
1264  unsigned int unoccupiedHF=0;
1265 
1266  unsigned int belowenergyHB=0;
1267  unsigned int belowenergyHE=0;
1268  unsigned int belowenergyHO=0;
1269  unsigned int belowenergyHF=0;
1270 
1271  unsigned int energyneverpresentHB=0;
1272  unsigned int energyneverpresentHE=0;
1273  unsigned int energyneverpresentHO=0;
1274  unsigned int energyneverpresentHF=0;
1275 
1277  Nevents->Fill(1,deadevt_);
1278 
1279  int etabins=0;
1280  int phibins=0;
1281 
1282  // Store values for number of bad channels in each lumi section, for plots of ProblemsVsLS.
1283  // This is different than the NumBadHB, etc. values, which must included even known bad channels
1284  // in order to calculate reportSummaryByLS values correctly.
1285 
1287  //Check for RBX data loss
1288  unsigned int RBX_loss_HB=0;
1289  unsigned int RBX_loss_HE=0;
1290  unsigned int RBX_loss_HO01=0;
1291  unsigned int RBX_loss_HO2=0;
1292  unsigned int RBX_loss_HF=0;
1293 
1294  unsigned int counter_HB = 0;
1295  unsigned int counter_HE = 0;
1296  unsigned int counter_HO01 = 0;
1297  unsigned int counter_HO2 = 0;
1298  unsigned int counter_HF = 0;
1299 
1300  for(int i=0; i<156; i++)
1301  {
1302  if(occupancy_RBX[i]==0 && is_RBX_loss_ == 1)
1303  {
1304  if(i<=35) //HB
1305  { counter_HB ++ ; RBX_loss_HB = 72*(counter_HB); }
1306  if(i>=36 && i<=71) //HE
1307  { counter_HE ++ ; RBX_loss_HE = 72*(counter_HE); }
1308  if(i>=85 && i<=119) // HO Rings 0, 1
1309  { counter_HO01 ++ ; RBX_loss_HO01 = 72*(counter_HO01); }
1310  if(i>=121 || i<=83) // HO Ring 2
1311  { counter_HO2 ++ ; RBX_loss_HO2 = 72*(counter_HO2); }
1312  if(i>=132 && i<=155) //HF
1313  { counter_HF ++ ; RBX_loss_HF = 72*(counter_HF); }
1314 
1315  if(excludeHO1P02_==true && i==109) NumBadHO1P02 = 72; // exclude HO1P02
1316  }
1317  if(occupancy_RBX[i]>0)
1319  if(occupancy_RBX[i]==0 && is_RBX_loss_ == 1)
1320  RBX_loss_VS_LB->Fill(currentLS, i, 1);
1321  }
1322 
1323  if (deadevt_ >= 10 && deadevt_<minDeadEventCount_) // maybe not enough events to run the standard test
1324  if( is_RBX_loss_ == 1 ) // but enough to detect RBX loss
1325  {
1326  NumBadHB+=RBX_loss_HB;
1327  NumBadHE+=RBX_loss_HE;
1328  NumBadHO+=RBX_loss_HO01+RBX_loss_HO2;
1329  NumBadHO01+=RBX_loss_HO01;
1330  NumBadHO2+=RBX_loss_HO2;
1331  NumBadHF+=RBX_loss_HF;
1332 
1333  belowenergyHB+=RBX_loss_HB;
1334  belowenergyHE+=RBX_loss_HE;
1335  belowenergyHO+=RBX_loss_HO01+RBX_loss_HO2;
1336  belowenergyHF+=RBX_loss_HF;
1337 
1338  unoccupiedHB+=RBX_loss_HB;
1339  unoccupiedHE+=RBX_loss_HE;
1340  unoccupiedHO+=RBX_loss_HO01+RBX_loss_HO2;
1341  unoccupiedHF+=RBX_loss_HF;
1342  }
1344 
1345  for (unsigned int depth=0;depth<DigiPresentByDepth.depth.size();++depth)
1346  {
1347  DigiPresentByDepth.depth[depth]->setBinContent(0,0,ievt_);
1348  etabins=DigiPresentByDepth.depth[depth]->getNbinsX();
1349  phibins=DigiPresentByDepth.depth[depth]->getNbinsY();
1350  for (int eta=0;eta<etabins;++eta)
1351  {
1352  for (int phi=0;phi<phibins;++phi)
1353  {
1354  iphi=phi+1;
1355  for (int subdet=1;subdet<=4;++subdet)
1356  {
1357  ieta=CalcIeta((HcalSubdetector)subdet,eta,depth+1);
1358  if (ieta==-9999) continue;
1359  if (!validDetId((HcalSubdetector)subdet, ieta, iphi, depth+1))
1360  continue;
1361  // Ignore subdetectors that weren't in run?
1362  /*
1363  if ((subdet==HcalBarrel && !HBpresent_) ||
1364  (subdet==HcalEndcap &&!HEpresent_) ||
1365  (subdet==HcalOuter &&!HOpresent_) ||
1366  (subdet==HcalForward &&!HFpresent_)) continue;
1367  */
1368 
1369  /*
1370  if ((!checkHB_ && subdet==HcalBarrel) ||
1371  (!checkHE_ && subdet==HcalEndcap) ||
1372  (!checkHO_ && subdet==HcalOuter) ||
1373  (!checkHF_ && subdet==HcalForward)) continue;
1374  */
1375 
1376  // now check which dead cell tests failed; increment counter if any failed
1377  if ((present_digi[eta][phi][depth]==0) ||
1380  )
1381  {
1382  HcalDetId TempID((HcalSubdetector)subdet, ieta, iphi, (int)depth+1);
1383  if (subdet==HcalBarrel)
1384  {
1385  ++NumBadHB;
1386  if (KnownBadCells_.find(TempID.rawId())!=KnownBadCells_.end())
1387  ++knownBadHB;
1388  }
1389  else if (subdet==HcalEndcap)
1390  {
1391  ++NumBadHE;
1392  if (KnownBadCells_.find(TempID.rawId())!=KnownBadCells_.end())
1393  ++knownBadHE;
1394  }
1395 
1396  else if (subdet==HcalOuter)
1397  {
1398  ++NumBadHO;
1399  if (abs(ieta)<=10) ++NumBadHO01;
1400  else ++NumBadHO2;
1401  // Don't include HORing2 if boolean set; subtract away those counters
1402  if (excludeHORing2_==true && abs(ieta)>10 && isSiPM(ieta,iphi,depth+1)==false)
1403  {
1404  --NumBadHO;
1405  --NumBadHO2;
1406  --NumBadHO12;
1407  }
1408  // Don't include HO1P02 if boolean set, RBX does not repsond well to resets,; subtract away those counters
1409  if (excludeHO1P02_==true && ( (ieta>4 && ieta<10) && (iphi<=10 || iphi>70) ) )
1410  ++NumBadHO1P02;
1411 
1412  if (KnownBadCells_.find(TempID.rawId())!=KnownBadCells_.end())
1413  {
1414  ++knownBadHO;
1415  if (abs(ieta)<=10) ++knownBadHO01;
1416  else ++knownBadHO2;
1417  // Don't include HORing2 if boolean set; subtract away those counters
1418  if (excludeHORing2_==true && abs(ieta)>10 && isSiPM(ieta,iphi,depth+1)==false)
1419  {
1420  --knownBadHO;
1421  --knownBadHO12;
1422  }
1423  }
1424  }
1425  else if (subdet==HcalForward)
1426  {
1427  ++NumBadHF;
1428  if (depth==1 && (abs(ieta)==33 || abs(ieta)==34))
1429  ++NumBadHFLUMI;
1430  else if (depth==2 && (abs(ieta)==35 || abs(ieta)==36))
1431  ++NumBadHFLUMI;
1432  if (KnownBadCells_.find(TempID.rawId())!=KnownBadCells_.end())
1433  {
1434  ++knownBadHF;
1435  if (depth==1 && (abs(ieta)==33 || abs(ieta)==34))
1436  ++knownBadHFLUMI;
1437  else if (depth==2 && (abs(ieta)==35 || abs(ieta)==36))
1438  ++knownBadHFLUMI;
1439  }
1440  }
1441  }
1442  if (present_digi[eta][phi][depth]==0 )
1443  {
1444  if (subdet==HcalBarrel) ++neverpresentHB;
1445  else if (subdet==HcalEndcap) ++neverpresentHE;
1446  else if (subdet==HcalOuter)
1447  {
1448  ++neverpresentHO;
1449  if (excludeHORing2_==true && abs(ieta)>10 && isSiPM(ieta,iphi,depth+1)==false)
1450  --neverpresentHO;
1451  }
1452  else if (subdet==HcalForward) ++neverpresentHF;
1453  }
1454  // Count recent unoccupied digis if the total events in this lumi section is > minEvents_
1456  {
1457  HcalDetId TempID((HcalSubdetector)subdet, ieta, iphi, (int)depth+1);
1458  if (subdet==HcalBarrel) ++unoccupiedHB;
1459  else if (subdet==HcalEndcap) ++unoccupiedHE;
1460  else if (subdet==HcalOuter)
1461  {
1462  ++unoccupiedHO;
1463  if (excludeHORing2_==true && abs(ieta)>10 && isSiPM(ieta,iphi,depth+1)==false)
1464  --unoccupiedHO;
1465  if (KnownBadCells_.find(TempID.rawId())!=KnownBadCells_.end() && abs(ieta)<=10)
1466  --unoccupiedHO;
1467  }
1468  else if (subdet==HcalForward) ++unoccupiedHF;
1469  }
1470  // Look at rechit checks
1472  {
1473  if (present_rechit[eta][phi][depth]==0)
1474  {
1475  if (subdet==HcalBarrel) ++energyneverpresentHB;
1476  else if (subdet==HcalEndcap) ++energyneverpresentHE;
1477  else if (subdet==HcalOuter)
1478  {
1479  ++energyneverpresentHO;
1480  if (excludeHORing2_==true && abs(ieta)>10 && isSiPM(ieta,iphi,depth+1)==false)
1481  --energyneverpresentHO;
1482  }
1483  else if (subdet==HcalForward) ++energyneverpresentHF;
1484  }
1486  {
1487  HcalDetId TempID((HcalSubdetector)subdet, ieta, iphi, (int)depth+1);
1488  if (subdet==HcalBarrel) ++belowenergyHB;
1489  else if (subdet==HcalEndcap) ++belowenergyHE;
1490  else if (subdet==HcalOuter)
1491  {
1492  ++belowenergyHO;
1493  if (excludeHORing2_==true && abs(ieta)>10 && isSiPM(ieta,iphi,depth+1)==false)
1494  --belowenergyHO;
1495  if (KnownBadCells_.find(TempID.rawId())!=KnownBadCells_.end() && abs(ieta)<=10)
1496  --belowenergyHO;
1497  }
1498  else if (subdet==HcalForward) ++belowenergyHF;
1499  }
1500  }
1501  } // subdet loop
1502  } // phi loop
1503  } //eta loop
1504  } // depth loop
1505 
1506  // Fill with number of problem cells found on this pass
1507  NumberOfNeverPresentDigisHB->Fill(currentLS,neverpresentHB);
1508  NumberOfNeverPresentDigisHE->Fill(currentLS,neverpresentHE);
1509  NumberOfNeverPresentDigisHO->Fill(currentLS,neverpresentHO);
1510  NumberOfNeverPresentDigisHF->Fill(currentLS,neverpresentHF);
1511  NumberOfNeverPresentDigis->Fill(currentLS,neverpresentHB+neverpresentHE+neverpresentHO+neverpresentHF);
1512 
1514  {
1515  if( NumBadHB<RBX_loss_HB )
1516  NumBadHB+=RBX_loss_HB;
1517  if( NumBadHE<RBX_loss_HE )
1518  NumBadHE+=RBX_loss_HE;
1519  if( NumBadHO01<RBX_loss_HO01 )
1520  NumBadHO01+=RBX_loss_HO01;
1521  if( NumBadHO2<RBX_loss_HO2 )
1522  NumBadHO2+=RBX_loss_HO2;
1523  if( NumBadHF<RBX_loss_HF )
1524  NumBadHF+=RBX_loss_HF;
1525 
1526  if( belowenergyHB<RBX_loss_HB )
1527  belowenergyHB+=RBX_loss_HB;
1528  if( belowenergyHE<RBX_loss_HE )
1529  belowenergyHE+=RBX_loss_HE;
1530  if( belowenergyHO<RBX_loss_HO01+RBX_loss_HO2)
1531  belowenergyHO+=RBX_loss_HO01+RBX_loss_HO2;
1532  if( belowenergyHF<RBX_loss_HF )
1533  belowenergyHF+=RBX_loss_HF;
1534 
1535  if( unoccupiedHB<RBX_loss_HB )
1536  unoccupiedHB+=RBX_loss_HB;
1537  if( unoccupiedHE<RBX_loss_HE )
1538  unoccupiedHE+=RBX_loss_HE;
1539  if( unoccupiedHO<RBX_loss_HO01+RBX_loss_HO2 )
1540  unoccupiedHO+=RBX_loss_HO01+RBX_loss_HO2;
1541  if( unoccupiedHF<RBX_loss_HF )
1542  unoccupiedHF+=RBX_loss_HF;
1543 
1544  // is_RBX_loss_ = 0;
1545  }
1546 
1547  ProblemsVsLB_HB->Fill(currentLS,NumBadHB-knownBadHB+0.0001); // add a small offset, so that the histograms reset when no errors follow
1548  ProblemsVsLB_HE->Fill(currentLS,NumBadHE-knownBadHE+0.0001); // problematic LSs
1549  ProblemsVsLB_HO->Fill(currentLS,NumBadHO01-knownBadHO01+0.0001);
1550  ProblemsVsLB_HO2->Fill(currentLS,NumBadHO2-knownBadHO2+0.0001);
1551  ProblemsVsLB_HF->Fill(currentLS,NumBadHF-knownBadHF+0.0001);
1552  ProblemsVsLB_HBHEHF->Fill(currentLS,NumBadHB+NumBadHE+NumBadHF-knownBadHB-knownBadHE-knownBadHF+0.0001);
1553  ProblemsVsLB->Fill(currentLS,NumBadHB+NumBadHE+NumBadHO01+NumBadHO2+NumBadHF-knownBadHB-knownBadHE-knownBadHO01-knownBadHO2-knownBadHF+0.0001);
1554 
1555  if(excludeHO1P02_==true)
1557 
1558  if( NumBadHB+NumBadHE+NumBadHF-knownBadHB-knownBadHE-knownBadHF < 30 )
1559  alarmer_counter_ = 0;
1560  if( NumBadHO01-knownBadHO01 < 30 )
1562 
1563  if( alarmer_counter_ >= 10 )
1564  ProblemsInLastNLB_HBHEHF_alarm->Fill( std::min(int(NumBadHB+NumBadHE+NumBadHF-knownBadHB-knownBadHE-knownBadHF), 99) );
1565  if( alarmer_counterHO01_ >= 10 )
1566  ProblemsInLastNLB_HO01_alarm->Fill( std::min(int(NumBadHO01-knownBadHO01), 99) );
1567 
1568  // if (deadevt_<minDeadEventCount_)
1569  // return;
1570 
1571  if (deadmon_test_digis_)
1572  {
1577  NumberOfRecentMissingDigis->Fill(currentLS,unoccupiedHB+unoccupiedHE+unoccupiedHO+unoccupiedHF);
1578  }
1579 
1581  {
1582  NumberOfNeverPresentRecHitsHB->Fill(currentLS,energyneverpresentHB);
1583  NumberOfNeverPresentRecHitsHE->Fill(currentLS,energyneverpresentHE);
1584  NumberOfNeverPresentRecHitsHO->Fill(currentLS,energyneverpresentHO);
1585  NumberOfNeverPresentRecHitsHF->Fill(currentLS,energyneverpresentHF);
1586  NumberOfNeverPresentRecHits->Fill(currentLS,energyneverpresentHB+energyneverpresentHE+energyneverpresentHO+energyneverpresentHF);
1587 
1592  NumberOfRecentMissingRecHits->Fill(currentLS,belowenergyHB+belowenergyHE+belowenergyHO+belowenergyHF);
1593  }
1594 
1595  return;
1596 } // void HcalDeadCellMonitor::fillNevents_problemCells(void)
1597 
1598 
1599 void HcalDeadCellMonitor::zeroCounters(bool resetpresent)
1600 {
1601 
1602  // zero all counters
1603 
1604  // 2D histogram counters
1605  for (unsigned int i=0;i<85;++i)
1606  {
1607  for (unsigned int j=0;j<72;++j)
1608  {
1609  for (unsigned int k=0;k<4;++k)
1610  {
1611  if (resetpresent) present_digi[i][j][k]=false; // keeps track of whether digi was ever present
1612  if (resetpresent) present_rechit[i][j][k]=false;
1613  recentoccupancy_digi[i][j][k]=0; // counts occupancy in last (checkNevents) events
1614  recentoccupancy_rechit[i][j][k]=0; // counts instances of cell above threshold energy in last (checkNevents)
1615  }
1616  }
1617  }
1618 
1619  for (unsigned int i=0;i<156;++i)
1620  {
1621  occupancy_RBX[i] = 0;
1622  rbxlost[i] = 0;
1623  }
1624 
1625  return;
1626 } // void HcalDeadCellMonitor::zeroCounters(bool resetpresent)
1627 
edm::InputTag hfRechitLabel_
void beginRun(const edm::Run &run, const edm::EventSetup &c)
T getUntrackedParameter(std::string const &, T const &) const
int i
Definition: DBlmapReader.cc:9
MonitorElement * NumberOfNeverPresentRecHitsHO
bool LumiInOrder(int lumisec)
MonitorElement * NumberOfRecentMissingRecHitsHF
MonitorElement * NumberOfNeverPresentRecHits
void setBinContent(int binx, double content)
set content of bin (1-D)
MonitorElement * ProblemsCurrentLB
MonitorElement * NumberOfNeverPresentDigisHB
const int binmapd2[]
void analyze(edm::Event const &e, edm::EventSetup const &s)
virtual void analyze(const edm::Event &e, const edm::EventSetup &c)
MonitorElement * HEDeadVsEvent
MonitorElement * NumberOfRecentMissingRecHits
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:717
void zeroCounters(bool resetpresent=false)
bool present_digi[85][72][4]
edm::InputTag hbheRechitLabel_
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
std::map< unsigned int, int > KnownBadCells_
MonitorElement * NumberOfNeverPresentDigisHE
std::vector< int > AllowedCalibTypes_
void endRun(const edm::Run &run, const edm::EventSetup &c)
void Reset(void)
std::vector< T >::const_iterator const_iterator
HcalDeadCellMonitor(const edm::ParameterSet &ps)
void setBinLabel(int bin, const std::string &label, int axis=1)
set bin label for x, y or z axis (axis=1, 2, 3 respectively)
#define abs(x)
Definition: mlp_lapack.h:159
edm::LuminosityBlockNumber_t luminosityBlock() const
Definition: EventBase.h:59
MonitorElement * NumberOfRecentMissingDigisHB
#define min(a, b)
Definition: mlp_lapack.h:161
void update(void)
Mark the object updated.
void process_RecHit(T &rechit)
T eta() const
MonitorElement * ProblemsInLastNLB_HO01_alarm
MonitorElement * NumberOfRecentMissingDigisHE
bool present_rechit[85][72][4]
MonitorElement * bookFloat(const char *name)
Book float.
Definition: DQMStore.cc:654
void Fill(long long x)
LuminosityBlockNumber_t luminosityBlock() const
uint32_t rawId() const
get the raw id
Definition: DetId.h:45
bool isSiPM(int ieta, int iphi, int depth)
EtaPhiHists RecHitPresentByDepth
MonitorElement * RBX_loss_VS_LB
std::vector< MonitorElement * > depth
virtual void beginRun(const edm::Run &run, const edm::EventSetup &c)
int CalcIeta(int subdet, int eta, int depth)
MonitorElement * ProblemsVsLB
void removeContents(void)
erase all monitoring elements in current directory (not including subfolders);
Definition: DQMStore.cc:2564
MonitorElement * NumberOfNeverPresentDigisHF
MonitorElement * ProblemsVsLB_HBHEHF
edm::InputTag hoRechitLabel_
std::vector< DetId > getAllChannels() const
unsigned int occupancy_RBX[156]
MonitorElement * NumberOfNeverPresentDigisHO
void processEvent_HBHEdigi(const HBHEDataFrame digi)
MonitorElement * NumberOfNeverPresentRecHitsHB
HcalSubdetector
Definition: HcalAssistant.h:32
int j
Definition: DBlmapReader.cc:9
MonitorElement * Nevents
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
unsigned int recentoccupancy_rechit[85][72][4]
MonitorElement * NumberOfRecentMissingRecHitsHE
MonitorElement * ProblemsVsLB_HF
MonitorElement * NumberOfRecentMissingDigisHO
bool isValid() const
Definition: HandleBase.h:76
MonitorElement * NumberOfNeverPresentRecHitsHF
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:356
MonitorElement * ProblemsVsLB_HB
int k[5][pyjets_maxn]
const cms_uint32_t totalIntensityBeam2() const
const_iterator end() const
const HcalFrontEndId getHcalFrontEndId(const DetId &)
const cms_uint32_t totalIntensityBeam1() const
unsigned int recentoccupancy_digi[85][72][4]
void processEvent(const HBHERecHitCollection &hbHits, const HORecHitCollection &hoHits, const HFRecHitCollection &hfHits, const HBHEDigiCollection &hbhedigi, const HODigiCollection &hodigi, const HFDigiCollection &hfdigi)
EtaPhiHists RecentMissingDigisByDepth
MonitorElement * NumberOfRecentMissingRecHitsHO
const T & get() const
Definition: EventSetup.h:55
T const * product() const
Definition: ESHandle.h:62
EtaPhiHists DigiPresentByDepth
int rbxIndex() const
virtual void reset(void)
void FillUnphysicalHEHFBins(std::vector< TH2F > &hh)
T const * product() const
Definition: Handle.h:74
EtaPhiHists RecentMissingRecHitsByDepth
int CalcEtaBin(int subdet, int ieta, int depth)
void SetupEtaPhiHists(EtaPhiHists &hh, std::string Name, std::string Units)
MonitorElement * HBDeadVsEvent
MonitorElement * NumberOfNeverPresentRecHitsHE
TString units(TString variable, Char_t axis)
MonitorElement * ProblemsVsLB_HE
TProfile * getTProfile(void) const
MonitorElement * NumberOfNeverPresentDigis
MonitorElement * NumberOfRecentMissingDigis
const JetExtendedData & getValue(const Container &, const reco::JetBaseRef &)
get value for the association. Throw exception if no association found
void endLuminosityBlock(const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &c)
MonitorElement * NumberOfRecentMissingDigisHF
tuple cout
Definition: gather_cfg.py:121
void process_Digi(T &digi)
tuple status
Definition: ntuplemaker.py:245
MonitorElement * bookInt(const char *name)
Book int.
Definition: DQMStore.cc:624
MonitorElement * ProblemsInLastNLB_HBHEHF_alarm
MonitorElement * book2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D histogram.
Definition: DQMStore.cc:845
virtual void setup(void)
const Item * getValues(DetId fId) const
MonitorElement * HFDeadVsEvent
HcalLogicalMap * logicalMap_
void Reset(void)
reset ME (ie. contents, errors, etc)
const cms_uint16_t beamMode() const
MonitorElement * ProblemsVsLB_HO2
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:429
MonitorElement * HODeadVsEvent
const_iterator begin() const
Definition: Run.h:33
bool validDetId(HcalSubdetector sd, int ies, int ip, int dp)
MonitorElement * NumberOfRecentMissingRecHitsHB
MonitorElement * ProblemsVsLB_HO
Definition: DDAxes.h:10