CMS 3D CMS Logo

HcalCaloTowerClient Class Reference

#include <DQM/HcalMonitorClient/interface/HcalCaloTowerClient.h>

Inheritance diagram for HcalCaloTowerClient:

HcalBaseClient

List of all members.

Public Member Functions

void analyze (void)
 Analyze.
void beginJob (void)
 BeginJob.
void beginRun (void)
 BeginRun.
void cleanup (void)
 Cleanup.
void createTests ()
void endJob (void)
 EndJob.
void endRun (void)
 EndRun.
void getHistograms ()
 HcalCaloTowerClient ()
 Constructor.
void htmlOutput (int run, string htmlDir, string htmlName)
 HtmlOutput.
void init (const edm::ParameterSet &ps, DQMStore *dbe, string clientName)
void loadHistograms (TFile *f)
void report ()
void resetAllME ()
void setup (void)
 Setup.
 ~HcalCaloTowerClient ()
 Destructor.

Private Attributes

TH2F * energy_
TH2F * occ_


Detailed Description

Definition at line 7 of file HcalCaloTowerClient.h.


Constructor & Destructor Documentation

HcalCaloTowerClient::HcalCaloTowerClient (  ) 

Constructor.

Definition at line 6 of file HcalCaloTowerClient.cc.

00006 {}

HcalCaloTowerClient::~HcalCaloTowerClient (  ) 

Destructor.

Definition at line 18 of file HcalCaloTowerClient.cc.

References cleanup().

00018                                          {
00019   this->cleanup();
00020 }


Member Function Documentation

void HcalCaloTowerClient::analyze ( void   ) 

Analyze.

Definition at line 102 of file HcalCaloTowerClient.cc.

References GenMuonPlsPt100GeV_cfg::cout, HcalBaseClient::debug_, lat::endl(), and HcalBaseClient::jevt_.

Referenced by HcalMonitorClient::analyze().

00102                                      {
00103 
00104   jevt_++;
00105   int updates = 0;
00106 
00107   if ( updates % 10 == 0 ) {
00108     if ( debug_ ) cout << "HcalCaloTowerClient: " << updates << " updates" << endl;
00109   }
00110 
00111   return;
00112 }

void HcalCaloTowerClient::beginJob ( void   ) 

BeginJob.

Definition at line 22 of file HcalCaloTowerClient.cc.

References GenMuonPlsPt100GeV_cfg::cout, HcalBaseClient::debug_, lat::endl(), HcalBaseClient::ievt_, HcalBaseClient::jevt_, resetAllME(), and setup().

Referenced by HcalMonitorClient::beginJob().

00022                                       {
00023 
00024   if ( debug_ ) cout << "HcalCaloTowerClient: beginJob" << endl;
00025 
00026   ievt_ = 0;
00027   jevt_ = 0;
00028 
00029   this->setup();
00030   this->resetAllME();
00031   return;
00032 }

void HcalCaloTowerClient::beginRun ( void   ) 

BeginRun.

Definition at line 34 of file HcalCaloTowerClient.cc.

References GenMuonPlsPt100GeV_cfg::cout, HcalBaseClient::debug_, lat::endl(), HcalBaseClient::jevt_, resetAllME(), and setup().

Referenced by HcalMonitorClient::beginRun().

00034                                       {
00035 
00036   if ( debug_ ) cout << "HcalCaloTowerClient: beginRun" << endl;
00037 
00038   jevt_ = 0;
00039   this->setup();
00040   this->resetAllME();
00041   return;
00042 }

void HcalCaloTowerClient::cleanup ( void   ) 

Cleanup.

Definition at line 64 of file HcalCaloTowerClient.cc.

References HcalBaseClient::cloneME_, HcalBaseClient::dqmQtests_, HcalBaseClient::dqmReportMapErr_, HcalBaseClient::dqmReportMapOther_, HcalBaseClient::dqmReportMapWarn_, energy_, and occ_.

Referenced by endJob(), endRun(), and ~HcalCaloTowerClient().

