CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
EcalDQMonitorClient Class Reference

#include <EcalDQMonitorClient.h>

Inheritance diagram for EcalDQMonitorClient:
EcalDQMonitor edm::EDAnalyzer edm::EDConsumerBase

Public Member Functions

 EcalDQMonitorClient (const edm::ParameterSet &)
 
 ~EcalDQMonitorClient ()
 
- Public Member Functions inherited from EcalDQMonitor
 EcalDQMonitor (const edm::ParameterSet &)
 
virtual ~EcalDQMonitor ()
 
- Public Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &)
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (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_
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
- Protected Attributes inherited from EcalDQMonitor
bool initialized_
 
const bool mergeRuns_
 
std::string moduleName_
 
const int verbosity_
 

Detailed Description

Definition at line 19 of file EcalDQMonitorClient.h.

Constructor & Destructor Documentation

EcalDQMonitorClient::EcalDQMonitorClient ( const edm::ParameterSet _ps)

Definition at line 27 of file EcalDQMonitorClient.cc.

References OfflineClient_cff::client, gather_cfg::cout, ecaldqm::DQWorker::getName(), edm::ParameterSet::getUntrackedParameter(), edm::ParameterSet::getUntrackedParameterSet(), EcalDQMonitor::moduleName_, ecaldqm::DQWorker::setVerbosity(), EcalDQMonitor::verbosity_, and workers_.

27  :
28  EcalDQMonitor(_ps),
29  workers_(0),
30  runAtEndLumi_(_ps.getUntrackedParameter<bool>("runAtEndLumi", false)),
31  lumiStatus_(-1)
32 {
33  using namespace std;
34 
35  const edm::ParameterSet& clientParams(_ps.getUntrackedParameterSet("clientParameters"));
36  const edm::ParameterSet& mePaths(_ps.getUntrackedParameterSet("mePaths"));
37 
38  vector<string> clientNames(_ps.getUntrackedParameter<vector<string> >("clients"));
39 
40  WorkerFactory factory(0);
41 
42  for(vector<string>::iterator cItr(clientNames.begin()); cItr != clientNames.end(); ++cItr){
43  if (!(factory = SetWorker::findFactory(*cItr))) continue;
44 
45  if(verbosity_ > 0) cout << moduleName_ << ": Setting up " << *cItr << endl;
46 
47  DQWorker* worker(factory(clientParams, mePaths.getUntrackedParameterSet(*cItr)));
48  if(worker->getName() != *cItr){
49  delete worker;
50  continue;
51  }
52  DQWorkerClient* client(static_cast<DQWorkerClient*>(worker));
53  client->setVerbosity(verbosity_);
54 
55  workers_.push_back(client);
56  }
57 }
T getUntrackedParameter(std::string const &, T const &) const
std::string moduleName_
Definition: EcalDQMonitor.h:22
EcalDQMonitor(const edm::ParameterSet &)
ParameterSet getUntrackedParameterSet(std::string const &name, ParameterSet const &defaultValue) const
DQWorker *(* WorkerFactory)(const edm::ParameterSet &, const edm::ParameterSet &)
Definition: DQWorker.h:64
std::vector< ecaldqm::DQWorkerClient * > workers_
tuple cout
Definition: gather_cfg.py:121
const int verbosity_
Definition: EcalDQMonitor.h:24
EcalDQMonitorClient::~EcalDQMonitorClient ( )

Definition at line 59 of file EcalDQMonitorClient.cc.

References workers_.

60 {
61  for(std::vector<DQWorkerClient*>::iterator wItr(workers_.begin()); wItr != workers_.end(); ++wItr)
62  delete *wItr;
63 }
std::vector< ecaldqm::DQWorkerClient * > workers_

Member Function Documentation

void EcalDQMonitorClient::analyze ( const edm::Event ,
const edm::EventSetup  
)
inlineprivatevirtual

Implements edm::EDAnalyzer.

Definition at line 33 of file EcalDQMonitorClient.h.

33 {}
void EcalDQMonitorClient::beginLuminosityBlock ( const edm::LuminosityBlock _lumi,
const edm::EventSetup _es 
)
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 124 of file EcalDQMonitorClient.cc.

References lumiStatus_, and workers_.

125 {
126  for(std::vector<DQWorkerClient *>::iterator wItr(workers_.begin()); wItr != workers_.end(); ++wItr)
127  (*wItr)->beginLuminosityBlock(_lumi, _es);
128 
129  lumiStatus_ = 0;
130 }
std::vector< ecaldqm::DQWorkerClient * > workers_
void EcalDQMonitorClient::beginRun ( const edm::Run _run,
const edm::EventSetup _es 
)
privatevirtual

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< class >::product(), edm::RunBase::run(), ecaldqm::setElectronicsMap(), ecaldqm::setTrigTowerMap(), EcalDQMonitor::verbosity_, and workers_.

76 {
77  // set up ecaldqm::electronicsMap in EcalDQMCommonUtils
79  _es.get<EcalMappingRcd>().get(elecMapHandle);
80  ecaldqm::setElectronicsMap(elecMapHandle.product());
81 
82  // set up ecaldqm::electronicsMap in EcalDQMCommonUtils
84  _es.get<IdealGeometryRecord>().get(ttMapHandle);
85  ecaldqm::setTrigTowerMap(ttMapHandle.product());
86 
87  if(_es.find(edm::eventsetup::EventSetupRecordKey::makeKey<EcalDQMChannelStatusRcd>())){
89  _es.get<EcalDQMChannelStatusRcd>().get(cStHndl);
90  DQWorkerClient::channelStatus = cStHndl.product();
91  }
92 
93  if(_es.find(edm::eventsetup::EventSetupRecordKey::makeKey<EcalDQMTowerStatusRcd>())){
95  _es.get<EcalDQMTowerStatusRcd>().get(tStHndl);
96  DQWorkerClient::towerStatus = tStHndl.product();
97  }
98 
99  for(std::vector<DQWorkerClient*>::iterator wItr(workers_.begin()); wItr != workers_.end(); ++wItr){
100  DQWorkerClient* client(*wItr);
101  if(verbosity_ > 1) std::cout << moduleName_ << ": Booking MEs for " << client->getName() << std::endl;
102  client->bookMEs();
103  client->beginRun(_run, _es);
104  }
105 
106  lumiStatus_ = -1;
107 
108  if(verbosity_ > 0)
109  std::cout << moduleName_ << ": Starting run " << _run.run() << std::endl;
110 }
void setTrigTowerMap(const EcalTrigTowerConstituentsMap *)
RunNumber_t run() const
Definition: RunBase.h:42
std::string moduleName_
Definition: EcalDQMonitor.h:22
const eventsetup::EventSetupRecord * find(const eventsetup::EventSetupRecordKey &) const
Definition: EventSetup.cc:90
void setElectronicsMap(const EcalElectronicsMapping *)
std::vector< ecaldqm::DQWorkerClient * > workers_
const T & get() const
Definition: EventSetup.h:55
T const * product() const
Definition: ESHandle.h:62
tuple cout
Definition: gather_cfg.py:121
const int verbosity_
Definition: EcalDQMonitor.h:24
void EcalDQMonitorClient::endLuminosityBlock ( const edm::LuminosityBlock _lumi,
const edm::EventSetup _es 
)
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 133 of file EcalDQMonitorClient.cc.

References lumiStatus_, runAtEndLumi_, runWorkers(), and workers_.

134 {
135  for(std::vector<DQWorkerClient *>::iterator wItr(workers_.begin()); wItr != workers_.end(); ++wItr)
136  (*wItr)->endLuminosityBlock(_lumi, _es);
137 
138  if(runAtEndLumi_){
139  runWorkers();
140  lumiStatus_ = 1;
141  }
142 }
std::vector< ecaldqm::DQWorkerClient * > workers_
void EcalDQMonitorClient::endRun ( const edm::Run _run,
const edm::EventSetup _es 
)
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 113 of file EcalDQMonitorClient.cc.

References lumiStatus_, runWorkers(), and workers_.

114 {
115  if(lumiStatus_ == 0)
116  runWorkers();
117 
118  for(std::vector<DQWorkerClient *>::iterator wItr(workers_.begin()); wItr != workers_.end(); ++wItr){
119  (*wItr)->endRun(_run, _es);
120  }
121 }
std::vector< ecaldqm::DQWorkerClient * > workers_
void EcalDQMonitorClient::fillDescriptions ( edm::ConfigurationDescriptions _descs)
static
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().

146 {
147  if(verbosity_ > 0)
148  std::cout << "EcalDQMonitorClient: Starting worker modules.." << std::endl;
149 
150  for(std::vector<DQWorkerClient *>::iterator wItr(workers_.begin()); wItr != workers_.end(); ++wItr){
151  DQWorkerClient* client(*wItr);
152  if(!client->isInitialized())
153  client->initialize();
154 
155  if(client->isInitialized())
156  client->producePlots();
157  }
158 
159  if(verbosity_ > 0)
160  std::cout << " done." << std::endl;
161 }
std::vector< ecaldqm::DQWorkerClient * > workers_
tuple cout
Definition: gather_cfg.py:121
const int verbosity_
Definition: EcalDQMonitor.h:24

Member Data Documentation

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