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