#include <EcalDQMonitorClient.h>
Public Member Functions | |
EcalDQMonitorClient (const edm::ParameterSet &) | |
~EcalDQMonitorClient () | |
Static Public Member Functions | |
static void | fillDescriptions (edm::ConfigurationDescriptions &) |
Private Member Functions | |
void | analyze (const edm::Event &, const edm::EventSetup &) |
void | beginLuminosityBlock (const edm::LuminosityBlock &, const edm::EventSetup &) |
void | beginRun (const edm::Run &, const edm::EventSetup &) |
void | endLuminosityBlock (const edm::LuminosityBlock &, const edm::EventSetup &) |
void | endRun (const edm::Run &, const edm::EventSetup &) |
void | runWorkers () |
Private Attributes | |
int | lumiStatus_ |
bool | runAtEndLumi_ |
std::vector < ecaldqm::DQWorkerClient * > | workers_ |
Definition at line 19 of file EcalDQMonitorClient.h.
EcalDQMonitorClient::EcalDQMonitorClient | ( | const edm::ParameterSet & | _ps | ) |
Definition at line 27 of file EcalDQMonitorClient.cc.
References OfflineClient_cff::client, gather_cfg::cout, tests::test_Package01::factory, ecaldqm::DQWorker::getName(), edm::ParameterSet::getUntrackedParameter(), edm::ParameterSet::getUntrackedParameterSet(), EcalDQMonitor::moduleName_, ecaldqm::DQWorker::setVerbosity(), EcalDQMonitor::verbosity_, and workers_.
: EcalDQMonitor(_ps), workers_(0), runAtEndLumi_(_ps.getUntrackedParameter<bool>("runAtEndLumi", false)), lumiStatus_(-1) { using namespace std; const edm::ParameterSet& clientParams(_ps.getUntrackedParameterSet("clientParameters")); const edm::ParameterSet& mePaths(_ps.getUntrackedParameterSet("mePaths")); vector<string> clientNames(_ps.getUntrackedParameter<vector<string> >("clients")); WorkerFactory factory(0); for(vector<string>::iterator cItr(clientNames.begin()); cItr != clientNames.end(); ++cItr){ if (!(factory = SetWorker::findFactory(*cItr))) continue; if(verbosity_ > 0) cout << moduleName_ << ": Setting up " << *cItr << endl; DQWorker* worker(factory(clientParams, mePaths.getUntrackedParameterSet(*cItr))); if(worker->getName() != *cItr){ delete worker; continue; } DQWorkerClient* client(static_cast<DQWorkerClient*>(worker)); client->setVerbosity(verbosity_); workers_.push_back(client); } }
EcalDQMonitorClient::~EcalDQMonitorClient | ( | ) |
Definition at line 59 of file EcalDQMonitorClient.cc.
References workers_.
void EcalDQMonitorClient::analyze | ( | const edm::Event & | , |
const edm::EventSetup & | |||
) | [inline, private, virtual] |
void EcalDQMonitorClient::beginLuminosityBlock | ( | const edm::LuminosityBlock & | _lumi, |
const edm::EventSetup & | _es | ||
) | [private, virtual] |
Reimplemented from edm::EDAnalyzer.
Definition at line 124 of file EcalDQMonitorClient.cc.
References lumiStatus_, and workers_.
{ for(std::vector<DQWorkerClient *>::iterator wItr(workers_.begin()); wItr != workers_.end(); ++wItr) (*wItr)->beginLuminosityBlock(_lumi, _es); lumiStatus_ = 0; }
void EcalDQMonitorClient::beginRun | ( | const edm::Run & | _run, |
const edm::EventSetup & | _es | ||
) | [private, virtual] |
Reimplemented from edm::EDAnalyzer.
Definition at line 75 of file EcalDQMonitorClient.cc.
References ecaldqm::DQWorker::beginRun(), ecaldqm::DQWorker::bookMEs(), OfflineClient_cff::client, gather_cfg::cout, edm::EventSetup::find(), edm::EventSetup::get(), ecaldqm::DQWorker::getName(), lumiStatus_, EcalDQMonitor::moduleName_, edm::ESHandle< T >::product(), edm::RunBase::run(), ecaldqm::setElectronicsMap(), ecaldqm::setTrigTowerMap(), EcalDQMonitor::verbosity_, and workers_.
{ // set up ecaldqm::electronicsMap in EcalDQMCommonUtils edm::ESHandle<EcalElectronicsMapping> elecMapHandle; _es.get<EcalMappingRcd>().get(elecMapHandle); ecaldqm::setElectronicsMap(elecMapHandle.product()); // set up ecaldqm::electronicsMap in EcalDQMCommonUtils edm::ESHandle<EcalTrigTowerConstituentsMap> ttMapHandle; _es.get<IdealGeometryRecord>().get(ttMapHandle); ecaldqm::setTrigTowerMap(ttMapHandle.product()); if(_es.find(edm::eventsetup::EventSetupRecordKey::makeKey<EcalDQMChannelStatusRcd>())){ edm::ESHandle<EcalDQMChannelStatus> cStHndl; _es.get<EcalDQMChannelStatusRcd>().get(cStHndl); DQWorkerClient::channelStatus = cStHndl.product(); } if(_es.find(edm::eventsetup::EventSetupRecordKey::makeKey<EcalDQMTowerStatusRcd>())){ edm::ESHandle<EcalDQMTowerStatus> tStHndl; _es.get<EcalDQMTowerStatusRcd>().get(tStHndl); DQWorkerClient::towerStatus = tStHndl.product(); } for(std::vector<DQWorkerClient*>::iterator wItr(workers_.begin()); wItr != workers_.end(); ++wItr){ DQWorkerClient* client(*wItr); if(verbosity_ > 1) std::cout << moduleName_ << ": Booking MEs for " << client->getName() << std::endl; client->bookMEs(); client->beginRun(_run, _es); } lumiStatus_ = -1; if(verbosity_ > 0) std::cout << moduleName_ << ": Starting run " << _run.run() << std::endl; }
void EcalDQMonitorClient::endLuminosityBlock | ( | const edm::LuminosityBlock & | _lumi, |
const edm::EventSetup & | _es | ||
) | [private, virtual] |
Reimplemented from edm::EDAnalyzer.
Definition at line 133 of file EcalDQMonitorClient.cc.
References lumiStatus_, runAtEndLumi_, runWorkers(), and workers_.
{ for(std::vector<DQWorkerClient *>::iterator wItr(workers_.begin()); wItr != workers_.end(); ++wItr) (*wItr)->endLuminosityBlock(_lumi, _es); if(runAtEndLumi_){ runWorkers(); lumiStatus_ = 1; } }
void EcalDQMonitorClient::endRun | ( | const edm::Run & | _run, |
const edm::EventSetup & | _es | ||
) | [private, virtual] |
Reimplemented from edm::EDAnalyzer.
Definition at line 113 of file EcalDQMonitorClient.cc.
References lumiStatus_, runWorkers(), and workers_.
{ if(lumiStatus_ == 0) runWorkers(); for(std::vector<DQWorkerClient *>::iterator wItr(workers_.begin()); wItr != workers_.end(); ++wItr){ (*wItr)->endRun(_run, _es); } }
void EcalDQMonitorClient::fillDescriptions | ( | edm::ConfigurationDescriptions & | _descs | ) | [static] |
Reimplemented from edm::EDAnalyzer.
Definition at line 67 of file EcalDQMonitorClient.cc.
References edm::ConfigurationDescriptions::addDefault(), and edm::ParameterSetDescription::setUnknown().
{ edm::ParameterSetDescription desc; desc.setUnknown(); _descs.addDefault(desc); }
void EcalDQMonitorClient::runWorkers | ( | ) | [private] |
Definition at line 145 of file EcalDQMonitorClient.cc.
References OfflineClient_cff::client, gather_cfg::cout, ecaldqm::DQWorkerClient::initialize(), ecaldqm::DQWorker::isInitialized(), ecaldqm::DQWorkerClient::producePlots(), EcalDQMonitor::verbosity_, and workers_.
Referenced by endLuminosityBlock(), and endRun().
{ if(verbosity_ > 0) std::cout << "EcalDQMonitorClient: Starting worker modules.." << std::endl; for(std::vector<DQWorkerClient *>::iterator wItr(workers_.begin()); wItr != workers_.end(); ++wItr){ DQWorkerClient* client(*wItr); if(!client->isInitialized()) client->initialize(); if(client->isInitialized()) client->producePlots(); } if(verbosity_ > 0) std::cout << " done." << std::endl; }
int EcalDQMonitorClient::lumiStatus_ [private] |
Definition at line 41 of file EcalDQMonitorClient.h.
Referenced by beginLuminosityBlock(), beginRun(), endLuminosityBlock(), and endRun().
bool EcalDQMonitorClient::runAtEndLumi_ [private] |
Definition at line 40 of file EcalDQMonitorClient.h.
Referenced by endLuminosityBlock().
std::vector<ecaldqm::DQWorkerClient*> EcalDQMonitorClient::workers_ [private] |
Definition at line 38 of file EcalDQMonitorClient.h.
Referenced by beginLuminosityBlock(), beginRun(), EcalDQMonitorClient(), endLuminosityBlock(), endRun(), runWorkers(), and ~EcalDQMonitorClient().