CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
HcalDetDiagLaserClient Class Reference

#include <HcalDetDiagLaserClient.h>

Inheritance diagram for HcalDetDiagLaserClient:
HcalBaseDQClient

Public Member Functions

void analyze (void)
 
void beginJob (void)
 
void beginRun (void)
 
void calculateProblems (void)
 
void cleanup (void)
 
void endJob (void)
 
void endRun (void)
 
bool hasErrors_Temp (void)
 
bool hasOther_Temp (void)
 
bool hasWarnings_Temp (void)
 
 HcalDetDiagLaserClient ()
 Constructors. More...
 
 HcalDetDiagLaserClient (std::string myname)
 
 HcalDetDiagLaserClient (std::string myname, const edm::ParameterSet &ps)
 
void htmlOutput (std::string)
 
void setup (void)
 
bool test_enabled (void)
 
void updateChannelStatus (std::map< HcalDetId, unsigned int > &myqual)
 
bool validHtmlOutput ()
 
 ~HcalDetDiagLaserClient ()
 Destructor. More...
 
- Public Member Functions inherited from HcalBaseDQClient
 HcalBaseDQClient ()
 
 HcalBaseDQClient (std::string s, const edm::ParameterSet &ps)
 
std::string name ()
 
void setEventSetup (const edm::EventSetup &es)
 
virtual void setStatusMap (std::map< HcalDetId, unsigned int > &map)
 
 ~HcalBaseDQClient (void)
 

Private Attributes

int nevts_
 
int status
 

Additional Inherited Members

- Public Attributes inherited from HcalBaseDQClient
int badChannelStatusMask_
 
std::map< HcalDetId, unsigned int > badstatusmap
 
const edm::EventSetupc
 
bool cloneME_
 
int debug_
 
DQMStoredqmStore_
 
bool enableCleanup_
 
bool enoughevents_
 
double minerrorrate_
 
int minevents_
 
std::string name_
 
std::string prefixME_
 
MonitorElementProblemCells
 
EtaPhiHistsProblemCellsByDepth
 
std::vector< std::string > problemnames_
 
std::string subdir_
 
bool testenabled_
 
bool validHtmlOutput_
 

Detailed Description

Definition at line 8 of file HcalDetDiagLaserClient.h.

Constructor & Destructor Documentation

HcalDetDiagLaserClient::HcalDetDiagLaserClient ( )
inline

Constructors.

Definition at line 13 of file HcalDetDiagLaserClient.h.

References HcalBaseDQClient::name_.

13 {name_="";};
HcalDetDiagLaserClient::HcalDetDiagLaserClient ( std::string  myname)

Definition at line 37 of file HcalDetDiagLaserClient.cc.

References ntuplemaker::status.

38 {
39  name_=myname; status=0;
40 }
HcalDetDiagLaserClient::HcalDetDiagLaserClient ( std::string  myname,
const edm::ParameterSet ps 
)

Definition at line 42 of file HcalDetDiagLaserClient.cc.

References edm::ParameterSet::getUntrackedParameter().

43 {
44  name_=myname;
45  enableCleanup_ = ps.getUntrackedParameter<bool>("enableCleanup",false);
46  debug_ = ps.getUntrackedParameter<int>("debug",0);
47  prefixME_ = ps.getUntrackedParameter<string>("subSystemFolder","Hcal/");
48  if (prefixME_.substr(prefixME_.size()-1,prefixME_.size())!="/")
49  prefixME_.append("/");
50  subdir_ = ps.getUntrackedParameter<string>("DetDiagLaserFolder","DetDiagLaserMonitor_Hcal/"); // DetDiagLaserMonitor_Hcal/
51  if (subdir_.size()>0 && subdir_.substr(subdir_.size()-1,subdir_.size())!="/")
52  subdir_.append("/");
53  subdir_=prefixME_+subdir_;
54 
55  validHtmlOutput_ = ps.getUntrackedParameter<bool>("DetDiagLaser_validHtmlOutput",true);
56  cloneME_ = ps.getUntrackedParameter<bool>("cloneME", true);
57  badChannelStatusMask_ = ps.getUntrackedParameter<int>("DetDiagLaser_BadChannelStatusMask",
58  ps.getUntrackedParameter<int>("BadChannelStatusMask",0));
59 
60  minerrorrate_ = ps.getUntrackedParameter<double>("DetDiagLaser_minerrorrate",
61  ps.getUntrackedParameter<double>("minerrorrate",0.05));
62  minevents_ = ps.getUntrackedParameter<int>("DetDiagLaser_minevents",
63  ps.getUntrackedParameter<int>("minevents",1));
64  ProblemCells=0;
66 }
T getUntrackedParameter(std::string const &, T const &) const
MonitorElement * ProblemCells
EtaPhiHists * ProblemCellsByDepth
std::string subdir_
std::string prefixME_
HcalDetDiagLaserClient::~HcalDetDiagLaserClient ( )

Destructor.

Member Function Documentation

void HcalDetDiagLaserClient::analyze ( void  )
virtual

Reimplemented from HcalBaseDQClient.

Definition at line 68 of file HcalDetDiagLaserClient.cc.

References gather_cfg::cout.

69 {
70  if (debug_>2) std::cout <<"\tHcalDetDiagLaserClient::analyze()"<<std::endl;
72 }
tuple cout
Definition: gather_cfg.py:41
void HcalDetDiagLaserClient::beginJob ( void  )
virtual

Reimplemented from HcalBaseDQClient.

Definition at line 200 of file HcalDetDiagLaserClient.cc.

References gather_cfg::cout, and cmsCodeRules.cppFunctionSkipper::operator.

201 {
203  if (debug_>0)
204  {
205  std::cout <<"<HcalDetDiagLaserClient::beginJob()> Displaying dqmStore directory structure:"<<std::endl;
207  }
208 }
tuple cout
Definition: gather_cfg.py:41
void showDirStructure(void) const
Definition: DQMStore.cc:2539
DQMStore * dqmStore_
void HcalDetDiagLaserClient::beginRun ( void  )
virtual

Reimplemented from HcalBaseDQClient.

Definition at line 211 of file HcalDetDiagLaserClient.cc.

References gather_cfg::cout, and i.

212 {
213  enoughevents_=false;
214  if (!dqmStore_)
215  {
216  if (debug_>0) std::cout <<"<HcalDetDiagLaserClient::beginRun> dqmStore does not exist!"<<std::endl;
217  return;
218  }
220  problemnames_.clear();
221 
222  // Put the appropriate name of your problem summary here
223  ProblemCells=dqmStore_->book2D(" ProblemDetDiagLaser",
224  " Problem DetDiagLaser Rate for all HCAL;ieta;iphi",
225  85,-42.5,42.5,
226  72,0.5,72.5);
227  problemnames_.push_back(ProblemCells->getName());
228  if (debug_>1)
229  std::cout << "Tried to create ProblemCells Monitor Element in directory "<<subdir_<<" \t Failed? "<<(ProblemCells==0)<<std::endl;
230  dqmStore_->setCurrentFolder(subdir_+"problem_DetDiagLaser");
232  ProblemCellsByDepth->setup(dqmStore_," Problem DetDiagLaser Rate");
233  for (unsigned int i=0; i<ProblemCellsByDepth->depth.size();++i)
234  problemnames_.push_back(ProblemCellsByDepth->depth[i]->getName());
235  nevts_=0;
236 }
const std::string & getName(void) const
get name of ME
int i
Definition: DBlmapReader.cc:9
MonitorElement * ProblemCells
void setup(DQMStore *&m_dbe, std::string Name, std::string Units="")
std::vector< MonitorElement * > depth
std::vector< std::string > problemnames_
EtaPhiHists * ProblemCellsByDepth
std::string subdir_
tuple cout
Definition: gather_cfg.py:41
MonitorElement * book2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D histogram.
Definition: DQMStore.cc:647
DQMStore * dqmStore_
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:237
void HcalDetDiagLaserClient::calculateProblems ( void  )
virtual

Reimplemented from HcalBaseDQClient.

Definition at line 74 of file HcalDetDiagLaserClient.cc.

References CalcIeta(), gather_cfg::cout, eta(), FillUnphysicalHEHFBins(), HcalBarrel, HcalEmpty, HcalEndcap, HcalEtaPhiHistNames(), HcalForward, HcalOuter, i, isHB(), isHE(), isHF(), isHO(), min, AlCaRecoCosmics_cfg::name, phi, and asciidump::s.

