CMS 3D CMS Logo

Public Member Functions | Private Member Functions | Private Attributes

ZDCMonitorClient Class Reference

#include <ZDCMonitorClient.h>

Inheritance diagram for ZDCMonitorClient:
edm::EDAnalyzer

List of all members.

Public Member Functions

void analyze (void)
 Analyze.
void analyze (const edm::Event &evt, const edm::EventSetup &es)
void beginJob ()
 BeginJob.
void beginLuminosityBlock (const edm::LuminosityBlock &l, const edm::EventSetup &c)
 BeginLumiBlock.
void beginRun (const edm::Run &r, const edm::EventSetup &c)
 BeginRun.
void createTests (void)
 Create tests.
void dumpHistograms (int &runNum, std::vector< TH1F * > &hist1d, std::vector< TH2F * > &hist2d)
void endJob (void)
 EndJob.
void endLuminosityBlock (const edm::LuminosityBlock &l, const edm::EventSetup &c)
 EndLumiBlock.
void endRun (const edm::Run &r, const edm::EventSetup &c)
 EndRun.
void errorSummary ()
 Generate error summary.
void htmlOutput (void)
 HtmlOutput.
void initialize (const edm::ParameterSet &ps)
void loadHistograms (TFile *infile, const char *fname)
void offlineSetup ()
bool prescale ()
 Boolean prescale test for this event.
void report (bool update)
 Create reports.
void resetAllME (void)
 reset all monitor elements
 ZDCMonitorClient (const edm::ParameterSet &ps)
 ZDCMonitorClient ()
 Constructors.
 ~ZDCMonitorClient ()
 Destructor.

Private Member Functions

void removeAllME (void)
void writeDBfile ()

Private Attributes

std::string baseHtmlDir_
edm::CPUTimer cpu_timer
DQMStoredbe_
 Connection to the DQM backend.
int debug_
 Verbosity switch used for debugging or informational output.
bool enableMonitorDaemon_
int ievent_
int ievt_
int ilumisec_
std::string inputFile_
int irun_
int itime_
int maxlumisec_
int minlumisec_
std::string monitorName_
 units of "updates", TBD
time_t mytime_
int nlumisecs_
 counters and flags
bool Online_
int prescaleEvt_
int prescaleLS_
 units of events
int prescaleTime_
 units of lumi sections
int prescaleUpdate_
 units of minutes
struct {
   double   elapsedTime
   double   startTime
   timeval   startTV
   double   updateTime
   timeval   updateTV
psTime_
int resetEvents_
int resetLS_
std::string rootFolder_
bool runningStandalone_
bool saved_
bool showTiming_

Detailed Description

Definition at line 18 of file ZDCMonitorClient.h.


Constructor & Destructor Documentation

ZDCMonitorClient::ZDCMonitorClient ( )

Constructors.

Definition at line 41 of file ZDCMonitorClient.cc.

{}
ZDCMonitorClient::ZDCMonitorClient ( const edm::ParameterSet ps)

Definition at line 37 of file ZDCMonitorClient.cc.

References initialize().

                                                           {
  initialize(ps);
}
ZDCMonitorClient::~ZDCMonitorClient ( )

Destructor.

Definition at line 44 of file ZDCMonitorClient.cc.

References gather_cfg::cout, and debug_.

                                   {

  if (debug_>0) std::cout << "ZDCMonitorClient: Exit ..." << std::endl;
}

Member Function Documentation

void ZDCMonitorClient::analyze ( void  )

Analyze.

Definition at line 399 of file ZDCMonitorClient.cc.

References gather_cfg::cout, createTests(), dbe_, debug_, errorSummary(), and DQMStore::runQTests().

Referenced by analyze(), endLuminosityBlock(), and endRun().

                              {
  if (debug_>0) 
    std::cout <<"<ZDCMonitorClient> Entered ZDCMonitorClient::analyze()"<<std::endl;
  if(debug_>1) std::cout<<"\nZDC Monitor Client heartbeat...."<<std::endl;
  
  createTests();  
  //mui_->doMonitoring();
  dbe_->runQTests();
  errorSummary();


  return;
  }
void ZDCMonitorClient::analyze ( const edm::Event evt,
const edm::EventSetup es 
) [virtual]

Implements edm::EDAnalyzer.

Definition at line 362 of file ZDCMonitorClient.cc.

References analyze(), gather_cfg::cout, debug_, edm::EventID::event(), edm::EventBase::id(), ievent_, ievt_, ilumisec_, irun_, itime_, edm::EventBase::luminosityBlock(), max(), maxlumisec_, min, minlumisec_, mytime_, prescale(), prescaleEvt_, resetAllME(), resetEvents_, resetLS_, edm::EventID::run(), runningStandalone_, edm::EventBase::time(), and edm::Timestamp::value().

                                                                                {

  if (debug_>1)
    std::cout <<"Entered ZDCMonitorClient::analyze(const Evt...)"<<std::endl;
  
  if(resetEvents_>0 && (ievt_%resetEvents_)==0) resetAllME(); // use ievt_ here, not ievent_, since ievent is the event #, not the # of events processed
  if(resetLS_>0 && (ilumisec_%resetLS_)==0) resetAllME();

  // environment datamembers

  // Don't process out-of-order lumi block information in online running
  //if (Online_ && (int)e.luminosityBlock()<ilumisec_) return;
  irun_     = e.id().run();
  ilumisec_ = e.luminosityBlock();
  ievent_   = e.id().event();
  itime_    = e.time().value();
  mytime_   = (e.time().value())>>32;

  if (minlumisec_==0)
    minlumisec_=ilumisec_;
  minlumisec_=std::min(minlumisec_,ilumisec_);
  maxlumisec_=std::max(maxlumisec_,ilumisec_);

  if (debug_>1) 
    std::cout << "ZDCMonitorClient: evts: "<< ievt_ << ", run: " << irun_ << ", LS: " << ilumisec_ << ", evt: " << ievent_ << ", time: " << itime_ << std::endl; 
  
  ievt_++; 

  if ( runningStandalone_) return;

  // run if we want to check individual events, and if this event isn't prescaled
  if (prescaleEvt_>0 && !prescale()) 
    analyze();
}
void ZDCMonitorClient::beginJob ( void  ) [virtual]

BeginJob.

Reimplemented from edm::EDAnalyzer.

Definition at line 154 of file ZDCMonitorClient.cc.

References gather_cfg::cout, debug_, and ievt_.

                               {

  if( debug_>0 ) std::cout << "ZDCMonitorClient: beginJob" << std::endl;
  
  ievt_ = 0;
 
  return;
}
void ZDCMonitorClient::beginLuminosityBlock ( const edm::LuminosityBlock l,
const edm::EventSetup c 
) [virtual]

BeginLumiBlock.

Reimplemented from edm::EDAnalyzer.

Definition at line 336 of file ZDCMonitorClient.cc.

References gather_cfg::cout, debug_, ilumisec_, and edm::LuminosityBlockBase::luminosityBlock().

{
  // don't allow 'backsliding' across lumi blocks in online running
  // This still won't prevent some lumi blocks from being evaluated multiple times.  Need to think about this.
  //if (Online_ && (int)l.luminosityBlock()<ilumisec_) return;
  if (debug_>0) std::cout <<"Entered Monitor Client beginLuminosityBlock for LS = "<<l.luminosityBlock()<<std::endl;
  ilumisec_ = l.luminosityBlock();
  if( debug_>0 ) std::cout << "ZDCMonitorClient: beginLuminosityBlock" << std::endl;
}
void ZDCMonitorClient::beginRun ( const edm::Run r,
const edm::EventSetup c 
) [virtual]

BeginRun.

Reimplemented from edm::EDAnalyzer.

Definition at line 164 of file ZDCMonitorClient.cc.

References DQMStore::book2D(), DQMStore::bookFloat(), gather_cfg::cout, dbe_, debug_, MonitorElement::Fill(), DQMStore::get(), MonitorElement::getName(), MonitorElement::getTH2F(), edm::RunBase::id(), DQMStore::removeElement(), rootFolder_, and DQMStore::setCurrentFolder().

