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:
edm::EDAnalyzer ecaldqm::EcalDQMonitor edm::EDConsumerBase

Public Member Functions

 EcalDQMonitorClient (edm::ParameterSet const &)
 
 ~EcalDQMonitorClient ()
 
- 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
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 
- Public Member Functions inherited from ecaldqm::EcalDQMonitor
 EcalDQMonitor (edm::ParameterSet const &)
 
virtual ~EcalDQMonitor ()
 

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 &)
 
- Static Public Member Functions inherited from ecaldqm::EcalDQMonitor
static void fillDescriptions (edm::ParameterSetDescription &)
 

Private Member Functions

void analyze (edm::Event const &, edm::EventSetup const &) override
 
void beginRun (edm::Run const &, edm::EventSetup const &) override
 
void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) override
 
void endRun (edm::Run const &, edm::EventSetup const &) override
 
void runWorkers (ecaldqm::DQWorkerClient::ProcessType)
 

Private Attributes

unsigned eventCycleLength_
 
unsigned iEvt_
 
ecaldqm::StatusManager statusManager_
 

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 Member Functions inherited from ecaldqm::EcalDQMonitor
void ecaldqmBeginLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &)
 
void ecaldqmBeginRun (edm::Run const &, edm::EventSetup const &)
 
template<typename Booker >
void ecaldqmBookHistograms (Booker &)
 
void ecaldqmEndLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &)
 
void ecaldqmEndRun (edm::Run const &, edm::EventSetup const &)
 
void ecaldqmGetSetupObjects (edm::EventSetup const &)
 
void ecaldqmReleaseHistograms ()
 
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 OfflineClient_cff::client, edm::hlt::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  eventCycleLength_(_ps.getUntrackedParameter<unsigned>("analyzeEvery")),
31  iEvt_(0),
33 {
34  executeOnWorkers_([this](ecaldqm::DQWorker* worker){
35  ecaldqm::DQWorkerClient* client(dynamic_cast<ecaldqm::DQWorkerClient*>(worker));
36  if(!client)
37  throw cms::Exception("InvalidConfiguration") << "Non-client DQWorker " << worker->getName() << " passed";
38  client->setStatusManager(this->statusManager_);
39  }, "initialization");
40 
41  if(_ps.existsAs<edm::FileInPath>("PNMaskFile", false)){
42  std::ifstream maskFile(_ps.getUntrackedParameter<edm::FileInPath>("PNMaskFile").fullPath());
43  if(maskFile.is_open())
45  }
46 }
ecaldqm::StatusManager statusManager_
void readFromStream(std::istream &)
void executeOnWorkers_(FuncOnWorker, std::string const &, std::string const &="", int=1)
Definition: EcalDQMonitor.h:56
std::string const & getName() const
Definition: DQWorker.h:69
std::string fullPath() const
Definition: FileInPath.cc:165
EcalDQMonitorClient::~EcalDQMonitorClient ( )
inline

Definition at line 13 of file EcalDQMonitorClient.h.

13 {}

Member Function Documentation

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

Reimplemented from edm::EDAnalyzer.

Definition at line 68 of file EcalDQMonitorClient.cc.

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

69 {
71 
72  if(_es.find(edm::eventsetup::EventSetupRecordKey::makeKey<EcalDQMChannelStatusRcd>()) && _es.find(edm::eventsetup::EventSetupRecordKey::makeKey<EcalDQMTowerStatusRcd>())){
74  _es.get<EcalDQMChannelStatusRcd>().get(cStHndl);
75 
77  _es.get<EcalDQMTowerStatusRcd>().get(tStHndl);
78 
79  statusManager_.readFromObj(*cStHndl, *tStHndl);
80  }
81 
83 
84  ecaldqmBeginRun(_run, _es);
85 }
ecaldqm::StatusManager statusManager_
void ecaldqmGetSetupObjects(edm::EventSetup const &)
void ecaldqmBeginRun(edm::Run const &, edm::EventSetup const &)
void ecaldqmBookHistograms(Booker &)
Definition: EcalDQMonitor.h:46
void readFromObj(EcalDQMChannelStatus const &, EcalDQMTowerStatus const &)
void EcalDQMonitorClient::endLuminosityBlock ( edm::LuminosityBlock const &  _lumi,
edm::EventSetup const &  _es 
)
overrideprivatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 98 of file EcalDQMonitorClient.cc.

