CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
HcalRecHitClient.cc
Go to the documentation of this file.
4 
8 
9 #include <iostream>
10 
11 /*
12  * \file HcalRecHitClient.cc
13  *
14  * \author J. Temple
15  * \brief Dead Cell Client class
16  */
17 
19 {
20  name_=myname;
21 }
22 
24 {
25  name_=myname;
26  enableCleanup_ = ps.getUntrackedParameter<bool>("enableCleanup",false);
27  debug_ = ps.getUntrackedParameter<int>("debug",0);
28  prefixME_ = ps.getUntrackedParameter<std::string>("subSystemFolder","Hcal/");
29  if (prefixME_.substr(prefixME_.size()-1,prefixME_.size())!="/")
30  prefixME_.append("/");
31  subdir_ = ps.getUntrackedParameter<std::string>("RecHitFolder","RecHitMonitor_Hcal/"); // RecHitMonitor_Hcal
32  if (subdir_.size()>0 && subdir_.substr(subdir_.size()-1,subdir_.size())!="/")
33  subdir_.append("/");
34  subdir_=prefixME_+subdir_;
35 
36  validHtmlOutput_ = ps.getUntrackedParameter<bool>("RecHit_validHtmlOutput",true);
37  cloneME_ = ps.getUntrackedParameter<bool>("cloneME", true);
38  badChannelStatusMask_ = ps.getUntrackedParameter<int>("RecHit_BadChannelStatusMask",
39  ps.getUntrackedParameter<int>("BadChannelStatusMask",
40  0)); // identify channel status values to mask
41 
42  minerrorrate_ = ps.getUntrackedParameter<double>("RecHit_minerrorrate",
43  ps.getUntrackedParameter<double>("minerrorrate",0.01));
44  minevents_ = ps.getUntrackedParameter<int>("RecHit_minevents",
45  ps.getUntrackedParameter<int>("minevents",1));
46  enoughevents_=false;
47  Online_ = ps.getUntrackedParameter<bool>("online",false);
48 
49  ProblemCells=0;
51 
54  meTimeByDepth=0;
58 
59  doProblemCellSetup_ = true;
60 }
61 
63 {
64  if (debug_>2) std::cout <<"\tHcalRecHitClient::analyze()"<<std::endl;
65 
67 
68  TH2F* OccupancyByDepth[4];
69  TH2F* SumEnergyByDepth[4];
70  TH2F* SumTimeByDepth[4];
71  TH2F* SqrtSumEnergy2ByDepth[4];
72 
73  TH2F* OccupancyThreshByDepth[4];
74  TH2F* SumEnergyThreshByDepth[4];
75  TH2F* SumTimeThreshByDepth[4];
76  TH2F* SqrtSumEnergy2ThreshByDepth[4];
77 
78  std::vector<std::string> name = HcalEtaPhiHistNames();
79 
80  MonitorElement* me;
81  bool gotHistos=true;
82 
83  for (int i=0;i<4;++i)
84  {
85  std::string s=subdir_+"Distributions_AllRecHits/"+name[i]+"RecHit Occupancy";
86  me=ig.get(s.c_str());
87  if (me==0) {if (debug_>0) std::cout <<"Could not get histogram "<<s<<std::endl; gotHistos=false; break;}
88  OccupancyByDepth[i]=HcalUtilsClient::getHisto<TH2F*>(me, cloneME_, OccupancyByDepth[i], debug_);
89  s=subdir_+"Distributions_AllRecHits/sumplots/"+name[i]+"RecHit Summed Energy GeV";
90  me=ig.get(s.c_str());
91  if (me==0) {if (debug_>0) std::cout <<"Could not get histogram "<<s<<std::endl; gotHistos=false; break;}
92  SumEnergyByDepth[i]=HcalUtilsClient::getHisto<TH2F*>(me, cloneME_, SumEnergyByDepth[i], debug_);
93  s=subdir_+"Distributions_AllRecHits/sumplots/"+name[i]+"RecHit Summed Time nS";
94  me=ig.get(s.c_str());
95  if (me==0) {if (debug_>0) std::cout <<"Could not get histogram "<<s<<std::endl; gotHistos=false; break;}
96  SumTimeByDepth[i]=HcalUtilsClient::getHisto<TH2F*>(me, cloneME_, SumTimeByDepth[i], debug_);
97  s=subdir_+"Distributions_AllRecHits/sumplots/"+name[i]+"RecHit Sqrt Summed Energy2 GeV";
98  me=ig.get(s.c_str());
99  if (me==0) {if (debug_>0) std::cout <<"Could not get histogram "<<s<<std::endl; gotHistos=false; break;}
100  SqrtSumEnergy2ByDepth[i]=HcalUtilsClient::getHisto<TH2F*>(me, cloneME_, SqrtSumEnergy2ByDepth[i], debug_);
101 
102  // Threshold histograms
103  s=subdir_+"Distributions_PassedMinBias/"+name[i]+"Above Threshold RecHit Occupancy";
104  me=ig.get(s.c_str());
105  if (me==0) {if (debug_>0) std::cout <<"Could not get histogram "<<s<<std::endl; gotHistos=false; break;}
106  OccupancyThreshByDepth[i]=HcalUtilsClient::getHisto<TH2F*>(me, cloneME_, OccupancyThreshByDepth[i], debug_);
107  s=subdir_+"Distributions_PassedMinBias/sumplots/"+name[i]+"Above Threshold RecHit Summed Energy GeV";
108  me=ig.get(s.c_str());
109  if (me==0) {if (debug_>0) std::cout <<"Could not get histogram "<<s<<std::endl; gotHistos=false; break;}
110  SumEnergyThreshByDepth[i]=HcalUtilsClient::getHisto<TH2F*>(me, cloneME_, SumEnergyThreshByDepth[i], debug_);
111  s=subdir_+"Distributions_PassedMinBias/sumplots/"+name[i]+"Above Threshold RecHit Summed Time nS";
112  me=ig.get(s.c_str());
113  if (me==0) {if (debug_>0) std::cout <<"Could not get histogram "<<s<<std::endl; gotHistos=false; break;}
114  SumTimeThreshByDepth[i]=HcalUtilsClient::getHisto<TH2F*>(me, cloneME_, SumTimeThreshByDepth[i], debug_);
115  s=subdir_+"Distributions_PassedMinBias/sumplots/"+name[i]+"Above Threshold RecHit Sqrt Summed Energy2 GeV";
116  me=ig.get(s.c_str());
117  if (me==0) {if (debug_>0) std::cout <<"Could not get histogram "<<s<<std::endl; gotHistos=false; break;}
118  SqrtSumEnergy2ThreshByDepth[i]=HcalUtilsClient::getHisto<TH2F*>(me, cloneME_, SqrtSumEnergy2ThreshByDepth[i], debug_);
119  }
120  if (gotHistos==false)
121  {
122  if (debug_>0) std::cout <<"<HcalRecHitClient::calculateProblems()> Not all histograms could be found; skipping normalization"<<std::endl;
123  return;
124  }
125 
126  // Clear histograms before re-filling
127  meHBEnergy_1D->Reset();
129  meHEEnergy_1D->Reset();
131  meHOEnergy_1D->Reset();
133  meHFEnergy_1D->Reset();
143 
144  for (int mydepth=0;mydepth<4;++mydepth)
145  {
146  for (int eta=0;eta<OccupancyByDepth[mydepth]->GetNbinsX();++eta)
147  {
148  // eta+1=1: ieta = -42
149  // eta+1=13: ieta = -29
150 
151  for (int phi=0;phi<72;++phi)
152  {
153  if (OccupancyByDepth[mydepth]->GetBinContent(eta+1, phi+1)>0)
154  {
155  // fill 1D plots
156  if (isHB(eta,mydepth+1))
157  {
158  if (topo_->validDetId(HcalBarrel, CalcIeta(HcalBarrel, eta, mydepth+1), phi+1, mydepth+1))
159  {
160  meHBEnergy_1D->Fill(SumEnergyByDepth[mydepth]->GetBinContent(eta+1, phi+1)/OccupancyByDepth[mydepth]->GetBinContent(eta+1, phi+1));
161  meHBEnergyRMS_1D->Fill(sqrt(pow(SqrtSumEnergy2ByDepth[mydepth]->GetBinContent(eta+1, phi+1),2)/OccupancyByDepth[mydepth]->GetBinContent(eta+1, phi+1)-pow(SumEnergyByDepth[mydepth]->GetBinContent(eta+1, phi+1)/OccupancyByDepth[mydepth]->GetBinContent(eta+1, phi+1),2)));
162  }
163  }
164  else if (isHE(eta,mydepth+1))
165  {
166  if (topo_->validDetId(HcalEndcap, CalcIeta(HcalEndcap, eta, mydepth+1), phi+1, mydepth+1))
167  {
168 
169  meHEEnergy_1D->Fill(SumEnergyByDepth[mydepth]->GetBinContent(eta+1, phi+1)/OccupancyByDepth[mydepth]->GetBinContent(eta+1, phi+1));
170  meHEEnergyRMS_1D->Fill(sqrt(pow(SqrtSumEnergy2ByDepth[mydepth]->GetBinContent(eta+1, phi+1),2)/OccupancyByDepth[mydepth]->GetBinContent(eta+1, phi+1)-pow(SumEnergyByDepth[mydepth]->GetBinContent(eta+1, phi+1)/OccupancyByDepth[mydepth]->GetBinContent(eta+1, phi+1),2)));
171  }
172  }
173  else if (isHO(eta,mydepth+1))
174  {
175  if (topo_->validDetId(HcalOuter, CalcIeta(HcalOuter, eta, mydepth+1), phi+1, mydepth+1))
176  {
177  meHOEnergy_1D->Fill(SumEnergyByDepth[mydepth]->GetBinContent(eta+1, phi+1)/OccupancyByDepth[mydepth]->GetBinContent(eta+1, phi+1));
178  meHOEnergyRMS_1D->Fill(sqrt(pow(SqrtSumEnergy2ByDepth[mydepth]->GetBinContent(eta+1, phi+1),2)/OccupancyByDepth[mydepth]->GetBinContent(eta+1, phi+1)-pow(SumEnergyByDepth[mydepth]->GetBinContent(eta+1, phi+1)/OccupancyByDepth[mydepth]->GetBinContent(eta+1, phi+1),2)));
179  }
180  }
181  else if (isHF(eta,mydepth+1))
182  {
183  if (topo_->validDetId(HcalForward, CalcIeta(HcalForward, eta, mydepth+1), phi+1, mydepth+1))
184  {
185  meHFEnergy_1D->Fill(SumEnergyByDepth[mydepth]->GetBinContent(eta+1, phi+1)/OccupancyByDepth[mydepth]->GetBinContent(eta+1, phi+1));
186  meHFEnergyRMS_1D->Fill(sqrt(pow(SqrtSumEnergy2ByDepth[mydepth]->GetBinContent(eta+1, phi+1),2)/OccupancyByDepth[mydepth]->GetBinContent(eta+1, phi+1)-pow(SumEnergyByDepth[mydepth]->GetBinContent(eta+1, phi+1)/OccupancyByDepth[mydepth]->GetBinContent(eta+1, phi+1),2)));
187  }
188  }
189  // normalize 2D plots by number of events
190 
191  meEnergyByDepth->depth[mydepth]->setBinContent(eta+1, phi+1, SumEnergyByDepth[mydepth]->GetBinContent(eta+1, phi+1)/OccupancyByDepth[mydepth]->GetBinContent(eta+1, phi+1));
192  meTimeByDepth->depth[mydepth]->setBinContent(eta+1, phi+1, SumTimeByDepth[mydepth]->GetBinContent(eta+1, phi+1)/OccupancyByDepth[mydepth]->GetBinContent(eta+1, phi+1));
193  } // (OccupancyByDepth[mydepth]->GetBinContent(eta+1,phi+1)>0)
194 
195  if (OccupancyThreshByDepth[mydepth]==0) continue;
196  if (OccupancyThreshByDepth[mydepth]->GetBinContent(eta+1, phi+1)>0)
197  {
198  // fill 1D plots
199  if (isHB(eta,mydepth+1))
200  {
201  if (topo_->validDetId(HcalBarrel, CalcIeta(HcalBarrel, eta, mydepth+1), phi+1, mydepth+1))
202  {
203  meHBEnergyThresh_1D->Fill(SumEnergyThreshByDepth[mydepth]->GetBinContent(eta+1, phi+1)/OccupancyThreshByDepth[mydepth]->GetBinContent(eta+1, phi+1));
204  double RMS=pow(SqrtSumEnergy2ThreshByDepth[mydepth]->GetBinContent(eta+1, phi+1),2)/OccupancyThreshByDepth[mydepth]->GetBinContent(eta+1,phi+1)-pow(SumEnergyThreshByDepth[mydepth]->GetBinContent(eta+1, phi+1)/OccupancyThreshByDepth[mydepth]->GetBinContent(eta+1, phi+1),2);
205  RMS=pow(fabs(RMS),0.5);
207  }
208  }
209  else if (isHE(eta,mydepth+1))
210  {
211  if (topo_->validDetId(HcalEndcap, CalcIeta(HcalEndcap, eta, mydepth+1), phi+1, mydepth+1))
212  {
213 
214  meHEEnergyThresh_1D->Fill(SumEnergyThreshByDepth[mydepth]->GetBinContent(eta+1, phi+1)/OccupancyThreshByDepth[mydepth]->GetBinContent(eta+1, phi+1));
215  double RMS=pow(SqrtSumEnergy2ThreshByDepth[mydepth]->GetBinContent(eta+1, phi+1),2)/OccupancyThreshByDepth[mydepth]->GetBinContent(eta+1,phi+1)-pow(SumEnergyThreshByDepth[mydepth]->GetBinContent(eta+1, phi+1)/OccupancyThreshByDepth[mydepth]->GetBinContent(eta+1, phi+1),2);
216  RMS=pow(fabs(RMS),0.5);
218  }
219  }
220  else if (isHO(eta,mydepth+1))
221  {
222  if (topo_->validDetId(HcalOuter, CalcIeta(HcalOuter, eta, mydepth+1), phi+1, mydepth+1))
223  {
224  meHOEnergyThresh_1D->Fill(SumEnergyThreshByDepth[mydepth]->GetBinContent(eta+1, phi+1)/OccupancyThreshByDepth[mydepth]->GetBinContent(eta+1, phi+1));
225  double RMS=pow(SqrtSumEnergy2ThreshByDepth[mydepth]->GetBinContent(eta+1, phi+1),2)/OccupancyThreshByDepth[mydepth]->GetBinContent(eta+1,phi+1)-pow(SumEnergyThreshByDepth[mydepth]->GetBinContent(eta+1, phi+1)/OccupancyThreshByDepth[mydepth]->GetBinContent(eta+1, phi+1),2);
226  RMS=pow(fabs(RMS),0.5);
228  }
229  }
230  else if (isHF(eta,mydepth+1))
231  {
232  if (topo_->validDetId(HcalForward, CalcIeta(HcalForward, eta, mydepth+1), phi+1, mydepth+1))
233  {
234  meHFEnergyThresh_1D->Fill(SumEnergyThreshByDepth[mydepth]->GetBinContent(eta+1, phi+1)/OccupancyThreshByDepth[mydepth]->GetBinContent(eta+1, phi+1));
235  double RMS=pow(SqrtSumEnergy2ThreshByDepth[mydepth]->GetBinContent(eta+1, phi+1),2)/OccupancyThreshByDepth[mydepth]->GetBinContent(eta+1,phi+1)-pow(SumEnergyThreshByDepth[mydepth]->GetBinContent(eta+1, phi+1)/OccupancyThreshByDepth[mydepth]->GetBinContent(eta+1, phi+1),2);
236  RMS=pow(fabs(RMS),0.5);
238  }
239  }
240  // fill 2D plots
241  meEnergyThreshByDepth->depth[mydepth]->setBinContent(eta+1, phi+1, SumEnergyThreshByDepth[mydepth]->GetBinContent(eta+1, phi+1)/OccupancyThreshByDepth[mydepth]->GetBinContent(eta+1, phi+1));
242  meTimeThreshByDepth->depth[mydepth]->setBinContent(eta+1, phi+1, SumTimeThreshByDepth[mydepth]->GetBinContent(eta+1, phi+1)/OccupancyThreshByDepth[mydepth]->GetBinContent(eta+1, phi+1));
243  }
244  } // for (int phi=0;phi<72;++phi)
245  } // for (int eta=0;eta<OccupancyByDepth->..;++eta)
246  } // for (int mydepth=0;...)
247 
252 
253  calculateProblems(ib,ig);
254 }
255 
257 {
258  if (debug_>2) std::cout <<"\t\tHcalRecHitClient::calculateProblems()"<<std::endl;
259  double totalevents=0;
260  int etabins=0, phibins=0, zside=0;
261  double problemvalue=0;
262  std::vector<std::string> name = HcalEtaPhiHistNames(); // use this to get EtaPhiHistograms that feed problem calculation, once they exist (see analyze function for example usage of HcalEtaPhiHistNames())
263 
264  // Get histograms used in determining rechit problem rate,
265  // and get totalevents from their underflow bins.
266  // No such problem histograms are defined so far.
267 
268  enoughevents_=true;
269 
270  if (totalevents==0)
271  return;
272 
273  // Clear away old problems
274  if (ProblemCells!=0)
275  {
276  ProblemCells->Reset();
277  (ProblemCells->getTH2F())->SetMaximum(1.05);
278  (ProblemCells->getTH2F())->SetMinimum(0.);
279  }
280  for (unsigned int d=0;d<ProblemCellsByDepth->depth.size();++d)
281  {
282  if (ProblemCellsByDepth->depth[d]!=0)
283  {
284  ProblemCellsByDepth->depth[d]->Reset();
285  (ProblemCellsByDepth->depth[d]->getTH2F())->SetMaximum(1.05);
286  (ProblemCellsByDepth->depth[d]->getTH2F())->SetMinimum(0.);
287  }
288  }
289 
290  for (unsigned int d=0;d<ProblemCellsByDepth->depth.size();++d)
291  {
292  if (ProblemCellsByDepth->depth[d]==0) continue;
293 
294  // Get total events from some future histogram
295  //totalevents=DigiPresentByDepth[d]->GetBinContent(0); // get totalevents from each depth, in case they differ
296  if (totalevents==0 || totalevents<minevents_) continue;
297  etabins=(ProblemCellsByDepth->depth[d]->getTH2F())->GetNbinsX();
298  phibins=(ProblemCellsByDepth->depth[d]->getTH2F())->GetNbinsY();
299  problemvalue=0;
300  for (int eta=0;eta<etabins;++eta)
301  {
302  int ieta=CalcIeta(eta,d+1);
303  if (ieta==-9999) continue;
304  for (int phi=0;phi<phibins;++phi)
305  {
306  problemvalue=0;
307  // Add histograms here when rechit testing decided upon
308  /*if (DigiPresentByDepth[d]!=0 && DigiPresentByDepth[d]->GetBinContent(eta+1,phi+1)>0)
309  problemvalue=totalevents; */
310 
311  if (problemvalue==0) continue;
312  problemvalue/=totalevents; // problem value is a rate; should be between 0 and 1
313  problemvalue = std::min(1.,problemvalue);
314 
315  zside=0;
316  if (isHF(eta,d+1)) // shift ieta by 1 for HF
317  ieta<0 ? zside = -1 : zside = 1;
318 
319  // For problem cells that exceed our allowed rate,
320  // set the values to 999 if the cells are already marked in the status database
321  if (problemvalue>minerrorrate_)
322  {
323  HcalSubdetector subdet=HcalEmpty;
324  if (isHB(eta,d+1))subdet=HcalBarrel;
325  else if (isHE(eta,d+1)) subdet=HcalEndcap;
326  else if (isHF(eta,d+1)) subdet=HcalForward;
327  else if (isHO(eta,d+1)) subdet=HcalOuter;
328  HcalDetId hcalid(subdet, ieta, phi+1, (int)(d+1));
329  if (badstatusmap.find(hcalid)!=badstatusmap.end())
330  problemvalue=999;
331  }
332 
333 
334  ProblemCellsByDepth->depth[d]->setBinContent(eta+1,phi+1,problemvalue);
335  if (ProblemCells!=0) ProblemCells->Fill(ieta+zside,phi+1,problemvalue);
336  } // loop on phi
337  } // loop on eta
338  } // loop on depth
339 
340  if (ProblemCells==0)
341  {
342  if (debug_>0) std::cout <<"<HcalRecHitClient::analyze> ProblemCells histogram does not exist!"<<std::endl;
343  return;
344  }
345 
346  // Normalization of ProblemCell plot, in the case where there are errors in multiple depths
347  etabins=(ProblemCells->getTH2F())->GetNbinsX();
348  phibins=(ProblemCells->getTH2F())->GetNbinsY();
349  for (int eta=0;eta<etabins;++eta)
350  {
351  for (int phi=0;phi<phibins;++phi)
352  {
355  }
356  }
359  return;
360 
361 }
362 
364 
366 {
368  problemnames_.clear();
369  ProblemCells=ib.book2D(" ProblemRecHits",
370  "Problem RecHit Rate for all HCAL;ieta;iphi",
371  85,-42.5,42.5,
372  72,0.5,72.5);
373  problemnames_.push_back(ProblemCells->getName());
374  if (debug_>1)
375  std::cout << "Tried to create ProblemCells Monitor Element in directory "<<subdir_<<" \t Failed? "<<(ProblemCells==0)<<std::endl;
376  ib.setCurrentFolder(subdir_+"problem_rechits");
378  ProblemCellsByDepth->setup(ib," Problem RecHit Rate");
379  for (unsigned int i=0; i<ProblemCellsByDepth->depth.size();++i)
380  problemnames_.push_back(ProblemCellsByDepth->depth[i]->getName());
381 
382  nevts_=0;
383 
384  ib.setCurrentFolder(subdir_+"Distributions_AllRecHits");
386  meEnergyByDepth->setup(ib,"RecHit Average Energy","GeV");
387  meTimeByDepth = new EtaPhiHists();
388  meTimeByDepth->setup(ib,"RecHit Average Time","nS");
389  // set all average times to -1000 by default (so that they don't show up on plots
390  for (unsigned int i=0;i<meTimeByDepth->depth.size();++i)
391  {
392  (meTimeByDepth->depth[i]->getTH2F())->SetMinimum(-150);
393  (meTimeByDepth->depth[i]->getTH2F())->SetMaximum(150);
394  int etabins=(meTimeByDepth->depth[i]->getTH2F())->GetNbinsX();
395  int phibins=(meTimeByDepth->depth[i]->getTH2F())->GetNbinsY();
396  for (int x=1;x<=etabins;++x)
397  for (int y=1;y<=phibins;++y)
398  meTimeByDepth->depth[i]->setBinContent(x,y,-1000);
399  }
400 
401  ib.setCurrentFolder(subdir_+"Distributions_PassedMinBias");
403  meEnergyThreshByDepth->setup(ib,"Above Threshold RecHit Average Energy","GeV");
405  meTimeThreshByDepth->setup(ib,"Above Threshold RecHit Average Time","nS");
406  // set all average times to -1000 by default (so that they don't show up on plots
407  for (unsigned int i=0;i<meTimeThreshByDepth->depth.size();++i)
408  {
409  (meTimeThreshByDepth->depth[i]->getTH2F())->SetMinimum(-150);
410  (meTimeThreshByDepth->depth[i]->getTH2F())->SetMaximum(150);
411  int etabins=(meTimeThreshByDepth->depth[i]->getTH2F())->GetNbinsX();
412  int phibins=(meTimeThreshByDepth->depth[i]->getTH2F())->GetNbinsY();
413  for (int x=1;x<=etabins;++x)
414  for (int y=1;y<=phibins;++y)
415  meTimeThreshByDepth->depth[i]->setBinContent(x,y,-1000);
416  }
417 
418  ib.setCurrentFolder(subdir_+"Distributions_AllRecHits/rechit_1D_plots/");
419  meHBEnergy_1D=ib.book1D("HB_energy_1D","HB Average Energy Per RecHit;Energy (GeV)",200,-5,15);
420  meHEEnergy_1D=ib.book1D("HE_energy_1D","HE Average Energy Per RecHit;Energy (GeV)",200,-5,15);
421  meHOEnergy_1D=ib.book1D("HO_energy_1D","HO Average Energy Per RecHit;Energy (GeV)",200,-10,20);
422  meHFEnergy_1D=ib.book1D("HF_energy_1D","HF Average Energy Per RecHit;Energy (GeV)",200,-5,15);
423 
424  meHBEnergyRMS_1D=ib.book1D("HB_energy_RMS_1D","HB Energy RMS Per RecHit;Energy (GeV)",250,0,5);
425  meHEEnergyRMS_1D=ib.book1D("HE_energy_RMS_1D","HE Energy RMS Per RecHit;Energy (GeV)",250,0,5);
426  meHOEnergyRMS_1D=ib.book1D("HO_energy_RMS_1D","HO Energy RMS Per RecHit;Energy (GeV)",250,0,5);
427  meHFEnergyRMS_1D=ib.book1D("HF_energy_RMS_1D","HF Energy RMS Per RecHit;Energy (GeV)",250,0,5);
428 
429  ib.setCurrentFolder(subdir_+"Distributions_PassedMinBias/rechit_1D_plots/");
430  meHBEnergyThresh_1D=ib.book1D("HB_energyThresh_1D","HB Average Energy Per RecHit Above Threshold;Energy (GeV)",200,-5,35);
431  meHEEnergyThresh_1D=ib.book1D("HE_energyThresh_1D","HE Average Energy Per RecHit Above Threshold;Energy (GeV)",200,-5,35);
432  meHOEnergyThresh_1D=ib.book1D("HO_energyThresh_1D","HO Average Energy Per RecHit Above Threshold;Energy (GeV)",300,-10,50);
433  meHFEnergyThresh_1D=ib.book1D("HF_energyThresh_1D","HF Average Energy Per RecHit Above Threshold;Energy (GeV)",200,-5,95);
434 
435  meHBEnergyRMSThresh_1D=ib.book1D("HB_energy_RMSThresh_1D","HB Energy RMS Per RecHit Above Threshold;Energy (GeV)",200,0,10);
436  meHEEnergyRMSThresh_1D=ib.book1D("HE_energy_RMSThresh_1D","HE Energy RMS Per RecHit Above Threshold;Energy (GeV)",200,0,10);
437  meHOEnergyRMSThresh_1D=ib.book1D("HO_energy_RMSThresh_1D","HO Energy RMS Per RecHit Above Threshold;Energy (GeV)",200,0,10);
438  meHFEnergyRMSThresh_1D=ib.book1D("HF_energy_RMSThresh_1D","HF Energy RMS Per RecHit Above Threshold;Energy (GeV)",200,0,20);
439 
440  doProblemCellSetup_ = false;
441 
442 }
443 
445 {
446  if (debug_>1) std::cout <<"<HcalRecHitClient::endRun>"<<std::endl;
447 
448 }
449 
450 /*void HcalRecHitClient::endRun(void)
451 {
452  if (debug_>1) std::cout <<"<HcalRecHitClient::endRun>"<<std::endl;
453  analyze();
454 }*/
455 
458 
460 {
461  if (!ProblemCells)
462  {
463  if (debug_>1) std::cout <<"<HcalRecHitClient::hasErrors_Temp> ProblemCells histogram does not exist!"<<std::endl;
464  return false;
465  }
466  int problemcount=0;
467  int ieta=-9999;
468 
469  for (int depth=0;depth<4; ++depth)
470  {
471  int etabins = (ProblemCells->getTH2F())->GetNbinsX();
472  int phibins = (ProblemCells->getTH2F())->GetNbinsY();
473  for (int hist_eta=0;hist_eta<etabins;++hist_eta)
474  {
475  for (int hist_phi=0; hist_phi<phibins;++hist_phi)
476  {
477  ieta=CalcIeta(hist_eta,depth+1);
478  if (ieta==-9999) continue;
480  continue;
481  if (ProblemCellsByDepth->depth[depth]->getBinContent(hist_eta,hist_phi)>minerrorrate_)
482  ++problemcount;
483  } // for (int hist_phi=1;...)
484  } // for (int hist_eta=1;...)
485  } // for (int depth=0;...)
486 
487  if (problemcount>0) return true;
488  return false;
489 }
490 
491 bool HcalRecHitClient::hasWarnings_Temp(void){return false;}
492 bool HcalRecHitClient::hasOther_Temp(void){return false;}
493 bool HcalRecHitClient::test_enabled(void){return true;}
494 
495 
496 
497 void HcalRecHitClient::updateChannelStatus(std::map<HcalDetId, unsigned int>& myqual)
498 {
499  // rechit quality not used to update channel status yet; see dead cell client for example
500 
501 
502 
503 } //void HcalRecHitClient::updateChannelStatus
504 
506 {
508  if ( meEnergyByDepth ) delete meEnergyByDepth;
510  if ( meTimeByDepth ) delete meTimeByDepth;
514 
515 }
bool isHO(int etabin, int depth)
MonitorElement * meHFEnergyThresh_1D
T getUntrackedParameter(std::string const &, T const &) const
const std::string & getName(void) const
get name of ME
int i
Definition: DBlmapReader.cc:9
MonitorElement * ProblemCells
std::string name()
void setBinContent(int binx, double content)
set content of bin (1-D)
int ib
Definition: cuy.py:660
MonitorElement * meHOEnergyRMS_1D
EtaPhiHists * meSqrtSumEnergy2ByDepth
MonitorElement * meHEEnergyRMS_1D
void updateChannelStatus(std::map< HcalDetId, unsigned int > &myqual)
MonitorElement * get(const std::string &path)
Definition: DQMStore.cc:302
bool validDetId(HcalSubdetector subdet, int ieta, int iphi, int depth) const
EtaPhiHists * meSqrtSumEnergy2ThreshByDepth
MonitorElement * meHFEnergyRMS_1D
MonitorElement * meHEEnergyRMSThresh_1D
std::vector< std::string > HcalEtaPhiHistNames()
HcalRecHitClient()
Constructors.
MonitorElement * meHBEnergyRMS_1D
const HcalTopology * topo_
int zside(DetId const &)
bool isHE(int etabin, int depth)
EtaPhiHists * meTimeThreshByDepth
MonitorElement * meHFEnergyRMSThresh_1D
void Fill(long long x)
MonitorElement * meHEEnergy_1D
tuple d
Definition: ztail.py:151
MonitorElement * meHBEnergy_1D
std::vector< MonitorElement * > depth
int CalcIeta(int subdet, int eta, int depth)
MonitorElement * meHOEnergyRMSThresh_1D
bool hasErrors_Temp(void)
std::vector< std::string > problemnames_
T sqrt(T t)
Definition: SSEVec.h:48
EtaPhiHists * ProblemCellsByDepth
EtaPhiHists * meEnergyThreshByDepth
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:115
HcalSubdetector
Definition: HcalAssistant.h:31
MonitorElement * meHOEnergyThresh_1D
void setup(DQMStore::IBooker &m_dbe, std::string Name, std::string Units="")
T min(T a, T b)
Definition: MathUtil.h:58
bool isHB(int etabin, int depth)
void setupProblemCells(DQMStore::IBooker &, DQMStore::IGetter &)
MonitorElement * meHOEnergy_1D
MonitorElement * meHEEnergyThresh_1D
~HcalRecHitClient()
Destructor.
virtual void calculateProblems(void)
bool isHF(int etabin, int depth)
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:274
MonitorElement * meHFEnergy_1D
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:133
EtaPhiHists * meEnergyByDepth
std::string subdir_
MonitorElement * meHBEnergyThresh_1D
std::map< HcalDetId, unsigned int > badstatusmap
void FillUnphysicalHEHFBins(std::vector< TH2F > &hh)
void analyze(DQMStore::IBooker &, DQMStore::IGetter &)
double getBinContent(int binx) const
get content of bin (1-D)
std::string prefixME_
bool hasOther_Temp(void)
EtaPhiHists * meTimeByDepth
tuple cout
Definition: gather_cfg.py:121
MonitorElement * meHBEnergyRMSThresh_1D
TH2F * getTH2F(void) const
void Reset(void)
reset ME (ie. contents, errors, etc)
bool hasWarnings_Temp(void)
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:40