                                                                       {

  if (debug_>0)
    std::cout << std::endl<<"ZDCMonitorClient: Standard beginRun() for run " << r.id().run() << std::endl<<std::endl;
 
  // Get current channel quality 
  /*
 edm::ESHandle<HcalChannelQuality> p;
  c.get<HcalChannelQualityRcd>().get(p);
  chanquality_= new HcalChannelQuality(*p.product());
  */

  std::string eventinfo="EventInfo";
  if (rootFolder_!="ZDC")
    eventinfo+="DUMMY";

  // Setup histograms -- this is all we will do for ZDC Monitor at the moment!
  MonitorElement* me; //JEFF
  dbe_->setCurrentFolder(rootFolder_+eventinfo.c_str()+"/");
  me=dbe_->get(rootFolder_+eventinfo.c_str()+"/reportSummary");
  if (me)
     dbe_->removeElement(me->getName());
  me = dbe_->bookFloat("reportSummary");
  me->Fill(-1); // set status to unknown at startup
  me=dbe_->get(rootFolder_+eventinfo.c_str()+"/reportSummaryMap");
  if (me)
    dbe_->removeElement(me->getName());
  me = dbe_->book2D("reportSummaryMap","ZDC Report Summary Map",4,0,4,1,0,1);
  TH2F* myhist=me->getTH2F();
  myhist->GetXaxis()->SetBinLabel(1,"HAD-");
  myhist->GetXaxis()->SetBinLabel(2,"EM-");
  myhist->GetXaxis()->SetBinLabel(3,"EM+");
  myhist->GetXaxis()->SetBinLabel(4,"HAD+");
  // Set all values to -1
  myhist->SetBinContent(1,1,-1);
  myhist->SetBinContent(2,1,-1);
  myhist->SetBinContent(3,1,-1);
  myhist->SetBinContent(4,1,-1);
  

  dbe_->setCurrentFolder(rootFolder_+eventinfo.c_str()+"/reportSummaryContents/");
  me=dbe_->get(rootFolder_+eventinfo.c_str()+"/reportSummary/reportSummaryContents/ZDC_HADMinus");
  if (me)
     dbe_->removeElement(me->getName());
  me = dbe_->bookFloat("ZDC_HADMinus");
  me->Fill(-1); // set status to unknown at startup
  me=dbe_->get(rootFolder_+eventinfo.c_str()+"/reportSummary/reportSummaryContents/ZDC_EMMinus");
  if (me)
     dbe_->removeElement(me->getName());
  me = dbe_->bookFloat("ZDC_EMMinus");
  me->Fill(-1); // set status to unknown at startup
  me=dbe_->get(rootFolder_+eventinfo.c_str()+"/reportSummary/reportSummaryContents/ZDC_EMPlus");
  if (me)
     dbe_->removeElement(me->getName());
  me = dbe_->bookFloat("ZDC_EMPlus");
  me->Fill(-1); // set status to unknown at startup
  me=dbe_->get(rootFolder_+eventinfo.c_str()+"/reportSummary/reportSummaryContents/ZDC_HADPlus");
  if (me)
     dbe_->removeElement(me->getName());
  me = dbe_->bookFloat("ZDC_HADPlus");
  me->Fill(-1); // set status to unknown at startup

  // Add dummy DAQ Summary, DCS Summary
  dbe_->setCurrentFolder(rootFolder_+eventinfo.c_str());
  me=dbe_->get(rootFolder_+eventinfo.c_str()+"/DAQSummary");
  if (me)
    dbe_->removeElement(me->getName());
  me = dbe_->bookFloat("DAQSummary");
  me->Fill(-1); // set status to unknown at startup

  dbe_->setCurrentFolder(rootFolder_+eventinfo.c_str()+"/DAQContents");
  me=dbe_->get(rootFolder_+eventinfo.c_str()+"/DAQSummary/DAQContents/ZDC_HADPlus");
  if (me)
    dbe_->removeElement(me->getName());
  me = dbe_->bookFloat("ZDC_HADPlus");
  me->Fill(-1); // set status to unknown at startup

  me=dbe_->get(rootFolder_+eventinfo.c_str()+"/DAQSummary/DAQContents/ZDC_HADMinus");
  if (me)
    dbe_->removeElement(me->getName());
  me = dbe_->bookFloat("ZDC_HADMinus");
  me->Fill(-1); // set status to unknown at startup

  me=dbe_->get(rootFolder_+eventinfo.c_str()+"/DAQSummary/DAQContents/ZDC_EMPlus");
  if (me)
    dbe_->removeElement(me->getName());
  me = dbe_->bookFloat("ZDC_EMPlus");
  me->Fill(-1); // set status to unknown at startup

  me=dbe_->get(rootFolder_+eventinfo.c_str()+"/DAQSummary/DAQContents/ZDC_EMMinus");
  if (me)
    dbe_->removeElement(me->getName());
  me = dbe_->bookFloat("ZDC_EMMinus");
  me->Fill(-1); // set status to unknown at startup

  // DCS Summary 
  dbe_->setCurrentFolder(rootFolder_+eventinfo.c_str());
  me=dbe_->get(rootFolder_+eventinfo.c_str()+"/DCSSummary");
  if (me)
    dbe_->removeElement(me->getName());
  me = dbe_->bookFloat("DCSSummary");
  me->Fill(-1); // set status to unknown at startup

  dbe_->setCurrentFolder(rootFolder_+eventinfo.c_str()+"/DCSContents");
  me=dbe_->get(rootFolder_+eventinfo.c_str()+"/DCSSummary/DCSContents/ZDC_HADPlus");
  if (me)
    dbe_->removeElement(me->getName());
  me = dbe_->bookFloat("ZDC_HADPlus");
  me->Fill(-1); // set status to unknown at startup

  me=dbe_->get(rootFolder_+eventinfo.c_str()+"/DCSSummary/DCSContents/ZDC_HADMinus");
  if (me)
    dbe_->removeElement(me->getName());
  me = dbe_->bookFloat("ZDC_HADMinus");
  me->Fill(-1); // set status to unknown at startup

  me=dbe_->get(rootFolder_+eventinfo.c_str()+"/DCSSummary/DCSContents/ZDC_EMPlus");
  if (me)
    dbe_->removeElement(me->getName());
  me = dbe_->bookFloat("ZDC_EMPlus");
  me->Fill(-1); // set status to unknown at startup

  me=dbe_->get(rootFolder_+eventinfo.c_str()+"/DCSSummary/DCSContents/ZDC_EMMinus");
  if (me)
    dbe_->removeElement(me->getName());
  me = dbe_->bookFloat("ZDC_EMMinus");
  me->Fill(-1); // set status to unknown at startup

}
void ZDCMonitorClient::createTests ( void  )

Create tests.

Definition at line 414 of file ZDCMonitorClient.cc.

References gather_cfg::cout, and debug_.

Referenced by analyze(), and report().

                                      {
  
  if( debug_>0 ) std::cout << "ZDCMonitorClient: creating all tests" << std::endl;
  return;
}
void ZDCMonitorClient::dumpHistograms ( int &  runNum,
std::vector< TH1F * > &  hist1d,
std::vector< TH2F * > &  hist2d 
)

Definition at line 474 of file ZDCMonitorClient.cc.

{
  hist1d.clear(); 
  hist2d.clear(); 
  return;
}
void ZDCMonitorClient::endJob ( void  ) [virtual]

EndJob.

Reimplemented from edm::EDAnalyzer.

Definition at line 296 of file ZDCMonitorClient.cc.

References gather_cfg::cout, debug_, and ievt_.

                                  {

  if( debug_>0 ) 
    std::cout << "ZDCMonitorClient: endJob, ievt = " << ievt_ << std::endl;

  return;
}
void ZDCMonitorClient::endLuminosityBlock ( const edm::LuminosityBlock l,
const edm::EventSetup c 
) [virtual]

EndLumiBlock.

Reimplemented from edm::EDAnalyzer.

Definition at line 347 of file ZDCMonitorClient.cc.

References analyze(), gather_cfg::cout, debug_, Online_, prescale(), and prescaleLS_.

                                                                                             {

  // don't allow backsliding in online running
  //if (Online_ && (int)l.luminosityBlock()<ilumisec_) return;
  if( debug_>0 ) std::cout << "ZDCMonitorClient: std::endluminosityBlock" << std::endl;
  if(prescaleLS_>0 && !prescale()){
    // do scheduled tasks...
    if (Online_)
      analyze();
  }

  return;
}
void ZDCMonitorClient::endRun ( const edm::Run r,
const edm::EventSetup c 
) [virtual]

EndRun.

Reimplemented from edm::EDAnalyzer.

Definition at line 305 of file ZDCMonitorClient.cc.

References analyze(), gather_cfg::cout, debug_, edm::RunBase::id(), ievt_, inputFile_, irun_, Online_, and report().

                                                                     {

  if (debug_>0)
    std::cout << std::endl<<"<ZDCMonitorClient> Standard endRun() for run " << r.id().run() << std::endl<<std::endl;

  if (!Online_)
    analyze();

  if( debug_ >0) std::cout <<"ZDCMonitorClient: processed events: "<<ievt_<<std::endl;

  if (debug_>0) std::cout <<"==>Creating report after run end condition"<<std::endl;
  if(irun_>1){
    if(inputFile_.size()!=0) report(true);
    else report(false);
  }

  // dumping to database

  // need to add separate function to do this!!!

  return;
}
void ZDCMonitorClient::errorSummary ( )

Generate error summary.

Definition at line 438 of file ZDCMonitorClient.cc.

References dbe_, MonitorElement::Fill(), DQMStore::get(), and rootFolder_.

Referenced by analyze(), and report().

                                   {
  

  float errorSummary = 1.0;
  
  char meTitle[256];
  sprintf(meTitle,"%sEventInfo/errorSummary",rootFolder_.c_str() );
  MonitorElement* me = dbe_->get(meTitle);
  if(me) me->Fill(errorSummary);
  
  return;
}
void ZDCMonitorClient::htmlOutput ( void  )

HtmlOutput.

Definition at line 378 of file HcalDetDiagLaserClient.cc.

References HcalObjRepresent::CalcIeta(), timingPdfMaker::can, gather_cfg::cout, HcalLogicalMapGenerator::createMap(), eta(), cmsDownloadME::gen, MonitorElement::getIntValue(), HcalBarrel, HcalEmpty, HcalEndcap, HcalEtaPhiHistNames(), HcalForward, HcalOuter, i, isHB(), isHE(), isHF(), isHO(), mergeVDriftHistosByStation::name, EdgesToViz::outfile, phi, prefixME_, printTableHeader(), printTableLine(), printTableTail(), asciidump::s, and ntuplemaker::status.

Referenced by report().

