CMS 3D CMS Logo

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:
DQMEDHarvester ecaldqm::EcalDQMonitor edm::one::EDAnalyzer< edm::one::WatchRuns, edm::one::WatchLuminosityBlocks, edm::one::SharedResources > edm::one::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

 EcalDQMonitorClient (edm::ParameterSet const &)
 
 ~EcalDQMonitorClient ()
 
- Public Member Functions inherited from DQMEDHarvester
virtual void analyze (edm::Event const &, edm::EventSetup const &) final
 
virtual void beginLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) final
 
 DQMEDHarvester (void)
 
virtual void endJob () final
 
virtual void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) final
 
- Public Member Functions inherited from edm::one::EDAnalyzer< edm::one::WatchRuns, edm::one::WatchLuminosityBlocks, edm::one::SharedResources >
 EDAnalyzer ()=default
 
- Public Member Functions inherited from edm::one::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDAnalyzerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 
- Public Member Functions inherited from ecaldqm::EcalDQMonitor
 EcalDQMonitor (edm::ParameterSet const &)
 
virtual ~EcalDQMonitor ()(false)
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &)
 
- Static Public Member Functions inherited from edm::one::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from ecaldqm::EcalDQMonitor
static void fillDescriptions (edm::ParameterSetDescription &)
 

Private Member Functions

void beginRun (edm::Run const &, edm::EventSetup const &) override
 
void dqmEndJob (DQMStore::IBooker &, DQMStore::IGetter &) override
 
void dqmEndLuminosityBlock (DQMStore::IBooker &, DQMStore::IGetter &, edm::LuminosityBlock const &, edm::EventSetup const &) override
 
void endRun (edm::Run const &, edm::EventSetup const &) override
 
void runWorkers (DQMStore::IGetter &, ecaldqm::DQWorkerClient::ProcessType)
 

Private Attributes

unsigned eventCycleLength_
 
unsigned iEvt_
 
ecaldqm::StatusManager statusManager_
 

Additional Inherited Members

- Public Types inherited from edm::one::EDAnalyzerBase
typedef EDAnalyzerBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- 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 Member Functions inherited from ecaldqm::EcalDQMonitor
void ecaldqmBeginLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &)
 
void ecaldqmBeginRun (edm::Run const &, edm::EventSetup const &)
 
void ecaldqmEndLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &)
 
void ecaldqmEndRun (edm::Run const &, edm::EventSetup const &)
 
void ecaldqmGetSetupObjects (edm::EventSetup const &)
 
template<typename FuncOnWorker >
void executeOnWorkers_ (FuncOnWorker, std::string const &, std::string const &="", int=1)
 
- Protected Attributes inherited from ecaldqm::EcalDQMonitor
std::string const moduleName_
 
int const verbosity_
 
std::vector< DQWorker * > workers_
 

Detailed Description

Definition at line 10 of file EcalDQMonitorClient.h.

Constructor & Destructor Documentation

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

Definition at line 27 of file EcalDQMonitorClient.cc.

References Exception, ecaldqm::EcalDQMonitor::executeOnWorkers_(), edm::ParameterSet::existsAs(), edm::FileInPath::fullPath(), ecaldqm::DQWorker::getName(), edm::ParameterSet::getUntrackedParameter(), ecaldqm::StatusManager::readFromStream(), ecaldqm::DQWorkerClient::setStatusManager(), and statusManager_.

27  :
30  iEvt_(0),
32 {
33  executeOnWorkers_([this](ecaldqm::DQWorker* worker){
34  ecaldqm::DQWorkerClient* client(dynamic_cast<ecaldqm::DQWorkerClient*>(worker));
35  if(!client)
36  throw cms::Exception("InvalidConfiguration") << "Non-client DQWorker " << worker->getName() << " passed";
37  client->setStatusManager(this->statusManager_);
38  }, "initialization");
39 
40  if(_ps.existsAs<edm::FileInPath>("PNMaskFile", false)){
41  std::ifstream maskFile(_ps.getUntrackedParameter<edm::FileInPath>("PNMaskFile").fullPath());
42  if(maskFile.is_open())
44  }
45 }
ecaldqm::StatusManager statusManager_
void readFromStream(std::istream &)
void executeOnWorkers_(FuncOnWorker, std::string const &, std::string const &="", int=1)
Definition: EcalDQMonitor.h:45
std::string const & getName() const
Definition: DQWorker.h:68
std::string fullPath() const
Definition: FileInPath.cc:184
EcalDQMonitorClient::~EcalDQMonitorClient ( )