References ecaldqm::EcalDQMonitor::ecaldqmEndLuminosityBlock(), ecaldqm::DQWorkerClient::kLumi, and runWorkers().

99 {
100  ecaldqmEndLuminosityBlock(_lumi, _es);
101 
103 }
void runWorkers(ecaldqm::DQWorkerClient::ProcessType)
void ecaldqmEndLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &)
void EcalDQMonitorClient::endRun ( edm::Run const &  _run,
edm::EventSetup const &  _es 
)
overrideprivatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 88 of file EcalDQMonitorClient.cc.

References ecaldqm::EcalDQMonitor::ecaldqmEndRun(), ecaldqm::EcalDQMonitor::ecaldqmReleaseHistograms(), ecaldqm::DQWorkerClient::kRun, and runWorkers().

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

Definition at line 50 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.

51 {
54 
55  edm::ParameterSetDescription clientParameters;
59  desc.addUntracked("workerParameters", allWorkers);
60 
61  desc.addUntracked<unsigned>("analyzeEvery", 0);
62  desc.addOptionalUntracked<edm::FileInPath>("PNMaskFile");
63 
64  _descs.addDefault(desc);
65 }
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 ( ecaldqm::DQWorkerClient::ProcessType  _type)
private

Definition at line 112 of file EcalDQMonitorClient.cc.

References OfflineClient_cff::client, ecaldqm::EcalDQMonitor::executeOnWorkers_(), ecaldqm::EcalDQMonitor::moduleName_, ecaldqm::DQWorker::onlineMode(), ecaldqm::DQWorkerClient::producePlots(), ecaldqm::DQWorkerClient::releaseSource(), ecaldqm::DQWorkerClient::resetMEs(), ecaldqm::DQWorkerClient::retrieveSource(), ecaldqm::DQWorker::setTime(), cond::rpcobgas::time, and ecaldqm::EcalDQMonitor::verbosity_.

Referenced by analyze(), endLuminosityBlock(), and endRun().

113 {
114  if(verbosity_ > 0) edm::LogInfo("EcalDQM") << moduleName_ << ": Starting worker modules..";
115 
116  DQMStore const& dqmStore(*edm::Service<DQMStore>());
117 
118  executeOnWorkers_([&dqmStore, &_type](ecaldqm::DQWorker* worker){
119  ecaldqm::DQWorkerClient* client(static_cast<ecaldqm::DQWorkerClient*>(worker));
120  client->releaseSource();
121  client->resetMEs();
122  if(!client->retrieveSource(dqmStore, _type)) return;
123  if(client->onlineMode()) client->setTime(time(0));
124  client->producePlots(_type);
125  }, "retrieveAndRun", "producing plots");
126 
127  if(verbosity_ > 0) edm::LogInfo("EcalDQM") << " done." << std::endl;
128 }
std::string const moduleName_
Definition: EcalDQMonitor.h:40
void executeOnWorkers_(FuncOnWorker, std::string const &, std::string const &="", int=1)
Definition: EcalDQMonitor.h:56

Member Data Documentation

unsigned EcalDQMonitorClient::eventCycleLength_
private

Definition at line 25 of file EcalDQMonitorClient.h.

Referenced by analyze().

unsigned EcalDQMonitorClient::iEvt_
private

Definition at line 26 of file EcalDQMonitorClient.h.

Referenced by analyze().

ecaldqm::StatusManager EcalDQMonitorClient::statusManager_
private

Definition at line 28 of file EcalDQMonitorClient.h.

Referenced by beginRun(), and EcalDQMonitorClient().