                                                     {
  if(dqmStore_==0){
      if (debug_>0) std::cout <<"<HcalDetDiagLaserClient::htmlOutput> dqmStore object does not exist!"<<std::endl;
      return;
  }
  if(debug_>2) std::cout <<"\t<HcalDetDiagLaserClient::htmlOutput>  Preparing html for task: "<<name_<<std::endl;

  HcalLogicalMapGenerator gen;
  HcalLogicalMap lmap(gen.createMap());
  HcalElectronicsMap emap=lmap.generateHcalElectronicsMap();

  string ref_run,s;
  MonitorElement* me;
  TH1F *hbheEnergy=0;
  TH1F *hbheTiming=0;
  TH1F *hbheEnergyRMS=0;
  TH1F *hbheTimingRMS=0;
  TH1F *hoEnergy=0;
  TH1F *hoTiming=0;
  TH1F *hoEnergyRMS=0;
  TH1F *hoTimingRMS=0;
  TH1F *hfEnergy=0;
  TH1F *hfTiming=0;
  TH1F *hfEnergyRMS=0;
  TH1F *hfTimingRMS=0;
  TH1F *hb=0;
  TH1F *he=0;
  TH1F *ho=0;
  TH1F *hf=0; 
  TH2F *Time2Dhbhehf=0;
  TH2F *Time2Dho=0;
  TH2F *Energy2Dhbhehf=0;
  TH2F *Energy2Dho=0;
  TH2F *refTime2Dhbhehf=0;
  TH2F *refTime2Dho=0;
  TH2F *refEnergy2Dhbhehf=0;
  TH2F *refEnergy2Dho=0;
  int HBpresent_=0,HEpresent_=0,HOpresent_=0,HFpresent_=0;

 
  me=dqmStore_->get(prefixME_+"HcalInfo/HBpresent");
  if(me!=0) HBpresent_=me->getIntValue();
  me=dqmStore_->get(prefixME_+"HcalInfo/HEpresent");
  if(me!=0) HEpresent_=me->getIntValue();
  me=dqmStore_->get(prefixME_+"HcalInfo/HOpresent");
  if(me!=0) HOpresent_=me->getIntValue();
  me=dqmStore_->get(prefixME_+"HcalInfo/HFpresent");
  if(me!=0) HFpresent_=me->getIntValue();

  s=subdir_+"Summary Plots/HBHE Laser Energy Distribution"; me=dqmStore_->get(s.c_str()); 
  if(me!=0) hbheEnergy=HcalUtilsClient::getHisto<TH1F*>(me, cloneME_, hbheEnergy, debug_);  else return;
  s=subdir_+"Summary Plots/HBHE Laser Timing Distribution"; me=dqmStore_->get(s.c_str());
  if(me!=0) hbheTiming=HcalUtilsClient::getHisto<TH1F*>(me, cloneME_, hbheTiming, debug_); else return;
  s=subdir_+"Summary Plots/HBHE Laser Energy RMS_div_Energy Distribution"; me=dqmStore_->get(s.c_str());
  if(me!=0) hbheEnergyRMS= HcalUtilsClient::getHisto<TH1F*>(me, cloneME_, hbheEnergyRMS, debug_); else return;
  s=subdir_+"Summary Plots/HBHE Laser Timing RMS Distribution"; me=dqmStore_->get(s.c_str());
  if(me!=0) hbheTimingRMS= HcalUtilsClient::getHisto<TH1F*>(me, cloneME_, hbheTimingRMS, debug_); else return;
  s=subdir_+"Summary Plots/HO Laser Energy Distribution"; me=dqmStore_->get(s.c_str());
  if(me!=0) hoEnergy = HcalUtilsClient::getHisto<TH1F*>(me, cloneME_, hoEnergy, debug_); else return;
  s=subdir_+"Summary Plots/HO Laser Timing Distribution"; me=dqmStore_->get(s.c_str());
  if(me!=0) hoTiming = HcalUtilsClient::getHisto<TH1F*>(me, cloneME_, hoTiming, debug_); else return;
  s=subdir_+"Summary Plots/HO Laser Energy RMS_div_Energy Distribution"; me=dqmStore_->get(s.c_str());
  if(me!=0) hoEnergyRMS = HcalUtilsClient::getHisto<TH1F*>(me, cloneME_, hoEnergyRMS, debug_); else return;
  s=subdir_+"Summary Plots/HO Laser Timing RMS Distribution"; me=dqmStore_->get(s.c_str());
  if(me!=0) hoTimingRMS  = HcalUtilsClient::getHisto<TH1F*>(me, cloneME_, hoTimingRMS, debug_); else return;
  s=subdir_+"Summary Plots/HF Laser Energy Distribution"; me=dqmStore_->get(s.c_str());
  if(me!=0) hfEnergy  = HcalUtilsClient::getHisto<TH1F*>(me, cloneME_, hfEnergy, debug_); else return;
  s=subdir_+"Summary Plots/HF Laser Timing Distribution"; me=dqmStore_->get(s.c_str());
  if(me!=0) hfTiming  = HcalUtilsClient::getHisto<TH1F*>(me, cloneME_, hfTiming, debug_); else return;
  s=subdir_+"Summary Plots/HF Laser Energy RMS_div_Energy Distribution"; me=dqmStore_->get(s.c_str());
  if(me!=0) hfEnergyRMS = HcalUtilsClient::getHisto<TH1F*>(me, cloneME_, hfEnergyRMS, debug_); else return;
  s=subdir_+"Summary Plots/HF Laser Timing RMS Distribution"; me=dqmStore_->get(s.c_str());
  if(me!=0) hfTimingRMS = HcalUtilsClient::getHisto<TH1F*>(me, cloneME_, hfTimingRMS, debug_); else return;

  s=subdir_+"Summary Plots/HB RBX average Time-Ref"; me=dqmStore_->get(s.c_str());
  if(me!=0) hb     = HcalUtilsClient::getHisto<TH1F*>(me, cloneME_, hb, debug_); else return;
  s=subdir_+"Summary Plots/HE RBX average Time-Ref"; me=dqmStore_->get(s.c_str());
  if(me!=0) he     = HcalUtilsClient::getHisto<TH1F*>(me, cloneME_, he, debug_); else return;
  s=subdir_+"Summary Plots/HO RBX average Time-Ref"; me=dqmStore_->get(s.c_str());
  if(me!=0) ho     = HcalUtilsClient::getHisto<TH1F*>(me, cloneME_, ho, debug_); else return;
  s=subdir_+"Summary Plots/HF RoBox average Time-Ref"; me=dqmStore_->get(s.c_str());
  if(me!=0) hf     = HcalUtilsClient::getHisto<TH1F*>(me, cloneME_, hf, debug_); else return;

  s=subdir_+"Summary Plots/Laser Timing HBHEHF"; me=dqmStore_->get(s.c_str());
  if(me!=0) Time2Dhbhehf  = HcalUtilsClient::getHisto<TH2F*>(me, cloneME_, Time2Dhbhehf, debug_); else return;
  s=subdir_+"Summary Plots/Laser Timing HO"; me=dqmStore_->get(s.c_str());
  if(me!=0) Time2Dho      = HcalUtilsClient::getHisto<TH2F*>(me, cloneME_, Time2Dho, debug_); else return;
  s=subdir_+"Summary Plots/Laser Energy HBHEHF"; me=dqmStore_->get(s.c_str());
  if(me!=0) Energy2Dhbhehf= HcalUtilsClient::getHisto<TH2F*>(me, cloneME_, Energy2Dhbhehf, debug_); else return;
  s=subdir_+"Summary Plots/Laser Energy HO"; me=dqmStore_->get(s.c_str());
  if(me!=0) Energy2Dho    = HcalUtilsClient::getHisto<TH2F*>(me, cloneME_, Energy2Dho, debug_); else return;
  s=subdir_+"Summary Plots/HBHEHF Laser (Timing-Ref)+1"; me=dqmStore_->get(s.c_str());
  if(me!=0) refTime2Dhbhehf  = HcalUtilsClient::getHisto<TH2F*>(me, cloneME_, refTime2Dhbhehf, debug_); else return;
  s=subdir_+"Summary Plots/HO Laser (Timing-Ref)+1"; me=dqmStore_->get(s.c_str());
  if(me!=0) refTime2Dho      = HcalUtilsClient::getHisto<TH2F*>(me, cloneME_, refTime2Dho, debug_); else return;
  s=subdir_+"Summary Plots/HBHEHF Laser Energy_div_Ref"; me=dqmStore_->get(s.c_str());
  if(me!=0) refEnergy2Dhbhehf= HcalUtilsClient::getHisto<TH2F*>(me, cloneME_, refEnergy2Dhbhehf, debug_); else return;
  s=subdir_+"Summary Plots/HO Laser Energy_div_Ref"; me=dqmStore_->get(s.c_str());
  if(me!=0) refEnergy2Dho    = HcalUtilsClient::getHisto<TH2F*>(me, cloneME_, refEnergy2Dho, debug_); else return;

  TH1F *Raddam[56];
  char str[100];
  for(int i=0;i<56;i++){  
       sprintf(str,"RADDAM (%i %i)",RADDAM_CH[i].eta,RADDAM_CH[i].phi);
       s=subdir_+"Raddam Plots/"+str; me=dqmStore_->get(s.c_str());
       if(me!=0) Raddam[i] = HcalUtilsClient::getHisto<TH1F*>(me, cloneME_, Raddam[i], debug_);
       Raddam[i]->SetXTitle("TS");
       Raddam[i]->SetTitle(str);
  }
  
  int ievt_ = -1,runNo=-1;
  s=subdir_+"HcalDetDiagLaserMonitor Event Number";
  me = dqmStore_->get(s.c_str());
  if ( me ) {
    s = me->valueString();
    sscanf((s.substr(2,s.length()-2)).c_str(), "%d", &ievt_);
  }
  s=subdir_+"HcalDetDiagLaserMonitor Run Number";
  me = dqmStore_->get(s.c_str());
  if ( me ) {
    s = me->valueString();
    sscanf((s.substr(2,s.length()-2)).c_str(), "%d", &runNo);
  }
  s=subdir_+"HcalDetDiagLaserMonitor Reference Run";
  me = dqmStore_->get(s.c_str());
  if(me) {
    string s=me->valueString();
    char str[200]; 
    sscanf((s.substr(2,s.length()-2)).c_str(), "%s", str);
    ref_run=str;
  }

  int  badT=0;
  int  badE=0;
  int  HBP[2]={0,0};
  int  HBM[2]={0,0};
  int  HEP[2]={0,0};
  int  HEM[2]={0,0};
  int  HFP[2]={0,0};
  int  HFM[2]={0,0};
  int  HO[2] ={0,0};
  int  newHBP[2]={0,0};
  int  newHBM[2]={0,0};
  int  newHEP[2]={0,0};
  int  newHEM[2]={0,0};
  int  newHFP[2]={0,0};
  int  newHFM[2]={0,0};
  int  newHO[2] ={0,0};

  TH2F* BadTiming_val[4];
  TH2F* BadEnergy_val[4];
  std::vector<std::string> name = HcalEtaPhiHistNames();
  for(int i=0;i<4;++i){
      BadTiming_val[i]=0;
      BadEnergy_val[i]=0;
      string s=subdir_+"Plots for client/"+name[i]+" Laser Timing difference";
      me=dqmStore_->get(s.c_str());
      if (me!=0) BadTiming_val[i]=HcalUtilsClient::getHisto<TH2F*>(me, cloneME_, BadTiming_val[i], debug_); else return;
      s=subdir_+"Plots for client/"+name[i]+" Laser Energy difference";
      me=dqmStore_->get(s.c_str());
      if (me!=0) BadEnergy_val[i]=HcalUtilsClient::getHisto<TH2F*>(me, cloneME_, BadEnergy_val[i], debug_); else return;
  }

  ofstream badTiming; 
  badTiming.open((htmlDir+"bad_timing_table.html").c_str());
  printTableHeader(badTiming,"Bad Timing Channels list");
  ofstream badEnergy; 
  badEnergy.open((htmlDir+"bad_energy_table.html").c_str());
  printTableHeader(badEnergy,"Bad Energy Channels list");

 for(int d=0;d<4;++d){
      int etabins=BadTiming_val[d]->GetNbinsX();
      int phibins=BadTiming_val[d]->GetNbinsY();
      for(int phi=0;phi<phibins;++phi)for(int eta=0;eta<etabins;++eta){
          int ieta=CalcIeta(eta,d+1);
          if(ieta==-9999) continue;
          HcalSubdetector subdet=HcalEmpty;
          if(isHB(eta,d+1))subdet=HcalBarrel;
             else if (isHE(eta,d+1)) subdet=HcalEndcap;
             else if (isHF(eta,d+1)) subdet=HcalForward;
             else if (isHO(eta,d+1)) subdet=HcalOuter;
          HcalDetId hcalid(subdet, ieta, phi+1, (int)(d+1));
          float val=BadTiming_val[d]->GetBinContent(eta+1,phi+1);
          if(val!=0){
            if(subdet==HcalBarrel){
               if(ieta>0){ HBP[0]++;}else{ HBM[0]++;} badT++;
               if(badstatusmap.find(hcalid)==badstatusmap.end()){if(ieta>0){ newHBP[0]++;}else{ newHBM[0]++;}}
            }   
            if(subdet==HcalEndcap){
               if(ieta>0){ HEP[0]++;}else{ HEM[0]++;} badT++;
               if(badstatusmap.find(hcalid)==badstatusmap.end()){if(ieta>0){ newHEP[0]++;}else{ newHEM[0]++;}}
            }   
            if(subdet==HcalForward){
               if(ieta>0){ HFP[0]++;}else{ HFM[0]++;} badT++;
               if(badstatusmap.find(hcalid)==badstatusmap.end()){if(ieta>0){ newHFP[0]++;}else{ newHFM[0]++;}}
            }   
            if(subdet==HcalOuter){
               HO[0]++;badT++;
               if(badstatusmap.find(hcalid)==badstatusmap.end()){newHO[0]++;}
            }   
         }
         val=BadEnergy_val[d]->GetBinContent(eta+1,phi+1);
         if(val!=0){
            if(subdet==HcalBarrel){
               if(ieta>0){ HBP[1]++;}else{ HBM[1]++;} badE++;
               if(badstatusmap.find(hcalid)==badstatusmap.end()){if(ieta>0){ newHBP[1]++;}else{ newHBM[1]++;}}
            }   
            if(subdet==HcalEndcap){
               if(ieta>0){ HEP[1]++;}else{ HEM[1]++;} badE++;
               if(badstatusmap.find(hcalid)==badstatusmap.end()){if(ieta>0){ newHEP[1]++;}else{ newHEM[1]++;}}
            }   
            if(subdet==HcalForward){
               if(ieta>0){ HFP[1]++;}else{ HFM[1]++;} badE++;
               if(badstatusmap.find(hcalid)==badstatusmap.end()){if(ieta>0){ newHFP[1]++;}else{ newHFM[1]++;}}
            }   
            if(subdet==HcalOuter){
               HO[1]++;badT++;
               if(badstatusmap.find(hcalid)==badstatusmap.end()){newHO[1]++;}
            }   
        }
     }
  }


  int cnt=0;
  if((HBP[0]+HBM[0])>0){
    badTiming << "<tr><td align=\"center\"><h3>"<< "HB" <<"</h3></td></tr>" << endl;
    for(int d=0;d<4;++d){
      int etabins=BadTiming_val[d]->GetNbinsX();
      int phibins=BadTiming_val[d]->GetNbinsY();
      for(int phi=0;phi<phibins;++phi)for(int eta=0;eta<etabins;++eta){
          int ieta=CalcIeta(eta,d+1);
          if(ieta==-9999) continue;
          if(!isHB(eta,d+1)) continue;
          float val=BadTiming_val[d]->GetBinContent(eta+1,phi+1);
          if(val==0) continue;
          HcalDetId hcalid(HcalBarrel,ieta,phi+1,d+1);
          HcalFrontEndId    lmap_entry=lmap.getHcalFrontEndId(hcalid);
          HcalElectronicsId emap_entry=emap.lookup(hcalid);
          sprintf(str,"Time-Ref=%.2f",val);
          printTableLine(badTiming,cnt++,hcalid,lmap_entry,emap_entry,str);
      } 
    }
  } 
  cnt=0;
  if((HEP[0]+HEM[0])>0){
    badTiming << "<tr><td align=\"center\"><h3>"<< "HE" <<"</h3></td></tr>" << endl;
    for(int d=0;d<4;++d){
      int etabins=BadTiming_val[d]->GetNbinsX();
      int phibins=BadTiming_val[d]->GetNbinsY();
      for(int phi=0;phi<phibins;++phi)for(int eta=0;eta<etabins;++eta){
          int ieta=CalcIeta(eta,d+1);
          if(ieta==-9999) continue;
          if(!isHE(eta,d+1)) continue;
          float val=BadTiming_val[d]->GetBinContent(eta+1,phi+1);
          if(val==0) continue;
          HcalDetId hcalid(HcalEndcap,ieta,phi+1,d+1);
          HcalFrontEndId    lmap_entry=lmap.getHcalFrontEndId(hcalid);
          HcalElectronicsId emap_entry=emap.lookup(hcalid);
          sprintf(str,"Time-Ref=%.2f",val);
          printTableLine(badTiming,cnt++,hcalid,lmap_entry,emap_entry,str);
      } 
    } 
  }
  cnt=0;
  if(HO[0]>0){
    badTiming << "<tr><td align=\"center\"><h3>"<< "HO" <<"</h3></td></tr>" << endl;
    for(int d=0;d<4;++d){
      int etabins=BadTiming_val[d]->GetNbinsX();
      int phibins=BadTiming_val[d]->GetNbinsY();
      for(int phi=0;phi<phibins;++phi)for(int eta=0;eta<etabins;++eta){
          int ieta=CalcIeta(eta,d+1);
          if(ieta==-9999) continue;
          if(!isHO(eta,d+1)) continue;
          float val=BadTiming_val[d]->GetBinContent(eta+1,phi+1);
          if(val==0) continue;
          HcalDetId hcalid(HcalOuter,ieta,phi+1,d+1);
          HcalFrontEndId    lmap_entry=lmap.getHcalFrontEndId(hcalid);
          HcalElectronicsId emap_entry=emap.lookup(hcalid);
          sprintf(str,"Time-Ref=%.2f",val);
          printTableLine(badTiming,cnt++,hcalid,lmap_entry,emap_entry,str);
      } 
    } 
  }
  cnt=0;
  if((HFP[0]+HFM[0])>0){
    badTiming << "<tr><td align=\"center\"><h3>"<< "HF" <<"</h3></td></tr>" << endl;
    for(int d=0;d<4;++d){
      int etabins=BadTiming_val[d]->GetNbinsX();
      int phibins=BadTiming_val[d]->GetNbinsY();
      for(int phi=0;phi<phibins;++phi)for(int eta=0;eta<etabins;++eta){
          int ieta=CalcIeta(eta,d+1);
          if(ieta==-9999) continue;
          if(!isHF(eta,d+1)) continue;
          float val=BadTiming_val[d]->GetBinContent(eta+1,phi+1);
          if(val==0) continue;
          HcalDetId hcalid(HcalForward,ieta,phi+1,d+1);
          HcalFrontEndId    lmap_entry=lmap.getHcalFrontEndId(hcalid);
          HcalElectronicsId emap_entry=emap.lookup(hcalid);
          sprintf(str,"Time-Ref=%.2f",val);
          printTableLine(badTiming,cnt++,hcalid,lmap_entry,emap_entry,str);
      } 
    } 
  }
  cnt=0;
  if((HBP[1]+HBM[1])>0){
    badEnergy << "<tr><td align=\"center\"><h3>"<< "HB" <<"</h3></td></tr>" << endl;
    for(int d=0;d<4;++d){
      int etabins=BadEnergy_val[d]->GetNbinsX();
      int phibins=BadEnergy_val[d]->GetNbinsY();
      for(int phi=0;phi<phibins;++phi)for(int eta=0;eta<etabins;++eta){
          int ieta=CalcIeta(eta,d+1);
          if(ieta==-9999) continue;
          if(!isHB(eta,d+1)) continue;
          float val=BadEnergy_val[d]->GetBinContent(eta+1,phi+1);
          if(val==0) continue;
          HcalDetId hcalid(HcalBarrel,ieta,phi+1,d+1);
          HcalFrontEndId    lmap_entry=lmap.getHcalFrontEndId(hcalid);
          HcalElectronicsId emap_entry=emap.lookup(hcalid);
          sprintf(str,"Energy/Ref=%.2f",val);
          printTableLine(badEnergy,cnt++,hcalid,lmap_entry,emap_entry,str);
      } 
    }
  } 
  cnt=0;
  if((HEP[1]+HEM[1])>0){
    badEnergy << "<tr><td align=\"center\"><h3>"<< "HE" <<"</h3></td></tr>" << endl;
    for(int d=0;d<4;++d){
      int etabins=BadEnergy_val[d]->GetNbinsX();
      int phibins=BadEnergy_val[d]->GetNbinsY();
      for(int phi=0;phi<phibins;++phi)for(int eta=0;eta<etabins;++eta){
          int ieta=CalcIeta(eta,d+1);
          if(ieta==-9999) continue;
          if(!isHE(eta,d+1)) continue;
          float val=BadEnergy_val[d]->GetBinContent(eta+1,phi+1);
          if(val==0) continue;
          HcalDetId hcalid(HcalEndcap,ieta,phi+1,d+1);
          HcalFrontEndId    lmap_entry=lmap.getHcalFrontEndId(hcalid);
          HcalElectronicsId emap_entry=emap.lookup(hcalid);
          sprintf(str,"Energy/Ref=%.2f",val);
          printTableLine(badEnergy,cnt++,hcalid,lmap_entry,emap_entry,str);
      } 
    } 
  }
  cnt=0;
  if(HO[1]>0){
    badEnergy << "<tr><td align=\"center\"><h3>"<< "HO" <<"</h3></td></tr>" << endl;
    for(int d=0;d<4;++d){
      int etabins=BadEnergy_val[d]->GetNbinsX();
      int phibins=BadEnergy_val[d]->GetNbinsY();
      for(int phi=0;phi<phibins;++phi)for(int eta=0;eta<etabins;++eta){
          int ieta=CalcIeta(eta,d+1);
          if(ieta==-9999) continue;
          if(!isHO(eta,d+1)) continue;
          float val=BadEnergy_val[d]->GetBinContent(eta+1,phi+1);
          if(val==0) continue;
          HcalDetId hcalid(HcalOuter,ieta,phi+1,d+1);
          HcalFrontEndId    lmap_entry=lmap.getHcalFrontEndId(hcalid);
          HcalElectronicsId emap_entry=emap.lookup(hcalid);
          sprintf(str,"Energy/Ref=%.2f",val);
          printTableLine(badEnergy,cnt++,hcalid,lmap_entry,emap_entry,str);
      } 
    } 
  }
  cnt=0;
  if((HFP[1]+HFM[1])>0){
    badEnergy << "<tr><td align=\"center\"><h3>"<< "HF" <<"</h3></td></tr>" << endl;
    for(int d=0;d<4;++d){
      int etabins=BadEnergy_val[d]->GetNbinsX();
      int phibins=BadEnergy_val[d]->GetNbinsY();
      for(int phi=0;phi<phibins;++phi)for(int eta=0;eta<etabins;++eta){
          int ieta=CalcIeta(eta,d+1);
          if(ieta==-9999) continue;
          if(!isHF(eta,d+1)) continue;
          float val=BadEnergy_val[d]->GetBinContent(eta+1,phi+1);
          if(val==0) continue;
          HcalDetId hcalid(HcalForward,ieta,phi+1,d+1);
          HcalFrontEndId    lmap_entry=lmap.getHcalFrontEndId(hcalid);
          HcalElectronicsId emap_entry=emap.lookup(hcalid);
          sprintf(str,"Energy/Ref=%.2f",val);
          printTableLine(badEnergy,cnt++,hcalid,lmap_entry,emap_entry,str);
      } 
    } 
  }

  printTableTail(badTiming);
  badTiming.close();
  printTableTail(badEnergy);
  badEnergy.close();

  ofstream htmlFile;
  string outfile=htmlDir+name_+".html";
  htmlFile.open(outfile.c_str());
  gROOT->SetBatch(true);
  gStyle->SetCanvasColor(0);
  gStyle->SetPadColor(0);
  gStyle->SetOptStat(111110);
  gStyle->SetPalette(1);
  TCanvas *can=new TCanvas("HcalDetDiagLaserClient","HcalDetDiagLaserClient",0,0,500,350);
  can->cd();
  
  if(Raddam[0]->GetEntries()>0){
     ofstream RADDAM;
     RADDAM.open((htmlDir + "RADDAM_"+name_).c_str());
     RADDAM << "</html><html xmlns=\"http://www.w3.org/1999/xhtml\">"<< endl;
     RADDAM << "<head>"<< endl;
     RADDAM << "<meta http-equiv=\"Content-Type\" content=\"text/html\"/>"<< endl;
     RADDAM << "<title>"<< "RADDAM channels" <<"</title>"<< endl;
     RADDAM << "<style type=\"text/css\">"<< endl;
     RADDAM << " body,td{ background-color: #FFFFCC; font-family: arial, arial ce, helvetica; font-size: 12px; }"<< endl;
     RADDAM << "   td.s0 { font-family: arial, arial ce, helvetica; }"<< endl;
     RADDAM << "   td.s1 { font-family: arial, arial ce, helvetica; font-weight: bold; background-color: #FFC169; text-align: center;}"<< endl;
     RADDAM << "   td.s2 { font-family: arial, arial ce, helvetica; background-color: #eeeeee; }"<< endl;
     RADDAM << "   td.s3 { font-family: arial, arial ce, helvetica; background-color: #d0d0d0; }"<< endl;
     RADDAM << "   td.s4 { font-family: arial, arial ce, helvetica; background-color: #FFC169; }"<< endl;
     RADDAM << "</style>"<< endl;
     RADDAM << "<body>"<< endl;
     RADDAM << "<h2>Run "<< runNo<<": RADDAM channels event shape </h2>" << endl;
     RADDAM << "<table>"<< endl;

     char str[100];
     for(int i=0;i<28;i++){
         RADDAM << "<tr align=\"left\">" << endl;
         //Raddam[2*i]->SetStats(0);
         //Raddam[2*i+1]->SetStats(0);
         Raddam[2*i]->Draw();    sprintf(str,"%02d",2*i);    can->SaveAs((htmlDir + "raddam_ch"+str+".gif").c_str());
         Raddam[2*i+1]->Draw();  sprintf(str,"%02d",2*i+1);  can->SaveAs((htmlDir + "raddam_ch"+str+".gif").c_str());
         sprintf(str,"raddam_ch%02d.gif",2*i);
         RADDAM << "<td align=\"center\"><img src=\""<<str<<"\" alt=\"raddam channel\">   </td>" << endl;
         sprintf(str,"raddam_ch%02d.gif",2*i+1);
         RADDAM << "<td align=\"center\"><img src=\""<<str<<"\" alt=\"raddam channel\">   </td>" << endl;
         RADDAM << "</tr>" << endl;
     }

     RADDAM << "</table>"<< endl;
     RADDAM << "</body>"<< endl;
     RADDAM << "</html>"<< endl;
     RADDAM.close();
  }

  Time2Dhbhehf->SetXTitle("i#eta");
  Time2Dhbhehf->SetYTitle("i#phi");
  Time2Dho->SetXTitle("i#eta");
  Time2Dho->SetYTitle("i#phi");
  Energy2Dhbhehf->SetXTitle("i#eta");
  Energy2Dhbhehf->SetYTitle("i#phi");
  Energy2Dho->SetXTitle("i#eta");
  Energy2Dho->SetYTitle("i#phi");
  refTime2Dhbhehf->SetXTitle("i#eta");
  refTime2Dhbhehf->SetYTitle("i#phi");
  refTime2Dho->SetXTitle("i#eta");
  refTime2Dho->SetYTitle("i#phi");
  refEnergy2Dhbhehf->SetXTitle("i#eta");
  refEnergy2Dhbhehf->SetYTitle("i#phi");
  refEnergy2Dho->SetXTitle("i#eta");
  refEnergy2Dho->SetYTitle("i#phi");
  refTime2Dhbhehf->SetMinimum(0);
  refTime2Dhbhehf->SetMaximum(2);
  refTime2Dho->SetMinimum(0);
  refTime2Dho->SetMaximum(2);
  refEnergy2Dhbhehf->SetMinimum(0.5);
  refEnergy2Dhbhehf->SetMaximum(1.5);
  refEnergy2Dho->SetMinimum(0.5);
  refEnergy2Dho->SetMaximum(1.5);
  
  Time2Dhbhehf->SetNdivisions(36,"Y");
  Time2Dho->SetNdivisions(36,"Y");
  Energy2Dhbhehf->SetNdivisions(36,"Y");
  Energy2Dho->SetNdivisions(36,"Y");
  refTime2Dhbhehf->SetNdivisions(36,"Y");
  refTime2Dho->SetNdivisions(36,"Y");
  refEnergy2Dhbhehf->SetNdivisions(36,"Y");
  refEnergy2Dho->SetNdivisions(36,"Y");

  // html page header
  htmlFile << "<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">  " << endl;
  htmlFile << "<html>  " << endl;
  htmlFile << "<head>  " << endl;
  htmlFile << "  <meta content=\"text/html; charset=ISO-8859-1\"  " << endl;
  htmlFile << " http-equiv=\"content-type\">  " << endl;
  htmlFile << "  <title>Detector Diagnostics Laser Monitor</title> " << endl;
  htmlFile << "</head>  " << endl;
  htmlFile << "<style type=\"text/css\"> td { font-weight: bold } </style>" << endl;
 
  htmlFile << "<style type=\"text/css\">"<< endl;
  htmlFile << "   td.s0 { font-family: arial, arial ce, helvetica; font-weight: bold; background-color: #FF7700; text-align: center;}"<< endl;
  htmlFile << "   td.s1 { font-family: arial, arial ce, helvetica; font-weight: bold; background-color: #FFC169; text-align: center;}"<< endl;
  htmlFile << "   td.s2 { font-family: arial, arial ce, helvetica; background-color: red; }"<< endl;
  htmlFile << "   td.s3 { font-family: arial, arial ce, helvetica; background-color: yellow; }"<< endl;
  htmlFile << "   td.s4 { font-family: arial, arial ce, helvetica; background-color: green; }"<< endl;
  htmlFile << "   td.s5 { font-family: arial, arial ce, helvetica; background-color: silver; }"<< endl;
  std::string state[4]={"<td class=\"s2\" align=\"center\">",
                        "<td class=\"s3\" align=\"center\">",
                        "<td class=\"s4\" align=\"center\">",
                        "<td class=\"s5\" align=\"center\">"};
  htmlFile << "</style>"<< endl;
 
  htmlFile << "<body>  " << endl;
  htmlFile << "<br>  " << endl;
  htmlFile << "<h2>Run:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" << endl;
  htmlFile << "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span " << endl;
  htmlFile << " style=\"color: rgb(0, 0, 153);\">" << runNo << "</span></h2>" << endl;
  htmlFile << "<h2>Monitoring task:&nbsp;&nbsp;&nbsp;&nbsp; <span " << endl;
  htmlFile << " style=\"color: rgb(0, 0, 153);\">Detector Diagnostics Laser Monitor</span></h2> " << endl;
  htmlFile << "<h2>Events processed:&nbsp;&nbsp;&nbsp;&nbsp;<span " << endl;
  htmlFile << " style=\"color: rgb(0, 0, 153);\">" << ievt_ << "</span></h2>" << endl;
  htmlFile << "<hr>" << endl;
 
  htmlFile << "<table width=100% border=1>" << endl;
  htmlFile << "<tr>" << endl;
  htmlFile << "<td class=\"s0\" width=20% align=\"center\">SebDet</td>" << endl;
  htmlFile << "<td class=\"s0\" width=20% align=\"center\">Bad Timing</td>" << endl;
  htmlFile << "<td class=\"s0\" width=20% align=\"center\">Bad Energy</td>" << endl;
  htmlFile << "</tr><tr>" << endl;
  int ind1=0,ind2=0;
  htmlFile << "<td class=\"s1\" align=\"center\">HB+</td>" << endl;
  if(HBP[0]==0) ind1=2; if(HBP[0]>0 && HBP[0]<=12) ind1=1; if(HBP[0]>12) ind1=0; 
  if(HBP[1]==0) ind2=2; if(HBP[1]>0 && HBP[1]<=12) ind2=1; if(HBP[1]>12) ind2=0; 
  if(!HBpresent_) ind1=ind2=3;  
  htmlFile << state[ind1] << HBP[0] <<"</td>" << endl;
  htmlFile << state[ind2] << HBP[1] <<"</td>" << endl;
  htmlFile << "</tr><tr>" << endl;
  htmlFile << "<td class=\"s1\" align=\"center\">HB-</td>" << endl;
  if(HBM[0]==0) ind1=2; if(HBM[0]>0 && HBP[0]<=12) ind1=1; if(HBM[0]>12) ind1=0; 
  if(HBM[1]==0) ind2=2; if(HBM[1]>0 && HBP[1]<=12) ind2=1; if(HBM[1]>12) ind2=0; 
  if(!HBpresent_) ind1=ind2=3;  
  htmlFile << state[ind1] << HBM[0] <<"</td>" << endl;
  htmlFile << state[ind2] << HBM[1] <<"</td>" << endl;
  htmlFile << "</tr><tr>" << endl;
  htmlFile << "<td class=\"s1\" align=\"center\">HE+</td>" << endl;
  if(HEP[0]==0) ind1=2; if(HEP[0]>0 && HEP[0]<=12) ind1=1; if(HEP[0]>12) ind1=0; 
  if(HEP[1]==0) ind2=2; if(HEP[1]>0 && HEP[1]<=12) ind2=1; if(HEP[1]>12) ind2=0;
  if(!HEpresent_) ind1=ind2=3;  
  if(ind1==0 || ind2==0) status|=2; else if(ind1==1 || ind2==1) status|=1;
  htmlFile << state[ind1] << HEP[0] <<"</td>" << endl;
  htmlFile << state[ind2] << HEP[1] <<"</td>" << endl;
  htmlFile << "</tr><tr>" << endl;
  htmlFile << "<td class=\"s1\" align=\"center\">HE-</td>" << endl;
  if(HEM[0]==0) ind1=2; if(HEM[0]>0 && HEM[0]<=12) ind1=1; if(HEM[0]>12) ind1=0; 
  if(HEM[1]==0) ind2=2; if(HEM[1]>0 && HEM[1]<=12) ind2=1; if(HEM[1]>12) ind2=0; 
  if(!HEpresent_) ind1=ind2=3;  
  if(ind1==0 || ind2==0) status|=2; else if(ind1==1 || ind2==1) status|=1;
  htmlFile << state[ind1] << HEM[0] <<"</td>" << endl;
  htmlFile << state[ind2] << HEM[1] <<"</td>" << endl;
  htmlFile << "</tr><tr>" << endl;
  htmlFile << "<td class=\"s1\" align=\"center\">HF+</td>" << endl;
  if(HFP[0]==0) ind1=2; if(HFP[0]>0 && HFP[0]<=12) ind1=1; if(HFP[0]>12) ind1=0; 
  if(HFP[1]==0) ind2=2; if(HFP[1]>0 && HFP[1]<=12) ind2=1; if(HFP[1]>12) ind2=0; 
  if(!HOpresent_) ind1=ind2=3;  
  if(ind1==0 || ind2==0) status|=2; else if(ind1==1 || ind2==1) status|=1;
  htmlFile << state[ind1] << HFP[0] <<"</td>" << endl;
  htmlFile << state[ind2] << HFP[1] <<"</td>" << endl;
  htmlFile << "</tr><tr>" << endl;
  htmlFile << "<td class=\"s1\" align=\"center\">HF-</td>" << endl;
  if(HFM[0]==0) ind1=2; if(HFM[0]>0 && HFM[0]<=12) ind1=1; if(HFM[0]>12) ind1=0; 
  if(HFM[1]==0) ind2=2; if(HFM[1]>0 && HFM[1]<=12) ind2=1; if(HFM[1]>12) ind2=0; 
  if(!HFpresent_) ind1=ind2=3;  
  if(ind1==0 || ind2==0) status|=2; else if(ind1==1 || ind2==1) status|=1;
  htmlFile << state[ind1] << HFM[0] <<"</td>" << endl;
  htmlFile << state[ind2] << HFM[1] <<"</td>" << endl;
  htmlFile << "</tr><tr>" << endl;
  htmlFile << "<td class=\"s1\" align=\"center\">HO</td>" << endl;
  if(HO[0]==0) ind1=2; if(HO[0]>0 && HO[0]<=12) ind1=1; if(HO[0]>12) ind1=0; 
  if(HO[1]==0) ind2=2; if(HO[1]>0 && HO[1]<=12) ind2=1; if(HO[1]>12) ind2=0; 
  if(!HFpresent_) ind1=ind2=3;  
  if(ind1==0 || ind2==0) status|=2; else if(ind1==1 || ind2==1) status|=1;
  htmlFile << state[ind1] << HO[0] <<"</td>" << endl;
  htmlFile << state[ind2] << HO[1] <<"</td>" << endl;

  htmlFile << "</tr></table>" << endl;
  htmlFile << "<hr>" << endl;

  if((badT+badE)>0){
      htmlFile << "<table width=100% border=1><tr>" << endl;
      if(badT>0)  htmlFile << "<td><a href=\"" << "bad_timing_table.html" <<"\">list of bad timing channels</a></td>";
      if(badE>0) htmlFile << "<td><a href=\"" << "bad_energy_table.html" <<"\">list of bad energy channels</a></td>";
      htmlFile << "</tr></table>" << endl;
  }

 
  if(Raddam[0]->GetEntries()>0){
    htmlFile << "<h2 align=\"center\"><a href=\"" << ("RADDAM_"+name_).c_str() <<"\">RADDAM channels</a><h2>";
    htmlFile << "<hr>" << endl;
  }
  
  htmlFile << "<h2 align=\"center\">Stability Laser plots (Reference run "<<ref_run<<")</h2>" << endl;
  htmlFile << "<table width=100% border=0><tr>" << endl;
  
  can->SetGridy();
  can->SetGridx();
  
  htmlFile << "<tr align=\"left\">" << endl;
  refTime2Dhbhehf->SetStats(0);
  refTime2Dho->SetStats(0);
  refTime2Dhbhehf->Draw("COLZ");    can->SaveAs((htmlDir + "ref_laser_timing_hbhehf.gif").c_str());
  refTime2Dho->Draw("COLZ");        can->SaveAs((htmlDir + "ref_laser_timing_ho.gif").c_str());
  htmlFile << "<td align=\"center\"><img src=\"ref_laser_timing_hbhehf.gif\" alt=\"ref laser timing distribution\">   </td>" << endl;
  htmlFile << "<td align=\"center\"><img src=\"ref_laser_timing_ho.gif\" alt=\"ref laser timing distribution\">   </td>" << endl;
  htmlFile << "</tr>" << endl;
  
  
  if(hb!=0 && he!=0 && ho!=0 && hf!=0){
  hb->SetMarkerStyle(22);
  hb->SetMarkerColor(kRed);
  hb->GetYaxis()->SetRangeUser(hb->GetMinimum()-1,hb->GetMaximum()+1);
  hb->GetXaxis()->SetNdivisions(520);
  
  he->SetMarkerStyle(22);
  he->SetMarkerColor(kRed);
  he->GetYaxis()->SetRangeUser(he->GetMinimum()-1,he->GetMaximum()+1);
  he->GetXaxis()->SetNdivisions(520);
  
  ho->SetMarkerStyle(22);
  ho->SetMarkerColor(kRed);
  ho->GetYaxis()->SetRangeUser(ho->GetMinimum()-1,ho->GetMaximum()+1);
  ho->GetXaxis()->SetNdivisions(520);
  
  hf->SetMarkerStyle(22);
  hf->SetMarkerColor(kRed);
  hf->GetYaxis()->SetRangeUser(hf->GetMinimum()-1,hf->GetMaximum()+1);
  hf->GetXaxis()->SetNdivisions(520);  
  hb->SetStats(0);
  he->SetStats(0);
  ho->SetStats(0);
  hf->SetStats(0);
 
  
  hb->GetXaxis()->SetBit(TAxis::kLabelsVert);
  he->GetXaxis()->SetBit(TAxis::kLabelsVert);
  ho->GetXaxis()->SetBit(TAxis::kLabelsVert);
  hf->GetXaxis()->SetBit(TAxis::kLabelsVert);
  hb->GetXaxis()->SetLabelSize(0.05);
  he->GetXaxis()->SetLabelSize(0.05);
  ho->GetXaxis()->SetLabelSize(0.05);
  hf->GetXaxis()->SetLabelSize(0.05);
 
  
  htmlFile << "<tr align=\"left\">" << endl;
  htmlFile << "<td align=\"center\"><img src=\"hb_rbx_timing1D.gif\" alt=\"rbx timing\">   </td>" << endl;
  htmlFile << "<td align=\"center\"><img src=\"he_rbx_timing1D.gif\" alt=\"rbx timing\">   </td>" << endl;
  htmlFile << "</tr>" << endl;
  htmlFile << "<tr align=\"left\">" << endl;
  htmlFile << "<td align=\"center\"><img src=\"ho_rbx_timing1D.gif\" alt=\"rbx timing\">   </td>" << endl;
  htmlFile << "<td align=\"center\"><img src=\"hf_rbx_timing1D.gif\" alt=\"rbx timing\">   </td>" << endl;
  htmlFile << "</tr>" << endl;
  }else printf("Error\n");
  
  
  
  htmlFile << "<tr align=\"left\">" << endl;
  refEnergy2Dhbhehf->SetStats(0);
  refEnergy2Dho->SetStats(0);
  refEnergy2Dhbhehf->Draw("COLZ");    can->SaveAs((htmlDir + "ref_laser_energy_hbhehf.gif").c_str());
  refEnergy2Dho->Draw("COLZ");        can->SaveAs((htmlDir + "ref_laser_energy_ho.gif").c_str());
  htmlFile << "<td align=\"center\"><img src=\"ref_laser_energy_hbhehf.gif\" alt=\"ref laser energy distribution\">   </td>" << endl;
  htmlFile << "<td align=\"center\"><img src=\"ref_laser_energy_ho.gif\" alt=\"ref laser energy distribution\">   </td>" << endl;
  htmlFile << "</tr>" << endl;
  
  htmlFile << "</table>" << endl;
  
  
  htmlFile << "<h2 align=\"center\">Summary Laser plots</h2>" << endl;
  htmlFile << "<table width=100% border=0><tr>" << endl;
  htmlFile << "<tr align=\"left\">" << endl;
  Time2Dhbhehf->SetStats(0);
  Time2Dho->SetStats(0);
  Time2Dhbhehf->Draw("COLZ");    can->SaveAs((htmlDir + "laser_timing_hbhehf.gif").c_str());
  Time2Dho->Draw("COLZ");        can->SaveAs((htmlDir + "laser_timing_ho.gif").c_str());
  htmlFile << "<td align=\"center\"><img src=\"laser_timing_hbhehf.gif\" alt=\"laser timing distribution\">   </td>" << endl;
  htmlFile << "<td align=\"center\"><img src=\"laser_timing_ho.gif\" alt=\"laser timing distribution\">   </td>" << endl;
  htmlFile << "</tr>" << endl;
  
  htmlFile << "<tr align=\"left\">" << endl;
  Energy2Dhbhehf->SetStats(0);
  Energy2Dho->SetStats(0);
  Energy2Dhbhehf->Draw("COLZ");    can->SaveAs((htmlDir + "laser_energy_hbhehf.gif").c_str());
  Energy2Dho->Draw("COLZ");        can->SaveAs((htmlDir + "laser_energy_ho.gif").c_str());
  htmlFile << "<td align=\"center\"><img src=\"laser_energy_hbhehf.gif\" alt=\"laser energy distribution\">   </td>" << endl;
  htmlFile << "<td align=\"center\"><img src=\"laser_energy_ho.gif\" alt=\"laser energy distribution\">   </td>" << endl;
  htmlFile << "</tr>" << endl;
  
  
  htmlFile << "<tr align=\"left\">" << endl;  
  hbheEnergy->Draw();    can->SaveAs((htmlDir + "hbhe_laser_energy_distribution.gif").c_str());
  hbheEnergyRMS->Draw(); can->SaveAs((htmlDir + "hbhe_laser_energy_rms_distribution.gif").c_str());
  htmlFile << "<td align=\"center\"><img src=\"hbhe_laser_energy_distribution.gif\" alt=\"hbhe laser energy distribution\">   </td>" << endl;
  htmlFile << "<td align=\"center\"><img src=\"hbhe_laser_energy_rms_distribution.gif\" alt=\"hbhelaser energy rms distribution\">   </td>" << endl;
  htmlFile << "</tr>" << endl;
  htmlFile << "<tr align=\"left\">" << endl;
  hbheTiming->Draw();    can->SaveAs((htmlDir + "hbhe_laser_timing_distribution.gif").c_str());
  hbheTimingRMS->Draw(); can->SaveAs((htmlDir + "hbhe_laser_timing_rms_distribution.gif").c_str());
  htmlFile << "<td align=\"center\"><img src=\"hbhe_laser_timing_distribution.gif\" alt=\"hbhe laser timing distribution\">   </td>" << endl;
  htmlFile << "<td align=\"center\"><img src=\"hbhe_laser_timing_rms_distribution.gif\" alt=\"hbhe laser timing rms distribution\">   </td>" << endl;
  htmlFile << "</tr>" << endl;

  htmlFile << "<tr align=\"left\">" << endl;  
  hoEnergy->Draw();    can->SaveAs((htmlDir + "ho_laser_energy_distribution.gif").c_str());
  hoEnergyRMS->Draw(); can->SaveAs((htmlDir + "ho_laser_energy_rms_distribution.gif").c_str());
  htmlFile << "<td align=\"center\"><img src=\"ho_laser_energy_distribution.gif\" alt=\"ho laser energy distribution\">   </td>" << endl;
  htmlFile << "<td align=\"center\"><img src=\"ho_laser_energy_rms_distribution.gif\" alt=\"ho laser energy rms distribution\">   </td>" << endl;
  htmlFile << "</tr>" << endl;
  htmlFile << "<tr align=\"left\">" << endl;
  hoTiming->Draw();    can->SaveAs((htmlDir + "ho_laser_timing_distribution.gif").c_str());
  hoTimingRMS->Draw(); can->SaveAs((htmlDir + "ho_laser_timing_rms_distribution.gif").c_str());
  htmlFile << "<td align=\"center\"><img src=\"ho_laser_timing_distribution.gif\" alt=\"ho laser timing distribution\">   </td>" << endl;
  htmlFile << "<td align=\"center\"><img src=\"ho_laser_timing_rms_distribution.gif\" alt=\"ho laser timing rms distribution\">   </td>" << endl;
  
  htmlFile << "</tr>" << endl;
  htmlFile << "<tr align=\"left\">" << endl;  
  hfEnergy->Draw();    can->SaveAs((htmlDir + "hf_laser_energy_distribution.gif").c_str());
  hfEnergyRMS->Draw(); can->SaveAs((htmlDir + "hf_laser_energy_rms_distribution.gif").c_str());
  htmlFile << "<td align=\"center\"><img src=\"hf_laser_energy_distribution.gif\" alt=\"hf laser energy distribution\">   </td>" << endl;
  htmlFile << "<td align=\"center\"><img src=\"hf_laser_energy_rms_distribution.gif\" alt=\"hf laser energy rms distribution\">   </td>" << endl;
  htmlFile << "</tr>" << endl;
  htmlFile << "<tr align=\"left\">" << endl;
  hfTiming->Draw();    can->SaveAs((htmlDir + "hf_laser_timing_distribution.gif").c_str());
  hfTimingRMS->Draw(); can->SaveAs((htmlDir + "hf_laser_timing_rms_distribution.gif").c_str());
  htmlFile << "<td align=\"center\"><img src=\"hf_laser_timing_distribution.gif\" alt=\"hf laser timing distribution\">   </td>" << endl;
  htmlFile << "<td align=\"center\"><img src=\"hf_laser_timing_rms_distribution.gif\" alt=\"hf laser timing rms distribution\">   </td>" << endl;
  htmlFile << "</tr>" << endl;
  
  can->SetBottomMargin(0.2);  
  if(hb->GetEntries()>0)hb->Draw("P");else hb->Draw(); can->SaveAs((htmlDir + "hb_rbx_timing1D.gif").c_str());
  if(he->GetEntries()>0)he->Draw("P");else he->Draw(); can->SaveAs((htmlDir + "he_rbx_timing1D.gif").c_str());
  if(ho->GetEntries()>0)ho->Draw("P");else ho->Draw(); can->SaveAs((htmlDir + "ho_rbx_timing1D.gif").c_str());
  if(hf->GetEntries()>0)hf->Draw("P");else hf->Draw(); can->SaveAs((htmlDir + "hf_rbx_timing1D.gif").c_str());  

  htmlFile << "</table>" << endl;

  htmlFile << "</body> " << endl;
  htmlFile << "</html> " << endl;
  can->Close();
  htmlFile.close();
  return;
}
void ZDCMonitorClient::initialize ( const edm::ParameterSet ps)

Definition at line 50 of file ZDCMonitorClient.cc.

References baseHtmlDir_, gather_cfg::cout, dbe_, debug_, enableMonitorDaemon_, edm::ParameterSet::getUntrackedParameter(), ievent_, ilumisec_, inputFile_, irun_, itime_, maxlumisec_, minlumisec_, NULL, Online_, DQMStore::open(), cmsCodeRules::cppFunctionSkipper::operator, prescaleEvt_, prescaleLS_, resetEvents_, resetLS_, rootFolder_, runningStandalone_, DQMStore::showDirStructure(), and showTiming_.

Referenced by ZDCMonitorClient().