00064                                       {
00065   
00066   if(cloneME_)
00067     {
00068       if(occ_) delete occ_;
00069       if(energy_) delete energy_;
00070     }    
00071 
00072   
00073   occ_=0; 
00074   energy_=0;
00075   
00076   dqmReportMapErr_.clear(); dqmReportMapWarn_.clear(); dqmReportMapOther_.clear();
00077   dqmQtests_.clear();
00078   
00079   return;
00080 }

void HcalCaloTowerClient::createTests (  ) 

Definition at line 210 of file HcalCaloTowerClient.cc.

References HcalBaseClient::dbe_, and HcalBaseClient::debug_.

Referenced by HcalMonitorClient::createTests().

00210                                      {
00211   if(!dbe_) return;
00212 
00213   if(debug_) printf("Creating CaloTower tests...\n"); 
00214   
00215   return;
00216 }

void HcalCaloTowerClient::endJob ( void   ) 

EndJob.

Definition at line 44 of file HcalCaloTowerClient.cc.

References cleanup(), GenMuonPlsPt100GeV_cfg::cout, HcalBaseClient::debug_, lat::endl(), and HcalBaseClient::ievt_.

Referenced by HcalMonitorClient::endJob().

00044                                      {
00045 
00046   if ( debug_ ) cout << "HcalCaloTowerClient: endJob, ievt = " << ievt_ << endl;
00047 
00048   this->cleanup(); 
00049   return;
00050 }

void HcalCaloTowerClient::endRun ( void   ) 

EndRun.

Definition at line 52 of file HcalCaloTowerClient.cc.

References cleanup(), GenMuonPlsPt100GeV_cfg::cout, HcalBaseClient::debug_, lat::endl(), and HcalBaseClient::jevt_.

Referenced by HcalMonitorClient::endRun().

00052                                      {
00053 
00054   if ( debug_ ) cout << "HcalCaloTowerClient: endRun, jevt = " << jevt_ << endl;
00055 
00056   this->cleanup();
00057   return;
00058 }

void HcalCaloTowerClient::getHistograms (  ) 

Definition at line 114 of file HcalCaloTowerClient.cc.

References HcalBaseClient::cloneME_, HcalBaseClient::dbe_, HcalBaseClient::debug_, energy_, getHisto2(), name, occ_, and HcalBaseClient::process_.

Referenced by report().

00114                                        {
00115   if(!dbe_) return;
00116   char name[150];    
00117   sprintf(name,"CaloTowerMonitor/CaloTowerOccupancy");
00118   occ_=getHisto2(name,process_,dbe_, debug_,cloneME_);
00119   sprintf(name,"CaloTowerMonitor/CaloTowerEnergy");
00120   energy_=getHisto2(name,process_,dbe_, debug_,cloneME_);
00121 
00122   return;
00123 }

void HcalCaloTowerClient::htmlOutput ( int  run,
string  htmlDir,
string  htmlName 
)

HtmlOutput.

Definition at line 139 of file HcalCaloTowerClient.cc.

References GenMuonPlsPt100GeV_cfg::cout, HcalBaseClient::dbe_, HcalBaseClient::dqmReportMapErr_, HcalBaseClient::dqmReportMapOther_, HcalBaseClient::dqmReportMapWarn_, lat::endl(), energy_, HcalBaseClient::hasErrors(), HcalBaseClient::hasOther(), HcalBaseClient::hasWarnings(), histoHTML2(), htmlErrors(), HcalBaseClient::ievt_, occ_, and HcalBaseClient::process_.

Referenced by HcalMonitorClient::htmlOutput().

