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