75 {
76  if (debug_>2) std::cout <<"\t\tHcalDetDiagLaserClient::calculateProblems()"<<std::endl;
77  if(!dqmStore_) return;
78  double totalevents=0;
79  int etabins=0, phibins=0, zside=0;
80  double problemvalue=0;
81 
82  // Clear away old problems
83  if (ProblemCells!=0)
84  {
86  (ProblemCells->getTH2F())->SetMaximum(1.05);
87  (ProblemCells->getTH2F())->SetMinimum(0.);
88  }
89  for (unsigned int d=0;d<ProblemCellsByDepth->depth.size();++d)
90  {
91  if (ProblemCellsByDepth->depth[d]!=0)
92  {
93  ProblemCellsByDepth->depth[d]->Reset();
94  (ProblemCellsByDepth->depth[d]->getTH2F())->SetMaximum(1.05);
95  (ProblemCellsByDepth->depth[d]->getTH2F())->SetMinimum(0.);
96  }
97  }
98  enoughevents_=true;
99  // Get histograms that are used in testing
100  // currently none used,
101 
102  std::vector<std::string> name = HcalEtaPhiHistNames();
103 
104  // This is a sample of how to get a histogram from the task that can then be used for evaluation purposes
105  TH2F* BadTiming[4];
106  TH2F* BadEnergy[4];
107  MonitorElement* me;
108  for (int i=0;i<4;++i)
109  {
110  BadTiming[i]=0;
111  BadEnergy[i]=0;
112  string s=subdir_+name[i]+" Problem Bad Laser Timing";
113  me=dqmStore_->get(s.c_str());
114  if (me!=0) BadTiming[i]=HcalUtilsClient::getHisto<TH2F*>(me, cloneME_, BadTiming[i], debug_);
115  else if (debug_>0) std::cout <<"<HcalDetDiagLaserClient::calculateProblems> could not get histogram '"<<s<<"'"<<std::endl;
116  s=subdir_+name[i]+" Problem Bad Laser Energy";
117  me=dqmStore_->get(s.c_str());
118  if (me!=0) BadEnergy[i]=HcalUtilsClient::getHisto<TH2F*>(me, cloneME_, BadEnergy[i], debug_);
119  else if (debug_>0) std::cout <<"<HcalDetDiagLaserClient::calculateProblems> could not get histogram '"<<s<<"'"<<std::endl;
120  }
121 
122  // Because we're clearing and re-forming the problem cell histogram here, we don't need to do any cute
123  // setting of the underflow bin to 0, and we can plot results as a raw rate between 0-1.
124 
125  for (unsigned int d=0;d<ProblemCellsByDepth->depth.size();++d)
126  {
127  if (ProblemCellsByDepth->depth[d]==0) continue;
128 
129  //totalevents=DigiPresentByDepth[d]->GetBinContent(0);
130  totalevents=0;
131  // Check underflow bins for events processed
132  if (BadTiming[d]!=0) totalevents += BadTiming[d]->GetBinContent(0);
133  if (BadEnergy[d]!=0) totalevents += BadEnergy[d]->GetBinContent(0);
134  //if (totalevents==0 || totalevents<minevents_) continue;
135 
136  totalevents=1; // temporary value pending removal of histogram normalization from tasks
137 
138  etabins=(ProblemCellsByDepth->depth[d]->getTH2F())->GetNbinsX();
139  phibins=(ProblemCellsByDepth->depth[d]->getTH2F())->GetNbinsY();
140  for (int eta=0;eta<etabins;++eta)
141  {
142  int ieta=CalcIeta(eta,d+1);
143  if (ieta==-9999) continue;
144  for (int phi=0;phi<phibins;++phi)
145  {
146  problemvalue=0;
147  if (BadTiming[d]!=0) problemvalue += BadTiming[d]->GetBinContent(eta+1,phi+1)*1./totalevents;
148  if (BadEnergy[d]!=0) problemvalue += BadEnergy[d]->GetBinContent(eta+1,phi+1)*1./totalevents;
149  if (problemvalue==0) continue;
150  // problem value is a rate; we can normalize it here
151  problemvalue = min(1.,problemvalue);
152 
153  zside=0;
154  if (isHF(eta,d+1)) // shift ieta by 1 for HF
155  ieta<0 ? zside = -1 : zside = 1;
156 
157  // For problem cells that exceed our allowed rate,
158  // set the values to -1 if the cells are already marked in the status database
159  if (problemvalue>minerrorrate_)
160  {
161  HcalSubdetector subdet=HcalEmpty;
162  if (isHB(eta,d+1))subdet=HcalBarrel;
163  else if (isHE(eta,d+1)) subdet=HcalEndcap;
164  else if (isHF(eta,d+1)) subdet=HcalForward;
165  else if (isHO(eta,d+1)) subdet=HcalOuter;
166  HcalDetId hcalid(subdet, ieta, phi+1, (int)(d+1));
167  if (badstatusmap.find(hcalid)!=badstatusmap.end())
168  problemvalue=999;
169  }
170 
171  ProblemCellsByDepth->depth[d]->setBinContent(eta+1,phi+1,problemvalue);
172  if (ProblemCells!=0) ProblemCells->Fill(ieta+zside,phi+1,problemvalue);
173  } // loop on phi
174  } // loop on eta
175  } // loop on depth
176 
177  if (ProblemCells==0)
178  {
179  if (debug_>0) std::cout <<"<HcalDetDiagLaserClient::calculateProblems> ProblemCells histogram does not exist!"<<endl;
180  return;
181  }
182 
183  // Normalization of ProblemCell plot, in the case where there are errors in multiple depths
184  etabins=(ProblemCells->getTH2F())->GetNbinsX();
185  phibins=(ProblemCells->getTH2F())->GetNbinsY();
186  for (int eta=0;eta<etabins;++eta)
187  {
188  for (int phi=0;phi<phibins;++phi)
189  {
192  }
193  }
194 
197  return;
198 }
bool isHO(int etabin, int depth)
int i
Definition: DBlmapReader.cc:9
MonitorElement * ProblemCells
std::string name()
void setBinContent(int binx, double content)
set content of bin (1-D)
std::vector< std::string > HcalEtaPhiHistNames()
#define min(a, b)
Definition: mlp_lapack.h:161
bool isHE(int etabin, int depth)
T eta() const
void Fill(long long x)
std::vector< MonitorElement * > depth
EtaPhiHists * ProblemCellsByDepth
HcalSubdetector
Definition: HcalAssistant.h:32
MonitorElement * get(const std::string &path) const
get ME from full pathname (e.g. &quot;my/long/dir/my_histo&quot;)
Definition: DQMStore.cc:1270
bool isHB(int etabin, int depth)
int CalcIeta(int subdet, int eta, int depth)
bool isHF(int etabin, int depth)
void FillUnphysicalHEHFBins(EtaPhiHists &hh)
std::string subdir_
std::map< HcalDetId, unsigned int > badstatusmap
double getBinContent(int binx) const
get content of bin (1-D)
tuple cout
Definition: gather_cfg.py:41
string s
Definition: asciidump.py:422
TH2F * getTH2F(void) const
void Reset(void)
reset ME (ie. contents, errors, etc)
DQMStore * dqmStore_
Definition: DDAxes.h:10
void HcalDetDiagLaserClient::cleanup ( void  )
virtual

Reimplemented from HcalBaseDQClient.

Definition at line 241 of file HcalDetDiagLaserClient.cc.

241 {}
void HcalDetDiagLaserClient::endJob ( void  )
virtual

Reimplemented from HcalBaseDQClient.

Definition at line 209 of file HcalDetDiagLaserClient.cc.

209 {}
void HcalDetDiagLaserClient::endRun ( void  )
virtual

Reimplemented from HcalBaseDQClient.

Definition at line 238 of file HcalDetDiagLaserClient.cc.

References python.Vispa.Share.Profiling::analyze().

bool HcalDetDiagLaserClient::hasErrors_Temp ( void  )
virtual

Reimplemented from HcalBaseDQClient.

Definition at line 243 of file HcalDetDiagLaserClient.cc.

References CalcIeta(), gather_cfg::cout, and ntuplemaker::status.

244 {
245  if(status&2) return true;
246  return false;
247 
248  if (!ProblemCells)
249  {
250  if (debug_>1) std::cout <<"<HcalDetDiagLaserClient::hasErrors_Temp> ProblemCells histogram does not exist!"<<std::endl;
251  return false;
252  }
253  int problemcount=0;
254  int ieta=-9999;
255 
256  for (int depth=0;depth<4; ++depth)
257  {
258  int etabins = (ProblemCells->getTH2F())->GetNbinsX();
259  int phibins = (ProblemCells->getTH2F())->GetNbinsY();
260  for (int hist_eta=0;hist_eta<etabins;++hist_eta)
261  {
262  for (int hist_phi=0; hist_phi<phibins;++hist_phi)
263  {
264  ieta=CalcIeta(hist_eta,depth+1);
265  if (ieta==-9999) continue;
266  if (ProblemCellsByDepth->depth[depth]==0)
267  continue;
268  if (ProblemCellsByDepth->depth[depth]->getBinContent(hist_eta,hist_phi)>minerrorrate_)
269  ++problemcount;
270 
271  } // for (int hist_phi=1;...)
272  } // for (int hist_eta=1;...)
273  } // for (int depth=0;...)
274 
275  if (problemcount>0) return true;
276  return false;
277 }
MonitorElement * ProblemCells
std::vector< MonitorElement * > depth
EtaPhiHists * ProblemCellsByDepth
int CalcIeta(int subdet, int eta, int depth)
tuple cout
Definition: gather_cfg.py:41
TH2F * getTH2F(void) const
bool HcalDetDiagLaserClient::hasOther_Temp ( void  )
virtual

Reimplemented from HcalBaseDQClient.

Definition at line 283 of file HcalDetDiagLaserClient.cc.

283 {return false;}
bool HcalDetDiagLaserClient::hasWarnings_Temp ( void  )
virtual

Reimplemented from HcalBaseDQClient.

Definition at line 279 of file HcalDetDiagLaserClient.cc.

References ntuplemaker::status.

279  {
280  if(status&1) return true;
281  return false;
282 }
void HcalDetDiagLaserClient::htmlOutput ( std::string  )
virtual

