CMS 3D CMS Logo

L1TEMUEventInfoClient Class Reference

#include <DQM/L1TMonitorClient/interface/L1TEMUEventInfoClient.h>

Inheritance diagram for L1TEMUEventInfoClient:

edm::EDAnalyzer

List of all members.

Public Member Functions

 L1TEMUEventInfoClient (const edm::ParameterSet &ps)
 Constructor.
virtual ~L1TEMUEventInfoClient ()
 Destructor.

Protected Member Functions

void analyze (const edm::Event &e, const edm::EventSetup &c)
 Fake Analyze.
void beginJob (const edm::EventSetup &c)
 BeginJob.
void beginLuminosityBlock (const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &context)
void beginRun (const edm::Run &r, const edm::EventSetup &c)
 BeginRun.
void endJob ()
 Endjob.
void endLuminosityBlock (const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &c)
 DQM Client Diagnostic.
void endRun (const edm::Run &r, const edm::EventSetup &c)
 EndRun.

Private Member Functions

TH1F * get1DHisto (string meName, DQMStore *dbi)
TProfile * get1DProfile (string meName, DQMStore *dbi)
TH2F * get2DHisto (string meName, DQMStore *dbi)
TProfile2D * get2DProfile (string meName, DQMStore *dbi)
void initialize ()
Float_t setSummary (MonitorElement *)

Private Attributes

int counterEvt_
 counter
int counterLS_
DQMStoredbe_
std::string monitorDir_
int nChannels
 prescale on number of events
edm::ParameterSet parameters_
int prescaleEvt_
 units of lumi sections
int prescaleLS_
 counter
Float_t reportSummary
MonitorElementreportSummary_
MonitorElementreportSummaryContent_ [nsys_]
MonitorElementreportSummaryMap_
Float_t summaryContent [nsys_]
Float_t summarySum
std::string syslabel_ [nsysmon_]
std::string syslabelext_ [nsysmon_]
bool sysmask_ [nsysmon_]
bool verbose_

Static Private Attributes

static const int nsys_ = 20
static const int nsysmon_ = 11


Detailed Description

Definition at line 22 of file L1TEMUEventInfoClient.h.


Constructor & Destructor Documentation

L1TEMUEventInfoClient::L1TEMUEventInfoClient ( const edm::ParameterSet ps  ) 

Constructor.

Definition at line 28 of file L1TEMUEventInfoClient.cc.

References initialize(), and parameters_.

00029 {
00030   parameters_=ps;
00031   initialize();
00032 }

L1TEMUEventInfoClient::~L1TEMUEventInfoClient (  )  [virtual]

Destructor.

Definition at line 34 of file L1TEMUEventInfoClient.cc.

References GenMuonPlsPt100GeV_cfg::cout, lat::endl(), and verbose_.

00034                                              {
00035  if(verbose_) cout <<"[TriggerDQM]: ending... " << endl;
00036 }


Member Function Documentation

void L1TEMUEventInfoClient::analyze ( const edm::Event e,
const edm::EventSetup c 
) [protected, virtual]

Fake Analyze.

Implements edm::EDAnalyzer.

Definition at line 178 of file L1TEMUEventInfoClient.cc.

References counterEvt_, GenMuonPlsPt100GeV_cfg::cout, lat::endl(), prescaleEvt_, and verbose_.

00178                                                                             {
00179    
00180    counterEvt_++;
00181    if (prescaleEvt_<1) return;
00182    if (prescaleEvt_>0 && counterEvt_%prescaleEvt_ != 0) return;
00183 
00184    if(verbose_) cout << "L1TEMUEventInfoClient::analyze" << endl;
00185 }

void L1TEMUEventInfoClient::beginJob ( const edm::EventSetup c  )  [protected, virtual]

BeginJob.

Reimplemented from edm::EDAnalyzer.

Definition at line 77 of file L1TEMUEventInfoClient.cc.