00139                                                                               {
00140 
00141   cout << "Preparing HcalCaloTowerClient html output ..." << endl;
00142   string client = "CaloTowerMonitor";
00143   htmlErrors(runNo,htmlDir,client,process_,dbe_,dqmReportMapErr_,dqmReportMapWarn_,dqmReportMapOther_);
00144   
00145   ofstream htmlFile;
00146   htmlFile.open((htmlDir + htmlName).c_str());
00147 
00148   // html page header
00149   htmlFile << "<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">  " << endl;
00150   htmlFile << "<html>  " << endl;
00151   htmlFile << "<head>  " << endl;
00152   htmlFile << "  <meta content=\"text/html; charset=ISO-8859-1\"  " << endl;
00153   htmlFile << " https-equiv=\"content-type\">  " << endl;
00154   htmlFile << "  <title>Monitor: Hcal CaloTower Task output</title> " << endl;
00155   htmlFile << "</head>  " << endl;
00156   htmlFile << "<style type=\"text/css\"> td { font-weight: bold } </style>" << endl;
00157   htmlFile << "<body>  " << endl;
00158   htmlFile << "<br>  " << endl;
00159   htmlFile << "<h2>Run:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" << endl;
00160   htmlFile << "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span " << endl;
00161   htmlFile << " style=\"color: rgb(0, 0, 153);\">" << runNo << "</span></h2>" << endl;
00162   htmlFile << "<h2>Monitoring task:&nbsp;&nbsp;&nbsp;&nbsp; <span " << endl;
00163   htmlFile << " style=\"color: rgb(0, 0, 153);\">Hcal CaloTowers</span></h2> " << endl;
00164   htmlFile << "<h2>Events processed:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" << endl;
00165   htmlFile << "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span " << endl;
00166   htmlFile << " style=\"color: rgb(0, 0, 153);\">" << ievt_ << "</span></h2>" << endl;
00167   htmlFile << "<hr>" << endl;
00168   htmlFile << "<table  width=100% border=1><tr>" << endl;
00169   if(hasErrors())htmlFile << "<td bgcolor=red><a href=\"CaloTowerMonitorErrors.html\">Errors in this task</a></td>" << endl;
00170   else htmlFile << "<td bgcolor=lime>No Errors</td>" << endl;
00171   if(hasWarnings()) htmlFile << "<td bgcolor=yellow><a href=\"CaloTowerMonitorWarnings.html\">Warnings in this task</a></td>" << endl;
00172   else htmlFile << "<td bgcolor=lime>No Warnings</td>" << endl;
00173   if(hasOther()) htmlFile << "<td bgcolor=aqua><a href=\"CaloTowerMonitorMessages.html\">Messages in this task</a></td>" << endl;
00174   else htmlFile << "<td bgcolor=lime>No Messages</td>" << endl;
00175   htmlFile << "</tr></table>" << endl;
00176   htmlFile << "<hr>" << endl;
00177 
00178   htmlFile << "<h2><strong>Hcal CaloTower Histograms</strong></h2>" << endl;
00179   htmlFile << "<h3>" << endl;
00180   /*
00181   if(subDetsOn_[0]) htmlFile << "<a href=\"#HB_Plots\">HB Plots </a></br>" << endl;
00182   if(subDetsOn_[1]) htmlFile << "<a href=\"#HE_Plots\">HE Plots </a></br>" << endl;
00183   if(subDetsOn_[2]) htmlFile << "<a href=\"#HF_Plots\">HF Plots </a></br>" << endl;
00184   if(subDetsOn_[3]) htmlFile << "<a href=\"#HO_Plots\">HO Plots </a></br>" << endl;
00185   */
00186   htmlFile << "</h3>" << endl;
00187   htmlFile << "<hr>" << endl;
00188 
00189   htmlFile << "<table border=\"0\" cellspacing=\"0\" " << endl;
00190   htmlFile << "cellpadding=\"10\"> " << endl;
00191   
00192   htmlFile << "<td>&nbsp;&nbsp;&nbsp;<h3>Global Histograms</h3></td></tr>" << endl;
00193   htmlFile << "<tr align=\"left\">" << endl;
00194   histoHTML2(runNo,occ_,"iEta","iPhi", 92, htmlFile,htmlDir);
00195   histoHTML2(runNo,energy_,"iEta","iPhi", 100, htmlFile,htmlDir);
00196   htmlFile << "</tr>" << endl;
00197   htmlFile<<"</table>"<<endl;
00198   htmlFile << "<br>" << endl;
00199 
00200   // html page footer
00201   htmlFile << "</body> " << endl;
00202   htmlFile << "</html> " << endl;
00203 
00204   htmlFile.close();
00205 
00206   return;
00207 }

void HcalCaloTowerClient::init ( const edm::ParameterSet ps,
DQMStore dbe,
string  clientName 
) [virtual]

Reimplemented from HcalBaseClient.

Definition at line 8 of file HcalCaloTowerClient.cc.