Definition at line 47 of file EcalDQMonitorClient.cc.

48 {
49 }

Member Function Documentation

void EcalDQMonitorClient::beginRun ( edm::Run const &  _run,
edm::EventSetup const &  _es 
)
overrideprivatevirtual

Reimplemented from DQMEDHarvester.

Definition at line 70 of file EcalDQMonitorClient.cc.

References ecaldqm::EcalDQMonitor::ecaldqmBeginRun(), ecaldqm::EcalDQMonitor::ecaldqmGetSetupObjects(), edm::EventSetup::find(), edm::EventSetup::get(), ecaldqm::StatusManager::readFromObj(), and statusManager_.

71 {
73 
74  if(_es.find(edm::eventsetup::EventSetupRecordKey::makeKey<EcalDQMChannelStatusRcd>()) && _es.find(edm::eventsetup::EventSetupRecordKey::makeKey<EcalDQMTowerStatusRcd>())){
76  _es.get<EcalDQMChannelStatusRcd>().get(cStHndl);
77 
79  _es.get<EcalDQMTowerStatusRcd>().get(tStHndl);
80 
81  statusManager_.readFromObj(*cStHndl, *tStHndl);
82  }
83 
84  ecaldqmBeginRun(_run, _es);
85 }
ecaldqm::StatusManager statusManager_
void ecaldqmGetSetupObjects(edm::EventSetup const &)
void ecaldqmBeginRun(edm::Run const &, edm::EventSetup const &)
void readFromObj(EcalDQMChannelStatus const &, EcalDQMTowerStatus const &)
void EcalDQMonitorClient::dqmEndJob ( DQMStore::IBooker _ibooker,
DQMStore::IGetter _igetter 
)
overrideprivatevirtual

Implements DQMEDHarvester.

Definition at line 108 of file EcalDQMonitorClient.cc.

References ecaldqm::DQWorker::bookMEs(), ecaldqm::EcalDQMonitor::executeOnWorkers_(), ecaldqm::DQWorkerClient::kJob, ecaldqm::DQWorker::releaseMEs(), and runWorkers().

109 {
110  executeOnWorkers_([&_ibooker](ecaldqm::DQWorker* worker){
111  worker->bookMEs(_ibooker); // worker returns if already booked
112  }, "bookMEs", "Booking MEs");
113 
115 
117  worker->releaseMEs();
118  }, "releaseMEs", "releasing histograms");
119 }
void runWorkers(DQMStore::IGetter &, ecaldqm::DQWorkerClient::ProcessType)
virtual void releaseMEs()
Definition: DQWorker.cc:77
virtual void bookMEs(DQMStore::IBooker &)
Definition: DQWorker.cc:85
void executeOnWorkers_(FuncOnWorker, std::string const &, std::string const &="", int=1)
Definition: EcalDQMonitor.h:45
void EcalDQMonitorClient::dqmEndLuminosityBlock ( DQMStore::IBooker _ibooker,
DQMStore::IGetter _igetter,
edm::LuminosityBlock const &  _lumi,
edm::EventSetup const &  _es 
)
overrideprivatevirtual

Reimplemented from DQMEDHarvester.

Definition at line 94 of file EcalDQMonitorClient.cc.

References ecaldqm::DQWorkerClient::bookMEs(), ecaldqm::EcalDQMonitor::ecaldqmEndLuminosityBlock(), ecaldqm::EcalDQMonitor::executeOnWorkers_(), ecaldqm::DQWorkerClient::kLumi, ecaldqm::DQWorker::onlineMode(), ecaldqm::DQWorkerClient::runsOn(), and runWorkers().

95 {
96  executeOnWorkers_([&_ibooker](ecaldqm::DQWorker* worker){
97  ecaldqm::DQWorkerClient* client(static_cast<ecaldqm::DQWorkerClient*>(worker));
98  if(!client->onlineMode() && !client->runsOn(ecaldqm::DQWorkerClient::kLumi)) return;
99  client->bookMEs(_ibooker);
100  }, "bookMEs", "Booking MEs");
101 
102  ecaldqmEndLuminosityBlock(_lumi, _es);
103 
105 }
void runWorkers(DQMStore::IGetter &, ecaldqm::DQWorkerClient::ProcessType)
void executeOnWorkers_(FuncOnWorker, std::string const &, std::string const &="", int=1)
Definition: EcalDQMonitor.h:45
void ecaldqmEndLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &)
void EcalDQMonitorClient::endRun ( edm::Run const &  _run,
edm::EventSetup const &  _es 
)
overrideprivatevirtual

