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