References DQMStore::book2D(), DQMStore::bookFloat(), GenMuonPlsPt100GeV_cfg::cout, data, dbe_, lat::endl(), MonitorElement::Fill(), DQMStore::get(), MonitorElement::getName(), i, k, nsys_, nsysmon_, DQMStore::removeElement(), reportSummary_, reportSummaryContent_, reportSummaryMap_, MonitorElement::setAxisTitle(), MonitorElement::setBinLabel(), DQMStore::setCurrentFolder(), summaryContent, syslabelext_, and verbose_.

00077                                                              {
00078 
00079   if(verbose_) cout <<"[TriggerDQM]: Begin Job" << endl;
00080   // get backendinterface  
00081   dbe_ = Service<DQMStore>().operator->();
00082 
00083   dbe_->setCurrentFolder("L1TEMU/EventInfo");
00084 
00085 //  sprintf(histo, "reportSummary");
00086   if ( reportSummary_ = dbe_->get("L1TEMU/EventInfo/reportSumamry") ) {
00087       dbe_->removeElement(reportSummary_->getName()); 
00088    }
00089   
00090   reportSummary_ = dbe_->bookFloat("reportSummary");
00091 
00092   //initialize reportSummary to 1
00093   if (reportSummary_) reportSummary_->Fill(1);
00094 
00095   dbe_->setCurrentFolder("L1TEMU/EventInfo/reportSummaryContents");
00096 
00097   char lbl[100];  
00098 
00099   for (int i=0; i<nsys_; i++) {    
00100     
00101     if(i<nsysmon_)
00102       sprintf(lbl,"L1TEMU_%s",syslabelext_[i].data());
00103     else 
00104       sprintf(lbl,"L1TEMU_dummy%d",i-nsysmon_+1);
00105 
00106     reportSummaryContent_[i] = dbe_->bookFloat(lbl);
00107     //if(reportSummaryContent_[i] = dbe_->get("L1T/EventInfo/reportSummaryContents/" + histo)) dbe_->removeElement(reportSummaryContent_[i]->getName());
00108   }
00109 
00110   //initialize reportSummaryContents to 1
00111   for (int k=0; k<nsys_; k++) {
00112     summaryContent[k] = 1;
00113     reportSummaryContent_[k]->Fill(1.);
00114   }  
00115 
00116   dbe_->setCurrentFolder("L1TEMU/EventInfo");
00117 
00118   if ( reportSummaryMap_ = dbe_->get("L1TEMU/EventInfo/reportSummaryMap") ) {
00119     dbe_->removeElement(reportSummaryMap_->getName());
00120   }
00121 
00122   reportSummaryMap_ = dbe_->book2D("reportSummaryMap", "reportSummaryMap", 1, 1, 2, 11, 1, nsysmon_+1);
00123   for(int i=0; i<nsysmon_; i++) {
00124     reportSummaryMap_->setBinLabel(i+1,syslabelext_[i],2);
00125   }
00126   reportSummaryMap_->setAxisTitle("", 1);
00127   reportSummaryMap_->setAxisTitle("", 2);
00128   reportSummaryMap_->setBinLabel(1," ",1);
00129 
00130 }