Reimplemented from HcalBaseDQClient.

Definition at line 376 of file HcalDetDiagLaserClient.cc.

References CalcIeta(), gather_cfg::cout, HcalLogicalMapGenerator::createMap(), eta(), MonitorElement::getIntValue(), HcalBarrel, HcalEmpty, HcalEndcap, HcalEtaPhiHistNames(), HcalForward, HcalOuter, i, isHB(), isHE(), isHF(), isHO(), AlCaRecoCosmics_cfg::name, EdgesToViz::outfile, phi, printTableHeader(), printTableLine(), printTableTail(), asciidump::s, evf::utils::state, and ntuplemaker::status.

376  {
377  if(dqmStore_==0){
378  if (debug_>0) std::cout <<"<HcalDetDiagLaserClient::htmlOutput> dqmStore object does not exist!"<<std::endl;
379  return;
380  }
381  if(debug_>2) std::cout <<"\t<HcalDetDiagLaserClient::htmlOutput> Preparing html for task: "<<name_<<std::endl;
383 
385  HcalLogicalMap lmap(gen.createMap());
386  HcalElectronicsMap emap=lmap.generateHcalElectronicsMap();
387 
389  string ref_run,s;
390  MonitorElement* me;
391  TH1F *hbheEnergy=0;
392  TH1F *hbheTiming=0;
393  TH1F *hbheEnergyRMS=0;
394  TH1F *hbheTimingRMS=0;
395  TH1F *hoEnergy=0;
396  TH1F *hoTiming=0;
397  TH1F *hoEnergyRMS=0;
398  TH1F *hoTimingRMS=0;
399  TH1F *hfEnergy=0;
400  TH1F *hfTiming=0;
401  TH1F *hfEnergyRMS=0;
402  TH1F *hfTimingRMS=0;
403  TH1F *hb=0;
404  TH1F *he=0;
405  TH1F *ho=0;
406  TH1F *hf=0;
407  TH2F *Time2Dhbhehf=0;
408  TH2F *Time2Dho=0;
409  TH2F *Energy2Dhbhehf=0;
410  TH2F *Energy2Dho=0;
411  TH2F *refTime2Dhbhehf=0;
412  TH2F *refTime2Dho=0;
413  TH2F *refEnergy2Dhbhehf=0;
414  TH2F *refEnergy2Dho=0;
415  int HBpresent_=0,HEpresent_=0,HOpresent_=0,HFpresent_=0;
416 
417 
418  me=dqmStore_->get(prefixME_+"HcalInfo/HBpresent");
419  if(me!=0) HBpresent_=me->getIntValue();
420  me=dqmStore_->get(prefixME_+"HcalInfo/HEpresent");
421  if(me!=0) HEpresent_=me->getIntValue();
422  me=dqmStore_->get(prefixME_+"HcalInfo/HOpresent");
423  if(me!=0) HOpresent_=me->getIntValue();
424  me=dqmStore_->get(prefixME_+"HcalInfo/HFpresent");
425  if(me!=0) HFpresent_=me->getIntValue();
426 
427  s=subdir_+"Summary Plots/HBHE Laser Energy Distribution"; me=dqmStore_->get(s.c_str());
428  if(me!=0) hbheEnergy=HcalUtilsClient::getHisto<TH1F*>(me, cloneME_, hbheEnergy, debug_); else return;
429  s=subdir_+"Summary Plots/HBHE Laser Timing Distribution"; me=dqmStore_->get(s.c_str());
430  if(me!=0) hbheTiming=HcalUtilsClient::getHisto<TH1F*>(me, cloneME_, hbheTiming, debug_); else return;
431  s=subdir_+"Summary Plots/HBHE Laser Energy RMS_div_Energy Distribution"; me=dqmStore_->get(s.c_str());
432  if(me!=0) hbheEnergyRMS= HcalUtilsClient::getHisto<TH1F*>(me, cloneME_, hbheEnergyRMS, debug_); else return;
433  s=subdir_+"Summary Plots/HBHE Laser Timing RMS Distribution"; me=dqmStore_->get(s.c_str());
434  if(me!=0) hbheTimingRMS= HcalUtilsClient::getHisto<TH1F*>(me, cloneME_, hbheTimingRMS, debug_); else return;
435  s=subdir_+"Summary Plots/HO Laser Energy Distribution"; me=dqmStore_->get(s.c_str());
436  if(me!=0) hoEnergy = HcalUtilsClient::getHisto<TH1F*>(me, cloneME_, hoEnergy, debug_); else return;
437  s=subdir_+"Summary Plots/HO Laser Timing Distribution"; me=dqmStore_->get(s.c_str());
438  if(me!=0) hoTiming = HcalUtilsClient::getHisto<TH1F*>(me, cloneME_, hoTiming, debug_); else return;
439  s=subdir_+"Summary Plots/HO Laser Energy RMS_div_Energy Distribution"; me=dqmStore_->get(s.c_str());
440  if(me!=0) hoEnergyRMS = HcalUtilsClient::getHisto<TH1F*>(me, cloneME_, hoEnergyRMS, debug_); else return;
441  s=subdir_+"Summary Plots/HO Laser Timing RMS Distribution"; me=dqmStore_->get(s.c_str());
442  if(me!=0) hoTimingRMS = HcalUtilsClient::getHisto<TH1F*>(me, cloneME_, hoTimingRMS, debug_); else return;
443  s=subdir_+"Summary Plots/HF Laser Energy Distribution"; me=dqmStore_->get(s.c_str());
444  if(me!=0) hfEnergy = HcalUtilsClient::getHisto<TH1F*>(me, cloneME_, hfEnergy, debug_); else return;
445  s=subdir_+"Summary Plots/HF Laser Timing Distribution"; me=dqmStore_->get(s.c_str());
446  if(me!=0) hfTiming = HcalUtilsClient::getHisto<TH1F*>(me, cloneME_, hfTiming, debug_); else return;
447  s=subdir_+"Summary Plots/HF Laser Energy RMS_div_Energy Distribution"; me=dqmStore_->get(s.c_str());
448  if(me!=0) hfEnergyRMS = HcalUtilsClient::getHisto<TH1F*>(me, cloneME_, hfEnergyRMS, debug_); else return;
449  s=subdir_+"Summary Plots/HF Laser Timing RMS Distribution"; me=dqmStore_->get(s.c_str());
450  if(me!=0) hfTimingRMS = HcalUtilsClient::getHisto<TH1F*>(me, cloneME_, hfTimingRMS, debug_); else return;
451 
452  s=subdir_+"Summary Plots/HB RBX average Time-Ref"; me=dqmStore_->get(s.c_str());
453  if(me!=0) hb = HcalUtilsClient::getHisto<TH1F*>(me, cloneME_, hb, debug_); else return;
454  s=subdir_+"Summary Plots/HE RBX average Time-Ref"; me=dqmStore_->get(s.c_str());
455  if(me!=0) he = HcalUtilsClient::getHisto<TH1F*>(me, cloneME_, he, debug_); else return;
456  s=subdir_+"Summary Plots/HO RBX average Time-Ref"; me=dqmStore_->get(s.c_str());
457  if(me!=0) ho = HcalUtilsClient::getHisto<TH1F*>(me, cloneME_, ho, debug_); else return;
458  s=subdir_+"Summary Plots/HF RoBox average Time-Ref"; me=dqmStore_->get(s.c_str());
459  if(me!=0) hf = HcalUtilsClient::getHisto<TH1F*>(me, cloneME_, hf, debug_); else return;
460 
461  s=subdir_+"Summary Plots/Laser Timing HBHEHF"; me=dqmStore_->get(s.c_str());
462  if(me!=0) Time2Dhbhehf = HcalUtilsClient::getHisto<TH2F*>(me, cloneME_, Time2Dhbhehf, debug_); else return;
463  s=subdir_+"Summary Plots/Laser Timing HO"; me=dqmStore_->get(s.c_str());
464  if(me!=0) Time2Dho = HcalUtilsClient::getHisto<TH2F*>(me, cloneME_, Time2Dho, debug_); else return;
465  s=subdir_+"Summary Plots/Laser Energy HBHEHF"; me=dqmStore_->get(s.c_str());
466  if(me!=0) Energy2Dhbhehf= HcalUtilsClient::getHisto<TH2F*>(me, cloneME_, Energy2Dhbhehf, debug_); else return;
467  s=subdir_+"Summary Plots/Laser Energy HO"; me=dqmStore_->get(s.c_str());
468  if(me!=0) Energy2Dho = HcalUtilsClient::getHisto<TH2F*>(me, cloneME_, Energy2Dho, debug_); else return;
469  s=subdir_+"Summary Plots/HBHEHF Laser (Timing-Ref)+1"; me=dqmStore_->get(s.c_str());
470  if(me!=0) refTime2Dhbhehf = HcalUtilsClient::getHisto<TH2F*>(me, cloneME_, refTime2Dhbhehf, debug_); else return;
471  s=subdir_+"Summary Plots/HO Laser (Timing-Ref)+1"; me=dqmStore_->get(s.c_str());
472  if(me!=0) refTime2Dho = HcalUtilsClient::getHisto<TH2F*>(me, cloneME_, refTime2Dho, debug_); else return;
473  s=subdir_+"Summary Plots/HBHEHF Laser Energy_div_Ref"; me=dqmStore_->get(s.c_str());
474  if(me!=0) refEnergy2Dhbhehf= HcalUtilsClient::getHisto<TH2F*>(me, cloneME_, refEnergy2Dhbhehf, debug_); else return;
475  s=subdir_+"Summary Plots/HO Laser Energy_div_Ref"; me=dqmStore_->get(s.c_str());
476  if(me!=0) refEnergy2Dho = HcalUtilsClient::getHisto<TH2F*>(me, cloneME_, refEnergy2Dho, debug_); else return;
477 
478  TH1F *Raddam[56];
479  char str[100];
480  for(int i=0;i<56;i++){
481  sprintf(str,"RADDAM (%i %i)",RADDAM_CH[i].eta,RADDAM_CH[i].phi);
482  s=subdir_+"Raddam Plots/"+str; me=dqmStore_->get(s.c_str());
483  if(me!=0) Raddam[i] = HcalUtilsClient::getHisto<TH1F*>(me, cloneME_, Raddam[i], debug_);
484  Raddam[i]->SetXTitle("TS");
485  Raddam[i]->SetTitle(str);
486  }
487 
488  int ievt_ = -1,runNo=-1;
489  s=subdir_+"HcalDetDiagLaserMonitor Event Number";
490  me = dqmStore_->get(s.c_str());
491  if ( me ) {
492  s = me->valueString();
493  sscanf((s.substr(2,s.length()-2)).c_str(), "%d", &ievt_);
494  }
495  s=subdir_+"HcalDetDiagLaserMonitor Run Number";
496  me = dqmStore_->get(s.c_str());
497  if ( me ) {
498  s = me->valueString();
499  sscanf((s.substr(2,s.length()-2)).c_str(), "%d", &runNo);
500  }
501  s=subdir_+"HcalDetDiagLaserMonitor Reference Run";
502  me = dqmStore_->get(s.c_str());
503  if(me) {
504  string s=me->valueString();
505  char str[200];
506  sscanf((s.substr(2,s.length()-2)).c_str(), "%s", str);
507  ref_run=str;
508  }
509 
510  int badT=0;
511  int badE=0;
512  int HBP[2]={0,0};
513  int HBM[2]={0,0};
514  int HEP[2]={0,0};
515  int HEM[2]={0,0};
516  int HFP[2]={0,0};
517  int HFM[2]={0,0};
518  int HO[2] ={0,0};
519  int newHBP[2]={0,0};
520  int newHBM[2]={0,0};
521  int newHEP[2]={0,0};
522  int newHEM[2]={0,0};
523  int newHFP[2]={0,0};
524  int newHFM[2]={0,0};
525  int newHO[2] ={0,0};
526 
527  TH2F* BadTiming_val[4];
528  TH2F* BadEnergy_val[4];
529  std::vector<std::string> name = HcalEtaPhiHistNames();
530  for(int i=0;i<4;++i){
531  BadTiming_val[i]=0;
532  BadEnergy_val[i]=0;
533  string s=subdir_+"Plots for client/"+name[i]+" Laser Timing difference";
534  me=dqmStore_->get(s.c_str());
535  if (me!=0) BadTiming_val[i]=HcalUtilsClient::getHisto<TH2F*>(me, cloneME_, BadTiming_val[i], debug_); else return;
536  s=subdir_+"Plots for client/"+name[i]+" Laser Energy difference";
537  me=dqmStore_->get(s.c_str());
538  if (me!=0) BadEnergy_val[i]=HcalUtilsClient::getHisto<TH2F*>(me, cloneME_, BadEnergy_val[i], debug_); else return;
539  }
540 
542  ofstream badTiming;
543  badTiming.open((htmlDir+"bad_timing_table.html").c_str());
544  printTableHeader(badTiming,"Bad Timing Channels list");
545  ofstream badEnergy;
546  badEnergy.open((htmlDir+"bad_energy_table.html").c_str());
547  printTableHeader(badEnergy,"Bad Energy Channels list");
548 
549  for(int d=0;d<4;++d){
550  int etabins=BadTiming_val[d]->GetNbinsX();
551  int phibins=BadTiming_val[d]->GetNbinsY();
552  for(int phi=0;phi<phibins;++phi)for(int eta=0;eta<etabins;++eta){
553  int ieta=CalcIeta(eta,d+1);
554  if(ieta==-9999) continue;
555  HcalSubdetector subdet=HcalEmpty;
556  if(isHB(eta,d+1))subdet=HcalBarrel;
557  else if (isHE(eta,d+1)) subdet=HcalEndcap;
558  else if (isHF(eta,d+1)) subdet=HcalForward;
559  else if (isHO(eta,d+1)) subdet=HcalOuter;
560  HcalDetId hcalid(subdet, ieta, phi+1, (int)(d+1));
561  float val=BadTiming_val[d]->GetBinContent(eta+1,phi+1);
562  if(val!=0){
563  if(subdet==HcalBarrel){
564  if(ieta>0){ HBP[0]++;}else{ HBM[0]++;} badT++;
565  if(badstatusmap.find(hcalid)==badstatusmap.end()){if(ieta>0){ newHBP[0]++;}else{ newHBM[0]++;}}
566  }
567  if(subdet==HcalEndcap){
568  if(ieta>0){ HEP[0]++;}else{ HEM[0]++;} badT++;
569  if(badstatusmap.find(hcalid)==badstatusmap.end()){if(ieta>0){ newHEP[0]++;}else{ newHEM[0]++;}}
570  }
571  if(subdet==HcalForward){
572  if(ieta>0){ HFP[0]++;}else{ HFM[0]++;} badT++;
573  if(badstatusmap.find(hcalid)==badstatusmap.end()){if(ieta>0){ newHFP[0]++;}else{ newHFM[0]++;}}
574  }
575  if(subdet==HcalOuter){
576  HO[0]++;badT++;
577  if(badstatusmap.find(hcalid)==badstatusmap.end()){newHO[0]++;}
578  }
579  }
580  val=BadEnergy_val[d]->GetBinContent(eta+1,phi+1);
581  if(val!=0){
582  if(subdet==HcalBarrel){
583  if(ieta>0){ HBP[1]++;}else{ HBM[1]++;} badE++;
584  if(badstatusmap.find(hcalid)==badstatusmap.end()){if(ieta>0){ newHBP[1]++;}else{ newHBM[1]++;}}
585  }
586  if(subdet==HcalEndcap){
587  if(ieta>0){ HEP[1]++;}else{ HEM[1]++;} badE++;
588  if(badstatusmap.find(hcalid)==badstatusmap.end()){if(ieta>0){ newHEP[1]++;}else{ newHEM[1]++;}}
589  }
590  if(subdet==HcalForward){
591  if(ieta>0){ HFP[1]++;}else{ HFM[1]++;} badE++;
592  if(badstatusmap.find(hcalid)==badstatusmap.end()){if(ieta>0){ newHFP[1]++;}else{ newHFM[1]++;}}
593  }
594  if(subdet==HcalOuter){
595  HO[1]++;badT++;
596  if(badstatusmap.find(hcalid)==badstatusmap.end()){newHO[1]++;}
597  }
598  }
599  }
600  }
601 
602 
603  int cnt=0;
604  if((HBP[0]+HBM[0])>0){
605  badTiming << "<tr><td align=\"center\"><h3>"<< "HB" <<"</h3></td></tr>" << endl;
606  for(int d=0;d<4;++d){
607  int etabins=BadTiming_val[d]->GetNbinsX();
608  int phibins=BadTiming_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=BadTiming_val[d]->GetBinContent(eta+1,phi+1);
614  if(val==0) continue;
615  HcalDetId hcalid(HcalBarrel,ieta,phi+1,d+1);
616  HcalFrontEndId lmap_entry=lmap.getHcalFrontEndId(hcalid);
617  HcalElectronicsId emap_entry=emap.lookup(hcalid);
618  sprintf(str,"Time-Ref=%.2f",val);
619  printTableLine(badTiming,cnt++,hcalid,lmap_entry,emap_entry,str);
620  }
621  }
622  }
623  cnt=0;
624  if((HEP[0]+HEM[0])>0){
625  badTiming << "<tr><td align=\"center\"><h3>"<< "HE" <<"</h3></td></tr>" << endl;
626  for(int d=0;d<4;++d){
627  int etabins=BadTiming_val[d]->GetNbinsX();
628  int phibins=BadTiming_val[d]->GetNbinsY();
629  for(int phi=0;phi<phibins;++phi)for(int eta=0;eta<etabins;++eta){
630  int ieta=CalcIeta(eta,d+1);
631  if(ieta==-9999) continue;
632  if(!isHE(eta,d+1)) continue;
633  float val=BadTiming_val[d]->GetBinContent(eta+1,phi+1);
634  if(val==0) continue;
635  HcalDetId hcalid(HcalEndcap,ieta,phi+1,d+1);
636  HcalFrontEndId lmap_entry=lmap.getHcalFrontEndId(hcalid);
637  HcalElectronicsId emap_entry=emap.lookup(hcalid);
638  sprintf(str,"Time-Ref=%.2f",val);
639  printTableLine(badTiming,cnt++,hcalid,lmap_entry,emap_entry,str);
640  }
641  }
642  }
643  cnt=0;
644  if(HO[0]>0){
645  badTiming << "<tr><td align=\"center\"><h3>"<< "HO" <<"</h3></td></tr>" << endl;
646  for(int d=0;d<4;++d){
647  int etabins=BadTiming_val[d]->GetNbinsX();
648  int phibins=BadTiming_val[d]->GetNbinsY();
649  for(int phi=0;phi<phibins;++phi)for(int eta=0;eta<etabins;++eta){
650  int ieta=CalcIeta(eta,d+1);
651  if(ieta==-9999) continue;
652  if(!isHO(eta,d+1)) continue;
653  float val=BadTiming_val[d]->GetBinContent(eta+1,phi+1);
654  if(val==0) continue;
655  HcalDetId hcalid(HcalOuter,ieta,phi+1,d+1);
656  HcalFrontEndId lmap_entry=lmap.getHcalFrontEndId(hcalid);
657  HcalElectronicsId emap_entry=emap.lookup(hcalid);
658  sprintf(str,"Time-Ref=%.2f",val);
659  printTableLine(badTiming,cnt++,hcalid,lmap_entry,emap_entry,str);
660  }
661  }
662  }
663  cnt=0;
664  if((HFP[0]+HFM[0])>0){
665  badTiming << "<tr><td align=\"center\"><h3>"<< "HF" <<"</h3></td></tr>" << endl;
666  for(int d=0;d<4;++d){
667  int etabins=BadTiming_val[d]->GetNbinsX();
668  int phibins=BadTiming_val[d]->GetNbinsY();
669  for(int phi=0;phi<phibins;++phi)for(int eta=0;eta<etabins;++eta){
670  int ieta=CalcIeta(eta,d+1);
671  if(ieta==-9999) continue;
672  if(!isHF(eta,d+1)) continue;
673  float val=BadTiming_val[d]->GetBinContent(eta+1,phi+1);
674  if(val==0) continue;
675  HcalDetId hcalid(HcalForward,ieta,phi+1,d+1);
676  HcalFrontEndId lmap_entry=lmap.getHcalFrontEndId(hcalid);
677  HcalElectronicsId emap_entry=emap.lookup(hcalid);
678  sprintf(str,"Time-Ref=%.2f",val);
679  printTableLine(badTiming,cnt++,hcalid,lmap_entry,emap_entry,str);
680  }
681  }
682  }
684  cnt=0;
685  if((HBP[1]+HBM[1])>0){
686  badEnergy << "<tr><td align=\"center\"><h3>"<< "HB" <<"</h3></td></tr>" << endl;
687  for(int d=0;d<4;++d){
688  int etabins=BadEnergy_val[d]->GetNbinsX();
689  int phibins=BadEnergy_val[d]->GetNbinsY();
690  for(int phi=0;phi<phibins;++phi)for(int eta=0;eta<etabins;++eta){
691  int ieta=CalcIeta(eta,d+1);
692  if(ieta==-9999) continue;
693  if(!isHB(eta,d+1)) continue;
694  float val=BadEnergy_val[d]->GetBinContent(eta+1,phi+1);
695  if(val==0) continue;
696  HcalDetId hcalid(HcalBarrel,ieta,phi+1,d+1);
697  HcalFrontEndId lmap_entry=lmap.getHcalFrontEndId(hcalid);
698  HcalElectronicsId emap_entry=emap.lookup(hcalid);
699  sprintf(str,"Energy/Ref=%.2f",val);
700  printTableLine(badEnergy,cnt++,hcalid,lmap_entry,emap_entry,str);
701  }
702  }
703  }
704  cnt=0;
705  if((HEP[1]+HEM[1])>0){
706  badEnergy << "<tr><td align=\"center\"><h3>"<< "HE" <<"</h3></td></tr>" << endl;
707  for(int d=0;d<4;++d){
708  int etabins=BadEnergy_val[d]->GetNbinsX();
709  int phibins=BadEnergy_val[d]->GetNbinsY();
710  for(int phi=0;phi<phibins;++phi)for(int eta=0;eta<etabins;++eta){
711  int ieta=CalcIeta(eta,d+1);
712  if(ieta==-9999) continue;
713  if(!isHE(eta,d+1)) continue;
714  float val=BadEnergy_val[d]->GetBinContent(eta+1,phi+1);
715  if(val==0) continue;
716  HcalDetId hcalid(HcalEndcap,ieta,phi+1,d+1);
717  HcalFrontEndId lmap_entry=lmap.getHcalFrontEndId(hcalid);
718  HcalElectronicsId emap_entry=emap.lookup(hcalid);
719  sprintf(str,"Energy/Ref=%.2f",val);
720  printTableLine(badEnergy,cnt++,hcalid,lmap_entry,emap_entry,str);
721  }
722  }
723  }
724  cnt=0;
725  if(HO[1]>0){
726  badEnergy << "<tr><td align=\"center\"><h3>"<< "HO" <<"</h3></td></tr>" << endl;
727  for(int d=0;d<4;++d){
728  int etabins=BadEnergy_val[d]->GetNbinsX();
729  int phibins=BadEnergy_val[d]->GetNbinsY();
730  for(int phi=0;phi<phibins;++phi)for(int eta=0;eta<etabins;++eta){
731  int ieta=CalcIeta(eta,d+1);
732  if(ieta==-9999) continue;
733  if(!isHO(eta,d+1)) continue;
734  float val=BadEnergy_val[d]->GetBinContent(eta+1,phi+1);
735  if(val==0) continue;
736  HcalDetId hcalid(HcalOuter,ieta,phi+1,d+1);
737  HcalFrontEndId lmap_entry=lmap.getHcalFrontEndId(hcalid);
738  HcalElectronicsId emap_entry=emap.lookup(hcalid);
739  sprintf(str,"Energy/Ref=%.2f",val);
740  printTableLine(badEnergy,cnt++,hcalid,lmap_entry,emap_entry,str);
741  }
742  }
743  }
744  cnt=0;
745  if((HFP[1]+HFM[1])>0){
746  badEnergy << "<tr><td align=\"center\"><h3>"<< "HF" <<"</h3></td></tr>" << endl;
747  for(int d=0;d<4;++d){
748  int etabins=BadEnergy_val[d]->GetNbinsX();
749  int phibins=BadEnergy_val[d]->GetNbinsY();
750  for(int phi=0;phi<phibins;++phi)for(int eta=0;eta<etabins;++eta){
751  int ieta=CalcIeta(eta,d+1);
752  if(ieta==-9999) continue;
753  if(!isHF(eta,d+1)) continue;
754  float val=BadEnergy_val[d]->GetBinContent(eta+1,phi+1);
755  if(val==0) continue;
756  HcalDetId hcalid(HcalForward,ieta,phi+1,d+1);
757  HcalFrontEndId lmap_entry=lmap.getHcalFrontEndId(hcalid);
758  HcalElectronicsId emap_entry=emap.lookup(hcalid);
759  sprintf(str,"Energy/Ref=%.2f",val);
760  printTableLine(badEnergy,cnt++,hcalid,lmap_entry,emap_entry,str);
761  }
762  }
763  }
764 
765  printTableTail(badTiming);
766  badTiming.close();
767  printTableTail(badEnergy);
768  badEnergy.close();
769 
771  ofstream htmlFile;
772  string outfile=htmlDir+name_+".html";
773  htmlFile.open(outfile.c_str());
775  gROOT->SetBatch(true);
776  gStyle->SetCanvasColor(0);
777  gStyle->SetPadColor(0);
778  gStyle->SetOptStat(111110);
779  gStyle->SetPalette(1);
780  TCanvas *can=new TCanvas("HcalDetDiagLaserClient","HcalDetDiagLaserClient",0,0,500,350);
781  can->cd();
782 
783  if(Raddam[0]->GetEntries()>0){
784  ofstream RADDAM;
785  RADDAM.open((htmlDir + "RADDAM_"+name_).c_str());
786  RADDAM << "</html><html xmlns=\"http://www.w3.org/1999/xhtml\">"<< endl;
787  RADDAM << "<head>"<< endl;
788  RADDAM << "<meta http-equiv=\"Content-Type\" content=\"text/html\"/>"<< endl;
789  RADDAM << "<title>"<< "RADDAM channels" <<"</title>"<< endl;
790  RADDAM << "<style type=\"text/css\">"<< endl;
791  RADDAM << " body,td{ background-color: #FFFFCC; font-family: arial, arial ce, helvetica; font-size: 12px; }"<< endl;
792  RADDAM << " td.s0 { font-family: arial, arial ce, helvetica; }"<< endl;
793  RADDAM << " td.s1 { font-family: arial, arial ce, helvetica; font-weight: bold; background-color: #FFC169; text-align: center;}"<< endl;
794  RADDAM << " td.s2 { font-family: arial, arial ce, helvetica; background-color: #eeeeee; }"<< endl;
795  RADDAM << " td.s3 { font-family: arial, arial ce, helvetica; background-color: #d0d0d0; }"<< endl;
796  RADDAM << " td.s4 { font-family: arial, arial ce, helvetica; background-color: #FFC169; }"<< endl;
797  RADDAM << "</style>"<< endl;
798  RADDAM << "<body>"<< endl;
799  RADDAM << "<h2>Run "<< runNo<<": RADDAM channels event shape </h2>" << endl;
800  RADDAM << "<table>"<< endl;
801 
802  char str[100];
803  for(int i=0;i<28;i++){
804  RADDAM << "<tr align=\"left\">" << endl;
805  //Raddam[2*i]->SetStats(0);
806  //Raddam[2*i+1]->SetStats(0);
807  Raddam[2*i]->Draw(); sprintf(str,"%02d",2*i); can->SaveAs((htmlDir + "raddam_ch"+str+".gif").c_str());
808  Raddam[2*i+1]->Draw(); sprintf(str,"%02d",2*i+1); can->SaveAs((htmlDir + "raddam_ch"+str+".gif").c_str());
809  sprintf(str,"raddam_ch%02d.gif",2*i);
810  RADDAM << "<td align=\"center\"><img src=\""<<str<<"\" alt=\"raddam channel\"> </td>" << endl;
811  sprintf(str,"raddam_ch%02d.gif",2*i+1);
812  RADDAM << "<td align=\"center\"><img src=\""<<str<<"\" alt=\"raddam channel\"> </td>" << endl;
813  RADDAM << "</tr>" << endl;
814  }
815 
816  RADDAM << "</table>"<< endl;
817  RADDAM << "</body>"<< endl;
818  RADDAM << "</html>"<< endl;
819  RADDAM.close();
820  }
821 
822  Time2Dhbhehf->SetXTitle("i#eta");
823  Time2Dhbhehf->SetYTitle("i#phi");
824  Time2Dho->SetXTitle("i#eta");
825  Time2Dho->SetYTitle("i#phi");
826  Energy2Dhbhehf->SetXTitle("i#eta");
827  Energy2Dhbhehf->SetYTitle("i#phi");
828  Energy2Dho->SetXTitle("i#eta");
829  Energy2Dho->SetYTitle("i#phi");
830  refTime2Dhbhehf->SetXTitle("i#eta");
831  refTime2Dhbhehf->SetYTitle("i#phi");
832  refTime2Dho->SetXTitle("i#eta");
833  refTime2Dho->SetYTitle("i#phi");
834  refEnergy2Dhbhehf->SetXTitle("i#eta");
835  refEnergy2Dhbhehf->SetYTitle("i#phi");
836  refEnergy2Dho->SetXTitle("i#eta");
837  refEnergy2Dho->SetYTitle("i#phi");
838  refTime2Dhbhehf->SetMinimum(0);
839  refTime2Dhbhehf->SetMaximum(2);
840  refTime2Dho->SetMinimum(0);
841  refTime2Dho->SetMaximum(2);
842  refEnergy2Dhbhehf->SetMinimum(0.5);
843  refEnergy2Dhbhehf->SetMaximum(1.5);
844  refEnergy2Dho->SetMinimum(0.5);
845  refEnergy2Dho->SetMaximum(1.5);
846 
847  Time2Dhbhehf->SetNdivisions(36,"Y");
848  Time2Dho->SetNdivisions(36,"Y");
849  Energy2Dhbhehf->SetNdivisions(36,"Y");
850  Energy2Dho->SetNdivisions(36,"Y");
851  refTime2Dhbhehf->SetNdivisions(36,"Y");
852  refTime2Dho->SetNdivisions(36,"Y");
853  refEnergy2Dhbhehf->SetNdivisions(36,"Y");
854  refEnergy2Dho->SetNdivisions(36,"Y");
855 
856  // html page header
857  htmlFile << "<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\"> " << endl;
858  htmlFile << "<html> " << endl;
859  htmlFile << "<head> " << endl;
860  htmlFile << " <meta content=\"text/html; charset=ISO-8859-1\" " << endl;
861  htmlFile << " http-equiv=\"content-type\"> " << endl;
862  htmlFile << " <title>Detector Diagnostics Laser Monitor</title> " << endl;
863  htmlFile << "</head> " << endl;
864  htmlFile << "<style type=\"text/css\"> td { font-weight: bold } </style>" << endl;
865 
866  htmlFile << "<style type=\"text/css\">"<< endl;
867  htmlFile << " td.s0 { font-family: arial, arial ce, helvetica; font-weight: bold; background-color: #FF7700; text-align: center;}"<< endl;
868  htmlFile << " td.s1 { font-family: arial, arial ce, helvetica; font-weight: bold; background-color: #FFC169; text-align: center;}"<< endl;
869  htmlFile << " td.s2 { font-family: arial, arial ce, helvetica; background-color: red; }"<< endl;
870  htmlFile << " td.s3 { font-family: arial, arial ce, helvetica; background-color: yellow; }"<< endl;
871  htmlFile << " td.s4 { font-family: arial, arial ce, helvetica; background-color: green; }"<< endl;
872  htmlFile << " td.s5 { font-family: arial, arial ce, helvetica; background-color: silver; }"<< endl;
873  std::string state[4]={"<td class=\"s2\" align=\"center\">",
874  "<td class=\"s3\" align=\"center\">",
875  "<td class=\"s4\" align=\"center\">",
876  "<td class=\"s5\" align=\"center\">"};
877  htmlFile << "</style>"<< endl;
878 
879  htmlFile << "<body> " << endl;
880  htmlFile << "<br> " << endl;
881  htmlFile << "<h2>Run:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" << endl;
882  htmlFile << "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span " << endl;
883  htmlFile << " style=\"color: rgb(0, 0, 153);\">" << runNo << "</span></h2>" << endl;
884  htmlFile << "<h2>Monitoring task:&nbsp;&nbsp;&nbsp;&nbsp; <span " << endl;
885  htmlFile << " style=\"color: rgb(0, 0, 153);\">Detector Diagnostics Laser Monitor</span></h2> " << endl;
886  htmlFile << "<h2>Events processed:&nbsp;&nbsp;&nbsp;&nbsp;<span " << endl;
887  htmlFile << " style=\"color: rgb(0, 0, 153);\">" << ievt_ << "</span></h2>" << endl;
888  htmlFile << "<hr>" << endl;
889 
890  htmlFile << "<table width=100% border=1>" << endl;
891  htmlFile << "<tr>" << endl;
892  htmlFile << "<td class=\"s0\" width=20% align=\"center\">SebDet</td>" << endl;
893  htmlFile << "<td class=\"s0\" width=20% align=\"center\">Bad Timing</td>" << endl;
894  htmlFile << "<td class=\"s0\" width=20% align=\"center\">Bad Energy</td>" << endl;
895  htmlFile << "</tr><tr>" << endl;
896  int ind1=0,ind2=0;
897  htmlFile << "<td class=\"s1\" align=\"center\">HB+</td>" << endl;
898  if(HBP[0]==0) ind1=2; if(HBP[0]>0 && HBP[0]<=12) ind1=1; if(HBP[0]>12) ind1=0;
899  if(HBP[1]==0) ind2=2; if(HBP[1]>0 && HBP[1]<=12) ind2=1; if(HBP[1]>12) ind2=0;
900  if(!HBpresent_) ind1=ind2=3;
901  htmlFile << state[ind1] << HBP[0] <<"</td>" << endl;
902  htmlFile << state[ind2] << HBP[1] <<"</td>" << endl;
903  htmlFile << "</tr><tr>" << endl;
904  htmlFile << "<td class=\"s1\" align=\"center\">HB-</td>" << endl;
905  if(HBM[0]==0) ind1=2; if(HBM[0]>0 && HBP[0]<=12) ind1=1; if(HBM[0]>12) ind1=0;
906  if(HBM[1]==0) ind2=2; if(HBM[1]>0 && HBP[1]<=12) ind2=1; if(HBM[1]>12) ind2=0;
907  if(!HBpresent_) ind1=ind2=3;
908  htmlFile << state[ind1] << HBM[0] <<"</td>" << endl;
909  htmlFile << state[ind2] << HBM[1] <<"</td>" << endl;
910  htmlFile << "</tr><tr>" << endl;
911  htmlFile << "<td class=\"s1\" align=\"center\">HE+</td>" << endl;
912  if(HEP[0]==0) ind1=2; if(HEP[0]>0 && HEP[0]<=12) ind1=1; if(HEP[0]>12) ind1=0;
913  if(HEP[1]==0) ind2=2; if(HEP[1]>0 && HEP[1]<=12) ind2=1; if(HEP[1]>12) ind2=0;
914  if(!HEpresent_) ind1=ind2=3;
915  if(ind1==0 || ind2==0) status|=2; else if(ind1==1 || ind2==1) status|=1;
916  htmlFile << state[ind1] << HEP[0] <<"</td>" << endl;
917  htmlFile << state[ind2] << HEP[1] <<"</td>" << endl;
918  htmlFile << "</tr><tr>" << endl;
919  htmlFile << "<td class=\"s1\" align=\"center\">HE-</td>" << endl;
920  if(HEM[0]==0) ind1=2; if(HEM[0]>0 && HEM[0]<=12) ind1=1; if(HEM[0]>12) ind1=0;
921  if(HEM[1]==0) ind2=2; if(HEM[1]>0 && HEM[1]<=12) ind2=1; if(HEM[1]>12) ind2=0;
922  if(!HEpresent_) ind1=ind2=3;
923  if(ind1==0 || ind2==0) status|=2; else if(ind1==1 || ind2==1) status|=1;
924  htmlFile << state[ind1] << HEM[0] <<"</td>" << endl;
925  htmlFile << state[ind2] << HEM[1] <<"</td>" << endl;
926  htmlFile << "</tr><tr>" << endl;
927  htmlFile << "<td class=\"s1\" align=\"center\">HF+</td>" << endl;
928  if(HFP[0]==0) ind1=2; if(HFP[0]>0 && HFP[0]<=12) ind1=1; if(HFP[0]>12) ind1=0;
929  if(HFP[1]==0) ind2=2; if(HFP[1]>0 && HFP[1]<=12) ind2=1; if(HFP[1]>12) ind2=0;
930  if(!HOpresent_) ind1=ind2=3;
931  if(ind1==0 || ind2==0) status|=2; else if(ind1==1 || ind2==1) status|=1;
932  htmlFile << state[ind1] << HFP[0] <<"</td>" << endl;
933  htmlFile << state[ind2] << HFP[1] <<"</td>" << endl;
934  htmlFile << "</tr><tr>" << endl;
935  htmlFile << "<td class=\"s1\" align=\"center\">HF-</td>" << endl;
936  if(HFM[0]==0) ind1=2; if(HFM[0]>0 && HFM[0]<=12) ind1=1; if(HFM[0]>12) ind1=0;
937  if(HFM[1]==0) ind2=2; if(HFM[1]>0 && HFM[1]<=12) ind2=1; if(HFM[1]>12) ind2=0;
938  if(!HFpresent_) ind1=ind2=3;
939  if(ind1==0 || ind2==0) status|=2; else if(ind1==1 || ind2==1) status|=1;
940  htmlFile << state[ind1] << HFM[0] <<"</td>" << endl;
941  htmlFile << state[ind2] << HFM[1] <<"</td>" << endl;
942  htmlFile << "</tr><tr>" << endl;
943  htmlFile << "<td class=\"s1\" align=\"center\">HO</td>" << endl;
944  if(HO[0]==0) ind1=2; if(HO[0]>0 && HO[0]<=12) ind1=1; if(HO[0]>12) ind1=0;
945  if(HO[1]==0) ind2=2; if(HO[1]>0 && HO[1]<=12) ind2=1; if(HO[1]>12) ind2=0;
946  if(!HFpresent_) ind1=ind2=3;
947  if(ind1==0 || ind2==0) status|=2; else if(ind1==1 || ind2==1) status|=1;
948  htmlFile << state[ind1] << HO[0] <<"</td>" << endl;
949  htmlFile << state[ind2] << HO[1] <<"</td>" << endl;
950 
951  htmlFile << "</tr></table>" << endl;
952  htmlFile << "<hr>" << endl;
953 
954  if((badT+badE)>0){
955  htmlFile << "<table width=100% border=1><tr>" << endl;
956  if(badT>0) htmlFile << "<td><a href=\"" << "bad_timing_table.html" <<"\">list of bad timing channels</a></td>";
957  if(badE>0) htmlFile << "<td><a href=\"" << "bad_energy_table.html" <<"\">list of bad energy channels</a></td>";
958  htmlFile << "</tr></table>" << endl;
959  }
960 
962 
963  if(Raddam[0]->GetEntries()>0){
964  htmlFile << "<h2 align=\"center\"><a href=\"" << ("RADDAM_"+name_).c_str() <<"\">RADDAM channels</a><h2>";
965  htmlFile << "<hr>" << endl;
966  }
967 
968  htmlFile << "<h2 align=\"center\">Stability Laser plots (Reference run "<<ref_run<<")</h2>" << endl;
969  htmlFile << "<table width=100% border=0><tr>" << endl;
970 
971  can->SetGridy();
972  can->SetGridx();
973 
974  htmlFile << "<tr align=\"left\">" << endl;
975  refTime2Dhbhehf->SetStats(0);
976  refTime2Dho->SetStats(0);
977  refTime2Dhbhehf->Draw("COLZ"); can->SaveAs((htmlDir + "ref_laser_timing_hbhehf.gif").c_str());
978  refTime2Dho->Draw("COLZ"); can->SaveAs((htmlDir + "ref_laser_timing_ho.gif").c_str());
979  htmlFile << "<td align=\"center\"><img src=\"ref_laser_timing_hbhehf.gif\" alt=\"ref laser timing distribution\"> </td>" << endl;
980  htmlFile << "<td align=\"center\"><img src=\"ref_laser_timing_ho.gif\" alt=\"ref laser timing distribution\"> </td>" << endl;
981  htmlFile << "</tr>" << endl;
982 
983 
984  if(hb!=0 && he!=0 && ho!=0 && hf!=0){
985  hb->SetMarkerStyle(22);
986  hb->SetMarkerColor(kRed);
987  hb->GetYaxis()->SetRangeUser(hb->GetMinimum()-1,hb->GetMaximum()+1);
988  hb->GetXaxis()->SetNdivisions(520);
989 
990  he->SetMarkerStyle(22);
991  he->SetMarkerColor(kRed);
992  he->GetYaxis()->SetRangeUser(he->GetMinimum()-1,he->GetMaximum()+1);
993  he->GetXaxis()->SetNdivisions(520);
994 
995  ho->SetMarkerStyle(22);
996  ho->SetMarkerColor(kRed);
997  ho->GetYaxis()->SetRangeUser(ho->GetMinimum()-1,ho->GetMaximum()+1);
998  ho->GetXaxis()->SetNdivisions(520);
999 
1000  hf->SetMarkerStyle(22);
1001  hf->SetMarkerColor(kRed);
1002  hf->GetYaxis()->SetRangeUser(hf->GetMinimum()-1,hf->GetMaximum()+1);
1003  hf->GetXaxis()->SetNdivisions(520);
1004  hb->SetStats(0);
1005  he->SetStats(0);
1006  ho->SetStats(0);
1007  hf->SetStats(0);
1008 
1009 
1010  hb->GetXaxis()->SetBit(TAxis::kLabelsVert);
1011  he->GetXaxis()->SetBit(TAxis::kLabelsVert);
1012  ho->GetXaxis()->SetBit(TAxis::kLabelsVert);
1013  hf->GetXaxis()->SetBit(TAxis::kLabelsVert);
1014  hb->GetXaxis()->SetLabelSize(0.05);
1015  he->GetXaxis()->SetLabelSize(0.05);
1016  ho->GetXaxis()->SetLabelSize(0.05);
1017  hf->GetXaxis()->SetLabelSize(0.05);
1018 
1019 
1020  htmlFile << "<tr align=\"left\">" << endl;
1021  htmlFile << "<td align=\"center\"><img src=\"hb_rbx_timing1D.gif\" alt=\"rbx timing\"> </td>" << endl;
1022  htmlFile << "<td align=\"center\"><img src=\"he_rbx_timing1D.gif\" alt=\"rbx timing\"> </td>" << endl;
1023  htmlFile << "</tr>" << endl;
1024  htmlFile << "<tr align=\"left\">" << endl;
1025  htmlFile << "<td align=\"center\"><img src=\"ho_rbx_timing1D.gif\" alt=\"rbx timing\"> </td>" << endl;
1026  htmlFile << "<td align=\"center\"><img src=\"hf_rbx_timing1D.gif\" alt=\"rbx timing\"> </td>" << endl;
1027  htmlFile << "</tr>" << endl;
1028  }else printf("Error\n");
1029 
1030 
1031 
1032  htmlFile << "<tr align=\"left\">" << endl;
1033  refEnergy2Dhbhehf->SetStats(0);
1034  refEnergy2Dho->SetStats(0);
1035  refEnergy2Dhbhehf->Draw("COLZ"); can->SaveAs((htmlDir + "ref_laser_energy_hbhehf.gif").c_str());
1036  refEnergy2Dho->Draw("COLZ"); can->SaveAs((htmlDir + "ref_laser_energy_ho.gif").c_str());
1037  htmlFile << "<td align=\"center\"><img src=\"ref_laser_energy_hbhehf.gif\" alt=\"ref laser energy distribution\"> </td>" << endl;
1038  htmlFile << "<td align=\"center\"><img src=\"ref_laser_energy_ho.gif\" alt=\"ref laser energy distribution\"> </td>" << endl;
1039  htmlFile << "</tr>" << endl;
1040 
1041  htmlFile << "</table>" << endl;
1042 
1043 
1044  htmlFile << "<h2 align=\"center\">Summary Laser plots</h2>" << endl;
1045  htmlFile << "<table width=100% border=0><tr>" << endl;
1046  htmlFile << "<tr align=\"left\">" << endl;
1047  Time2Dhbhehf->SetStats(0);
1048  Time2Dho->SetStats(0);
1049  Time2Dhbhehf->Draw("COLZ"); can->SaveAs((htmlDir + "laser_timing_hbhehf.gif").c_str());
1050  Time2Dho->Draw("COLZ"); can->SaveAs((htmlDir + "laser_timing_ho.gif").c_str());
1051  htmlFile << "<td align=\"center\"><img src=\"laser_timing_hbhehf.gif\" alt=\"laser timing distribution\"> </td>" << endl;
1052  htmlFile << "<td align=\"center\"><img src=\"laser_timing_ho.gif\" alt=\"laser timing distribution\"> </td>" << endl;
1053  htmlFile << "</tr>" << endl;
1054 
1055  htmlFile << "<tr align=\"left\">" << endl;
1056  Energy2Dhbhehf->SetStats(0);
1057  Energy2Dho->SetStats(0);
1058  Energy2Dhbhehf->Draw("COLZ"); can->SaveAs((htmlDir + "laser_energy_hbhehf.gif").c_str());
1059  Energy2Dho->Draw("COLZ"); can->SaveAs((htmlDir + "laser_energy_ho.gif").c_str());
1060  htmlFile << "<td align=\"center\"><img src=\"laser_energy_hbhehf.gif\" alt=\"laser energy distribution\"> </td>" << endl;
1061  htmlFile << "<td align=\"center\"><img src=\"laser_energy_ho.gif\" alt=\"laser energy distribution\"> </td>" << endl;
1062  htmlFile << "</tr>" << endl;
1063 
1064 
1065  htmlFile << "<tr align=\"left\">" << endl;
1066  hbheEnergy->Draw(); can->SaveAs((htmlDir + "hbhe_laser_energy_distribution.gif").c_str());
1067  hbheEnergyRMS->Draw(); can->SaveAs((htmlDir + "hbhe_laser_energy_rms_distribution.gif").c_str());
1068  htmlFile << "<td align=\"center\"><img src=\"hbhe_laser_energy_distribution.gif\" alt=\"hbhe laser energy distribution\"> </td>" << endl;
1069  htmlFile << "<td align=\"center\"><img src=\"hbhe_laser_energy_rms_distribution.gif\" alt=\"hbhelaser energy rms distribution\"> </td>" << endl;
1070  htmlFile << "</tr>" << endl;
1071  htmlFile << "<tr align=\"left\">" << endl;
1072  hbheTiming->Draw(); can->SaveAs((htmlDir + "hbhe_laser_timing_distribution.gif").c_str());
1073  hbheTimingRMS->Draw(); can->SaveAs((htmlDir + "hbhe_laser_timing_rms_distribution.gif").c_str());
1074  htmlFile << "<td align=\"center\"><img src=\"hbhe_laser_timing_distribution.gif\" alt=\"hbhe laser timing distribution\"> </td>" << endl;
1075  htmlFile << "<td align=\"center\"><img src=\"hbhe_laser_timing_rms_distribution.gif\" alt=\"hbhe laser timing rms distribution\"> </td>" << endl;
1076  htmlFile << "</tr>" << endl;
1077 
1078  htmlFile << "<tr align=\"left\">" << endl;
1079  hoEnergy->Draw(); can->SaveAs((htmlDir + "ho_laser_energy_distribution.gif").c_str());
1080  hoEnergyRMS->Draw(); can->SaveAs((htmlDir + "ho_laser_energy_rms_distribution.gif").c_str());
1081  htmlFile << "<td align=\"center\"><img src=\"ho_laser_energy_distribution.gif\" alt=\"ho laser energy distribution\"> </td>" << endl;
1082  htmlFile << "<td align=\"center\"><img src=\"ho_laser_energy_rms_distribution.gif\" alt=\"ho laser energy rms distribution\"> </td>" << endl;
1083  htmlFile << "</tr>" << endl;
1084  htmlFile << "<tr align=\"left\">" << endl;
1085  hoTiming->Draw(); can->SaveAs((htmlDir + "ho_laser_timing_distribution.gif").c_str());
1086  hoTimingRMS->Draw(); can->SaveAs((htmlDir + "ho_laser_timing_rms_distribution.gif").c_str());
1087  htmlFile << "<td align=\"center\"><img src=\"ho_laser_timing_distribution.gif\" alt=\"ho laser timing distribution\"> </td>" << endl;
1088  htmlFile << "<td align=\"center\"><img src=\"ho_laser_timing_rms_distribution.gif\" alt=\"ho laser timing rms distribution\"> </td>" << endl;
1089 
1090  htmlFile << "</tr>" << endl;
1091  htmlFile << "<tr align=\"left\">" << endl;
1092  hfEnergy->Draw(); can->SaveAs((htmlDir + "hf_laser_energy_distribution.gif").c_str());
1093  hfEnergyRMS->Draw(); can->SaveAs((htmlDir + "hf_laser_energy_rms_distribution.gif").c_str());
1094  htmlFile << "<td align=\"center\"><img src=\"hf_laser_energy_distribution.gif\" alt=\"hf laser energy distribution\"> </td>" << endl;
1095  htmlFile << "<td align=\"center\"><img src=\"hf_laser_energy_rms_distribution.gif\" alt=\"hf laser energy rms distribution\"> </td>" << endl;
1096  htmlFile << "</tr>" << endl;
1097  htmlFile << "<tr align=\"left\">" << endl;
1098  hfTiming->Draw(); can->SaveAs((htmlDir + "hf_laser_timing_distribution.gif").c_str());
1099  hfTimingRMS->Draw(); can->SaveAs((htmlDir + "hf_laser_timing_rms_distribution.gif").c_str());
1100  htmlFile << "<td align=\"center\"><img src=\"hf_laser_timing_distribution.gif\" alt=\"hf laser timing distribution\"> </td>" << endl;
1101  htmlFile << "<td align=\"center\"><img src=\"hf_laser_timing_rms_distribution.gif\" alt=\"hf laser timing rms distribution\"> </td>" << endl;
1102  htmlFile << "</tr>" << endl;
1103 
1104  can->SetBottomMargin(0.2);
1105  if(hb->GetEntries()>0)hb->Draw("P");else hb->Draw(); can->SaveAs((htmlDir + "hb_rbx_timing1D.gif").c_str());
1106  if(he->GetEntries()>0)he->Draw("P");else he->Draw(); can->SaveAs((htmlDir + "he_rbx_timing1D.gif").c_str());
1107  if(ho->GetEntries()>0)ho->Draw("P");else ho->Draw(); can->SaveAs((htmlDir + "ho_rbx_timing1D.gif").c_str());
1108  if(hf->GetEntries()>0)hf->Draw("P");else hf->Draw(); can->SaveAs((htmlDir + "hf_rbx_timing1D.gif").c_str());
1109 
1110  htmlFile << "</table>" << endl;
1111 
1112  htmlFile << "</body> " << endl;
1113  htmlFile << "</html> " << endl;
1114  can->Close();
1116  htmlFile.close();
1117  return;
1118 }
bool isHO(int etabin, int depth)
int i
Definition: DBlmapReader.cc:9
static void printTableHeader(ofstream &file, std::string header)
std::string name()
std::vector< std::string > HcalEtaPhiHistNames()
bool isHE(int etabin, int depth)
T eta() const
static void printTableLine(ofstream &file, int ind, HcalDetId &detid, HcalFrontEndId &lmap_entry, HcalElectronicsId &emap_entry, std::string comment="")
Raddam_ch RADDAM_CH[56]
HcalLogicalMap createMap(unsigned int mapIOV=4)
list outfile
Definition: EdgesToViz.py:91
HcalSubdetector
Definition: HcalAssistant.h:32
MonitorElement * get(const std::string &path) const
get ME from full pathname (e.g. &quot;my/long/dir/my_histo&quot;)
Definition: DQMStore.cc:1270
bool isHB(int etabin, int depth)
int CalcIeta(int subdet, int eta, int depth)
std::string valueString(void) const
bool isHF(int etabin, int depth)
int64_t getIntValue(void) const
std::string subdir_
std::map< HcalDetId, unsigned int > badstatusmap
char state
Definition: procUtils.cc:75
std::string prefixME_
tuple cout
Definition: gather_cfg.py:41
static void printTableTail(ofstream &file)
string s
Definition: asciidump.py:422
Readout chain identification for Hcal [31:26] Unused (so far) [25] Trigger-chain id flag [24:20] Read...
DQMStore * dqmStore_
Definition: DDAxes.h:10
void HcalDetDiagLaserClient::setup ( void  )
virtual