                                                          {

  irun_=0; ilumisec_=0; ievent_=0; itime_=0;

  maxlumisec_=0; minlumisec_=0;


  debug_ = ps.getUntrackedParameter<int>("debug", 0);
  if (debug_>0)
    std::cout << std::endl<<" *** ZDC Monitor Client ***" << std::endl<<std::endl;

  if(debug_>1) std::cout << "ZDCMonitorClient: constructor...." << std::endl;

  Online_ = ps.getUntrackedParameter<bool>("Online",false);
  // timing switch 
  showTiming_ = ps.getUntrackedParameter<bool>("showTiming",false);  

  // MonitorDaemon switch
  enableMonitorDaemon_ = ps.getUntrackedParameter<bool>("enableMonitorDaemon", true);
  if (debug_>0)
    {
      if ( enableMonitorDaemon_ ) std::cout << "-->enableMonitorDaemon switch is ON" << std::endl;
      else std::cout << "-->enableMonitorDaemon switch is OFF" << std::endl;
    }

  // get hold of back-end interface
  dbe_ = edm::Service<DQMStore>().operator->();
  if (debug_>1) dbe_->showDirStructure();   

  // DQM ROOT input
  inputFile_ = ps.getUntrackedParameter<std::string>("inputFile", "");
  if(inputFile_.size()!=0 && debug_>0) std::cout << "-->reading DQM input from " << inputFile_ << std::endl;
  
  if( ! enableMonitorDaemon_ ) {  
    if( inputFile_.size() != 0 && dbe_!=NULL){
      dbe_->open(inputFile_);
      dbe_->showDirStructure();     
    }
  }

  //histogram reset freqency, update frequency, timeout
  resetEvents_ = ps.getUntrackedParameter<int>("resetFreqEvents",-1);   //number of real events
  if(resetEvents_!=-1 && debug_>0) std::cout << "-->Will reset histograms every " << resetEvents_ <<" events." << std::endl;
  resetLS_ = ps.getUntrackedParameter<int>("resetFreqLS",-1);       //number of lumisections
  if(resetLS_!=-1 && debug_>0) std::cout << "-->Will reset histograms every " << resetLS_ <<" lumi sections." << std::endl;

  // base Html output directory
  baseHtmlDir_ = ps.getUntrackedParameter<std::string>("baseHtmlDir", "");
  if (debug_>0)
    {
      if( baseHtmlDir_.size() != 0) 
        std::cout << "-->HTML output will go to baseHtmlDir = '" << baseHtmlDir_ << "'" << std::endl;
      else std::cout << "-->HTML output is disabled" << std::endl;
    }
  
  runningStandalone_ = ps.getUntrackedParameter<bool>("runningStandalone", false); // unnecessary? Or use for offline client processing?
  if (debug_>1)
    {
      if( runningStandalone_ ) std::cout << "-->standAlone switch is ON" << std::endl;
      else std::cout << "-->standAlone switch is OFF" << std::endl;
    }

  // set parameters   
  prescaleEvt_ = ps.getUntrackedParameter<int>("diagnosticPrescaleEvt", -1);
  if (debug_>0) 
    std::cout << "===>DQM event prescale = " << prescaleEvt_ << " event(s)"<< std::endl;

  prescaleLS_ = ps.getUntrackedParameter<int>("diagnosticPrescaleLS", -1);
  if (debug_>0) std::cout << "===>DQM lumi section prescale = " << prescaleLS_ << " lumi section(s)"<< std::endl;

  // Base folder for the contents of this job
  std::string subsystemname = ps.getUntrackedParameter<std::string>("subSystemFolder", "ZDC") ;
  if (debug_>0) std::cout << "===>ZDCMonitor name = " << subsystemname << std::endl;
  rootFolder_ = subsystemname + "/";

  return;
}
void ZDCMonitorClient::loadHistograms ( TFile *  infile,
const char *  fname 
)

Definition at line 463 of file ZDCMonitorClient.cc.

References Exception.

{
  if(!infile){
    throw cms::Exception("Incomplete configuration") << 
      "ZDCMonitorClient: this histogram file is bad! " <<std::endl;
    return;
  }
  return;
}
void ZDCMonitorClient::offlineSetup ( )

Definition at line 456 of file ZDCMonitorClient.cc.

