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 }
52 
54 {
55  if (debug_>2) std::cout <<"\tHcalRecHitClient::analyze()"<<std::endl;
56 
57  TH2F* OccupancyByDepth[4];
58  TH2F* SumEnergyByDepth[4];
59  TH2F* SumTimeByDepth[4];
60  TH2F* SqrtSumEnergy2ByDepth[4];
61 
62  TH2F* OccupancyThreshByDepth[4];
63  TH2F* SumEnergyThreshByDepth[4];
64  TH2F* SumTimeThreshByDepth[4];
65  TH2F* SqrtSumEnergy2ThreshByDepth[4];
66 
67  std::vector<std::string> name = HcalEtaPhiHistNames();
68 
69  MonitorElement* me;
70  bool gotHistos=true;
71 
72  for (int i=0;i<4;++i)
73  {
74  std::string s=subdir_+"Distributions_AllRecHits/"+name[i]+"RecHit Occupancy";
75  me=dqmStore_->get(s.c_str());
76  if (me==0) {if (debug_>0) std::cout <<"Could not get histogram "<<s<<std::endl; gotHistos=false; break;}
77  OccupancyByDepth[i]=HcalUtilsClient::getHisto<TH2F*>(me, cloneME_, OccupancyByDepth[i], debug_);
78  s=subdir_+"Distributions_AllRecHits/sumplots/"+name[i]+"RecHit Summed Energy GeV";
79  me=dqmStore_->get(s.c_str());
80  if (me==0) {if (debug_>0) std::cout <<"Could not get histogram "<<s<<std::endl; gotHistos=false; break;}
81  SumEnergyByDepth[i]=HcalUtilsClient::getHisto<TH2F*>(me, cloneME_, SumEnergyByDepth[i], debug_);
82  s=subdir_+"Distributions_AllRecHits/sumplots/"+name[i]+"RecHit Summed Time nS";
83  me=dqmStore_->get(s.c_str());
84  if (me==0) {if (debug_>0) std::cout <<"Could not get histogram "<<s<<std::endl; gotHistos=false; break;}
85  SumTimeByDepth[i]=HcalUtilsClient::getHisto<TH2F*>(me, cloneME_, SumTimeByDepth[i], debug_);
86  s=subdir_+"Distributions_AllRecHits/sumplots/"+name[i]+"RecHit Sqrt Summed Energy2 GeV";
87  me=dqmStore_->get(s.c_str());
88  if (me==0) {if (debug_>0) std::cout <<"Could not get histogram "<<s<<std::endl; gotHistos=false; break;}
89  SqrtSumEnergy2ByDepth[i]=HcalUtilsClient::getHisto<TH2F*>(me, cloneME_, SqrtSumEnergy2ByDepth[i], debug_);
90 
91  // Threshold histograms
92  s=subdir_+"Distributions_PassedMinBias/"+name[i]+"Above Threshold RecHit Occupancy";
93  me=dqmStore_->get(s.c_str());
94  if (me==0) {if (debug_>0) std::cout <<"Could not get histogram "<<s<<std::endl; gotHistos=false; break;}
95  OccupancyThreshByDepth[i]=HcalUtilsClient::getHisto<TH2F*>(me, cloneME_, OccupancyThreshByDepth[i], debug_);
96  s=subdir_+"Distributions_PassedMinBias/sumplots/"+name[i]+"Above Threshold RecHit Summed Energy GeV";
97  me=dqmStore_->get(s.c_str());
98  if (me==0) {if (debug_>0) std::cout <<"Could not get histogram "<<s<<std::endl; gotHistos=false; break;}
99  SumEnergyThreshByDepth[i]=HcalUtilsClient::getHisto<TH2F*>(me, cloneME_, SumEnergyThreshByDepth[i], debug_);
100  s=subdir_+"Distributions_PassedMinBias/sumplots/"+name[i]+"Above Threshold RecHit Summed Time nS";
101  me=dqmStore_->get(s.c_str());
102  if (me==0) {if (debug_>0) std::cout <<"Could not get histogram "<<s<<std::endl; gotHistos=false; break;}
103  SumTimeThreshByDepth[i]=HcalUtilsClient::getHisto<TH2F*>(me, cloneME_, SumTimeThreshByDepth[i], debug_);
104  s=subdir_+"Distributions_PassedMinBias/sumplots/"+name[i]+"Above Threshold RecHit Sqrt Summed Energy2 GeV";
105  me=dqmStore_->get(s.c_str());
106  if (me==0) {if (debug_>0) std::cout <<"Could not get histogram "<<s<<std::endl; gotHistos=false; break;}
107  SqrtSumEnergy2ThreshByDepth[i]=HcalUtilsClient::getHisto<TH2F*>(me, cloneME_, SqrtSumEnergy2ThreshByDepth[i], debug_);
108  }
109  if (gotHistos==false)
110  {
111  if (debug_>0) std::cout <<"<HcalRecHitClient::calculateProblems()> Not all histograms could be found; skipping normalization"<<std::endl;
112  return;
113  }
114 
115  // Clear histograms before re-filling
116  meHBEnergy_1D->Reset();
118  meHEEnergy_1D->Reset();
120  meHOEnergy_1D->Reset();
122  meHFEnergy_1D->Reset();
132 
133  for (int mydepth=0;mydepth<4;++mydepth)
134  {
135  for (int eta=0;eta<OccupancyByDepth[mydepth]->GetNbinsX();++eta)
136  {
137  // eta+1=1: ieta = -42
138  // eta+1=13: ieta = -29
139 
140  for (int phi=0;phi<72;++phi)
141  {
142  if (OccupancyByDepth[mydepth]->GetBinContent(eta+1, phi+1)>0)
143  {
144  // fill 1D plots
145  if (isHB(eta,mydepth+1))
146  {
147  if (validDetId(HcalBarrel, CalcIeta(HcalBarrel, eta, mydepth+1), phi+1, mydepth+1))
148  {
149  meHBEnergy_1D->Fill(SumEnergyByDepth[mydepth]->GetBinContent(eta+1, phi+1)/OccupancyByDepth[mydepth]->GetBinContent(eta+1, phi+1));
150  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)));
151  }
152  }
153  else if (isHE(eta,mydepth+1))
154  {
155  if (validDetId(HcalEndcap, CalcIeta(HcalEndcap, eta, mydepth+1), phi+1, mydepth+1))
156  {
157 
158  meHEEnergy_1D->Fill(SumEnergyByDepth[mydepth]->GetBinContent(eta+1, phi+1)/OccupancyByDepth[mydepth]->GetBinContent(eta+1, phi+1));
159  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)));
160  }
161  }
162  else if (isHO(eta,mydepth+1))
163  {
164  if (validDetId(HcalOuter, CalcIeta(HcalOuter, eta, mydepth+1), phi+1, mydepth+1))
165  {
166  meHOEnergy_1D->Fill(SumEnergyByDepth[mydepth]->GetBinContent(eta+1, phi+1)/OccupancyByDepth[mydepth]->GetBinContent(eta+1, phi+1));
167  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)));
168  }
169  }
170  else if (isHF(eta,mydepth+1))
171  {
172  if (validDetId(HcalForward, CalcIeta(HcalForward, eta, mydepth+1), phi+1, mydepth+1))
173  {
174  meHFEnergy_1D->Fill(SumEnergyByDepth[mydepth]->GetBinContent(eta+1, phi+1)/OccupancyByDepth[mydepth]->GetBinContent(eta+1, phi+1));
175  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)));
176  }
177  }
178  // normalize 2D plots by number of events
179 
180  meEnergyByDepth->depth[mydepth]->setBinContent(eta+1, phi+1, SumEnergyByDepth[mydepth]->GetBinContent(eta+1, phi+1)/OccupancyByDepth[mydepth]->GetBinContent(eta+1, phi+1));
181  meTimeByDepth->depth[mydepth]->setBinContent(eta+1, phi+1, SumTimeByDepth[mydepth]->GetBinContent(eta+1, phi+1)/OccupancyByDepth[mydepth]->GetBinContent(eta+1, phi+1));
182  } // (OccupancyByDepth[mydepth]->GetBinContent(eta+1,phi+1)>0)
183 
184  if (OccupancyThreshByDepth[mydepth]==0) continue;
185  if (OccupancyThreshByDepth[mydepth]->GetBinContent(eta+1, phi+1)>0)
186  {
187  // fill 1D plots
188  if (isHB(eta,mydepth+1))
189  {
190  if (validDetId(HcalBarrel, CalcIeta(HcalBarrel, eta, mydepth+1), phi+1, mydepth+1))
191  {
192  meHBEnergyThresh_1D->Fill(SumEnergyThreshByDepth[mydepth]->GetBinContent(eta+1, phi+1)/OccupancyThreshByDepth[mydepth]->GetBinContent(eta+1, phi+1));
193  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);
194  RMS=pow(fabs(RMS),0.5);
196  }
197  }
198  else if (isHE(eta,mydepth+1))
199  {
200  if (validDetId(HcalEndcap, CalcIeta(HcalEndcap, eta, mydepth+1), phi+1, mydepth+1))
201  {
202 
203  meHEEnergyThresh_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 (isHO(eta,mydepth+1))
210  {
211  if (validDetId(HcalOuter, CalcIeta(HcalOuter, eta, mydepth+1), phi+1, mydepth+1))
212  {
213  meHOEnergyThresh_1D->Fill(SumEnergyThreshByDepth[mydepth]->GetBinContent(eta+1, phi+1)/OccupancyThreshByDepth[mydepth]->GetBinContent(eta+1, phi+1));
214  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);
215  RMS=pow(fabs(RMS),0.5);
217  }
218  }
219  else if (isHF(eta,mydepth+1))
220  {
221  if (validDetId(HcalForward, CalcIeta(HcalForward, eta, mydepth+1), phi+1, mydepth+1))
222  {
223  meHFEnergyThresh_1D->Fill(SumEnergyThreshByDepth[mydepth]->GetBinContent(eta+1, phi+1)/OccupancyThreshByDepth[mydepth]->GetBinContent(eta+1, phi+1));
224  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);
225  RMS=pow(fabs(RMS),0.5);
227  }
228  }
229  // fill 2D plots
230  meEnergyThreshByDepth->depth[mydepth]->setBinContent(eta+1, phi+1, SumEnergyThreshByDepth[mydepth]->GetBinContent(eta+1, phi+1)/OccupancyThreshByDepth[mydepth]->GetBinContent(eta+1, phi+1));
231  meTimeThreshByDepth->depth[mydepth]->setBinContent(eta+1, phi+1, SumTimeThreshByDepth[mydepth]->GetBinContent(eta+1, phi+1)/OccupancyThreshByDepth[mydepth]->GetBinContent(eta+1, phi+1));
232  }
233  } // for (int phi=0;phi<72;++phi)
234  } // for (int eta=0;eta<OccupancyByDepth->..;++eta)
235  } // for (int mydepth=0;...)
236 
241 
243 }
244 
246 {
247  if (debug_>2) std::cout <<"\t\tHcalRecHitClient::calculateProblems()"<<std::endl;
248  if(!dqmStore_) return;
249  double totalevents=0;
250  int etabins=0, phibins=0, zside=0;
251  double problemvalue=0;
252  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())
253 
254  // Get histograms used in determining rechit problem rate,
255  // and get totalevents from their underflow bins.
256  // No such problem histograms are defined so far.
257 
258  enoughevents_=true;
259 
260  if (totalevents==0)
261  return;
262 
263  // Clear away old problems
264  if (ProblemCells!=0)
265  {
266  ProblemCells->Reset();
267  (ProblemCells->getTH2F())->SetMaximum(1.05);
268  (ProblemCells->getTH2F())->SetMinimum(0.);
269  }
270  for (unsigned int d=0;d<ProblemCellsByDepth->depth.size();++d)
271  {
272  if (ProblemCellsByDepth->depth[d]!=0)
273  {
274  ProblemCellsByDepth->depth[d]->Reset();
275  (ProblemCellsByDepth->depth[d]->getTH2F())->SetMaximum(1.05);
276  (ProblemCellsByDepth->depth[d]->getTH2F())->SetMinimum(0.);
277  }
278  }
279 
280  for (unsigned int d=0;d<ProblemCellsByDepth->depth.size();++d)
281  {
282  if (ProblemCellsByDepth->depth[d]==0) continue;
283 
284  // Get total events from some future histogram
285  //totalevents=DigiPresentByDepth[d]->GetBinContent(0); // get totalevents from each depth, in case they differ
286  if (totalevents==0 || totalevents<minevents_) continue;
287  etabins=(ProblemCellsByDepth->depth[d]->getTH2F())->GetNbinsX();
288  phibins=(ProblemCellsByDepth->depth[d]->getTH2F())->GetNbinsY();
289  problemvalue=0;
290  for (int eta=0;eta<etabins;++eta)
291  {
292  int ieta=CalcIeta(eta,d+1);
293  if (ieta==-9999) continue;
294  for (int phi=0;phi<phibins;++phi)
295  {
296  problemvalue=0;
297  // Add histograms here when rechit testing decided upon
298  /*if (DigiPresentByDepth[d]!=0 && DigiPresentByDepth[d]->GetBinContent(eta+1,phi+1)>0)
299  problemvalue=totalevents; */
300 
301  if (problemvalue==0) continue;
302  problemvalue/=totalevents; // problem value is a rate; should be between 0 and 1
303  problemvalue = std::min(1.,problemvalue);
304 
305  zside=0;
306  if (isHF(eta,d+1)) // shift ieta by 1 for HF
307  ieta<0 ? zside = -1 : zside = 1;
308 
309  // For problem cells that exceed our allowed rate,
310  // set the values to 999 if the cells are already marked in the status database
311  if (problemvalue>minerrorrate_)
312  {
313  HcalSubdetector subdet=HcalEmpty;
314  if (isHB(eta,d+1))subdet=HcalBarrel;
315  else if (isHE(eta,d+1)) subdet=HcalEndcap;
316  else if (isHF(eta,d+1)) subdet=HcalForward;
317  else if (isHO(eta,d+1)) subdet=HcalOuter;
318  HcalDetId hcalid(subdet, ieta, phi+1, (int)(d+1));
319  if (badstatusmap.find(hcalid)!=badstatusmap.end())
320  problemvalue=999;
321  }
322 
323 
324  ProblemCellsByDepth->depth[d]->setBinContent(eta+1,phi+1,problemvalue);
325  if (ProblemCells!=0) ProblemCells->Fill(ieta+zside,phi+1,problemvalue);
326  } // loop on phi
327  } // loop on eta
328  } // loop on depth
329 
330  if (ProblemCells==0)
331  {
332  if (debug_>0) std::cout <<"<HcalRecHitClient::analyze> ProblemCells histogram does not exist!"<<std::endl;
333  return;
334  }
335 
336  // Normalization of ProblemCell plot, in the case where there are errors in multiple depths
337  etabins=(ProblemCells->getTH2F())->GetNbinsX();
338  phibins=(ProblemCells->getTH2F())->GetNbinsY();
339  for (int eta=0;eta<etabins;++eta)
340  {
341  for (int phi=0;phi<phibins;++phi)
342  {
345  }
346  }
349  return;
350 
351 }
352 
354 {
356  if (debug_>0)
357  {
358  std::cout <<"<HcalRecHitClient::beginJob()> Displaying dqmStore directory structure:"<<std::endl;
360  }
361 }
363 
365 {
366  if (debug_>1) std::cout <<"<HcalRecHitClient::endRun>"<<std::endl;
367 
368  if (!dqmStore_)
369  {
370  if (debug_>0) std::cout <<"<HcalRecHitClient::beginRun> dqmStore does not exist!"<<std::endl;
371  return;
372  }
374  problemnames_.clear();
375  ProblemCells=dqmStore_->book2D(" ProblemRecHits",
376  "Problem RecHit Rate for all HCAL;ieta;iphi",
377  85,-42.5,42.5,
378  72,0.5,72.5);
379  problemnames_.push_back(ProblemCells->getName());
380  if (debug_>1)
381  std::cout << "Tried to create ProblemCells Monitor Element in directory "<<subdir_<<" \t Failed? "<<(ProblemCells==0)<<std::endl;
382  dqmStore_->setCurrentFolder(subdir_+"problem_rechits");
384  ProblemCellsByDepth->setup(dqmStore_," Problem RecHit Rate");
385  for (unsigned int i=0; i<ProblemCellsByDepth->depth.size();++i)
386  problemnames_.push_back(ProblemCellsByDepth->depth[i]->getName());
387 
388  nevts_=0;
389 
390  dqmStore_->setCurrentFolder(subdir_+"Distributions_AllRecHits");
392  meEnergyByDepth->setup(dqmStore_,"RecHit Average Energy","GeV");
393  meTimeByDepth = new EtaPhiHists();
394  meTimeByDepth->setup(dqmStore_,"RecHit Average Time","nS");
395  // set all average times to -1000 by default (so that they don't show up on plots
396  for (unsigned int i=0;i<meTimeByDepth->depth.size();++i)
397  {
398  (meTimeByDepth->depth[i]->getTH2F())->SetMinimum(-150);
399  (meTimeByDepth->depth[i]->getTH2F())->SetMaximum(150);
400  int etabins=(meTimeByDepth->depth[i]->getTH2F())->GetNbinsX();
401  int phibins=(meTimeByDepth->depth[i]->getTH2F())->GetNbinsY();
402  for (int x=1;x<=etabins;++x)
403  for (int y=1;y<=phibins;++y)
404  meTimeByDepth->depth[i]->setBinContent(x,y,-1000);
405  }
406 
407  dqmStore_->setCurrentFolder(subdir_+"Distributions_PassedMinBias");
409  meEnergyThreshByDepth->setup(dqmStore_,"Above Threshold RecHit Average Energy","GeV");
411  meTimeThreshByDepth->setup(dqmStore_,"Above Threshold RecHit Average Time","nS");
412  // set all average times to -1000 by default (so that they don't show up on plots
413  for (unsigned int i=0;i<meTimeThreshByDepth->depth.size();++i)
414  {
415  (meTimeThreshByDepth->depth[i]->getTH2F())->SetMinimum(-150);
416  (meTimeThreshByDepth->depth[i]->getTH2F())->SetMaximum(150);
417  int etabins=(meTimeThreshByDepth->depth[i]->getTH2F())->GetNbinsX();
418  int phibins=(meTimeThreshByDepth->depth[i]->getTH2F())->GetNbinsY();
419  for (int x=1;x<=etabins;++x)
420  for (int y=1;y<=phibins;++y)
421  meTimeThreshByDepth->depth[i]->setBinContent(x,y,-1000);
422  }
423 
424  dqmStore_->setCurrentFolder(subdir_+"Distributions_AllRecHits/rechit_1D_plots/");
425  meHBEnergy_1D=dqmStore_->book1D("HB_energy_1D","HB Average Energy Per RecHit;Energy (GeV)",200,-5,15);
426  meHEEnergy_1D=dqmStore_->book1D("HE_energy_1D","HE Average Energy Per RecHit;Energy (GeV)",200,-5,15);
427  meHOEnergy_1D=dqmStore_->book1D("HO_energy_1D","HO Average Energy Per RecHit;Energy (GeV)",200,-10,20);
428  meHFEnergy_1D=dqmStore_->book1D("HF_energy_1D","HF Average Energy Per RecHit;Energy (GeV)",200,-5,15);
429 
430  meHBEnergyRMS_1D=dqmStore_->book1D("HB_energy_RMS_1D","HB Energy RMS Per RecHit;Energy (GeV)",250,0,5);
431  meHEEnergyRMS_1D=dqmStore_->book1D("HE_energy_RMS_1D","HE Energy RMS Per RecHit;Energy (GeV)",250,0,5);
432  meHOEnergyRMS_1D=dqmStore_->book1D("HO_energy_RMS_1D","HO Energy RMS Per RecHit;Energy (GeV)",250,0,5);
433  meHFEnergyRMS_1D=dqmStore_->book1D("HF_energy_RMS_1D","HF Energy RMS Per RecHit;Energy (GeV)",250,0,5);
434 
435  dqmStore_->setCurrentFolder(subdir_+"Distributions_PassedMinBias/rechit_1D_plots/");
436  meHBEnergyThresh_1D=dqmStore_->book1D("HB_energyThresh_1D","HB Average Energy Per RecHit Above Threshold;Energy (GeV)",200,-5,35);
437  meHEEnergyThresh_1D=dqmStore_->book1D("HE_energyThresh_1D","HE Average Energy Per RecHit Above Threshold;Energy (GeV)",200,-5,35);
438  meHOEnergyThresh_1D=dqmStore_->book1D("HO_energyThresh_1D","HO Average Energy Per RecHit Above Threshold;Energy (GeV)",300,-10,50);
439  meHFEnergyThresh_1D=dqmStore_->book1D("HF_energyThresh_1D","HF Average Energy Per RecHit Above Threshold;Energy (GeV)",200,-5,95);
440 
441  meHBEnergyRMSThresh_1D=dqmStore_->book1D("HB_energy_RMSThresh_1D","HB Energy RMS Per RecHit Above Threshold;Energy (GeV)",200,0,10);
442  meHEEnergyRMSThresh_1D=dqmStore_->book1D("HE_energy_RMSThresh_1D","HE Energy RMS Per RecHit Above Threshold;Energy (GeV)",200,0,10);
443  meHOEnergyRMSThresh_1D=dqmStore_->book1D("HO_energy_RMSThresh_1D","HO Energy RMS Per RecHit Above Threshold;Energy (GeV)",200,0,10);
444  meHFEnergyRMSThresh_1D=dqmStore_->book1D("HF_energy_RMSThresh_1D","HF Energy RMS Per RecHit Above Threshold;Energy (GeV)",200,0,20);
445 }
446 
448 {
449  if (debug_>1) std::cout <<"<HcalRecHitClient::endRun>"<<std::endl;
450  analyze();
451 }
452 
455 
457 {
458  if (!ProblemCells)
459  {
460  if (debug_>1) std::cout <<"<HcalRecHitClient::hasErrors_Temp> ProblemCells histogram does not exist!"<<std::endl;
461  return false;
462  }
463  int problemcount=0;
464  int ieta=-9999;
465 
466  for (int depth=0;depth<4; ++depth)
467  {
468  int etabins = (ProblemCells->getTH2F())->GetNbinsX();
469  int phibins = (ProblemCells->getTH2F())->GetNbinsY();
470  for (int hist_eta=0;hist_eta<etabins;++hist_eta)
471  {
472  for (int hist_phi=0; hist_phi<phibins;++hist_phi)
473  {
474  ieta=CalcIeta(hist_eta,depth+1);
475  if (ieta==-9999) continue;
476  if (ProblemCellsByDepth->depth[depth]==0)
477  continue;
478  if (ProblemCellsByDepth->depth[depth]->getBinContent(hist_eta,hist_phi)>minerrorrate_)
479  ++problemcount;
480  } // for (int hist_phi=1;...)
481  } // for (int hist_eta=1;...)
482  } // for (int depth=0;...)
483 
484  if (problemcount>0) return true;
485  return false;
486 }
487 
488 bool HcalRecHitClient::hasWarnings_Temp(void){return false;}
489 bool HcalRecHitClient::hasOther_Temp(void){return false;}
490 bool HcalRecHitClient::test_enabled(void){return true;}
491 
492 
493 
494 void HcalRecHitClient::updateChannelStatus(std::map<HcalDetId, unsigned int>& myqual)
495 {
496  // rechit quality not used to update channel status yet; see dead cell client for example
497 
498 
499 
500 } //void HcalRecHitClient::updateChannelStatus
501 
503 {}
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)
MonitorElement * meHOEnergyRMS_1D
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:873
MonitorElement * meHEEnergyRMS_1D
void updateChannelStatus(std::map< HcalDetId, unsigned int > &myqual)
MonitorElement * meHFEnergyRMS_1D
MonitorElement * meHEEnergyRMSThresh_1D
std::vector< std::string > HcalEtaPhiHistNames()
void setup(DQMStore *&m_dbe, std::string Name, std::string Units="")
HcalRecHitClient()
Constructors.
MonitorElement * meHBEnergyRMS_1D
bool isHE(int etabin, int depth)
T eta() const
EtaPhiHists * meTimeThreshByDepth
MonitorElement * meHFEnergyRMSThresh_1D
void Fill(long long x)
MonitorElement * meHEEnergy_1D
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
HcalSubdetector
Definition: HcalAssistant.h:31
MonitorElement * meHOEnergyThresh_1D
MonitorElement * get(const std::string &path) const
get ME from full pathname (e.g. &quot;my/long/dir/my_histo&quot;)
Definition: DQMStore.cc:1624
bool isHB(int etabin, int depth)
MonitorElement * meHOEnergy_1D
MonitorElement * meHEEnergyThresh_1D
~HcalRecHitClient()
Destructor.
bool isHF(int etabin, int depth)
MonitorElement * meHFEnergy_1D
EtaPhiHists * meEnergyByDepth
std::string subdir_
MonitorElement * meHBEnergyThresh_1D
std::map< HcalDetId, unsigned int > badstatusmap
void FillUnphysicalHEHFBins(std::vector< TH2F > &hh)
void calculateProblems(void)
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
void showDirStructure(void) const
Definition: DQMStore.cc:2962
Definition: DDAxes.h:10
TH2F * getTH2F(void) const
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:1001
void Reset(void)
reset ME (ie. contents, errors, etc)
bool hasWarnings_Temp(void)
DQMStore * dqmStore_
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:40
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:585
bool validDetId(HcalSubdetector sd, int ies, int ip, int dp)
Definition: DDAxes.h:10