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