                                   {
  //  std::cout << std::endl;
  //  std::cout << " *** Hcal Generic Monitor Client, for offline operation***" << std::endl;
  //  std::cout << std::endl;
  return;
}
bool ZDCMonitorClient::prescale ( )

Boolean prescale test for this event.

Return true if this event should be skipped according to the prescale condition...

Accommodate a logical "OR" of the possible tests

Definition at line 482 of file ZDCMonitorClient.cc.

References gather_cfg::cout, debug_, ievt_, ilumisec_, prescaleEvt_, and prescaleLS_.

Referenced by analyze(), and endLuminosityBlock().

                               {

  if (debug_>1) std::cout <<"ZDCMonitorClient::prescale"<<std::endl;
  
  // If no prescales are set, return 'false'.  (This means that we should process the event.)
  if(prescaleEvt_<=0 && prescaleLS_<=0) return false;

  // Now check whether event should be kept.  Assume that it should not by default

  bool keepEvent=false;
  
  // Keep event if prescaleLS test is met or if prescaleEvt test is met
  if(prescaleLS_>0 && (ilumisec_%prescaleLS_)==0) keepEvent = true; // check on ls prescale; 
  if (prescaleEvt_>0 && (ievt_%prescaleEvt_)==0) keepEvent = true; // 
  
  // if any criteria wants to keep the event, do so
  if (keepEvent) return false;  // event should be kept; don't apply prescale
  return true; // apply prescale by default
}
void ZDCMonitorClient::removeAllME ( void  ) [private]

Definition at line 130 of file ZDCMonitorClient.cc.

References DQMStore::cd(), gather_cfg::cout, dbe_, debug_, DQMStore::dirExists(), NULL, DQMStore::removeContents(), and DQMStore::rmdir().