References energy_, HcalBaseClient::ievt_, HcalBaseClient::init(), HcalBaseClient::jevt_, and occ_.

Referenced by HcalMonitorClient::initialize().

00008                                                                                       {
00009   //Call the base class first
00010   HcalBaseClient::init(ps,dbe,clientName);
00011   ievt_ = 0;
00012   jevt_ = 0;
00013   occ_=0;
00014   energy_=0;
00015 
00016 }

void HcalCaloTowerClient::loadHistograms ( TFile *  f  ) 

Definition at line 219 of file HcalCaloTowerClient.cc.

References energy_, HcalBaseClient::ievt_, name, occ_, and s.

00219                                                      {
00220 
00221   // Don't currently use event number
00222   TNamed* tnd = (TNamed*)infile->Get("DQMData/Hcal/CaloTowerMonitor/CaloTower Event Number");
00223   if(tnd){
00224     string s =tnd->GetTitle();
00225     ievt_ = -1;
00226     sscanf((s.substr(2,s.length()-2)).c_str(), "%d", &ievt_);
00227   }
00228 
00229   char name[150];    
00230   sprintf(name,"DQMData/Hcal/CaloTowerMonitor/CaloTowerOccupancy");      
00231   occ_= (TH2F*)infile->Get(name);
00232   sprintf(name,"DQMData/Hcal/CaloTowerMonitor/CaloTowerEnergy");      
00233   energy_= (TH2F*)infile->Get(name);
00234 
00235   return;
00236 }

void HcalCaloTowerClient::report (  ) 

Definition at line 83 of file HcalCaloTowerClient.cc.

References GenMuonPlsPt100GeV_cfg::cout, HcalBaseClient::dbe_, HcalBaseClient::debug_, lat::endl(), DQMStore::get(), getHistograms(), HcalBaseClient::ievt_, me, name, HcalBaseClient::process_, s, and setup().

Referenced by HcalMonitorClient::report().

00083                                 {
00084   if(!dbe_) return;
00085   if ( debug_ ) cout << "HcalCaloTowerClient: report" << endl;
00086   this->setup();
00087 
00088   char name[256];
00089   sprintf(name, "%sHcal/CaloTowerMonitor/CaloTower Event Number",process_.c_str());
00090   MonitorElement* me = dbe_->get(name); 
00091   if ( me ) {
00092     string s = me->valueString();
00093     ievt_ = -1;
00094     sscanf((s.substr(2,s.length()-2)).c_str(), "%d", &ievt_);
00095     if ( debug_ ) cout << "Found '" << name << "'" << endl;
00096   }
00097   getHistograms();
00098 
00099   return;
00100 }

void HcalCaloTowerClient::resetAllME (  ) 

Definition at line 125 of file HcalCaloTowerClient.cc.

References HcalBaseClient::dbe_, name, HcalBaseClient::process_, and resetME().

Referenced by beginJob(), beginRun(), and HcalMonitorClient::resetAllME().

00125                                     {
00126   if(!dbe_) return;
00127   Char_t name[150];
00128   
00129   sprintf(name,"%sHcal/CaloTowerMonitor/CaloTowerOccupancy",process_.c_str());
00130   resetME(name,dbe_);
00131   sprintf(name,"%sHcal/CaloTowerMonitor/CaloTowerEnergyy",process_.c_str());
00132   resetME(name,dbe_);
00133 
00134 
00135   return;
00136 }

void HcalCaloTowerClient::setup ( void   ) 

Setup.

Definition at line 60 of file HcalCaloTowerClient.cc.

Referenced by beginJob(), beginRun(), and report().

00060                                     {
00061   return;
00062 }


Member Data Documentation

TH2F* HcalCaloTowerClient::energy_ [private]

Definition at line 52 of file HcalCaloTowerClient.h.

Referenced by cleanup(), getHistograms(), htmlOutput(), init(), and loadHistograms().

TH2F* HcalCaloTowerClient::occ_ [private]

Definition at line 51 of file HcalCaloTowerClient.h.

Referenced by cleanup(), getHistograms(), htmlOutput(), init(), and loadHistograms().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:23:30 2009 for CMSSW by  doxygen 1.5.4