CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
HcalDetDiagPedestalClient.cc
Go to the documentation of this file.
4 
8 
10 
11 #include <iostream>
12 
13 /*
14  * \file HcalDetDiagPedestalClient.cc
15  *
16  * $Date: 2012/11/12 23:26:19 $
17  * $Revision: 1.13 $
18  * \author J. Temple
19  * \brief Hcal DetDiagPedestal Client class
20  */
21 
22 
24 {
25  name_=myname; status=0;
26  needLogicalMap_=true;
27 }
28 
30 {
31  name_=myname;
32  enableCleanup_ = ps.getUntrackedParameter<bool>("enableCleanup",false);
33  debug_ = ps.getUntrackedParameter<int>("debug",0);
34  prefixME_ = ps.getUntrackedParameter<std::string>("subSystemFolder","Hcal/");
35  if (prefixME_.substr(prefixME_.size()-1,prefixME_.size())!="/")
36  prefixME_.append("/");
37  subdir_ = ps.getUntrackedParameter<std::string>("DetDiagPedestalFolder","DetDiagPedestalMonitor_Hcal/"); // DetDiagPedestalMonitor_Hcal/
38  if (subdir_.size()>0 && subdir_.substr(subdir_.size()-1,subdir_.size())!="/")
39  subdir_.append("/");
40  subdir_=prefixME_+subdir_;
41 
42  validHtmlOutput_ = ps.getUntrackedParameter<bool>("DetDiagPedestal_validHtmlOutput",true);
43  cloneME_ = ps.getUntrackedParameter<bool>("cloneME", true);
44  badChannelStatusMask_ = ps.getUntrackedParameter<int>("DetDiagPedestal_BadChannelStatusMask",
45  ps.getUntrackedParameter<int>("BadChannelStatusMask",(1<<HcalChannelStatus::HcalCellDead)));
46 
47  minerrorrate_ = ps.getUntrackedParameter<double>("DetDiagPedestal_minerrorrate",
48  ps.getUntrackedParameter<double>("minerrorrate",0.05));
49  minevents_ = ps.getUntrackedParameter<int>("DetDiagPedestal_minevents",
50  ps.getUntrackedParameter<int>("minevents",1));
51  Online_ = ps.getUntrackedParameter<bool>("online",false);
52 
53  ProblemCells=0;
55  needLogicalMap_=true;
56 }
57 
59 {
60  if (debug_>2) std::cout <<"\tHcalDetDiagPedestalClient::analyze()"<<std::endl;
62 }
63 
65 {
66  if (debug_>2) std::cout <<"\t\tHcalDetDiagPedestalClient::calculateProblems()"<<std::endl;
67  if(!dqmStore_) return;
68  double totalevents=0;
69  int etabins=0, phibins=0, zside=0;
70  double problemvalue=0;
71 
72  // Clear away old problems
73  if (ProblemCells!=0)
74  {
76  (ProblemCells->getTH2F())->SetMaximum(1.05);
77  (ProblemCells->getTH2F())->SetMinimum(0.);
78  }
79  for (unsigned int d=0;d<ProblemCellsByDepth->depth.size();++d)
80  {
81  if (ProblemCellsByDepth->depth[d]!=0)
82  {
83  ProblemCellsByDepth->depth[d]->Reset();
84  (ProblemCellsByDepth->depth[d]->getTH2F())->SetMaximum(1.05);
85  (ProblemCellsByDepth->depth[d]->getTH2F())->SetMinimum(0.);
86  }
87  }
88  enoughevents_=true;
89  // Get histograms that are used in testing
90  // currently none used,
91 
92  std::vector<std::string> name = HcalEtaPhiHistNames();
93 
94  // This is a sample of how to get a histogram from the task that can then be used for evaluation purposes
95  TH2F* PedestalsMissing[4];
96  TH2F* PedestalsUnstable[4];
97  TH2F* PedestalsBadMean[4];
98  TH2F* PedestalsBadRMS[4];
99  MonitorElement* me;
100  for (int i=0;i<4;++i)
101  {
102  // Assume that histograms aren't found
103  PedestalsMissing[i]=0;
104  PedestalsUnstable[i]=0;
105  PedestalsBadMean[i]=0;
106  PedestalsBadRMS[i]=0;
107  std::string s=subdir_+name[i]+" Problem Missing Channels";
108  me=dqmStore_->get(s.c_str());
109  if (me!=0) PedestalsMissing[i]=HcalUtilsClient::getHisto<TH2F*>(me, cloneME_, PedestalsMissing[i], debug_);
110  else
111  {
112  if (debug_>0)
113  std::cout <<"<HcalDetDiagPedestalClient::calcluateProblems> could not get histogram '"<<s<<"'"<<std::endl;
114  }
115 
116  s=subdir_+name[i]+" Problem Unstable Channels";
117  me=dqmStore_->get(s.c_str());
118  if (me!=0) PedestalsUnstable[i]=HcalUtilsClient::getHisto<TH2F*>(me, cloneME_, PedestalsUnstable[i], debug_);
119  else if (debug_>0) std::cout <<"<HcalDetDiagPedestalClient::calculateProblems> could not get histogram '"<<s<<"'"<<std::endl;
120  s=subdir_+name[i]+" Problem Bad Pedestal Value";
121  me=dqmStore_->get(s.c_str());
122  if (me!=0) PedestalsBadMean[i]=HcalUtilsClient::getHisto<TH2F*>(me, cloneME_, PedestalsBadMean[i], debug_);
123  else if (debug_>0) std::cout <<"<HcalDetDiagPedestalClient::calculateProblems> could not get histogram '"<<s<<"'"<<std::endl;
124  s=subdir_+name[i]+" Problem Bad Rms Value";
125  me=dqmStore_->get(s.c_str());
126  if (me!=0) PedestalsBadRMS[i]=HcalUtilsClient::getHisto<TH2F*>(me, cloneME_, PedestalsBadRMS[i], debug_);
127  else if (debug_>0) std::cout <<"<HcalDetDiagPedestalClient::calculateProblems> could not get histogram '"<<s<<"'"<<std::endl;
128  }
129 
130  // Because we're clearing and re-forming the problem cell histogram here, we don't need to do any cute
131  // setting of the underflow bin to 0, and we can plot results as a raw rate between 0-1.
132 
133  for (unsigned int d=0;d<ProblemCellsByDepth->depth.size();++d)
134  {
135  if (ProblemCellsByDepth->depth[d]==0) continue;
136 
137  //totalevents=DigiPresentByDepth[d]->GetBinContent(0);
138  totalevents=0;
139  // Check underflow bins for events processed
140  if (PedestalsMissing[d]!=0) totalevents = PedestalsMissing[d]->GetBinContent(0);
141  else if (PedestalsUnstable[d]!=0) totalevents = PedestalsUnstable[d]->GetBinContent(0);
142  else if (PedestalsBadMean[d]!=0) totalevents = PedestalsBadMean[d]->GetBinContent(0);
143  else if (PedestalsBadRMS[d]!=0) totalevents = PedestalsBadRMS[d]->GetBinContent(0);
144  //if (totalevents==0 || totalevents<minevents_) continue;
145 
146  totalevents=1; // temporary value pending removal of normalization from task
147  etabins=(ProblemCellsByDepth->depth[d]->getTH2F())->GetNbinsX();
148  phibins=(ProblemCellsByDepth->depth[d]->getTH2F())->GetNbinsY();
149  for (int eta=0;eta<etabins;++eta)
150  {
151  int ieta=CalcIeta(eta,d+1);
152  if (ieta==-9999) continue;
153  for (int phi=0;phi<phibins;++phi)
154  {
155  problemvalue=0;
156  if (PedestalsMissing[d]!=0) problemvalue += PedestalsMissing[d]->GetBinContent(eta+1,phi+1)*1./totalevents;
157  if (PedestalsUnstable[d]!=0) problemvalue += PedestalsUnstable[d]->GetBinContent(eta+1,phi+1)*1./totalevents;
158  if (PedestalsBadMean[d]!=0) problemvalue += PedestalsBadMean[d]->GetBinContent(eta+1,phi+1)*1./totalevents;
159  if (PedestalsBadRMS[d]!=0) problemvalue += PedestalsBadRMS[d]->GetBinContent(eta+1,phi+1)*1./totalevents;
160 
161  if (problemvalue==0) continue;
162  // problem value is a rate; we can normalize it here
163  problemvalue = std::min(1.,problemvalue);
164 
165  zside=0;
166  if (isHF(eta,d+1)) // shift ieta by 1 for HF
167  ieta<0 ? zside = -1 : zside = 1;
168 
169  // For problem cells that exceed our allowed rate,
170  // set the values to -1 if the cells are already marked in the status database
171  if (problemvalue>minerrorrate_)
172  {
173  HcalSubdetector subdet=HcalEmpty;
174  if (isHB(eta,d+1))subdet=HcalBarrel;
175  else if (isHE(eta,d+1)) subdet=HcalEndcap;
176  else if (isHF(eta,d+1)) subdet=HcalForward;
177  else if (isHO(eta,d+1)) subdet=HcalOuter;
178  HcalDetId hcalid(subdet, ieta, phi+1, (int)(d+1));
179  if (badstatusmap.find(hcalid)!=badstatusmap.end())
180  problemvalue=999;
181  }
182 
183  ProblemCellsByDepth->depth[d]->setBinContent(eta+1,phi+1,problemvalue);
184  if (ProblemCells!=0) ProblemCells->Fill(ieta+zside,phi+1,problemvalue);
185  } // loop on phi
186  } // loop on eta
187  } // loop on depth
188 
189  if (ProblemCells==0)
190  {
191  if (debug_>0) std::cout <<"<HcalDetDiagPedestalClient::analyze> ProblemCells histogram does not exist!"<<std::endl;
192  return;
193  }
194 
195  // Normalization of ProblemCell plot, in the case where there are errors in multiple depths
196  etabins=(ProblemCells->getTH2F())->GetNbinsX();
197  phibins=(ProblemCells->getTH2F())->GetNbinsY();
198  for (int eta=0;eta<etabins;++eta)
199  {
200  for (int phi=0;phi<phibins;++phi)
201  {
204  }
205  }
206 
209  return;
210 }
211 
213 {
215  if (debug_>0)
216  {
217  std::cout <<"<HcalDetDiagPedestalClient::beginJob()> Displaying dqmStore directory structure:"<<std::endl;
219  }
220 }
222 
224 {
225  enoughevents_=false;
226  if (!dqmStore_)
227  {
228  if (debug_>0) std::cout <<"<HcalDetDiagPedestalClient::beginRun> dqmStore does not exist!"<<std::endl;
229  return;
230  }
232  problemnames_.clear();
233 
234  // Put the appropriate name of your problem summary here
235  ProblemCells=dqmStore_->book2D(" ProblemDetDiagPedestal",
236  " Problem DetDiagPedestal Rate for all HCAL;ieta;iphi",
237  85,-42.5,42.5,
238  72,0.5,72.5);
239  problemnames_.push_back(ProblemCells->getName());
240  if (debug_>1)
241  std::cout << "Tried to create ProblemCells Monitor Element in directory "<<subdir_<<" \t Failed? "<<(ProblemCells==0)<<std::endl;
242  dqmStore_->setCurrentFolder(subdir_+"problem_DetDiagPedestal");
244  ProblemCellsByDepth->setup(dqmStore_," Problem DetDiagPedestal Rate");
245  for (unsigned int i=0; i<ProblemCellsByDepth->depth.size();++i)
246  problemnames_.push_back(ProblemCellsByDepth->depth[i]->getName());
247  nevts_=0;
248 }
249 
251 
254 
256 {
257  if(status&2) return true;
258  return false;
259 
260  if (!ProblemCells)
261  {
262  if (debug_>1) std::cout <<"<HcalDetDiagPedestalClient::hasErrors_Temp> ProblemCells histogram does not exist!"<<std::endl;
263  return false;
264  }
265  int problemcount=0;
266  int ieta=-9999;
267 
268  for (int depth=0;depth<4; ++depth)
269  {
270  int etabins = (ProblemCells->getTH2F())->GetNbinsX();
271  int phibins = (ProblemCells->getTH2F())->GetNbinsY();
272  for (int hist_eta=0;hist_eta<etabins;++hist_eta)
273  {
274  for (int hist_phi=0; hist_phi<phibins;++hist_phi)
275  {
276  ieta=CalcIeta(hist_eta,depth+1);
277  if (ieta==-9999) continue;
278  if (ProblemCellsByDepth->depth[depth]==0)
279  continue;
280  if (ProblemCellsByDepth->depth[depth]->getBinContent(hist_eta,hist_phi)>minerrorrate_)
281  ++problemcount;
282 
283  } // for (int hist_phi=1;...)
284  } // for (int hist_eta=1;...)
285  } // for (int depth=0;...)
286 
287  if (problemcount>0) return true;
288  return false;
289 }
290 
292  if(status&1) return true;
293  return false;
294 }
297 
298 
299 void HcalDetDiagPedestalClient::updateChannelStatus(std::map<HcalDetId, unsigned int>& myqual)
300 {
301  // This gets called by HcalMonitorClient
302  // trigger primitives don't yet contribute to channel status (though they could...)
303  // see dead or hot cell code for an example
304 
305 } //void HcalDetDiagPedestalClient::updateChannelStatus
306 
307 static void printTableHeader(ofstream& file,std::string header){
308  file << "</html><html xmlns=\"http://www.w3.org/1999/xhtml\">"<< std::endl;
309  file << "<head>"<< std::endl;
310  file << "<meta http-equiv=\"Content-Type\" content=\"text/html\"/>"<< std::endl;
311  file << "<title>"<< header <<"</title>"<< std::endl;
312  file << "<style type=\"text/css\">"<< std::endl;
313  file << " body,td{ background-color: #FFFFCC; font-family: arial, arial ce, helvetica; font-size: 12px; }"<< std::endl;
314  file << " td.s0 { font-family: arial, arial ce, helvetica; }"<< std::endl;
315  file << " td.s1 { font-family: arial, arial ce, helvetica; font-weight: bold; background-color: #FFC169; text-align: center;}"<< std::endl;
316  file << " td.s2 { font-family: arial, arial ce, helvetica; background-color: #eeeeee; }"<< std::endl;
317  file << " td.s3 { font-family: arial, arial ce, helvetica; background-color: #d0d0d0; }"<< std::endl;
318  file << " td.s4 { font-family: arial, arial ce, helvetica; background-color: #FFC169; }"<< std::endl;
319  file << "</style>"<< std::endl;
320  file << "<body>"<< std::endl;
321  file << "<table>"<< std::endl;
322 }
323 
324 static void printTableLine(ofstream& file,int ind,HcalDetId& detid,HcalFrontEndId& lmap_entry,HcalElectronicsId &emap_entry,std::string comment=""){
325  if(ind==0){
326  file << "<tr>";
327  file << "<td class=\"s4\" align=\"center\">#</td>" << std::endl;
328  file << "<td class=\"s1\" align=\"center\">ETA</td>" << std::endl;
329  file << "<td class=\"s1\" align=\"center\">PHI</td>" << std::endl;
330  file << "<td class=\"s1\" align=\"center\">DEPTH</td>"<< std::endl;
331  file << "<td class=\"s1\" align=\"center\">RBX</td>" << std::endl;
332  file << "<td class=\"s1\" align=\"center\">RM</td>" << std::endl;
333  file << "<td class=\"s1\" align=\"center\">PIXEL</td>" << std::endl;
334  file << "<td class=\"s1\" align=\"center\">RM_FIBER</td>" << std::endl;
335  file << "<td class=\"s1\" align=\"center\">FIBER_CH</td>" << std::endl;
336  file << "<td class=\"s1\" align=\"center\">QIE</td>" << std::endl;
337  file << "<td class=\"s1\" align=\"center\">ADC</td>" << std::endl;
338  file << "<td class=\"s1\" align=\"center\">CRATE</td>" << std::endl;
339  file << "<td class=\"s1\" align=\"center\">DCC</td>" << std::endl;
340  file << "<td class=\"s1\" align=\"center\">SPIGOT</td>" << std::endl;
341  file << "<td class=\"s1\" align=\"center\">HTR_FIBER</td>" << std::endl;
342  file << "<td class=\"s1\" align=\"center\">HTR_SLOT</td>" << std::endl;
343  file << "<td class=\"s1\" align=\"center\">HTR_FPGA</td>" << std::endl;
344  if(comment[0]!=0) file << "<td class=\"s1\" align=\"center\">Comment</td>" << std::endl;
345  file << "</tr>" << std::endl;
346  }
347  std::string raw_class;
348  file << "<tr>"<< std::endl;
349  if((ind%2)==1){
350  raw_class="<td class=\"s2\" align=\"center\">";
351  }else{
352  raw_class="<td class=\"s3\" align=\"center\">";
353  }
354  file << "<td class=\"s4\" align=\"center\">" << ind+1 <<"</td>"<< std::endl;
355  file << raw_class<< detid.ieta()<<"</td>"<< std::endl;
356  file << raw_class<< detid.iphi()<<"</td>"<< std::endl;
357  file << raw_class<< detid.depth() <<"</td>"<< std::endl;
358  file << raw_class<< lmap_entry.rbx()<<"</td>"<< std::endl;
359  file << raw_class<< lmap_entry.rm() <<"</td>"<< std::endl;
360  file << raw_class<< lmap_entry.pixel()<<"</td>"<< std::endl;
361  file << raw_class<< lmap_entry.rmFiber() <<"</td>"<< std::endl;
362  file << raw_class<< lmap_entry.fiberChannel()<<"</td>"<< std::endl;
363  file << raw_class<< lmap_entry.qieCard() <<"</td>"<< std::endl;
364  file << raw_class<< lmap_entry.adc()<<"</td>"<< std::endl;
365  file << raw_class<< emap_entry.readoutVMECrateId()<<"</td>"<< std::endl;
366  file << raw_class<< emap_entry.dccid()<<"</td>"<< std::endl;
367  file << raw_class<< emap_entry.spigot()<<"</td>"<< std::endl;
368  file << raw_class<< emap_entry.fiberIndex()<<"</td>"<< std::endl;
369  file << raw_class<< emap_entry.htrSlot()<<"</td>"<< std::endl;
370  file << raw_class<< emap_entry.htrTopBottom()<<"</td>"<< std::endl;
371  if(comment[0]!=0) file << raw_class<< comment<<"</td>"<< std::endl;
372 }
373 static void printTableTail(ofstream& file){
374  file << "</table>"<< std::endl;
375  file << "</body>"<< std::endl;
376  file << "</html>"<< std::endl;
377 }
378 
380  std::string s=subdir_+"HcalDetDiagPedestalMonitor Event Number";
381  MonitorElement *me = dqmStore_->get(s.c_str());
382  int n=0;
383  if ( me ) {
384  s = me->valueString();
385  sscanf((s.substr(2,s.length()-2)).c_str(), "%d", &n);
386  }
387  if(n<100) return false;
388  return true;
389 }
390 
392 int MissingCnt=0,UnstableCnt=0,BadCnt=0;
393 int HBP[4]={0,0,0,0},HBM[4]={0,0,0,0},HEP[4]={0,0,0,0},HEM[4]={0,0,0,0},HFP[4]={0,0,0,0},HFM[4]={0,0,0,0},HO[4] ={0,0,0,0};
394 int newHBP[4]={0,0,0,0},newHBM[4]={0,0,0,0},newHEP[4]={0,0,0,0},newHEM[4]={0,0,0,0};
395 int newHFP[4]={0,0,0,0},newHFM[4]={0,0,0,0},newHO[4] ={0,0,0,0};
396  if (debug_>0) std::cout << "<HcalDetDiagPedestalClient::htmlOutput> Preparing html output ..." << std::endl;
397  if(!dqmStore_) return;
398 
400  TH2F *Missing_val[4],*Unstable_val[4],*BadPed_val[4],*BadRMS_val[4];
401  MonitorElement* me;
402 
403 
404  TH1F *PedestalsAve4HB=0;
405  TH1F *PedestalsAve4HE=0;
406  TH1F *PedestalsAve4HO=0;
407  TH1F *PedestalsAve4HF=0;
408  TH1F *PedestalsAve4Simp=0;
409 
410  TH1F *PedestalsAve4HBref=0;
411  TH1F *PedestalsAve4HEref=0;
412  TH1F *PedestalsAve4HOref=0;
413  TH1F *PedestalsAve4HFref=0;
414  TH1F *PedestalsRmsHB=0;
415  TH1F *PedestalsRmsHE=0;
416  TH1F *PedestalsRmsHO=0;
417  TH1F *PedestalsRmsHF=0;
418  TH1F *PedestalsRmsSimp=0;
419 
420  TH1F *PedestalsRmsHBref=0;
421  TH1F *PedestalsRmsHEref=0;
422  TH1F *PedestalsRmsHOref=0;
423  TH1F *PedestalsRmsHFref=0;
424 
425  TH2F *Pedestals2DRmsHBHEHF=0;
426  TH2F *Pedestals2DRmsHO=0;
427  TH2F *Pedestals2DHBHEHF=0;
428  TH2F *Pedestals2DHO=0;
429  TH2F *Pedestals2DErrorHBHEHF=0;
430  TH2F *Pedestals2DErrorHO=0;
431 
432  std::string s=subdir_+"Summary Plots/HB Pedestal Distribution (average over 4 caps)"; me=dqmStore_->get(s.c_str());
433  if(me!=0) PedestalsAve4HB=HcalUtilsClient::getHisto<TH1F*>(me, cloneME_, PedestalsAve4HB, debug_); else return;
434  s=subdir_+"Summary Plots/HE Pedestal Distribution (average over 4 caps)"; me=dqmStore_->get(s.c_str());
435  if(me!=0) PedestalsAve4HE=HcalUtilsClient::getHisto<TH1F*>(me, cloneME_, PedestalsAve4HE, debug_); else return;
436  s=subdir_+"Summary Plots/HO Pedestal Distribution (average over 4 caps)"; me=dqmStore_->get(s.c_str());
437  if(me!=0) PedestalsAve4HO=HcalUtilsClient::getHisto<TH1F*>(me, cloneME_, PedestalsAve4HO, debug_); else return;
438  s=subdir_+"Summary Plots/HF Pedestal Distribution (average over 4 caps)"; me=dqmStore_->get(s.c_str());
439  if(me!=0) PedestalsAve4HF=HcalUtilsClient::getHisto<TH1F*>(me, cloneME_, PedestalsAve4HF, debug_); else return;
440  s=subdir_+"Summary Plots/SIPM Pedestal Distribution (average over 4 caps)"; me=dqmStore_->get(s.c_str());
441  if(me!=0) PedestalsAve4Simp=HcalUtilsClient::getHisto<TH1F*>(me, cloneME_, PedestalsAve4Simp, debug_); else return;
442 
443  s=subdir_+"Summary Plots/HB Pedestal-Reference Distribution (average over 4 caps)"; me=dqmStore_->get(s.c_str());
444  if(me!=0) PedestalsAve4HBref=HcalUtilsClient::getHisto<TH1F*>(me, cloneME_, PedestalsAve4HBref, debug_); else return;
445  s=subdir_+"Summary Plots/HE Pedestal-Reference Distribution (average over 4 caps)"; me=dqmStore_->get(s.c_str());
446  if(me!=0) PedestalsAve4HEref=HcalUtilsClient::getHisto<TH1F*>(me, cloneME_, PedestalsAve4HEref, debug_); else return;
447  s=subdir_+"Summary Plots/HO Pedestal-Reference Distribution (average over 4 caps)"; me=dqmStore_->get(s.c_str());
448  if(me!=0) PedestalsAve4HOref=HcalUtilsClient::getHisto<TH1F*>(me, cloneME_, PedestalsAve4HOref, debug_); else return;
449  s=subdir_+"Summary Plots/HF Pedestal-Reference Distribution (average over 4 caps)"; me=dqmStore_->get(s.c_str());
450  if(me!=0) PedestalsAve4HFref=HcalUtilsClient::getHisto<TH1F*>(me, cloneME_, PedestalsAve4HFref, debug_); else return;
451 
452  s=subdir_+"Summary Plots/HB Pedestal RMS Distribution (individual cap)"; me=dqmStore_->get(s.c_str());
453  if(me!=0) PedestalsRmsHB=HcalUtilsClient::getHisto<TH1F*>(me, cloneME_, PedestalsRmsHB, debug_); else return;
454  s=subdir_+"Summary Plots/HE Pedestal RMS Distribution (individual cap)"; me=dqmStore_->get(s.c_str());
455  if(me!=0) PedestalsRmsHE=HcalUtilsClient::getHisto<TH1F*>(me, cloneME_, PedestalsRmsHE, debug_); else return;
456  s=subdir_+"Summary Plots/HO Pedestal RMS Distribution (individual cap)"; me=dqmStore_->get(s.c_str());
457  if(me!=0) PedestalsRmsHO=HcalUtilsClient::getHisto<TH1F*>(me, cloneME_, PedestalsRmsHO, debug_); else return;
458  s=subdir_+"Summary Plots/HF Pedestal RMS Distribution (individual cap)"; me=dqmStore_->get(s.c_str());
459  if(me!=0) PedestalsRmsHF=HcalUtilsClient::getHisto<TH1F*>(me, cloneME_, PedestalsRmsHF, debug_); else return;
460  s=subdir_+"Summary Plots/SIPM Pedestal RMS Distribution (individual cap)"; me=dqmStore_->get(s.c_str());
461  if(me!=0) PedestalsRmsSimp=HcalUtilsClient::getHisto<TH1F*>(me, cloneME_, PedestalsRmsSimp, debug_); else return;
462 
463  s=subdir_+"Summary Plots/HB Pedestal_rms-Reference_rms Distribution"; me=dqmStore_->get(s.c_str());
464  if(me!=0) PedestalsRmsHBref=HcalUtilsClient::getHisto<TH1F*>(me, cloneME_, PedestalsRmsHBref, debug_); else return;
465  s=subdir_+"Summary Plots/HE Pedestal_rms-Reference_rms Distribution"; me=dqmStore_->get(s.c_str());
466  if(me!=0) PedestalsRmsHEref=HcalUtilsClient::getHisto<TH1F*>(me, cloneME_, PedestalsRmsHEref, debug_); else return;
467  s=subdir_+"Summary Plots/HO Pedestal_rms-Reference_rms Distribution"; me=dqmStore_->get(s.c_str());
468  if(me!=0) PedestalsRmsHOref=HcalUtilsClient::getHisto<TH1F*>(me, cloneME_, PedestalsRmsHOref, debug_); else return;
469  s=subdir_+"Summary Plots/HF Pedestal_rms-Reference_rms Distribution"; me=dqmStore_->get(s.c_str());
470  if(me!=0) PedestalsRmsHFref=HcalUtilsClient::getHisto<TH1F*>(me, cloneME_, PedestalsRmsHFref, debug_); else return;
471 
472  s=subdir_+"Summary Plots/HBHEHF pedestal mean map"; me=dqmStore_->get(s.c_str());
473  if(me!=0) Pedestals2DHBHEHF=HcalUtilsClient::getHisto<TH2F*>(me, cloneME_, Pedestals2DHBHEHF, debug_); else return;
474  s=subdir_+"Summary Plots/HO pedestal mean map"; me=dqmStore_->get(s.c_str());
475  if(me!=0) Pedestals2DHO=HcalUtilsClient::getHisto<TH2F*>(me, cloneME_, Pedestals2DHO, debug_); else return;
476  s=subdir_+"Summary Plots/HBHEHF pedestal rms map"; me=dqmStore_->get(s.c_str());
477  if(me!=0) Pedestals2DRmsHBHEHF=HcalUtilsClient::getHisto<TH2F*>(me, cloneME_, Pedestals2DRmsHBHEHF, debug_); else return;
478  s=subdir_+"Summary Plots/HO pedestal rms map"; me=dqmStore_->get(s.c_str());
479  if(me!=0) Pedestals2DRmsHO=HcalUtilsClient::getHisto<TH2F*>(me, cloneME_, Pedestals2DRmsHO, debug_); else return;
480  s=subdir_+"Summary Plots/HBHEHF pedestal problems map"; me=dqmStore_->get(s.c_str());
481  if(me!=0) Pedestals2DErrorHBHEHF=HcalUtilsClient::getHisto<TH2F*>(me, cloneME_, Pedestals2DErrorHBHEHF, debug_); else return;
482  s=subdir_+"Summary Plots/HO pedestal problems map"; me=dqmStore_->get(s.c_str());
483  if(me!=0) Pedestals2DErrorHO=HcalUtilsClient::getHisto<TH2F*>(me, cloneME_, Pedestals2DErrorHO, debug_); else return;
484 
485 
486  std::vector<std::string> name = HcalEtaPhiHistNames();
487  for(int i=0;i<4;++i){
488  Missing_val[i]=Unstable_val[i]=BadPed_val[i]=BadRMS_val[i]=0;
489  std::string s=subdir_+"Plots for client/"+name[i]+" Missing channels";
490  me=dqmStore_->get(s.c_str());
491  if (me!=0) Missing_val[i]=HcalUtilsClient::getHisto<TH2F*>(me, cloneME_, Missing_val[i], debug_); else return;
492  s=subdir_+"Plots for client/"+name[i]+" Channel instability value";
493  me=dqmStore_->get(s.c_str());
494  if (me!=0) Unstable_val[i]=HcalUtilsClient::getHisto<TH2F*>(me, cloneME_, Unstable_val[i], debug_); else return;
495  s=subdir_+"Plots for client/"+name[i]+" Bad Pedestal-Ref Value";
496  me=dqmStore_->get(s.c_str());
497  if (me!=0) BadPed_val[i]=HcalUtilsClient::getHisto<TH2F*>(me, cloneME_, BadPed_val[i], debug_); else return;
498  s=subdir_+"Plots for client/"+name[i]+" Bad Rms-ref Value";
499  me=dqmStore_->get(s.c_str());
500  if (me!=0) BadRMS_val[i]=HcalUtilsClient::getHisto<TH2F*>(me, cloneME_, BadRMS_val[i], debug_); else return;
501  }
502  // Calculate problems
503  for(int d=0;d<4;++d){
504  int etabins=Missing_val[d]->GetNbinsX();
505  int phibins=Missing_val[d]->GetNbinsY();
506  for(int phi=0;phi<phibins;++phi)for(int eta=0;eta<etabins;++eta){
507  int ieta=CalcIeta(eta,d+1);
508  if(ieta==-9999) continue;
509  HcalSubdetector subdet=HcalEmpty;
510  if(isHB(eta,d+1))subdet=HcalBarrel;
511  else if (isHE(eta,d+1)) subdet=HcalEndcap;
512  else if (isHF(eta,d+1)) subdet=HcalForward;
513  else if (isHO(eta,d+1)) subdet=HcalOuter;
514  HcalDetId hcalid(subdet, ieta, phi+1, (int)(d+1));
515  float val=Missing_val[d]->GetBinContent(eta+1,phi+1);
516  if(val!=0){
517  if(subdet==HcalBarrel){
518  if(ieta>0){ HBP[0]++;}else{ HBM[0]++;} MissingCnt++;
519  if(badstatusmap.find(hcalid)==badstatusmap.end()){if(ieta>0){ newHBP[0]++;}else{ newHBM[0]++;}}
520  }
521  if(subdet==HcalEndcap){
522  if(ieta>0){ HEP[0]++;}else{ HEM[0]++;} MissingCnt++;
523  if(badstatusmap.find(hcalid)==badstatusmap.end()){if(ieta>0){ newHEP[0]++;}else{ newHEM[0]++;}}
524  }
525  if(subdet==HcalForward){
526  if(ieta>0){ HFP[0]++;}else{ HFM[0]++;} MissingCnt++;
527  if(badstatusmap.find(hcalid)==badstatusmap.end()){if(ieta>0){ newHFP[0]++;}else{ newHFM[0]++;}}
528  }
529  if(subdet==HcalOuter){
530  HO[0]++;MissingCnt++;
531  if(badstatusmap.find(hcalid)==badstatusmap.end()){newHO[0]++;}
532  }
533  }
534  val=Unstable_val[d]->GetBinContent(eta+1,phi+1);
535  if(val!=0){
536  if(subdet==HcalBarrel){
537  if(ieta>0){ HBP[1]++;}else{ HBM[1]++;} UnstableCnt++;
538  if(badstatusmap.find(hcalid)==badstatusmap.end()){if(ieta>0){ newHBP[1]++;}else{ newHBM[1]++;}}
539  }
540  if(subdet==HcalEndcap){
541  if(ieta>0){ HEP[1]++;}else{ HEM[1]++;} UnstableCnt++;
542  if(badstatusmap.find(hcalid)==badstatusmap.end()){if(ieta>0){ newHEP[1]++;}else{ newHEM[1]++;}}
543  }
544  if(subdet==HcalForward){
545  if(ieta>0){ HFP[1]++;}else{ HFM[1]++;} UnstableCnt++;
546  if(badstatusmap.find(hcalid)==badstatusmap.end()){if(ieta>0){ newHFP[1]++;}else{ newHFM[1]++;}}
547  }
548  if(subdet==HcalOuter){
549  HO[1]++;UnstableCnt++;
550  if(badstatusmap.find(hcalid)==badstatusmap.end()){newHO[1]++;}
551  }
552  }
553  val=BadPed_val[d]->GetBinContent(eta+1,phi+1);
554  if(val!=0){
555  if(subdet==HcalBarrel){
556  if(ieta>0){ HBP[2]++;}else{ HBM[2]++;} BadCnt++;
557  if(badstatusmap.find(hcalid)==badstatusmap.end()){if(ieta>0){ newHBP[2]++;}else{ newHBM[2]++;}}
558  }
559  if(subdet==HcalEndcap){
560  if(ieta>0){ HEP[2]++;}else{ HEM[2]++;} BadCnt++;
561  if(badstatusmap.find(hcalid)==badstatusmap.end()){if(ieta>0){ newHEP[2]++;}else{ newHEM[2]++;}}
562  }
563  if(subdet==HcalForward){
564  if(ieta>0){ HFP[2]++;}else{ HFM[2]++;} BadCnt++;
565  if(badstatusmap.find(hcalid)==badstatusmap.end()){if(ieta>0){ newHFP[2]++;}else{ newHFM[2]++;}}
566  }
567  if(subdet==HcalOuter){
568  HO[2]++;BadCnt++;
569  if(badstatusmap.find(hcalid)==badstatusmap.end()){newHO[2]++;}
570  }
571  }
572  val=BadRMS_val[d]->GetBinContent(eta+1,phi+1);
573  if(val!=0){
574  if(subdet==HcalBarrel){
575  if(ieta>0){ HBP[3]++;}else{ HBM[3]++;} BadCnt++;
576  if(badstatusmap.find(hcalid)==badstatusmap.end()){if(ieta>0){ newHBP[3]++;}else{ newHBM[3]++;}}
577  }
578  if(subdet==HcalEndcap){
579  if(ieta>0){ HEP[3]++;}else{ HEM[3]++;} BadCnt++;
580  if(badstatusmap.find(hcalid)==badstatusmap.end()){if(ieta>0){ newHEP[3]++;}else{ newHEM[3]++;}}
581  }
582  if(subdet==HcalForward){
583  if(ieta>0){ HFP[3]++;}else{ HFM[3]++;} BadCnt++;
584  if(badstatusmap.find(hcalid)==badstatusmap.end()){if(ieta>0){ newHFP[3]++;}else{ newHFM[3]++;}}
585  }
586  if(subdet==HcalOuter){
587  HO[3]++;BadCnt++;
588  if(badstatusmap.find(hcalid)==badstatusmap.end()){newHO[3]++;}
589  }
590  }
591  }
592  }
593 
594 
595  ofstream badMissing;
596  badMissing.open((htmlDir+"bad_missing_table.html").c_str());
597  printTableHeader(badMissing,"Missing Channels list");
598  ofstream badUnstable;
599  badUnstable.open((htmlDir+"bad_unstable_table.html").c_str());
600  printTableHeader(badUnstable,"Unstable Channels list");
601  ofstream badPedRMS;
602  badPedRMS.open((htmlDir+"bad_badpedrms_table.html").c_str());
603  printTableHeader(badPedRMS,"Missing Channels list");
604 
605  int cnt=0;
606  if((HBP[0]+HBP[0])>0 && (HBM[0]+HBP[0])!=(1296*2)){
607  badMissing << "<tr><td align=\"center\"><h3>"<< "HB" <<"</h3></td></tr>" << std::endl;
608  for(int d=0;d<4;++d){
609  int etabins=Missing_val[d]->GetNbinsX();
610  int phibins=Missing_val[d]->GetNbinsY();
611  for(int phi=0;phi<phibins;++phi)for(int eta=0;eta<etabins;++eta){
612  int ieta=CalcIeta(eta,d+1);
613  if(ieta==-9999) continue;
614  if(!isHB(eta,d+1)) continue;
615  float val=Missing_val[d]->GetBinContent(eta+1,phi+1);
616  if(val==0) continue;
617  HcalDetId hcalid(HcalBarrel,ieta,phi+1,d+1);
618  std::string s=" ";
619  if(badstatusmap.find(hcalid)!=badstatusmap.end()){ s="Known problem";}
620  HcalFrontEndId lmap_entry=logicalMap_->getHcalFrontEndId(hcalid);
621  HcalElectronicsId emap_entry=emap.lookup(hcalid);
622  printTableLine(badMissing,cnt++,hcalid,lmap_entry,emap_entry,s);
623  }
624  }
625  }
626  cnt=0;
627  if((HEP[0]+HEP[0])>0 && (HEM[0]+HEP[0])!=(1296*2)){
628  badMissing << "<tr><td align=\"center\"><h3>"<< "HE" <<"</h3></td></tr>" << std::endl;
629  for(int d=0;d<4;++d){
630  int etabins=Missing_val[d]->GetNbinsX();
631  int phibins=Missing_val[d]->GetNbinsY();
632  for(int phi=0;phi<phibins;++phi)for(int eta=0;eta<etabins;++eta){
633  int ieta=CalcIeta(eta,d+1);
634  if(ieta==-9999) continue;
635  if(!isHE(eta,d+1)) continue;
636  float val=Missing_val[d]->GetBinContent(eta+1,phi+1);
637  if(val==0) continue;
638  HcalDetId hcalid(HcalEndcap,ieta,phi+1,d+1);
639  std::string s=" ";
640  if(badstatusmap.find(hcalid)!=badstatusmap.end()){ s="Known problem";}
641  HcalFrontEndId lmap_entry=logicalMap_->getHcalFrontEndId(hcalid);
642  HcalElectronicsId emap_entry=emap.lookup(hcalid);
643  printTableLine(badMissing,cnt++,hcalid,lmap_entry,emap_entry,s);
644  }
645  }
646  }
647  cnt=0;
648  if(HO[0]>0 && HO[0]!=2160){
649  badMissing << "<tr><td align=\"center\"><h3>"<< "HO" <<"</h3></td></tr>" << std::endl;
650  for(int d=0;d<4;++d){
651  int etabins=Missing_val[d]->GetNbinsX();
652  int phibins=Missing_val[d]->GetNbinsY();
653  for(int phi=0;phi<phibins;++phi)for(int eta=0;eta<etabins;++eta){
654  int ieta=CalcIeta(eta,d+1);
655  if(ieta==-9999) continue;
656  if(!isHO(eta,d+1)) continue;
657  float val=Missing_val[d]->GetBinContent(eta+1,phi+1);
658  if(val==0) continue;
659  HcalDetId hcalid(HcalOuter,ieta,phi+1,d+1);
660  std::string s=" ";
661  if(badstatusmap.find(hcalid)!=badstatusmap.end()){ s="Known problem";}
662  HcalFrontEndId lmap_entry=logicalMap_->getHcalFrontEndId(hcalid);
663  HcalElectronicsId emap_entry=emap.lookup(hcalid);
664  printTableLine(badMissing,cnt++,hcalid,lmap_entry,emap_entry,s);
665  }
666  }
667  }
668  cnt=0;
669  if((HFP[0]+HFP[0])>0 && (HFM[0]+HFP[0])!=(864*2)){
670  badMissing << "<tr><td align=\"center\"><h3>"<< "HF" <<"</h3></td></tr>" << std::endl;
671  for(int d=0;d<4;++d){
672  int etabins=Missing_val[d]->GetNbinsX();
673  int phibins=Missing_val[d]->GetNbinsY();
674  for(int phi=0;phi<phibins;++phi)for(int eta=0;eta<etabins;++eta){
675  int ieta=CalcIeta(eta,d+1);
676  if(ieta==-9999) continue;
677  if(!isHF(eta,d+1)) continue;
678  float val=Missing_val[d]->GetBinContent(eta+1,phi+1);
679  if(val==0) continue;
680  HcalDetId hcalid(HcalForward,ieta,phi+1,d+1);
681  std::string s=" ";
682  if(badstatusmap.find(hcalid)!=badstatusmap.end()){ s="Known problem";}
683  HcalFrontEndId lmap_entry=logicalMap_->getHcalFrontEndId(hcalid);
684  HcalElectronicsId emap_entry=emap.lookup(hcalid);
685  printTableLine(badMissing,cnt++,hcalid,lmap_entry,emap_entry,s);
686  }
687  }
688  }
690  cnt=0;
691  if((HBP[1]+HBP[1])>0){
692  badUnstable << "<tr><td align=\"center\"><h3>"<< "HB" <<"</h3></td></tr>" << std::endl;
693  for(int d=0;d<4;++d){
694  int etabins=Unstable_val[d]->GetNbinsX();
695  int phibins=Unstable_val[d]->GetNbinsY();
696  for(int phi=0;phi<phibins;++phi)for(int eta=0;eta<etabins;++eta){
697  int ieta=CalcIeta(eta,d+1);
698  if(ieta==-9999) continue;
699  if(!isHB(eta,d+1)) continue;
700  float val=Unstable_val[d]->GetBinContent(eta+1,phi+1);
701  if(val==0) continue;
702  HcalDetId hcalid(HcalBarrel,ieta,phi+1,d+1);
703  char comment[100]; sprintf(comment,"Missing in %.3f%% of events\n",(1.0-val)*100.0);
705  if(badstatusmap.find(hcalid)!=badstatusmap.end()){ s+=",Known problem";}
706  HcalFrontEndId lmap_entry=logicalMap_->getHcalFrontEndId(hcalid);
707  HcalElectronicsId emap_entry=emap.lookup(hcalid);
708  printTableLine(badUnstable,cnt++,hcalid,lmap_entry,emap_entry,s);
709  }
710  }
711  }
712  cnt=0;
713  if((HEP[1]+HEP[1])>0){
714  badUnstable << "<tr><td align=\"center\"><h3>"<< "HE" <<"</h3></td></tr>" << std::endl;
715  for(int d=0;d<4;++d){
716  int etabins=Unstable_val[d]->GetNbinsX();
717  int phibins=Unstable_val[d]->GetNbinsY();
718  for(int phi=0;phi<phibins;++phi)for(int eta=0;eta<etabins;++eta){
719  int ieta=CalcIeta(eta,d+1);
720  if(ieta==-9999) continue;
721  if(!isHE(eta,d+1)) continue;
722  float val=Unstable_val[d]->GetBinContent(eta+1,phi+1);
723  if(val==0) continue;
724  HcalDetId hcalid(HcalEndcap,ieta,phi+1,d+1);
725  char comment[100]; sprintf(comment,"Missing in %.3f%% of events\n",(1.0-val)*100.0);
727  if(badstatusmap.find(hcalid)!=badstatusmap.end()){ s+=",Known problem";}
728  HcalFrontEndId lmap_entry=logicalMap_->getHcalFrontEndId(hcalid);
729  HcalElectronicsId emap_entry=emap.lookup(hcalid);
730  printTableLine(badUnstable,cnt++,hcalid,lmap_entry,emap_entry,s);
731  }
732  }
733  }
734  cnt=0;
735  if(HO[1]>0){
736  badUnstable << "<tr><td align=\"center\"><h3>"<< "HO" <<"</h3></td></tr>" << std::endl;
737  for(int d=0;d<4;++d){
738  int etabins=Unstable_val[d]->GetNbinsX();
739  int phibins=Unstable_val[d]->GetNbinsY();
740  for(int phi=0;phi<phibins;++phi)for(int eta=0;eta<etabins;++eta){
741  int ieta=CalcIeta(eta,d+1);
742  if(ieta==-9999) continue;
743  if(!isHO(eta,d+1)) continue;
744  float val=Unstable_val[d]->GetBinContent(eta+1,phi+1);
745  if(val==0) continue;
746  HcalDetId hcalid(HcalOuter,ieta,phi+1,d+1);
747  char comment[100]; sprintf(comment,"Missing in %.3f%% of events\n",(1.0-val)*100.0);
749  if(badstatusmap.find(hcalid)!=badstatusmap.end()){ s+=",Known problem";}
750  HcalFrontEndId lmap_entry=logicalMap_->getHcalFrontEndId(hcalid);
751  HcalElectronicsId emap_entry=emap.lookup(hcalid);
752  printTableLine(badUnstable,cnt++,hcalid,lmap_entry,emap_entry,s);
753  }
754  }
755  }
756  cnt=0;
757  if((HFP[1]+HFP[1])>0){
758  badUnstable << "<tr><td align=\"center\"><h3>"<< "HF" <<"</h3></td></tr>" << std::endl;
759  for(int d=0;d<4;++d){
760  int etabins=Unstable_val[d]->GetNbinsX();
761  int phibins=Unstable_val[d]->GetNbinsY();
762  for(int phi=0;phi<phibins;++phi)for(int eta=0;eta<etabins;++eta){
763  int ieta=CalcIeta(eta,d+1);
764  if(ieta==-9999) continue;
765  if(!isHF(eta,d+1)) continue;
766  float val=Unstable_val[d]->GetBinContent(eta+1,phi+1);
767  if(val==0) continue;
768  HcalDetId hcalid(HcalForward,ieta,phi+1,d+1);
769  char comment[100]; sprintf(comment,"Missing in %.3f%% of events\n",(1.0-val)*100.0);
771  if(badstatusmap.find(hcalid)!=badstatusmap.end()){ s+=",Known problem";}
772  HcalFrontEndId lmap_entry=logicalMap_->getHcalFrontEndId(hcalid);
773  HcalElectronicsId emap_entry=emap.lookup(hcalid);
774  printTableLine(badUnstable,cnt++,hcalid,lmap_entry,emap_entry,s);
775  }
776  }
777  }
779  cnt=0;
780  if((HBP[2]+HBP[2]+HBP[3]+HBP[3])>0){
781  badPedRMS << "<tr><td align=\"center\"><h3>"<< "HB" <<"</h3></td></tr>" << std::endl;
782  for(int d=0;d<4;++d){
783  int etabins=BadPed_val[d]->GetNbinsX();
784  int phibins=BadPed_val[d]->GetNbinsY();
785  for(int phi=0;phi<phibins;++phi)for(int eta=0;eta<etabins;++eta){
786  int ieta=CalcIeta(eta,d+1);
787  if(ieta==-9999) continue;
788  if(!isHB(eta,d+1)) continue;
789  float val1=BadPed_val[d]->GetBinContent(eta+1,phi+1);
790  float val2=BadRMS_val[d]->GetBinContent(eta+1,phi+1);
791  if(val1==0 && val2==0) continue;
792  HcalDetId hcalid(HcalBarrel,ieta,phi+1,d+1);
793  char comment[100];
794  if(val1!=0) sprintf(comment,"Ped-Ref=%.2f",val1);
795  if(val2!=0) sprintf(comment,"Rms-Ref=%.2f",val2);
796  if(val1!=0 && val2!=0) sprintf(comment,"Ped-Ref=%.2f,Rms-Ref=%.2f",val1,val2);
798  if(badstatusmap.find(hcalid)!=badstatusmap.end()){ s+=",Known problem";}
799  HcalFrontEndId lmap_entry=logicalMap_->getHcalFrontEndId(hcalid);
800  HcalElectronicsId emap_entry=emap.lookup(hcalid);
801  printTableLine(badPedRMS,cnt++,hcalid,lmap_entry,emap_entry,s);
802  }
803  }
804  }
805  cnt=0;
806  if((HEP[2]+HEP[2]+HEP[3]+HEP[3])>0){
807  badPedRMS << "<tr><td align=\"center\"><h3>"<< "HE" <<"</h3></td></tr>" << std::endl;
808  for(int d=0;d<4;++d){
809  int etabins=BadPed_val[d]->GetNbinsX();
810  int phibins=BadPed_val[d]->GetNbinsY();
811  for(int phi=0;phi<phibins;++phi)for(int eta=0;eta<etabins;++eta){
812  int ieta=CalcIeta(eta,d+1);
813  if(ieta==-9999) continue;
814  if(!isHE(eta,d+1)) continue;
815  float val1=BadPed_val[d]->GetBinContent(eta+1,phi+1);
816  float val2=BadRMS_val[d]->GetBinContent(eta+1,phi+1);
817  if(val1==0 && val2==0) continue;
818  HcalDetId hcalid(HcalEndcap,ieta,phi+1,d+1);
819  char comment[100];
820  if(val1!=0) sprintf(comment,"Ped-Ref=%.2f",val1);
821  if(val2!=0) sprintf(comment,"Rms-Ref=%.2f",val2);
822  if(val1!=0 && val2!=0) sprintf(comment,"Ped-Ref=%.2f,Rms-Ref=%.2f",val1,val2);
824  if(badstatusmap.find(hcalid)!=badstatusmap.end()){ s+=",Known problem";}
825  HcalFrontEndId lmap_entry=logicalMap_->getHcalFrontEndId(hcalid);
826  HcalElectronicsId emap_entry=emap.lookup(hcalid);
827  printTableLine(badPedRMS,cnt++,hcalid,lmap_entry,emap_entry,s);
828  }
829  }
830  }
831  cnt=0;
832  if((HO[2]+HO[3])>0){
833  badPedRMS << "<tr><td align=\"center\"><h3>"<< "HO" <<"</h3></td></tr>" << std::endl;
834  for(int d=0;d<4;++d){
835  int etabins=BadPed_val[d]->GetNbinsX();
836  int phibins=BadPed_val[d]->GetNbinsY();
837  for(int phi=0;phi<phibins;++phi)for(int eta=0;eta<etabins;++eta){
838  int ieta=CalcIeta(eta,d+1);
839  if(ieta==-9999) continue;
840  if(!isHO(eta,d+1)) continue;
841  float val1=BadPed_val[d]->GetBinContent(eta+1,phi+1);
842  float val2=BadRMS_val[d]->GetBinContent(eta+1,phi+1);
843  if(val1==0 && val2==0) continue;
844  HcalDetId hcalid(HcalOuter,ieta,phi+1,d+1);
845  char comment[100];
846  if(val1!=0) sprintf(comment,"Ped-Ref=%.2f",val1);
847  if(val2!=0) sprintf(comment,"Rms-Ref=%.2f",val2);
848  if(val1!=0 && val2!=0) sprintf(comment,"Ped-Ref=%.2f,Rms-Ref=%.2f",val1,val2);
850  if(badstatusmap.find(hcalid)!=badstatusmap.end()){ s+=",Known problem";}
851  HcalFrontEndId lmap_entry=logicalMap_->getHcalFrontEndId(hcalid);
852  HcalElectronicsId emap_entry=emap.lookup(hcalid);
853  printTableLine(badPedRMS,cnt++,hcalid,lmap_entry,emap_entry,s);
854  }
855  }
856  }
857  cnt=0;
858  if((HFP[2]+HFP[2]+HFP[3]+HFP[3])>0){
859  badPedRMS << "<tr><td align=\"center\"><h3>"<< "HF" <<"</h3></td></tr>" << std::endl;
860  for(int d=0;d<4;++d){
861  int etabins=BadPed_val[d]->GetNbinsX();
862  int phibins=BadPed_val[d]->GetNbinsY();
863  for(int phi=0;phi<phibins;++phi)for(int eta=0;eta<etabins;++eta){
864  int ieta=CalcIeta(eta,d+1);
865  if(ieta==-9999) continue;
866  if(!isHF(eta,d+1)) continue;
867  float val1=BadPed_val[d]->GetBinContent(eta+1,phi+1);
868  float val2=BadRMS_val[d]->GetBinContent(eta+1,phi+1);
869  if(val1==0 && val2==0) continue;
870  HcalDetId hcalid(HcalForward,ieta,phi+1,d+1);
871  char comment[100];
872  if(val1!=0) sprintf(comment,"Ped-Ref=%.2f",val1);
873  if(val2!=0) sprintf(comment,"Rms-Ref=%.2f",val2);
874  if(val1!=0 && val2!=0) sprintf(comment,"Ped-Ref=%.2f,Rms-Ref=%.2f",val1,val2);
876  if(badstatusmap.find(hcalid)!=badstatusmap.end()){ s+=",Known problem";}
877  HcalFrontEndId lmap_entry=logicalMap_->getHcalFrontEndId(hcalid);
878  HcalElectronicsId emap_entry=emap.lookup(hcalid);
879  printTableLine(badPedRMS,cnt++,hcalid,lmap_entry,emap_entry,s);
880  }
881  }
882  }
883 
884  printTableTail(badMissing);
885  badMissing.close();
886  printTableTail(badUnstable);
887  badUnstable.close();
888  printTableTail(badPedRMS);
889  badPedRMS.close();
890 
891  int ievt_ = -1,runNo=-1;
892  std::string ref_run;
893  s=subdir_+"HcalDetDiagPedestalMonitor Event Number";
894  me = dqmStore_->get(s.c_str());
895  if ( me ) {
896  s = me->valueString();
897  sscanf((s.substr(2,s.length()-2)).c_str(), "%d", &ievt_);
898  }
899  s=subdir_+"HcalDetDiagPedestalMonitor Run Number";
900  me = dqmStore_->get(s.c_str());
901  if ( me ) {
902  s = me->valueString();
903  sscanf((s.substr(2,s.length()-2)).c_str(), "%d", &runNo);
904  }
905  s=subdir_+"HcalDetDiagLaserMonitor Reference Run";
906  me = dqmStore_->get(s.c_str());
907  if(me) {
908  std::string s=me->valueString();
909  char str[200];
910  sscanf((s.substr(2,s.length()-2)).c_str(), "%s", str);
911  ref_run=str;
912  }
913 
914  gROOT->SetBatch(true);
915  gStyle->SetCanvasColor(0);
916  gStyle->SetPadColor(0);
917  gStyle->SetOptStat(111110);
918  gStyle->SetPalette(1);
919 
920  TCanvas *can=new TCanvas("HcalDetDiagPedestalClient","HcalDetDiagPedestalClient",0,0,500,350);
921  can->cd();
922 
923  ofstream htmlFile;
924  std::string outfile=htmlDir+name_+".html";
925  htmlFile.open(outfile.c_str());
926  // html page header
927  htmlFile << "<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\"> " << std::endl;
928  htmlFile << "<html> " << std::endl;
929  htmlFile << "<head> " << std::endl;
930  htmlFile << " <meta content=\"text/html; charset=ISO-8859-1\" " << std::endl;
931  htmlFile << " http-equiv=\"content-type\"> " << std::endl;
932  htmlFile << " <title>Detector Diagnostics Pedestal Monitor</title> " << std::endl;
933  htmlFile << "</head> " << std::endl;
934  htmlFile << "<style type=\"text/css\"> td { font-weight: bold } </style>" << std::endl;
935  htmlFile << "<style type=\"text/css\">"<< std::endl;
936  htmlFile << " td.s0 { font-family: arial, arial ce, helvetica; font-weight: bold; background-color: #FF7700; text-align: center;}"<< std::endl;
937  htmlFile << " td.s1 { font-family: arial, arial ce, helvetica; font-weight: bold; background-color: #FFC169; text-align: center;}"<< std::endl;
938  htmlFile << " td.s2 { font-family: arial, arial ce, helvetica; background-color: red; }"<< std::endl;
939  htmlFile << " td.s3 { font-family: arial, arial ce, helvetica; background-color: yellow; }"<< std::endl;
940  htmlFile << " td.s4 { font-family: arial, arial ce, helvetica; background-color: green; }"<< std::endl;
941  htmlFile << " td.s5 { font-family: arial, arial ce, helvetica; background-color: silver; }"<< std::endl;
942  std::string state[4]={"<td class=\"s2\" align=\"center\">",
943  "<td class=\"s3\" align=\"center\">",
944  "<td class=\"s4\" align=\"center\">",
945  "<td class=\"s5\" align=\"center\">"};
946  htmlFile << "</style>"<< std::endl;
947  htmlFile << "<body> " << std::endl;
948  htmlFile << "<br> " << std::endl;
949  htmlFile << "<h2>Run:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" << std::endl;
950  htmlFile << "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span " << std::endl;
951  htmlFile << " style=\"color: rgb(0, 0, 153);\">" << runNo << "</span></h2>" << std::endl;
952  htmlFile << "<h2>Monitoring task:&nbsp;&nbsp;&nbsp;&nbsp; <span " << std::endl;
953  htmlFile << " style=\"color: rgb(0, 0, 153);\">Detector Diagnostics Pedestal Monitor</span></h2> " << std::endl;
954  htmlFile << "<h2>Events processed:&nbsp;&nbsp;&nbsp;&nbsp;<span " << std::endl;
955  htmlFile << " style=\"color: rgb(0, 0, 153);\">" << ievt_ << "</span></h2>" << std::endl;
956  htmlFile << "<hr>" << std::endl;
958  htmlFile << "<table width=100% border=1>" << std::endl;
959  htmlFile << "<tr>" << std::endl;
960  htmlFile << "<td class=\"s0\" width=20% align=\"center\">SebDet</td>" << std::endl;
961  htmlFile << "<td class=\"s0\" width=20% align=\"center\">Missing</td>" << std::endl;
962  htmlFile << "<td class=\"s0\" width=20% align=\"center\">Unstable</td>" << std::endl;
963  htmlFile << "<td class=\"s0\" width=20% align=\"center\">Bad |Ped-Ref|</td>" << std::endl;
964  htmlFile << "<td class=\"s0\" width=20% align=\"center\">Bad |Rms-Ref|</td>" << std::endl;
965  htmlFile << "</tr><tr>" << std::endl;
966  int ind1=0,ind2=0,ind3=0,ind4=0;
967  htmlFile << "<td class=\"s1\" align=\"center\">HB+</td>" << std::endl;
968  ind1=3; if(newHBP[0]==0) ind1=2; if(newHBP[0]>0 && newHBP[0]<=12) ind1=1; if(newHBP[0]>=12 && newHBP[0]<1296) ind1=0;
969  ind2=3; if(newHBP[1]==0) ind2=2; if(newHBP[1]>0) ind2=1; if(newHBP[1]>21) ind2=0;
970  ind3=3; if(newHBP[2]==0) ind3=2; if(newHBP[2]>0) ind3=1; if(newHBP[2]>21) ind3=0;
971  ind4=3; if(newHBP[3]==0) ind4=2; if(newHBP[3]>0) ind4=1; if(newHBP[3]>21) ind4=0;
972  if(ind1==3) ind2=ind3=ind4=3;
973  if(ind1==0 || ind2==0 || ind3==0 || ind4==0) status|=2; else if(ind1==1 || ind2==1 || ind3==1 || ind4==1) status|=1;
974  htmlFile << state[ind1] << HBP[0] <<" (1296)</td>" << std::endl;
975  htmlFile << state[ind2] << HBP[1] <<"</td>" << std::endl;
976  htmlFile << state[ind3] << HBP[2] <<"</td>" << std::endl;
977  htmlFile << state[ind4] << HBP[3] <<"</td>" << std::endl;
978 
979  htmlFile << "</tr><tr>" << std::endl;
980  htmlFile << "<td class=\"s1\" align=\"center\">HB-</td>" << std::endl;
981  ind1=3; if(newHBM[0]==0) ind1=2; if(newHBM[0]>0 && newHBM[0]<=12) ind1=1; if(newHBM[0]>=12 && newHBM[0]<1296) ind1=0;
982  ind2=3; if(newHBM[1]==0) ind2=2; if(newHBM[1]>0) ind2=1; if(newHBM[1]>21) ind2=0;
983  ind3=3; if(newHBM[2]==0) ind3=2; if(newHBM[2]>0) ind3=1; if(newHBM[2]>21) ind3=0;
984  ind4=3; if(newHBM[3]==0) ind4=2; if(newHBM[3]>0) ind4=1; if(newHBM[3]>21) ind4=0;
985  if(ind1==3) ind2=ind3=ind4=3;
986  if(ind1==0 || ind2==0 || ind3==0 || ind4==0) status|=2; else if(ind1==1 || ind2==1 || ind3==1 || ind4==1) status|=1;
987  htmlFile << state[ind1] << HBM[0] <<" (1296)</td>" << std::endl;
988  htmlFile << state[ind2] << HBM[1] <<"</td>" << std::endl;
989  htmlFile << state[ind3] << HBM[2] <<"</td>" << std::endl;
990  htmlFile << state[ind4] << HBM[3] <<"</td>" << std::endl;
991 
992  htmlFile << "</tr><tr>" << std::endl;
993  htmlFile << "<td class=\"s1\" align=\"center\">HE+</td>" << std::endl;
994  ind1=3; if(newHEP[0]==0) ind1=2; if(newHEP[0]>0 && newHEP[0]<=12) ind1=1; if(newHEP[0]>=12 && newHEP[0]<1296) ind1=0;
995  ind2=3; if(newHEP[1]==0) ind2=2; if(newHEP[1]>0) ind2=1; if(newHEP[1]>21) ind2=0;
996  ind3=3; if(newHEP[2]==0) ind3=2; if(newHEP[2]>0) ind3=1; if(newHEP[2]>21) ind3=0;
997  ind4=3; if(newHEP[3]==0) ind4=2; if(newHEP[3]>0) ind4=1; if(newHEP[3]>21) ind4=0;
998  if(ind1==3) ind2=ind3=ind4=3;
999  if(ind1==0 || ind2==0 || ind3==0 || ind4==0) status|=2; else if(ind1==1 || ind2==1 || ind3==1 || ind4==1) status|=1;
1000  htmlFile << state[ind1] << HEP[0] <<" (1296)</td>" << std::endl;
1001  htmlFile << state[ind2] << HEP[1] <<"</td>" << std::endl;
1002  htmlFile << state[ind3] << HEP[2] <<"</td>" << std::endl;
1003  htmlFile << state[ind4] << HEP[3] <<"</td>" << std::endl;
1004 
1005  htmlFile << "</tr><tr>" << std::endl;
1006  htmlFile << "<td class=\"s1\" align=\"center\">HE-</td>" << std::endl;
1007  ind1=3; if(newHEM[0]==0) ind1=2; if(newHEM[0]>0 && newHEM[0]<=12) ind1=1; if(newHEM[0]>=12 && newHEM[0]<1296) ind1=0;
1008  ind2=3; if(newHEM[1]==0) ind2=2; if(newHEM[1]>0) ind2=1; if(newHEM[1]>21) ind2=0;
1009  ind3=3; if(newHEM[2]==0) ind3=2; if(newHEM[2]>0) ind3=1; if(newHEM[2]>21) ind3=0;
1010  ind4=3; if(newHEM[3]==0) ind4=2; if(newHEM[3]>0) ind4=1; if(newHEM[3]>21) ind4=0;
1011  if(ind1==3) ind2=ind3=ind4=3;
1012  if(ind1==0 || ind2==0 || ind3==0 || ind4==0) status|=2; else if(ind1==1 || ind2==1 || ind3==1 || ind4==1) status|=1;
1013  htmlFile << state[ind1] << HEM[0] <<" (1296)</td>" << std::endl;
1014  htmlFile << state[ind2] << HEM[1] <<"</td>" << std::endl;
1015  htmlFile << state[ind3] << HEM[2] <<"</td>" << std::endl;
1016  htmlFile << state[ind4] << HEM[3] <<"</td>" << std::endl;
1017 
1018  htmlFile << "</tr><tr>" << std::endl;
1019  htmlFile << "<td class=\"s1\" align=\"center\">HF+</td>" << std::endl;
1020  ind1=3; if(newHFP[0]==0) ind1=2; if(newHFP[0]>0 && newHFP[0]<=12) ind1=1; if(newHFP[0]>=12 && newHFP[0]<864) ind1=0;
1021  ind2=3; if(newHFP[1]==0) ind2=2; if(newHFP[1]>0) ind2=1; if(newHFP[1]>21) ind2=0;
1022  ind3=3; if(newHFP[2]==0) ind3=2; if(newHFP[2]>0) ind3=1; if(newHFP[2]>21) ind3=0;
1023  ind4=3; if(newHFP[3]==0) ind4=2; if(newHFP[3]>0) ind4=1; if(newHFP[3]>21) ind4=0;
1024  if(ind1==3) ind2=ind3=ind4=3;
1025  if(ind1==0 || ind2==0 || ind3==0 || ind4==0) status|=2; else if(ind1==1 || ind2==1 || ind3==1 || ind4==1) status|=1;
1026  htmlFile << state[ind1] << HFP[0] <<" (864)</td>" << std::endl;
1027  htmlFile << state[ind2] << HFP[1] <<"</td>" << std::endl;
1028  htmlFile << state[ind3] << HFP[2] <<"</td>" << std::endl;
1029  htmlFile << state[ind4] << HFP[3] <<"</td>" << std::endl;
1030 
1031  htmlFile << "</tr><tr>" << std::endl;
1032  htmlFile << "<td class=\"s1\" align=\"center\">HF-</td>" << std::endl;
1033  ind1=3; if(newHFM[0]==0) ind1=2; if(newHFM[0]>0 && newHFM[0]<=12) ind1=1; if(newHFM[0]>=12 && newHFM[0]<864) ind1=0;
1034  ind2=3; if(newHFM[1]==0) ind2=2; if(newHFM[1]>0) ind2=1; if(newHFM[1]>21) ind2=0;
1035  ind3=3; if(newHFM[2]==0) ind3=2; if(newHFM[2]>0) ind3=1; if(newHFM[2]>21) ind3=0;
1036  ind4=3; if(newHFM[3]==0) ind4=2; if(newHFM[3]>0) ind4=1; if(newHFM[3]>21) ind4=0;
1037  if(ind1==3) ind2=ind3=ind4=3;
1038  if(ind1==0 || ind2==0 || ind3==0 || ind4==0) status|=2; else if(ind1==1 || ind2==1 || ind3==1 || ind4==1) status|=1;
1039  htmlFile << state[ind1] << HFM[0] <<" (864)</td>" << std::endl;
1040  htmlFile << state[ind2] << HFM[1] <<"</td>" << std::endl;
1041  htmlFile << state[ind3] << HFM[2] <<"</td>" << std::endl;
1042  htmlFile << state[ind4] << HFM[3] <<"</td>" << std::endl;
1043 
1044  htmlFile << "</tr><tr>" << std::endl;
1045  htmlFile << "<td class=\"s1\" align=\"center\">HO</td>" << std::endl;
1046  ind1=3; if(newHO[0]==0) ind1=2; if(newHO[0]>0 && newHO[0]<=12) ind1=1; if(newHO[0]>=12 && newHO[0]<2160) ind1=0;
1047  ind2=3; if(newHO[1]==0) ind2=2; if(newHO[1]>0) ind2=1; if(newHO[1]>21) ind2=0;
1048  ind3=3; if(newHO[2]==0) ind3=2; if(newHO[2]>0) ind3=1; if(newHO[2]>21) ind3=0;
1049  ind4=3; if(newHO[3]==0) ind4=2; if(newHO[3]>0) ind4=1; if(newHO[3]>21) ind4=0;
1050  if(ind1==3) ind2=ind3=ind4=3;
1051  if(ind1==0 || ind2==0 || ind3==0 || ind4==0) status|=2; else if(ind1==1 || ind2==1 || ind3==1 || ind4==1) status|=1;
1052  htmlFile << state[ind1] << HO[0] <<" (2160)</td>" << std::endl;
1053  htmlFile << state[ind2] << HO[1] <<"</td>" << std::endl;
1054  htmlFile << state[ind3] << HO[2] <<"</td>" << std::endl;
1055  htmlFile << state[ind4] << HO[3] <<"</td>" << std::endl;
1056 
1057  htmlFile << "</tr></table>" << std::endl;
1058  htmlFile << "<hr>" << std::endl;
1060  if((MissingCnt+UnstableCnt+BadCnt)>0){
1061  htmlFile << "<table width=100% border=1><tr>" << std::endl;
1062  if(MissingCnt>0) htmlFile << "<td><a href=\"" << "bad_missing_table.html" <<"\">list of missing channels</a></td>";
1063  if(UnstableCnt>0) htmlFile << "<td><a href=\"" << "bad_unstable_table.html" <<"\">list of unstable channels</a></td>";
1064  if(BadCnt>0) htmlFile << "<td><a href=\"" << "bad_badpedrms_table.html" <<"\">list of bad pedestal/rms channels</a></td>";
1065  htmlFile << "</tr></table>" << std::endl;
1066  }
1067  can->SetGridy();
1068  can->SetGridx();
1069  can->SetLogy(0);
1070 
1071 
1072 
1074  htmlFile << "<h2 align=\"center\">Summary plots</h2>" << std::endl;
1075  htmlFile << "<table width=100% border=0><tr>" << std::endl;
1076  htmlFile << "<tr align=\"left\">" << std::endl;
1077  Pedestals2DHBHEHF->SetStats(0);
1078  Pedestals2DHBHEHF->SetMaximum(5);
1079  Pedestals2DHBHEHF->SetNdivisions(36,"Y");
1080  Pedestals2DHBHEHF->Draw("COLZ");
1081  can->SaveAs((htmlDir + "hbhehf_pedestal_map.gif").c_str());
1082  htmlFile << "<td><img src=\"hbhehf_pedestal_map.gif\" alt=\"hbhehf pedestal mean map\"> </td>" << std::endl;
1083  Pedestals2DHO->SetStats(0);
1084  Pedestals2DHO->SetMaximum(5);
1085  Pedestals2DHO->SetNdivisions(36,"Y");
1086  Pedestals2DHO->Draw("COLZ");
1087  can->SaveAs((htmlDir + "ho_pedestal_map.gif").c_str());
1088  htmlFile << "<td><img src=\"ho_pedestal_map.gif\" alt=\"ho pedestal mean map\"> </td>" << std::endl;
1089  htmlFile << "</tr>" << std::endl;
1090 
1091  htmlFile << "<tr align=\"left\">" << std::endl;
1092  Pedestals2DRmsHBHEHF->SetStats(0);
1093  Pedestals2DRmsHBHEHF->SetMaximum(2);
1094  Pedestals2DRmsHBHEHF->SetNdivisions(36,"Y");
1095  Pedestals2DRmsHBHEHF->Draw("COLZ");
1096  can->SaveAs((htmlDir + "hbhehf_rms_map.gif").c_str());
1097  htmlFile << "<td><img src=\"hbhehf_rms_map.gif\" alt=\"hbhehf pedestal rms map\"> </td>" << std::endl;
1098  Pedestals2DRmsHO->SetStats(0);
1099  Pedestals2DRmsHO->SetMaximum(2);
1100  Pedestals2DRmsHO->SetNdivisions(36,"Y");
1101  Pedestals2DRmsHO->Draw("COLZ");
1102  can->SaveAs((htmlDir + "ho_rms_map.gif").c_str());
1103  htmlFile << "<td><img src=\"ho_rms_map.gif\" alt=\"ho pedestal rms map\"> </td>" << std::endl;
1104  htmlFile << "</tr>" << std::endl;
1105 
1106  htmlFile << "<tr align=\"left\">" << std::endl;
1107  Pedestals2DErrorHBHEHF->SetStats(0);
1108  Pedestals2DErrorHBHEHF->SetNdivisions(36,"Y");
1109  Pedestals2DErrorHBHEHF->Draw("COLZ");
1110  can->SaveAs((htmlDir + "hbhehf_error_map.gif").c_str());
1111  htmlFile << "<td><img src=\"hbhehf_error_map.gif\" alt=\"hbhehf pedestal error map\"> </td>" << std::endl;
1112  Pedestals2DErrorHO->SetStats(0);
1113  Pedestals2DErrorHO->SetNdivisions(36,"Y");
1114  Pedestals2DErrorHO->Draw("COLZ");
1115  can->SaveAs((htmlDir + "ho_error_map.gif").c_str());
1116  htmlFile << "<td><img src=\"ho_error_map.gif\" alt=\"ho pedestal error map\"> </td>" << std::endl;
1117  htmlFile << "</tr>" << std::endl;
1118  htmlFile << "</table>" << std::endl;
1119  htmlFile << "<hr>" << std::endl;
1120 
1122  htmlFile << "<h2 align=\"center\">HB Pedestal plots (Reference run "<<ref_run<<")</h2>" << std::endl;
1123  htmlFile << "<table width=100% border=0><tr>" << std::endl;
1124  htmlFile << "<tr align=\"left\">" << std::endl;
1125  if(PedestalsAve4HB->GetMaximum()>0) can->SetLogy(1); else can->SetLogy(0);
1126  PedestalsAve4HB->Draw();
1127  can->SaveAs((htmlDir + "hb_pedestal_distribution.gif").c_str());
1128  htmlFile << "<td><img src=\"hb_pedestal_distribution.gif\" alt=\"hb pedestal mean\"> </td>" << std::endl;
1129  if(PedestalsRmsHB->GetMaximum()>0) can->SetLogy(1); else can->SetLogy(0);
1130  PedestalsRmsHB->Draw();
1131  can->SaveAs((htmlDir + "hb_pedestal_rms_distribution.gif").c_str());
1132  htmlFile << "<td><img src=\"hb_pedestal_rms_distribution.gif\" alt=\"hb pedestal rms mean\"> </td>" << std::endl;
1133  htmlFile << "</tr>" << std::endl;
1134 
1135  htmlFile << "<tr align=\"left\">" << std::endl;
1136  if(PedestalsAve4HBref->GetMaximum()>0) can->SetLogy(1); else can->SetLogy(0);
1137  PedestalsAve4HBref->Draw();
1138  can->SaveAs((htmlDir + "hb_pedestal_ref_distribution.gif").c_str());
1139  htmlFile << "<td><img src=\"hb_pedestal_ref_distribution.gif\" alt=\"hb pedestal-reference mean\"> </td>" << std::endl;
1140  if(PedestalsRmsHBref->GetMaximum()>0) can->SetLogy(1); else can->SetLogy(0);
1141  PedestalsRmsHBref->Draw();
1142  can->SaveAs((htmlDir + "hb_pedestal_rms_ref_distribution.gif").c_str());
1143  htmlFile << "<td><img src=\"hb_pedestal_rms_ref_distribution.gif\" alt=\"hb pedestal rms-reference mean\"> </td>" << std::endl;
1144  htmlFile << "</tr>" << std::endl;
1145  htmlFile << "</table>" << std::endl;
1147  htmlFile << "<h2 align=\"center\">HE Pedestal plots (Reference run "<<ref_run<<")</h2>" << std::endl;
1148  htmlFile << "<table width=100% border=0><tr>" << std::endl;
1149  htmlFile << "<tr align=\"left\">" << std::endl;
1150  if(PedestalsAve4HE->GetMaximum()>0) can->SetLogy(1); else can->SetLogy(0);
1151  PedestalsAve4HE->Draw();
1152  can->SaveAs((htmlDir + "he_pedestal_distribution.gif").c_str());
1153  htmlFile << "<td><img src=\"he_pedestal_distribution.gif\" alt=\"he pedestal mean\"> </td>" << std::endl;
1154  if(PedestalsRmsHE->GetMaximum()>0) can->SetLogy(1); else can->SetLogy(0);
1155  PedestalsRmsHE->Draw();
1156  can->SaveAs((htmlDir + "he_pedestal_rms_distribution.gif").c_str());
1157  htmlFile << "<td><img src=\"he_pedestal_rms_distribution.gif\" alt=\"he pedestal rms mean\"> </td>" << std::endl;
1158  htmlFile << "</tr>" << std::endl;
1159 
1160  htmlFile << "<tr align=\"left\">" << std::endl;
1161  if(PedestalsAve4HEref->GetMaximum()>0) can->SetLogy(1); else can->SetLogy(0);
1162  PedestalsAve4HEref->Draw();
1163  can->SaveAs((htmlDir + "he_pedestal_ref_distribution.gif").c_str());
1164  htmlFile << "<td><img src=\"he_pedestal_ref_distribution.gif\" alt=\"he pedestal-reference mean\"> </td>" << std::endl;
1165  if(PedestalsRmsHEref->GetMaximum()>0) can->SetLogy(1); else can->SetLogy(0);
1166  PedestalsRmsHEref->Draw();
1167  can->SaveAs((htmlDir + "he_pedestal_rms_ref_distribution.gif").c_str());
1168  htmlFile << "<td><img src=\"he_pedestal_rms_ref_distribution.gif\" alt=\"he pedestal rms-reference mean\"> </td>" << std::endl;
1169  htmlFile << "</tr>" << std::endl;
1170  htmlFile << "</table>" << std::endl;
1172  htmlFile << "<h2 align=\"center\">HO Pedestal plots (Reference run "<<ref_run<<")</h2>" << std::endl;
1173  htmlFile << "<table width=100% border=0><tr>" << std::endl;
1174  htmlFile << "<tr align=\"left\">" << std::endl;
1175  if(PedestalsAve4HO->GetMaximum()>0) can->SetLogy(1); else can->SetLogy(0);
1176  PedestalsAve4HO->Draw();
1177  can->SaveAs((htmlDir + "ho_pedestal_distribution.gif").c_str());
1178  htmlFile << "<td><img src=\"ho_pedestal_distribution.gif\" alt=\"ho pedestal mean\"> </td>" << std::endl;
1179  if(PedestalsRmsHO->GetMaximum()>0) can->SetLogy(1); else can->SetLogy(0);
1180  PedestalsRmsHO->Draw();
1181  can->SaveAs((htmlDir + "ho_pedestal_rms_distribution.gif").c_str());
1182  htmlFile << "<td><img src=\"ho_pedestal_rms_distribution.gif\" alt=\"ho pedestal rms mean\"> </td>" << std::endl;
1183  htmlFile << "</tr>" << std::endl;
1184  // SIMP
1185  htmlFile << "<tr align=\"left\">" << std::endl;
1186  if(PedestalsAve4Simp->GetMaximum()>0) can->SetLogy(1); else can->SetLogy(0);
1187  PedestalsAve4Simp->Draw();
1188  can->SaveAs((htmlDir + "sipm_pedestal_distribution.gif").c_str());
1189  htmlFile << "<td><img src=\"sipm_pedestal_distribution.gif\" alt=\"sipm pedestal mean\"> </td>" << std::endl;
1190  if(PedestalsRmsSimp->GetMaximum()>0) can->SetLogy(1); else can->SetLogy(0);
1191  PedestalsRmsSimp->Draw();
1192  can->SaveAs((htmlDir + "simp_pedestal_rms_distribution.gif").c_str());
1193  htmlFile << "<td><img src=\"simp_pedestal_rms_distribution.gif\" alt=\"sipm pedestal rms mean\"> </td>" << std::endl;
1194  htmlFile << "</tr>" << std::endl;
1195  // SIMP
1196  htmlFile << "<tr align=\"left\">" << std::endl;
1197  if(PedestalsAve4HOref->GetMaximum()>0) can->SetLogy(1); else can->SetLogy(0);
1198  PedestalsAve4HOref->Draw();
1199  can->SaveAs((htmlDir + "ho_pedestal_ref_distribution.gif").c_str());
1200  htmlFile << "<td><img src=\"ho_pedestal_ref_distribution.gif\" alt=\"ho pedestal-reference mean\"> </td>" << std::endl;
1201  if(PedestalsRmsHOref->GetMaximum()>0) can->SetLogy(1); else can->SetLogy(0);
1202  PedestalsRmsHOref->Draw();
1203  can->SaveAs((htmlDir + "ho_pedestal_rms_ref_distribution.gif").c_str());
1204  htmlFile << "<td><img src=\"ho_pedestal_rms_ref_distribution.gif\" alt=\"ho pedestal rms-reference mean\"> </td>" << std::endl;
1205  htmlFile << "</tr>" << std::endl;
1206  htmlFile << "</table>" << std::endl;
1208 
1209  htmlFile << "<h2 align=\"center\">HF Pedestal plots (Reference run "<<ref_run<<")</h2>" << std::endl;
1210  htmlFile << "<table width=100% border=0><tr>" << std::endl;
1211  htmlFile << "<tr align=\"left\">" << std::endl;
1212  if(PedestalsAve4HF->GetMaximum()>0) can->SetLogy(1); else can->SetLogy(0);
1213  PedestalsAve4HF->Draw();
1214  can->SaveAs((htmlDir + "hf_pedestal_distribution.gif").c_str());
1215  htmlFile << "<td><img src=\"hf_pedestal_distribution.gif\" alt=\"hf pedestal mean\"> </td>" << std::endl;
1216  if(PedestalsRmsHF->GetMaximum()>0) can->SetLogy(1); else can->SetLogy(0);
1217  PedestalsRmsHF->Draw();
1218  can->SaveAs((htmlDir + "hf_pedestal_rms_distribution.gif").c_str());
1219  htmlFile << "<td><img src=\"hf_pedestal_rms_distribution.gif\" alt=\"hf pedestal rms mean\"> </td>" << std::endl;
1220  htmlFile << "</tr>" << std::endl;
1221 
1222  htmlFile << "<tr align=\"left\">" << std::endl;
1223  if(PedestalsAve4HFref->GetMaximum()>0) can->SetLogy(1); else can->SetLogy(0);
1224  PedestalsAve4HFref->Draw();
1225  can->SaveAs((htmlDir + "hf_pedestal_ref_distribution.gif").c_str());
1226  htmlFile << "<td><img src=\"hf_pedestal_ref_distribution.gif\" alt=\"hf pedestal-reference mean\"> </td>" << std::endl;
1227  if(PedestalsRmsHFref->GetMaximum()>0) can->SetLogy(1); else can->SetLogy(0);
1228  PedestalsRmsHFref->Draw();
1229  can->SaveAs((htmlDir + "hf_pedestal_rms_ref_distribution.gif").c_str());
1230  htmlFile << "<td><img src=\"hf_pedestal_rms_ref_distribution.gif\" alt=\"hf pedestal rms-reference mean\"> </td>" << std::endl;
1231  htmlFile << "</tr>" << std::endl;
1232  htmlFile << "</table>" << std::endl;
1233 
1234 
1235  htmlFile << "</body> " << std::endl;
1236  htmlFile << "</html> " << std::endl;
1237  htmlFile.close();
1238  can->Close();
1239 }
1240 
1242 {}
int fiberChannel() const
bool isHO(int etabin, int depth)
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
int fiberIndex() const
get the fiber index [1-8] (which of eight fibers carried by a spigot) (valid only for non-trigger-cha...
std::string name()
void setBinContent(int binx, double content)
set content of bin (1-D)
int pixel() const
std::vector< std::string > HcalEtaPhiHistNames()
int htrSlot() const
get the htr slot
void setup(DQMStore *&m_dbe, std::string Name, std::string Units="")
#define min(a, b)
Definition: mlp_lapack.h:161
bool isHE(int etabin, int depth)
T eta() const
int readoutVMECrateId() const
get the readout VME crate number
std::string rbx() const
void Fill(long long x)
int depth() const
get the tower depth
Definition: HcalDetId.h:42
list outfile
Definition: EdgesToViz.py:91
HcalElectronicsMap generateHcalElectronicsMap()
std::vector< MonitorElement * > depth
int CalcIeta(int subdet, int eta, int depth)
static void printTableTail(ofstream &file)
int htrTopBottom() const
get the htr top/bottom (1=top/0=bottom)
std::vector< std::string > problemnames_
int rm() const
EtaPhiHists * ProblemCellsByDepth
int ieta() const
get the cell ieta
Definition: HcalDetId.h:38
int dccid() const
get the (Hcal local) DCC id
HcalSubdetector
Definition: HcalAssistant.h:32
MonitorElement * get(const std::string &path) const
get ME from full pathname (e.g. &quot;my/long/dir/my_histo&quot;)
Definition: DQMStore.cc:1473
bool isHB(int etabin, int depth)
int spigot() const
get the spigot (input number on DCC)
std::string valueString(void) const
const HcalFrontEndId getHcalFrontEndId(const DetId &)
int iphi() const
get the cell iphi
Definition: HcalDetId.h:40
bool isHF(int etabin, int depth)
int adc() const
std::string subdir_
std::map< HcalDetId, unsigned int > badstatusmap
void FillUnphysicalHEHFBins(std::vector< TH2F > &hh)
char state
Definition: procUtils.cc:75
double getBinContent(int binx) const
get content of bin (1-D)
std::string prefixME_
HcalLogicalMap * logicalMap_
tuple cout
Definition: gather_cfg.py:121
static void printTableHeader(ofstream &file, std::string header)
static void printTableLine(ofstream &file, int ind, HcalDetId &detid, HcalFrontEndId &lmap_entry, HcalElectronicsId &emap_entry, std::string comment="")
void showDirStructure(void) const
Definition: DQMStore.cc:2766
int rmFiber() const
TH2F * getTH2F(void) const
void updateChannelStatus(std::map< HcalDetId, unsigned int > &myqual)
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:850
int qieCard() const
void Reset(void)
reset ME (ie. contents, errors, etc)
Readout chain identification for Hcal [31:26] Unused (so far) [25] Trigger-chain id flag [24:20] Read...
DQMStore * dqmStore_
const DetId lookup(HcalElectronicsId fId) const
lookup the logical detid associated with the given electronics id
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:434
Definition: DDAxes.h:10
#define comment(par)
Definition: vmac.h:162