#include <ESDcsInfoTask.h>
Public Member Functions | |
ESDcsInfoTask (const edm::ParameterSet &ps) | |
Constructor. | |
virtual | ~ESDcsInfoTask () |
Destructor. | |
Protected Member Functions | |
void | analyze (const edm::Event &e, const edm::EventSetup &c) |
Analyze. | |
void | beginJob (void) |
BeginJob. | |
void | beginLuminosityBlock (const edm::LuminosityBlock &lumiBlock, const edm::EventSetup &iSetup) |
BeginLuminosityBlock. | |
void | cleanup (void) |
Cleanup. | |
void | endJob (void) |
EndJob. | |
void | endLuminosityBlock (const edm::LuminosityBlock &lumiBlock, const edm::EventSetup &iSetup) |
EndLuminosityBlock. | |
void | reset (void) |
Reset. | |
Private Attributes | |
edm::InputTag | dcsStatuslabel_ |
DQMStore * | dqmStore_ |
bool | enableCleanup_ |
int | ievt_ |
MonitorElement * | meESDcsActiveMap_ |
MonitorElement * | meESDcsFraction_ |
bool | mergeRuns_ |
std::string | prefixME_ |
Definition at line 11 of file ESDcsInfoTask.h.
ESDcsInfoTask::ESDcsInfoTask | ( | const edm::ParameterSet & | ps | ) |
Constructor.
Definition at line 22 of file ESDcsInfoTask.cc.
References edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), and cmsCodeRules::cppFunctionSkipper::operator.
{ dqmStore_ = Service<DQMStore>().operator->(); prefixME_ = ps.getUntrackedParameter<string>("prefixME", ""); enableCleanup_ = ps.getUntrackedParameter<bool>("enableCleanup", false); mergeRuns_ = ps.getUntrackedParameter<bool>("mergeRuns", false); dcsStatuslabel_ = ps.getParameter<InputTag>("DcsStatusLabel"); meESDcsFraction_ = 0; meESDcsActiveMap_ = 0; }
ESDcsInfoTask::~ESDcsInfoTask | ( | ) | [virtual] |
void ESDcsInfoTask::analyze | ( | const edm::Event & | e, |
const edm::EventSetup & | c | ||
) | [protected, virtual] |
Analyze.
Implements edm::EDAnalyzer.
Definition at line 107 of file ESDcsInfoTask.cc.
References DcsStatus::ESm, DcsStatus::ESp, edm::Event::getByLabel(), and edm::HandleBase::isValid().
{ ievt_++; float ESpDcsStatus = 0; float ESmDcsStatus = 0; Handle<DcsStatusCollection> dcsStatus; e.getByLabel(dcsStatuslabel_, dcsStatus); if (dcsStatus.isValid()) { for (DcsStatusCollection::const_iterator dcsStatusItr = dcsStatus->begin(); dcsStatusItr != dcsStatus->end(); ++dcsStatusItr) { ESpDcsStatus = dcsStatusItr->ready(DcsStatus::ESp); ESmDcsStatus = dcsStatusItr->ready(DcsStatus::ESm); } ESpDcsStatus = (ESpDcsStatus + float(ievt_-1)*meESDcsActiveMap_->getBinContent(1))/float(ievt_); ESmDcsStatus = (ESmDcsStatus + float(ievt_-1)*meESDcsActiveMap_->getBinContent(2))/float(ievt_); } meESDcsActiveMap_->setBinContent(1, ESpDcsStatus); meESDcsActiveMap_->setBinContent(2, ESmDcsStatus); meESDcsFraction_->Fill( (ESpDcsStatus + ESmDcsStatus)/2. ); }
void ESDcsInfoTask::beginJob | ( | void | ) | [protected, virtual] |
BeginJob.
Reimplemented from edm::EDAnalyzer.
Definition at line 43 of file ESDcsInfoTask.cc.
References timingPdfMaker::histo.
{ char histo[200]; if ( dqmStore_ ) { dqmStore_->setCurrentFolder(prefixME_ + "/EventInfo"); sprintf(histo, "DCSSummary"); meESDcsFraction_ = dqmStore_->bookFloat(histo); meESDcsFraction_->Fill(-1.0); sprintf(histo, "DCSSummaryMap"); meESDcsActiveMap_ = dqmStore_->book1D(histo,histo, 2, 0., 2.); meESDcsActiveMap_->setAxisTitle("(ES+/ES-)", 1); } }
void ESDcsInfoTask::beginLuminosityBlock | ( | const edm::LuminosityBlock & | lumiBlock, |
const edm::EventSetup & | iSetup | ||
) | [protected, virtual] |
BeginLuminosityBlock.
Reimplemented from edm::EDAnalyzer.
Definition at line 70 of file ESDcsInfoTask.cc.
{ this->reset(); for( int i = 0; i < 2; i++) { meESDcsActiveMap_->setBinContent(i+1 , -1.0); } }
void ESDcsInfoTask::cleanup | ( | void | ) | [protected] |
Cleanup.
Definition at line 93 of file ESDcsInfoTask.cc.
{ if ( dqmStore_ ) { dqmStore_->setCurrentFolder(prefixME_ + "/EventInfo"); if ( meESDcsFraction_ ) dqmStore_->removeElement( meESDcsFraction_->getName() ); if ( meESDcsActiveMap_ ) dqmStore_->removeElement( meESDcsActiveMap_->getName() ); } }
void ESDcsInfoTask::endJob | ( | void | ) | [protected, virtual] |
EndJob.
Reimplemented from edm::EDAnalyzer.
Definition at line 64 of file ESDcsInfoTask.cc.
References edm::cleanup().
{ if ( enableCleanup_ ) this->cleanup(); }
void ESDcsInfoTask::endLuminosityBlock | ( | const edm::LuminosityBlock & | lumiBlock, |
const edm::EventSetup & | iSetup | ||
) | [protected, virtual] |
EndLuminosityBlock.
Reimplemented from edm::EDAnalyzer.
Definition at line 80 of file ESDcsInfoTask.cc.
{ }
void ESDcsInfoTask::reset | ( | void | ) | [protected] |
Reset.
Definition at line 84 of file ESDcsInfoTask.cc.
{ if ( meESDcsFraction_ ) meESDcsFraction_->Reset(); if ( meESDcsActiveMap_ ) meESDcsActiveMap_->Reset(); }
edm::InputTag ESDcsInfoTask::dcsStatuslabel_ [private] |
Definition at line 54 of file ESDcsInfoTask.h.
DQMStore* ESDcsInfoTask::dqmStore_ [private] |
Definition at line 46 of file ESDcsInfoTask.h.
bool ESDcsInfoTask::enableCleanup_ [private] |
Definition at line 50 of file ESDcsInfoTask.h.
int ESDcsInfoTask::ievt_ [private] |
Definition at line 59 of file ESDcsInfoTask.h.
MonitorElement* ESDcsInfoTask::meESDcsActiveMap_ [private] |
Definition at line 57 of file ESDcsInfoTask.h.
MonitorElement* ESDcsInfoTask::meESDcsFraction_ [private] |
Definition at line 56 of file ESDcsInfoTask.h.
bool ESDcsInfoTask::mergeRuns_ [private] |
Definition at line 52 of file ESDcsInfoTask.h.
std::string ESDcsInfoTask::prefixME_ [private] |
Definition at line 48 of file ESDcsInfoTask.h.