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