CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
HcalMonitorClient.cc
Go to the documentation of this file.
1 /*
2  * \file HcalMonitorClient.cc
3  *
4  * \author J. Temple
5  *
6  */
7 
24 
32 
35 
40 
43 
44 #include <iostream>
45 #include <iomanip>
46 #include <fstream>
47 
48 #include "TROOT.h"
49 #include "TH1.h"
50 
51 //'using' declarations should only be used within classes/functions, and 'using namespace std;' should not be used,
52 // according to Bill Tanenbaum (DQM development hypernews, 25 March 2010)
53 
55 {
56  debug_ = ps.getUntrackedParameter<int>("debug",0);
57  inputFile_ = ps.getUntrackedParameter<std::string>("inputFile","");
58  mergeRuns_ = ps.getUntrackedParameter<bool>("mergeRuns", false);
59  cloneME_ = ps.getUntrackedParameter<bool>("cloneME", true);
60  prescaleFactor_ = ps.getUntrackedParameter<int>("prescaleFactor", -1);
61  prefixME_ = ps.getUntrackedParameter<std::string>("subSystemFolder", "Hcal/");
62  if (prefixME_.substr(prefixME_.size()-1,prefixME_.size())!="/")
63  prefixME_.append("/");
64  enableCleanup_ = ps.getUntrackedParameter<bool>("enableCleanup", false);
65  enabledClients_ = ps.getUntrackedParameter<std::vector<std::string> >("enabledClients", enabledClients_);
66 
67  updateTime_ = ps.getUntrackedParameter<int>("UpdateTime",0);
68  baseHtmlDir_ = ps.getUntrackedParameter<std::string>("baseHtmlDir", "");
69  htmlUpdateTime_ = ps.getUntrackedParameter<int>("htmlUpdateTime", 0);
70  htmlFirstUpdate_ = ps.getUntrackedParameter<int>("htmlFirstUpdate",20);
71  databasedir_ = ps.getUntrackedParameter<std::string>("databaseDir","");
72  databaseUpdateTime_ = ps.getUntrackedParameter<int>("databaseUpdateTime",0);
73  databaseFirstUpdate_ = ps.getUntrackedParameter<int>("databaseFirstUpdate",10);
74 
75  saveByLumiSection_ = ps.getUntrackedParameter<bool>("saveByLumiSection",false);
76  Online_ = ps.getUntrackedParameter<bool>("online",false);
77 
78 
79  doPedSetup_ = true;
80  doChanStatSetup_ = true;
81 
82 
83  if (debug_>0)
84  {
85  std::cout <<"HcalMonitorClient:: The following clients are enabled:"<<std::endl;
86  for (unsigned int i=0;i<enabledClients_.size();++i)
87  std::cout <<enabledClients_[i]<<std::endl;
88  } // if (debug_>0)
89 
90  // Set all EtaPhiHists pointers to 0 to start
91  ChannelStatus=0;
96 
97  // Add all relevant clients
98  clients_.clear();
99  clients_.reserve(14); // any reason to reserve ahead of time?
100  summaryClient_=0;
101 
102  clients_.push_back(new HcalBaseDQClient((std::string)"HcalMonitorModule",ps));
103  if (find(enabledClients_.begin(), enabledClients_.end(),"DeadCellMonitor")!=enabledClients_.end())
104  clients_.push_back(new HcalDeadCellClient((std::string)"DeadCellMonitor",ps));
105  if (find(enabledClients_.begin(), enabledClients_.end(),"HotCellMonitor")!=enabledClients_.end())
106  clients_.push_back(new HcalHotCellClient((std::string)"HotCellMonitor",ps));
107  if (find(enabledClients_.begin(), enabledClients_.end(),"RecHitMonitor")!=enabledClients_.end())
108  clients_.push_back(new HcalRecHitClient((std::string)"RecHitMonitor",ps));
109  if (find(enabledClients_.begin(), enabledClients_.end(),"DigiMonitor")!=enabledClients_.end())
110  clients_.push_back(new HcalDigiClient((std::string)"DigiMonitor",ps));
111  if (find(enabledClients_.begin(), enabledClients_.end(),"RawDataMonitor")!=enabledClients_.end())
112  clients_.push_back(new HcalRawDataClient((std::string)"RawDataMonitor",ps));
113  if (find(enabledClients_.begin(), enabledClients_.end(),"TrigPrimMonitor")!=enabledClients_.end())
114  clients_.push_back(new HcalTrigPrimClient((std::string)"TrigPrimMonitor",ps));
115  if (find(enabledClients_.begin(), enabledClients_.end(),"NZSMonitor")!=enabledClients_.end())
116  clients_.push_back(new HcalNZSClient((std::string)"NZSMonitor",ps));
117  if (find(enabledClients_.begin(), enabledClients_.end(),"BeamMonitor")!=enabledClients_.end())
118  clients_.push_back(new HcalBeamClient((std::string)"BeamMonitor",ps));
119  if (find(enabledClients_.begin(), enabledClients_.end(),"DetDiagPedestalMonitor")!=enabledClients_.end())
120  clients_.push_back(new HcalDetDiagPedestalClient((std::string)"DetDiagPedestalMonitor",ps));
121  if (find(enabledClients_.begin(), enabledClients_.end(),"DetDiagLaserMonitor")!=enabledClients_.end())
122  clients_.push_back(new HcalDetDiagLaserClient((std::string)"DetDiagLaserMonitor",ps));
123  if (find(enabledClients_.begin(), enabledClients_.end(),"DetDiagLEDMonitor")!=enabledClients_.end())
124  clients_.push_back(new HcalDetDiagLEDClient((std::string)"DetDiagLEDMonitor",ps));
125  if (find(enabledClients_.begin(), enabledClients_.end(),"DetDiagNoiseMonitor")!=enabledClients_.end())
126  clients_.push_back(new HcalDetDiagNoiseMonitorClient((std::string)"DetDiagNoiseMonitor",ps));
127  if (find(enabledClients_.begin(), enabledClients_.end(),"DetDiagTimingMonitor")!=enabledClients_.end())
128  clients_.push_back(new HcalDetDiagTimingClient((std::string)"DetDiagTimingMonitor",ps));
129  if (find(enabledClients_.begin(), enabledClients_.end(),"CoarsePedestalMonitor")!=enabledClients_.end())
130  clients_.push_back(new HcalCoarsePedestalClient((std::string)"CoarsePedestalMonitor",ps));
131 
132  if (find(enabledClients_.begin(), enabledClients_.end(),"Summary")!=enabledClients_.end())
133  summaryClient_ = new HcalSummaryClient((std::string)"ReportSummaryClient",ps);
134 
135  // Contents of the beginJob(void) method (this was moved here during the MT migration
136  begin_run_ = false;
137  end_run_ = false;
138 
140  ievt_ = 0;
141  jevt_ =0;
142 
144  last_time_html_ = 0;
145  last_time_db_ = 0;
146 
147 
148 } // HcalMonitorClient constructor
149 
150 
152 {
153  if (debug_>0) std::cout <<"<HcalMonitorClient> Exiting..."<<std::endl;
154  for (unsigned int i=0;i<clients_.size();++i)
155  delete clients_[i];
156  //if (summaryClient_) delete summaryClient_;
157 
158 }
159 
160 
162 {
163  if (debug_>0) std::cout <<"<HcalMonitorClient::beginRun(r,c)>"<<std::endl;
164  begin_run_ = true;
165  end_run_ = false;
166 
167  run_ = r.id().run();
168  jevt_ = 0;
169  htmlcounter_ = 0;
170 
171  // Store list of bad channels and their values
172  std::map <HcalDetId, unsigned int> badchannelmap;
173  badchannelmap.clear();
174 
175  // Let's get the channel status quality
177  c.get<IdealGeometryRecord>().get(topo);
178 
180  c.get<HcalChannelQualityRcd>().get("withTopo",p);
181  chanquality_= p.product();
182 
183  // Find only channels with non-zero quality, and add them to badchannelmap
184  std::vector<DetId> mydetids = chanquality_->getAllChannels();
185  for (std::vector<DetId>::const_iterator i = mydetids.begin();i!=mydetids.end();++i)
186  {
187  if (i->det()!=DetId::Hcal) continue; // not an hcal cell
188  HcalDetId id=HcalDetId(*i);
189  int status=(chanquality_->getValues(id))->getValue();
190  //if (status!=status) status=-1; // protects against NaN values
191  // The above line doesn't seem to work in identifying NaNs; ints for bad values come back as negative numbers (at least in run 146501)
192  if (status==0) continue;
193  badchannelmap[id]=status;
194 
195  // Fill Channel Status histogram
196  int depth=id.depth();
197  if (depth<1 || depth>4) continue;
198  int ieta=id.ieta();
199  int iphi=id.iphi();
200  if (id.subdet()==HcalForward)
201  ieta>0 ? ++ieta: --ieta;
202 
203  double logstatus = 0;
204  // Fill ChannelStatus value with '-1' when a 'NaN' occurs
205  if (status<0)
206  logstatus=-1*(log2(-1.*status)+1);
207  else
208  logstatus=log2(1.*status)+1;
209  if (ChannelStatus && ChannelStatus->depth[depth-1]) ChannelStatus->depth[depth-1]->Fill(ieta,iphi,logstatus);
210  }
211 
212  for (unsigned int i=0;i<clients_.size();++i)
213  {
214  if (clients_[i]->name()=="RawDataMonitor") clients_[i]->setEventSetup(c);
215  clients_[i]->beginRun();
216  clients_[i]->setStatusMap(badchannelmap);
217  }
218 
219  if (summaryClient_!=0)
220  {
223  }
224 
225 } // void HcalMonitorClient::beginRun(const Run& r, const EventSetup& c)
226 
227 
229 {
230  // no setup required
231 }
232 
233 
234 
236 {
237  if (debug_>0)
238  std::cout <<"HcalMonitorClient::analyze() "<<std::endl;
240  // no ievt_, jevt_ counters needed here: this function gets called at endlumiblock, after default analyze function runs
241  for (unsigned int i=0;i<clients_.size();++i)
242  clients_[i]->analyze(ib,ig);
243  if (summaryClient_!=0)
244  {
245  // Always call basic analyze to form histograms for each task
246  summaryClient_->analyze(ib,ig,LS);
247  // Call this if LS-by-LS enabling is set to true
248  if (saveByLumiSection_==true)
250  }
251 } // void HcalMonitorClient::analyze()
252 
253 
255 {
256 
258  if ( doPedSetup_ ) setupPedestalMon(ib);
259 
260  if (debug_>0) std::cout <<"<HcalMonitorClient::dqmEndLuminosityBlock>"<<std::endl;
262  if (updateTime_>0)
263  {
265  return;
267  }
268  this->analyze(ib,ig,l.luminosityBlock());
269 
270  if (databaseUpdateTime_>0)
271  {
272  if (
273  // first update occurs at after databaseFirstUpdate_ minutes
275  ||
276  // following updates follow once every databaseUpdateTime_ minutes
278  )
279  {
280  this->writeChannelStatus();
282  }
283  }
284 
285  if (htmlUpdateTime_>0)
286  {
287  if (
289  //
291  ) // htmlUpdateTime_ in minutes
292  {
293  this->writeHtml(ib,ig);
295  }
296  }
297 
298 
299 } // void HcalMonitorClient::endLuminosityBlock
300 
302 {
303  begin_run_ = false;
304  end_run_ = true;
305 
306  // Always fill summaryClient at end of run (as opposed to the end-lumi fills, which may just contain info for a single LS)
307  // At the end of this run, set LS=-1 (LS-based plotting in doesn't work yet anyway)
308  if (summaryClient_)
309  summaryClient_->analyze(ib,ig,-1);
310 
311  if (databasedir_.size()>0)
312  this->writeChannelStatus();
313  // writeHtml takes longer; run it last
314  // Also, don't run it if htmlUpdateTime_>0 -- it should have already been run
315  if (baseHtmlDir_.size()>0 && htmlUpdateTime_==0)
316  this->writeHtml(ib,ig);
317 }
318 
320 {
321  // Set values here, because the "analyze" method occasionally times out,
322  // which keeps the endRun() call from being made. This causes endJob to
323  // crash, since end_run_ is still set to false at that point.
324  begin_run_ = false;
325  end_run_ = true;
326 
327  // pedestal values
328  if ( !doPedSetup_ ) {
329  edm::ESHandle<HcalDbService> conditions;
330  c.get<HcalDbRecord>().get(conditions);
331  PlotPedestalValues(*conditions);
332  }
333 
334 }
335 
337 {
338  // Temporary fix for crash of April 2011 in online DQM
339  if (Online_==true)
340  return;
341 
342  if (! end_run_)
343  {
344  this->analyze(ib,ig);
345  this->endRun(ib,ig);
346  }
347  this->cleanup(); // currently does nothing
348 
349  for ( unsigned int i=0; i<clients_.size(); i++ )
350  clients_[i]->endJob();
351  //if ( summaryClient_ ) summaryClient_->endJob();
352 
353 } // void HcalMonitorClient::endJob(void)
354 
356 {
357  if (!enableCleanup_) return;
358  // other cleanup?
359 } // void HcalMonitorClient::cleanup(void)
360 
361 
363 {
364  if (debug_>0) std::cout << "Preparing HcalMonitorClient html output ..." << std::endl;
365 
366 
367  // global ROOT style
368  gStyle->Reset("Default");
369  gStyle->SetCanvasColor(0);
370  gStyle->SetPadColor(0);
371  gStyle->SetFillColor(0);
372  gStyle->SetTitleFillColor(10);
373  // gStyle->SetOptStat(0);
374  gStyle->SetOptStat("ouemr");
375  gStyle->SetPalette(1);
376 
377  char tmp[20];
378 
379  if (run_ != edm::invalidRunNumber) {
380  sprintf(tmp, "DQM_%s_R%09d_%i", prefixME_.substr(0,prefixME_.size()-1).c_str(),run_,htmlcounter_);
381  } else {
382  sprintf(tmp, "DQM_%s_R%09d_%i", prefixME_.substr(0,prefixME_.size()-1).c_str(),0,htmlcounter_);
383  }
384  std::string htmlDir = baseHtmlDir_ + "/" + tmp + "/";
385  system(("/bin/mkdir -p " + htmlDir).c_str());
386 
387  ++htmlcounter_;
388 
389  std::ofstream htmlFile;
390  htmlFile.open((htmlDir + "index.html").c_str());
391 
392  // html page header
393  htmlFile << "<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\"> " << std::endl;
394  htmlFile << "<html> " << std::endl;
395  htmlFile << "<head> " << std::endl;
396  htmlFile << " <meta content=\"text/html; charset=ISO-8859-1\" " << std::endl;
397  htmlFile << " http-equiv=\"content-type\"> " << std::endl;
398  htmlFile << " <title>Hcal Data Quality Monitor</title> " << std::endl;
399  htmlFile << "</head> " << std::endl;
400  htmlFile << "<body> " << std::endl;
401  htmlFile << "<br> " << std::endl;
402  htmlFile << "<center><h1>Hcal Data Quality Monitor</h1></center>" << std::endl;
403  htmlFile << "<h2>Run Number:&nbsp;&nbsp;&nbsp;" << std::endl;
404  htmlFile << "<span style=\"color: rgb(0, 0, 153);\">" << run_ <<"</span></h2> " << std::endl;
405  htmlFile << "<h2>Events processed:&nbsp;&nbsp;&nbsp;" << std::endl;
406  htmlFile << "<span style=\"color: rgb(0, 0, 153);\">" << ievt_ <<"</span></h2> " << std::endl;
407  htmlFile << "<hr>" << std::endl;
408  htmlFile << "<ul>" << std::endl;
409 
410  for (unsigned int i=0;i<clients_.size();++i)
411  {
412  if (clients_[i]->validHtmlOutput(ib,ig)==true)
413  {
414  clients_[i]->htmlOutput(ib,ig,htmlDir);
415  // Always print this out? Or only when validHtmlOutput is true?
416  htmlFile << "<table border=0 WIDTH=\"50%\"><tr>" << std::endl;
417  htmlFile << "<td WIDTH=\"35%\"><a href=\"" << clients_[i]->name_ << ".html"<<"\">"<<clients_[i]->name_<<"</a></td>" << std::endl;
418  if(clients_[i]->hasErrors_Temp()) htmlFile << "<td bgcolor=red align=center>This monitor task has errors.</td>" << std::endl;
419  else if(clients_[i]->hasWarnings_Temp()) htmlFile << "<td bgcolor=yellow align=center>This monitor task has warnings.</td>" << std::endl;
420  else if(clients_[i]->hasOther_Temp()) htmlFile << "<td bgcolor=aqua align=center>This monitor task has messages.</td>" << std::endl;
421  else htmlFile << "<td bgcolor=lime align=center>This monitor task has no problems</td>" << std::endl;
422  htmlFile << "</tr></table>" << std::endl;
423  }
424  }
425 
426  // Add call to reportSummary html output
427  if (summaryClient_)
428  {
429  summaryClient_->htmlOutput(ib,ig,htmlDir);
430  htmlFile << "<table border=0 WIDTH=\"50%\"><tr>" << std::endl;
431  htmlFile << "<td WIDTH=\"35%\"><a href=\"" << summaryClient_->name_ << ".html"<<"\">"<<summaryClient_->name_<<"</a></td>" << std::endl;
432  if(summaryClient_->hasErrors_Temp()) htmlFile << "<td bgcolor=red align=center>This monitor task has errors.</td>" << std::endl;
433  else if(summaryClient_->hasWarnings_Temp()) htmlFile << "<td bgcolor=yellow align=center>This monitor task has warnings.</td>" << std::endl;
434  else if(summaryClient_->hasOther_Temp()) htmlFile << "<td bgcolor=aqua align=center>This monitor task has messages.</td>" << std::endl;
435  else htmlFile << "<td bgcolor=lime align=center>This monitor task has no problems</td>" << std::endl;
436  htmlFile << "</tr></table>" << std::endl;
437  }
438 
439  htmlFile << "</ul>" << std::endl;
440 
441  // html page footer
442  htmlFile << "</body> " << std::endl;
443  htmlFile << "</html> " << std::endl;
444 
445  htmlFile.close();
446  if (debug_>0) std::cout << "HcalMonitorClient html output done..." << std::endl;
447 
448 } // void HcalMonitorClient::writeHtml()
449 
451 {
452  if (databasedir_.size()==0) return;
453  if (debug_>0) std::cout <<"<HcalMonitorClient::writeDBfile> Writing file for database"<<std::endl;
454 
455  std::map<HcalDetId, unsigned int> myquality; //map of quality flags as reported by each client
456  // Get status from all channels (we need to store all channels in case a bad channel suddenly becomes good)
458  clients_[i]->updateChannelStatus(myquality);
459 
460  if (debug_>0) std::cout <<"<HcalMonitorClient::writeChannelStatus()> myquality size = "<<myquality.size()<<std::endl;
461 
462  std::vector<DetId> mydetids = chanquality_->getAllChannels();
464 
465  for (unsigned int i=0;i<mydetids.size();++i)
466  {
467  if (mydetids[i].det()!=DetId::Hcal) continue; // not hcal
468 
469  HcalDetId id=mydetids[i];
470  // get original channel status item
471  const HcalChannelStatus* origstatus=chanquality_->getValues(mydetids[i]);
472  // make copy of status
473  HcalChannelStatus* mystatus=new HcalChannelStatus(origstatus->rawId(),origstatus->getValue());
474  // loop over myquality flags
475  if (myquality.find(id)!=myquality.end())
476  {
477 
478  // check dead cells
479  if ((myquality[id]>>HcalChannelStatus::HcalCellDead)&0x1)
481  else
483  // check hot cells
484  if ((myquality[id]>>HcalChannelStatus::HcalCellHot)&0x1)
486  else
488  } // if (myquality.find_...)
489  newChanQual->addValues(*mystatus);
490  } // for (unsigned int i=0;...)
491 
492  //Now dump out to text file
493  std::ostringstream file;
494  databasedir_=databasedir_+"/"; // add extra slash, just in case
495  //file <<databasedir_<<"HcalDQMstatus_"<<run_<<".txt";
496  file <<databasedir_<<"HcalDQMstatus.txt";
497  std::ofstream outStream(file.str().c_str());
498  outStream<<"### Run # "<<run_<<std::endl;
499  HcalDbASCIIIO::dumpObject (outStream, (*newChanQual));
500  return;
501 } // void HcalMonitorClient::writeChannelStatus()
502 
503 
505 {
506 
507  double ADC_ped=0;
508  double ADC_width=0;
509  double fC_ped=0;
510  double fC_width=0;
511  double temp_ADC=0;
512  double temp_fC=0;
513 
514  int ieta=-9999;
515  int iphi=-9999;
516  HcalCalibrations calibs_;
517 
522 
523 
524  for (int subdet=1; subdet<=4;++subdet)
525  {
526  for (int depth=0;depth<4;++depth)
527  {
528  int etabins= ADC_PedestalFromDBByDepth->depth[depth]->getNbinsX();
529  int phibins = ADC_PedestalFromDBByDepth->depth[depth]->getNbinsY();
530  for (int eta=0;eta<etabins;++eta)
531  {
532  ieta=CalcIeta(subdet,eta,depth+1);
533  if (ieta==-9999) continue;
534  for (int phi=0;phi<phibins;++phi)
535  {
536  iphi=phi+1;
537  if (!validDetId((HcalSubdetector)(subdet), ieta, iphi, depth+1)) continue;
538  HcalDetId detid((HcalSubdetector)(subdet), ieta, iphi, depth+1);
539  ADC_ped=0;
540  ADC_width=0;
541  fC_ped=0;
542  fC_width=0;
543  calibs_= cond.getHcalCalibrations(detid);
544  const HcalPedestalWidth* pedw = cond.getPedestalWidth(detid);
545  const HcalQIECoder* channelCoder_ = cond.getHcalCoder(detid);
546  const HcalQIEShape* shape_ = cond.getHcalShape(channelCoder_);
547 
548  // Loop over capIDs
549  for (unsigned int capid=0;capid<4;++capid)
550  {
551  // Still need to determine how to convert widths to ADC or fC
552  // calibs_.pedestal value is always in fC, according to Radek
553  temp_fC = calibs_.pedestal(capid);
554  fC_ped+= temp_fC;
555  // convert to ADC from fC
556  temp_ADC=channelCoder_->adc(*shape_,
557  (float)calibs_.pedestal(capid),
558  capid);
559  ADC_ped+=temp_ADC;
560  // Pedestals assumed to be read out in fC
561  temp_fC=pedw->getSigma(capid,capid);
562  fC_width+=temp_fC;
563  temp_ADC=pedw->getSigma(capid,capid)*pow(1.*channelCoder_->adc(*shape_,(float)calibs_.pedestal(capid),capid)/calibs_.pedestal(capid),2);
564  ADC_width+=temp_ADC;
565  }//capid loop
566 
567  // Pedestal values are average over four cap IDs
568  // widths are sqrt(SUM [sigma_ii^2])/4.
569  fC_ped/=4.;
570  ADC_ped/=4.;
571 
572  // Divide width by 2, or by four?
573  // Dividing by 2 gives subtracted results closer to zero -- estimate of variance?
574  fC_width=pow(fC_width,0.5)/2.;
575  ADC_width=pow(ADC_width,0.5)/2.;
576 
577  if (debug_>1)
578  {
579  std::cout <<"<HcalMonitorClient::PlotPedestalValues> HcalDet ID = "<<(HcalSubdetector)subdet<<": ("<<ieta<<", "<<iphi<<", "<<depth<<")"<<std::endl;
580  std::cout <<"\tADC pedestal = "<<ADC_ped<<" +/- "<<ADC_width<<std::endl;
581  std::cout <<"\tfC pedestal = "<<fC_ped<<" +/- "<<fC_width<<std::endl;
582  }
583  // Shift HF by -/+1 when filling eta-phi histograms
584  int zside=0;
585  if (subdet==4)
586  {
587  if (ieta<0) zside=-1;
588  else zside=1;
589  }
590  ADC_PedestalFromDBByDepth->depth[depth]->Fill(ieta+zside,iphi,ADC_ped);
591  ADC_WidthFromDBByDepth->depth[depth]->Fill(ieta+zside, iphi, ADC_width);
592  fC_PedestalFromDBByDepth->depth[depth]->Fill(ieta+zside,iphi,fC_ped);
593  fC_WidthFromDBByDepth->depth[depth]->Fill(ieta+zside, iphi, fC_width);
594  } // phi loop
595  } // eta loop
596  } //depth loop
597 
598  } // subdet loop
603 
604  // Center ADC pedestal values near 3 +/- 1
605  for (unsigned int i=0;i<ADC_PedestalFromDBByDepth->depth.size();++i)
606  {
607  ADC_PedestalFromDBByDepth->depth[i]->getTH2F()->SetMinimum(0);
608  if (ADC_PedestalFromDBByDepth->depth[i]->getTH2F()->GetMaximum()<6)
609  ADC_PedestalFromDBByDepth->depth[i]->getTH2F()->SetMaximum(6);
610  }
611 
612  for (unsigned int i=0;i<ADC_WidthFromDBByDepth->depth.size();++i)
613  {
614  ADC_WidthFromDBByDepth->depth[i]->getTH2F()->SetMinimum(0);
615  if (ADC_WidthFromDBByDepth->depth[i]->getTH2F()->GetMaximum()<2)
616  ADC_WidthFromDBByDepth->depth[i]->getTH2F()->SetMaximum(2);
617  }
618 
619 }
620 
621 
622 //
623 // setupPedestalMon
624 //
626 {
627 
628  // Now let's setup pedestals
629  ib.setCurrentFolder(prefixME_+"HcalInfo/PedestalsFromCondDB");
631  {
633  ADC_PedestalFromDBByDepth->setup(ib,"ADC Pedestals From Conditions DB");
634  }
635  if (ADC_WidthFromDBByDepth==0)
636  {
638  ADC_WidthFromDBByDepth->setup(ib,"ADC Widths From Conditions DB");
639  }
641  {
643  fC_PedestalFromDBByDepth->setup(ib,"fC Pedestals From Conditions DB");
644  }
645  if (fC_WidthFromDBByDepth==0)
646  {
648  fC_WidthFromDBByDepth->setup(ib,"fC Widths From Conditions DB");
649  }
650 
651  doPedSetup_ = false;
652 }
653 
654 //
655 // setupChannelStatus
656 //
658 {
659 
660  if (ChannelStatus==0)
661  {
662  ib.setCurrentFolder(prefixME_+"HcalInfo/ChannelStatus");
664  ChannelStatus->setup(ib,"ChannelStatus");
665  std::stringstream x;
666  for (unsigned int d=0;d<ChannelStatus->depth.size();++d)
667  {
668  ChannelStatus->depth[d]->Reset();
669  x<<"1+log2(status) for HCAL depth "<<d+1;
670  if (ChannelStatus->depth[d]) ChannelStatus->depth[d]->setTitle(x.str().c_str());
671  x.str("");
672  }
673  }
674 
675  doChanStatSetup_ = false;
676 
677 }
678 
std::vector< std::string > enabledClients_
T getUntrackedParameter(std::string const &, T const &) const
void setup(void)
Setup.
int i
Definition: DBlmapReader.cc:9
void cleanup(void)
Cleanup.
EtaPhiHists * fC_WidthFromDBByDepth
RunID const & id() const
Definition: RunBase.h:41
EtaPhiHists * ADC_PedestalFromDBByDepth
int ib
Definition: cuy.py:660
void setupPedestalMon(DQMStore::IBooker &)
void PlotPedestalValues(const HcalDbService &cond)
RunNumber_t run() const
Definition: RunID.h:39
std::string databasedir_
float getSigma(int fCapId1, int fCapId2) const
get correlation element for capId1/2 = 0..3
RunNumber_t const invalidRunNumber
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
void Reset(void)
EtaPhiHists * fC_PedestalFromDBByDepth
#define NULL
Definition: scimark2.h:8
virtual void htmlOutput(DQMStore::IBooker &, DQMStore::IGetter &, std::string htmlDir)
double pedestal(int fCapId) const
get pedestal for capid=0..3
EtaPhiHists * ADC_WidthFromDBByDepth
const Item * getValues(DetId fId, bool throwOnFail=true) const
int zside(DetId const &)
T eta() const
void setupChannelStatusMon(DQMStore::IBooker &)
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:7
void unsetBit(unsigned int bitnumber)
uint16_t size_type
void setBit(unsigned int bitnumber)
uint32_t rawId() const
LuminosityBlockNumber_t luminosityBlock() const
void beginRun(const edm::Run &r, const edm::EventSetup &c)
BeginRun.
void dqmEndJob(DQMStore::IBooker &, DQMStore::IGetter &)
EndJob.
const HcalPedestalWidth * getPedestalWidth(const HcalGenericDetId &fId) const
virtual void endJob() final
std::string baseHtmlDir_
HcalMonitorClient(const edm::ParameterSet &ps)
std::vector< MonitorElement * > depth
std::string inputFile_
int CalcIeta(int subdet, int eta, int depth)
void analyze(DQMStore::IBooker &, DQMStore::IGetter &, int LS=-1)
std::vector< DetId > getAllChannels() const
HcalSubdetector
Definition: HcalAssistant.h:31
void setup(DQMStore::IBooker &m_dbe, std::string Name, std::string Units="")
void analyze(DQMStore::IBooker &ib, DQMStore::IGetter &, int LS=-1)
Analyze.
HcalSummaryClient * summaryClient_
void dqmEndLuminosityBlock(DQMStore::IBooker &, DQMStore::IGetter &, const edm::LuminosityBlock &l, const edm::EventSetup &c)
EndLumiBlock.
std::vector< HcalBaseDQClient * > clients_
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:274
const T & get() const
Definition: EventSetup.h:55
T const * product() const
Definition: ESHandle.h:86
const HcalQIECoder * getHcalCoder(const HcalGenericDetId &fId) const
void FillUnphysicalHEHFBins(std::vector< TH2F > &hh)
EtaPhiHists * ChannelStatus
const HcalQIEShape * getHcalShape(const HcalGenericDetId &fId) const
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
bool dumpObject(std::ostream &fOutput, const HcalPedestals &fObject)
void writeHtml(DQMStore::IBooker &, DQMStore::IGetter &)
const HcalChannelQuality * chanquality_
edm::RunNumber_t run_
unsigned adc(const HcalQIEShape &fShape, float fCharge, unsigned fCapId) const
fC + capid [0..3] -&gt; ADC conversion
Definition: HcalQIECoder.cc:27
const JetExtendedData & getValue(const Container &, const reco::JetBaseRef &)
get value for the association. Throw exception if no association found
tuple cout
Definition: gather_cfg.py:121
void fillReportSummaryLSbyLS(DQMStore::IBooker &, DQMStore::IGetter &, int LS)
Definition: DDAxes.h:10
tuple status
Definition: ntuplemaker.py:245
uint32_t getValue() const
void endRun(DQMStore::IBooker &, DQMStore::IGetter &)
EndRun.
const HcalCalibrations & getHcalCalibrations(const HcalGenericDetId &fId) const
bool addValues(const Item &myItem)
void getFriends(const std::vector< HcalBaseDQClient * > &clients)
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:40
Definition: Run.h:41
const HcalTopology * topo() const
bool validDetId(HcalSubdetector sd, int ies, int ip, int dp)
Definition: DDAxes.h:10