Reimplemented from HcalBaseDQClient.

Definition at line 240 of file HcalDetDiagLaserClient.cc.

240 {}
bool HcalDetDiagLaserClient::test_enabled ( void  )
virtual

Reimplemented from HcalBaseDQClient.

Definition at line 284 of file HcalDetDiagLaserClient.cc.

284 {return true;}
void HcalDetDiagLaserClient::updateChannelStatus ( std::map< HcalDetId, unsigned int > &  myqual)
virtual

Reimplemented from HcalBaseDQClient.

Definition at line 287 of file HcalDetDiagLaserClient.cc.

288 {
289  // This gets called by HcalMonitorClient
290  // trigger primitives don't yet contribute to channel status (though they could...)
291  // see dead or hot cell code for an example
292 
293 } //void HcalDetDiagLaserClient::updateChannelStatus
bool HcalDetDiagLaserClient::validHtmlOutput ( )
virtual

Reimplemented from HcalBaseDQClient.

Definition at line 365 of file HcalDetDiagLaserClient.cc.

References n, asciidump::s, and MonitorElement::valueString().

365  {
366  string s=subdir_+"HcalDetDiagLaserMonitor Event Number";
367  MonitorElement *me = dqmStore_->get(s.c_str());
368  int n=0;
369  if ( me ) {
370  s = me->valueString();
371  sscanf((s.substr(2,s.length()-2)).c_str(), "%d", &n);
372  }
373  if(n<100) return false;
374  return true;
375 }
MonitorElement * get(const std::string &path) const
get ME from full pathname (e.g. &quot;my/long/dir/my_histo&quot;)
Definition: DQMStore.cc:1270
std::string valueString(void) const
std::string subdir_
string s
Definition: asciidump.py:422
DQMStore * dqmStore_

Member Data Documentation

int HcalDetDiagLaserClient::nevts_
private

Definition at line 37 of file HcalDetDiagLaserClient.h.

int HcalDetDiagLaserClient::status
private

Definition at line 38 of file HcalDetDiagLaserClient.h.