                                  {
  if (debug_>0) std::cout <<"<ZDCMonitorClient>removeAllME()"<<std::endl;
  if(dbe_==NULL) return;

  // go to top directory
  dbe_->cd();
  // remove MEs at top directory
  dbe_->removeContents(); 
  // remove directory (including subdirectories recursively)
  if(dbe_->dirExists("Collector"))
    dbe_->rmdir("Collector");
  if(dbe_->dirExists("Summary"))
    dbe_->rmdir("Summary");
  return;
}
void ZDCMonitorClient::report ( bool  update)

Create reports.

Definition at line 421 of file ZDCMonitorClient.cc.

References baseHtmlDir_, gather_cfg::cout, createTests(), dbe_, debug_, errorSummary(), htmlOutput(), ievt_, and DQMStore::runQTests().

Referenced by endRun().

                                           {
  
  if( debug_>0 ) 
    std::cout << "ZDCMonitorClient: creating report, ievt = " << ievt_ << std::endl;
  
  if(doUpdate){
    createTests();  
    dbe_->runQTests();
  }
  errorSummary();

  //create html output if specified...
  if( baseHtmlDir_.size() != 0 && ievt_>0) 
    htmlOutput();
  return;
}
void ZDCMonitorClient::resetAllME ( void  )

reset all monitor elements

do a reset of all monitor elements...

Definition at line 148 of file ZDCMonitorClient.cc.

References gather_cfg::cout, and debug_.

Referenced by analyze().