Reimplemented from DQMEDHarvester.

Definition at line 88 of file EcalDQMonitorClient.cc.

References ecaldqm::EcalDQMonitor::ecaldqmEndRun().

89 {
90  ecaldqmEndRun(_run, _es);
91 }
void ecaldqmEndRun(edm::Run const &, edm::EventSetup const &)
void EcalDQMonitorClient::fillDescriptions ( edm::ConfigurationDescriptions _descs)
static

Definition at line 53 of file EcalDQMonitorClient.cc.

References edm::ConfigurationDescriptions::addDefault(), edm::ParameterSetDescription::addNode(), edm::ParameterSetDescription::addOptionalUntracked(), edm::ParameterSetDescription::addUntracked(), ecaldqm::DQWorkerClient::fillDescriptions(), ecaldqm::EcalDQMonitor::fillDescriptions(), and edm::RequireZeroOrMore.

54 {
57 
58  edm::ParameterSetDescription clientParameters;
62  desc.addUntracked("workerParameters", allWorkers);
63 
64  desc.addOptionalUntracked<edm::FileInPath>("PNMaskFile");
65 
66  _descs.addDefault(desc);
67 }
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
ParameterDescriptionNode * addNode(ParameterDescriptionNode const &node)
static void fillDescriptions(edm::ParameterSetDescription &)
void addDefault(ParameterSetDescription const &psetDescription)
static void fillDescriptions(edm::ParameterSetDescription &)
ParameterDescriptionBase * addOptionalUntracked(U const &iLabel, T const &value)
void EcalDQMonitorClient::runWorkers ( DQMStore::IGetter _igetter,
ecaldqm::DQWorkerClient::ProcessType  _type 
)
private

Definition at line 122 of file EcalDQMonitorClient.cc.

References DEFINE_FWK_MODULE, ecaldqm::EcalDQMonitor::executeOnWorkers_(), ecaldqm::EcalDQMonitor::moduleName_, ecaldqm::DQWorker::onlineMode(), ecaldqm::DQWorkerClient::producePlots(), ecaldqm::DQWorkerClient::releaseSource(), ecaldqm::DQWorkerClient::resetMEs(), ecaldqm::DQWorkerClient::retrieveSource(), ecaldqm::DQWorkerClient::runsOn(), ecaldqm::DQWorker::setTime(), ntuplemaker::time, and ecaldqm::EcalDQMonitor::verbosity_.

Referenced by dqmEndJob(), and dqmEndLuminosityBlock().

123 {
124  if(verbosity_ > 0) edm::LogInfo("EcalDQM") << moduleName_ << ": Starting worker modules..";
125 
126  executeOnWorkers_([&_igetter, &_type](ecaldqm::DQWorker* worker){
127  ecaldqm::DQWorkerClient* client(static_cast<ecaldqm::DQWorkerClient*>(worker));
128  if(!client->onlineMode() && !client->runsOn(_type)) return;
129  client->releaseSource();
130  client->resetMEs();
131  if(!client->retrieveSource(_igetter, _type)) return;
132  if(client->onlineMode()) client->setTime(time(0));
133  client->producePlots(_type);
134  }, "retrieveAndRun", "producing plots");
135 
136  if(verbosity_ > 0) edm::LogInfo("EcalDQM") << " done." << std::endl;
137 }
std::string const moduleName_
Definition: EcalDQMonitor.h:39
void executeOnWorkers_(FuncOnWorker, std::string const &, std::string const &="", int=1)
Definition: EcalDQMonitor.h:45

Member Data Documentation

unsigned EcalDQMonitorClient::eventCycleLength_
private

Definition at line 25 of file EcalDQMonitorClient.h.

unsigned EcalDQMonitorClient::iEvt_
private

Definition at line 26 of file EcalDQMonitorClient.h.

ecaldqm::StatusManager EcalDQMonitorClient::statusManager_
private

Definition at line 28 of file EcalDQMonitorClient.h.

Referenced by beginRun(), and EcalDQMonitorClient().