void L1TEMUEventInfoClient::beginLuminosityBlock ( const edm::LuminosityBlock lumiSeg,
const edm::EventSetup context 
) [protected, virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 137 of file L1TEMUEventInfoClient.cc.

00137                                                                                                           {
00138    // optionally reset histograms here
00139 }

void L1TEMUEventInfoClient::beginRun ( const edm::Run r,
const edm::EventSetup c 
) [protected, virtual]

BeginRun.

Reimplemented from edm::EDAnalyzer.

Definition at line 133 of file L1TEMUEventInfoClient.cc.

00133                                                                             {
00134 }

void L1TEMUEventInfoClient::endJob ( void   )  [protected, virtual]

Endjob.

Reimplemented from edm::EDAnalyzer.

Definition at line 192 of file L1TEMUEventInfoClient.cc.

00192                                   {
00193 }

void L1TEMUEventInfoClient::endLuminosityBlock ( const edm::LuminosityBlock lumiSeg,
const edm::EventSetup c 
) [protected, virtual]

DQM Client Diagnostic.

Reimplemented from edm::EDAnalyzer.

Definition at line 141 of file L1TEMUEventInfoClient.cc.

References dbe_, MonitorElement::Fill(), DQMStore::get(), i, nsys_, nsysmon_, pv, reportSummary, reportSummary_, reportSummaryContent_, reportSummaryMap_, MonitorElement::setBinContent(), setSummary(), summaryContent, summarySum, syslabel_, syslabelext_, and sysmask_.

00142                                                  {
00143 
00144   for (int i = 0; i < nsys_; i++) {
00145     summaryContent[i] = 1;    
00146     reportSummaryContent_[i]->Fill(1.);
00147   }
00148   summarySum = 0;
00149 
00150   MonitorElement* QHist[nsysmon_];   
00151   std::string lbl("");  
00152   for(int i=0; i<nsysmon_; i++) {
00153     lbl.clear();
00154     lbl+="L1TEMU/"; lbl+=syslabel_[i]; lbl+="/"; 
00155     lbl+=syslabelext_[i]; lbl+="ErrorFlag";
00156     QHist[i]=dbe_->get(lbl.data());
00157     float pv = -1.;
00158     if(!sysmask_[i])
00159       pv = setSummary(QHist[i]);
00160     summaryContent[i] = pv;
00161     reportSummaryContent_[i]->Fill(pv);
00162   }
00163 
00164   for (int i = 0; i < nsys_; i++) {    
00165     if(summaryContent[i] != -1)  summarySum += summaryContent[i];
00166   }
00167   
00168   reportSummary = summarySum / nsys_;
00169   if (reportSummary_) reportSummary_->Fill(reportSummary);
00170 
00171    //12x1 summary map
00172   for (int i=0; i< 11; i++)
00173     reportSummaryMap_->setBinContent(1,i+1,summaryContent[i]);
00174 
00175 }

void L1TEMUEventInfoClient::endRun ( const edm::Run r,
const edm::EventSetup c 
) [protected, virtual]

EndRun.

Reimplemented from edm::EDAnalyzer.

Definition at line 188 of file L1TEMUEventInfoClient.cc.

00188                                                                          {
00189 }

TH1F * L1TEMUEventInfoClient::get1DHisto ( string  meName,
DQMStore dbi 
) [private]

Definition at line 207 of file L1TEMUEventInfoClient.cc.

References GenMuonPlsPt100GeV_cfg::cout, lat::endl(), DQMStore::get(), MonitorElement::getTH1F(), NULL, and verbose_.

00208 {
00209 
00210   MonitorElement * me_ = dbi->get(meName);
00211 
00212   if (!me_) { 
00213     if(verbose_) cout << "ME NOT FOUND." << endl;
00214     return NULL;
00215   }
00216 
00217   return me_->getTH1F();
00218 }

TProfile * L1TEMUEventInfoClient::get1DProfile ( string  meName,
DQMStore dbi 
) [private]

Definition at line 251 of file L1TEMUEventInfoClient.cc.

References GenMuonPlsPt100GeV_cfg::cout, lat::endl(), DQMStore::get(), MonitorElement::getTProfile(), NULL, and verbose_.

00252 {
00253 
00254 
00255   MonitorElement * me_ = dbi->get(meName);
00256 
00257   if (!me_) { 
00258     if(verbose_) cout << "ME NOT FOUND." << endl;
00259     return NULL;
00260   }
00261 
00262   return me_->getTProfile();
00263 }

TH2F * L1TEMUEventInfoClient::get2DHisto ( string  meName,
DQMStore dbi 
) [private]

Definition at line 220 of file L1TEMUEventInfoClient.cc.

References GenMuonPlsPt100GeV_cfg::cout, lat::endl(), DQMStore::get(), MonitorElement::getTH2F(), NULL, and verbose_.

00221 {
00222 
00223 
00224   MonitorElement * me_ = dbi->get(meName);
00225 
00226   if (!me_) { 
00227     if(verbose_) cout << "ME NOT FOUND." << endl;
00228     return NULL;
00229   }
00230 
00231   return me_->getTH2F();
00232 }

TProfile2D * L1TEMUEventInfoClient::get2DProfile ( string  meName,
DQMStore dbi 
) [private]

Definition at line 236 of file L1TEMUEventInfoClient.cc.

References GenMuonPlsPt100GeV_cfg::cout, lat::endl(), DQMStore::get(), MonitorElement::getTProfile2D(), NULL, and verbose_.

00237 {
00238 
00239 
00240   MonitorElement * me_ = dbi->get(meName);
00241 
00242   if (!me_) { 
00243      if(verbose_) cout << "ME NOT FOUND." << endl;
00244    return NULL;
00245   }
00246 
00247   return me_->getTProfile2D();
00248 }

void L1TEMUEventInfoClient::initialize (  )  [private]

Definition at line 39 of file L1TEMUEventInfoClient.cc.

References counterEvt_, counterLS_, GenMuonPlsPt100GeV_cfg::cout, dbe_, lat::endl(), edm::ParameterSet::getUntrackedParameter(), i, monitorDir_, nsysmon_, parameters_, prescaleEvt_, prescaleLS_, syslabel_, syslabelext_, sysmask_, and verbose_.

Referenced by L1TEMUEventInfoClient().

00039                                       { 
00040 
00041   counterLS_=0; 
00042   counterEvt_=0; 
00043   
00044   // get back-end interface
00045   dbe_ = Service<DQMStore>().operator->();
00046   
00047   // base folder for the contents of this job
00048   verbose_ = parameters_.getUntrackedParameter<bool>("verbose", false);
00049   
00050   monitorDir_ = parameters_.getUntrackedParameter<string>("monitorDir","");
00051   if(verbose_) cout << "Monitor dir = " << monitorDir_ << endl;
00052     
00053   prescaleLS_ = parameters_.getUntrackedParameter<int>("prescaleLS", -1);
00054   if(verbose_) cout << "DQM lumi section prescale = " << prescaleLS_ << " lumi section(s)"<< endl;
00055   
00056   prescaleEvt_ = parameters_.getUntrackedParameter<int>("prescaleEvt", -1);
00057   if(verbose_) cout << "DQM event prescale = " << prescaleEvt_ << " events(s)"<< endl;
00058   
00059   //tbd should revert to regular order as defined in hardwarevalidation
00060   // + use std labels defined in traits therein
00061   std::string syslabel   [nsysmon_]=
00062     {"DTTF","DTTPG","CSCTF","CSCTPG","RPC","GMT", "ECAL","HCAL","RCT","GCT","GT"};
00063   std::string syslabelext[nsysmon_]=
00064     {"DTF","DTP","CTF","CTP","RPC","GMT", "ETP","HTP","RCT","GCT","GLT"};
00065   std::vector<unsigned int> sysmask(0,nsysmon_); 
00066   sysmask = parameters_.getUntrackedParameter<std::vector<unsigned int> >("maskedSystems", sysmask);
00067 
00068   for(int i=0; i<nsysmon_; i++) {
00069     syslabel_[i] = syslabel[i];
00070     syslabelext_[i] = syslabelext[i];
00071     sysmask_[i] = sysmask[i];
00072   }
00073   
00074 }

Float_t L1TEMUEventInfoClient::setSummary ( MonitorElement QHist  )  [private]

Definition at line 196 of file L1TEMUEventInfoClient.cc.

References MonitorElement::getBinContent(), MonitorElement::getEntries(), and i.

Referenced by endLuminosityBlock().

00196                                                                {
00197   bool isempty = QHist->getEntries()==0;
00198   //errflag bins: agree, loc agree, loc disagree, data only, emul only
00199   if(!isempty)
00200     for(int i=1; i<5; i++) 
00201       if(QHist->getBinContent(i)>0) 
00202         {isempty=false;continue;}
00203   return isempty ? -1. : 
00204     (QHist->getBinContent(1)) / (QHist->getEntries());
00205 }


Member Data Documentation

int L1TEMUEventInfoClient::counterEvt_ [private]

counter

Definition at line 69 of file L1TEMUEventInfoClient.h.

Referenced by analyze(), and initialize().

int L1TEMUEventInfoClient::counterLS_ [private]

Definition at line 68 of file L1TEMUEventInfoClient.h.

Referenced by initialize().

DQMStore* L1TEMUEventInfoClient::dbe_ [private]

Definition at line 65 of file L1TEMUEventInfoClient.h.

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

std::string L1TEMUEventInfoClient::monitorDir_ [private]

Definition at line 66 of file L1TEMUEventInfoClient.h.

Referenced by initialize().

int L1TEMUEventInfoClient::nChannels [private]

prescale on number of events

Definition at line 72 of file L1TEMUEventInfoClient.h.

const int L1TEMUEventInfoClient::nsys_ = 20 [static, private]

Definition at line 75 of file L1TEMUEventInfoClient.h.

Referenced by beginJob(), and endLuminosityBlock().

const int L1TEMUEventInfoClient::nsysmon_ = 11 [static, private]

Definition at line 76 of file L1TEMUEventInfoClient.h.

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

edm::ParameterSet L1TEMUEventInfoClient::parameters_ [private]

Definition at line 63 of file L1TEMUEventInfoClient.h.

Referenced by initialize(), and L1TEMUEventInfoClient().

int L1TEMUEventInfoClient::prescaleEvt_ [private]

units of lumi sections

Definition at line 71 of file L1TEMUEventInfoClient.h.

Referenced by analyze(), and initialize().

int L1TEMUEventInfoClient::prescaleLS_ [private]

counter

Definition at line 70 of file L1TEMUEventInfoClient.h.

Referenced by initialize().

Float_t L1TEMUEventInfoClient::reportSummary [private]

Definition at line 78 of file L1TEMUEventInfoClient.h.

Referenced by endLuminosityBlock().

MonitorElement* L1TEMUEventInfoClient::reportSummary_ [private]

Definition at line 87 of file L1TEMUEventInfoClient.h.

Referenced by beginJob(), and endLuminosityBlock().

MonitorElement* L1TEMUEventInfoClient::reportSummaryContent_[nsys_] [private]

Definition at line 88 of file L1TEMUEventInfoClient.h.

Referenced by beginJob(), and endLuminosityBlock().

MonitorElement* L1TEMUEventInfoClient::reportSummaryMap_ [private]

Definition at line 89 of file L1TEMUEventInfoClient.h.

Referenced by beginJob(), and endLuminosityBlock().

Float_t L1TEMUEventInfoClient::summaryContent[nsys_] [private]

Definition at line 80 of file L1TEMUEventInfoClient.h.

Referenced by beginJob(), and endLuminosityBlock().

Float_t L1TEMUEventInfoClient::summarySum [private]

Definition at line 79 of file L1TEMUEventInfoClient.h.

Referenced by endLuminosityBlock().

std::string L1TEMUEventInfoClient::syslabel_[nsysmon_] [private]

Definition at line 81 of file L1TEMUEventInfoClient.h.

Referenced by endLuminosityBlock(), and initialize().

std::string L1TEMUEventInfoClient::syslabelext_[nsysmon_] [private]

Definition at line 82 of file L1TEMUEventInfoClient.h.

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

bool L1TEMUEventInfoClient::sysmask_[nsysmon_] [private]

Definition at line 83 of file L1TEMUEventInfoClient.h.

Referenced by endLuminosityBlock(), and initialize().

bool L1TEMUEventInfoClient::verbose_ [private]

Definition at line 67 of file L1TEMUEventInfoClient.h.

Referenced by analyze(), beginJob(), get1DHisto(), get1DProfile(), get2DHisto(), get2DProfile(), initialize(), and ~L1TEMUEventInfoClient().


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