                                  {
  if (debug_>0) std::cout <<"<ZDCMonitorClient> resetAllME()"<<std::endl;
   return;
}
void ZDCMonitorClient::writeDBfile ( ) [private]

Definition at line 328 of file ZDCMonitorClient.cc.

{
  return; // not used for ZDC

} // ZDCMonitorClient::writeDBfile()

Member Data Documentation

std::string ZDCMonitorClient::baseHtmlDir_ [private]

Definition at line 133 of file ZDCMonitorClient.h.

Referenced by initialize(), and report().

Definition at line 98 of file ZDCMonitorClient.h.

Connection to the DQM backend.

Definition at line 114 of file ZDCMonitorClient.h.

Referenced by analyze(), beginRun(), errorSummary(), initialize(), removeAllME(), and report().

int ZDCMonitorClient::debug_ [private]

Verbosity switch used for debugging or informational output.

Definition at line 94 of file ZDCMonitorClient.h.

Referenced by analyze(), beginJob(), beginLuminosityBlock(), beginRun(), createTests(), endJob(), endLuminosityBlock(), endRun(), initialize(), prescale(), removeAllME(), report(), resetAllME(), and ~ZDCMonitorClient().

Definition at line 109 of file ZDCMonitorClient.h.

Definition at line 130 of file ZDCMonitorClient.h.

Referenced by initialize().

Definition at line 117 of file ZDCMonitorClient.h.

Referenced by analyze(), and initialize().

int ZDCMonitorClient::ievt_ [private]

Definition at line 125 of file ZDCMonitorClient.h.

Referenced by analyze(), beginJob(), endJob(), endRun(), prescale(), and report().

Definition at line 118 of file ZDCMonitorClient.h.

Referenced by analyze(), beginLuminosityBlock(), initialize(), and prescale().

std::string ZDCMonitorClient::inputFile_ [private]

Definition at line 132 of file ZDCMonitorClient.h.

Referenced by endRun(), and initialize().

int ZDCMonitorClient::irun_ [private]

Definition at line 117 of file ZDCMonitorClient.h.

Referenced by analyze(), endRun(), and initialize().

int ZDCMonitorClient::itime_ [private]

Definition at line 117 of file ZDCMonitorClient.h.

Referenced by analyze(), and initialize().

Definition at line 119 of file ZDCMonitorClient.h.

Referenced by analyze(), and initialize().

Definition at line 119 of file ZDCMonitorClient.h.

Referenced by analyze(), and initialize().

std::string ZDCMonitorClient::monitorName_ [private]

units of "updates", TBD

The name of the monitoring process which derives from this class, used to standardize filename and file structure

Definition at line 91 of file ZDCMonitorClient.h.

time_t ZDCMonitorClient::mytime_ [private]

Definition at line 121 of file ZDCMonitorClient.h.

Referenced by analyze().

counters and flags

Definition at line 102 of file ZDCMonitorClient.h.

bool ZDCMonitorClient::Online_ [private]

Definition at line 104 of file ZDCMonitorClient.h.

Referenced by endLuminosityBlock(), endRun(), and initialize().

Prescale variables for restricting the frequency of analyzer behavior. The base class does not implement prescales. Set to -1 to be ignored.

Definition at line 84 of file ZDCMonitorClient.h.

Referenced by analyze(), initialize(), and prescale().

units of events

Definition at line 85 of file ZDCMonitorClient.h.

Referenced by endLuminosityBlock(), initialize(), and prescale().

units of lumi sections

Definition at line 86 of file ZDCMonitorClient.h.

units of minutes

Definition at line 87 of file ZDCMonitorClient.h.

struct { ... } ZDCMonitorClient::psTime_ [private]

Definition at line 126 of file ZDCMonitorClient.h.

Referenced by analyze(), and initialize().

Definition at line 127 of file ZDCMonitorClient.h.

Referenced by analyze(), and initialize().

std::string ZDCMonitorClient::rootFolder_ [private]

Definition at line 123 of file ZDCMonitorClient.h.

Referenced by beginRun(), errorSummary(), and initialize().

Definition at line 129 of file ZDCMonitorClient.h.

Referenced by analyze(), and initialize().

bool ZDCMonitorClient::saved_ [private]

Definition at line 103 of file ZDCMonitorClient.h.

Definition at line 97 of file ZDCMonitorClient.h.

Referenced by initialize().

Definition at line 108 of file ZDCMonitorClient.h.

Definition at line 107 of file ZDCMonitorClient.h.

Definition at line 110 of file ZDCMonitorClient.h.

Definition at line 107 of file ZDCMonitorClient.h.