CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes
ecaldqm::EcalDQMonitor Class Reference

#include <EcalDQMonitor.h>

Inheritance diagram for ecaldqm::EcalDQMonitor:
EcalDQMonitorClient EcalDQMonitorTask

Public Member Functions

 EcalDQMonitor (edm::ParameterSet const &)
 
virtual ~EcalDQMonitor () noexcept(false)
 

Static Public Member Functions

static void fillDescriptions (edm::ParameterSetDescription &)
 

Protected Member Functions

void ecaldqmBeginLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) 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 &)
 
template<typename FuncOnWorker >
void executeOnWorkers_ (FuncOnWorker, std::string const &, std::string const &="", int=1) const
 

Protected Attributes

const std::string moduleName_
 
const int verbosity_
 
std::vector< DQWorker * > workers_
 

Detailed Description

Definition at line 25 of file EcalDQMonitor.h.

Constructor & Destructor Documentation

◆ EcalDQMonitor()

ecaldqm::EcalDQMonitor::EcalDQMonitor ( edm::ParameterSet const &  _ps)

Definition at line 21 of file EcalDQMonitor.cc.

22  : workers_(),
23  moduleName_(_ps.getUntrackedParameter<std::string>("moduleName")),
24  verbosity_(_ps.getUntrackedParameter<int>("verbosity")) {
25  std::vector<std::string> workerNames(_ps.getUntrackedParameter<std::vector<std::string>>("workers"));
26  edm::ParameterSet const &workerParams(_ps.getUntrackedParameterSet("workerParameters"));
27  edm::ParameterSet const &commonParams(_ps.getUntrackedParameterSet("commonParameters"));
28 
29  std::for_each(workerNames.begin(), workerNames.end(), [&](std::string const &name) {
30  if (verbosity_ > 0)
31  edm::LogInfo("EcalDQM") << moduleName_ << ": Setting up " << name << std::endl;
32  try {
33  DQWorker *worker(WorkerFactoryStore::singleton()->getWorker(
34  name, verbosity_, commonParams, workerParams.getUntrackedParameterSet(name)));
35  if (worker->onlineMode())
36  worker->setTime(time(nullptr));
37  workers_.push_back(worker);
38  } catch (std::exception &) {
39  edm::LogError("EcalDQM") << "Worker " << name << " not defined";
40  throw;
41  }
42  });
43  }

References cppFunctionSkipper::exception, edm::ParameterSet::getUntrackedParameter(), edm::ParameterSet::getUntrackedParameterSet(), moduleName_, Skims_PA_cff::name, ecaldqm::DQWorker::onlineMode(), ecaldqm::DQWorker::setTime(), ecaldqm::WorkerFactoryStore::singleton(), AlCaHLTBitMon_QueryRunRegistry::string, protons_cff::time, verbosity_, EcalCondDBWriter_cfi::workerParams, and workers_.

◆ ~EcalDQMonitor()

ecaldqm::EcalDQMonitor::~EcalDQMonitor ( )
virtualnoexcept

Definition at line 45 of file EcalDQMonitor.cc.

45  {
46  if (verbosity_ > 2)
47  edm::LogInfo("EcalDQM") << moduleName_ << ": Deleting workers";
48 
49  executeOnWorkers_([](DQWorker *worker) { delete worker; }, "Dtor");
50  }

References executeOnWorkers_(), moduleName_, and verbosity_.

Member Function Documentation

◆ ecaldqmBeginLuminosityBlock()

void ecaldqm::EcalDQMonitor::ecaldqmBeginLuminosityBlock ( edm::LuminosityBlock const &  _lumi,
edm::EventSetup const &  _es 
) const
protected

Definition at line 92 of file EcalDQMonitor.cc.

92  {
94  [&_lumi, &_es](DQWorker *worker) {
95  if (worker->onlineMode())
96  worker->setTime(time(nullptr));
97  worker->setLumiNumber(_lumi.luminosityBlock());
98  worker->beginLuminosityBlock(_lumi, _es);
99  },
100  "beginLumi");
101 
102  if (verbosity_ > 1)
103  edm::LogInfo("EcalDQM") << moduleName_ << "::ecaldqmBeginLuminosityBlock";
104  }

References ecaldqm::DQWorker::beginLuminosityBlock(), executeOnWorkers_(), edm::LuminosityBlockBase::luminosityBlock(), moduleName_, ecaldqm::DQWorker::onlineMode(), ecaldqm::DQWorker::setLumiNumber(), ecaldqm::DQWorker::setTime(), protons_cff::time, and verbosity_.

Referenced by EcalDQMonitorTask::globalBeginLuminosityBlock().

◆ ecaldqmBeginRun()

void ecaldqm::EcalDQMonitor::ecaldqmBeginRun ( edm::Run const &  _run,
edm::EventSetup const &  _es 
)
protected

Definition at line 64 of file EcalDQMonitor.cc.

64  {
66  [&_run, &_es](DQWorker *worker) {
67  if (worker->onlineMode())
68  worker->setTime(time(nullptr));
69  worker->setRunNumber(_run.run());
70  worker->beginRun(_run, _es);
71  },
72  "beginRun");
73 
74  if (verbosity_ > 0)
75  edm::LogInfo("EcalDQM") << moduleName_ << "::ecaldqmBeginRun";
76  }

References ecaldqm::DQWorker::beginRun(), executeOnWorkers_(), moduleName_, ecaldqm::DQWorker::onlineMode(), edm::RunBase::run(), ecaldqm::DQWorker::setRunNumber(), ecaldqm::DQWorker::setTime(), protons_cff::time, and verbosity_.

Referenced by EcalDQMonitorClient::beginRun(), and EcalDQMonitorTask::dqmBeginRun().

◆ ecaldqmEndLuminosityBlock()

void ecaldqm::EcalDQMonitor::ecaldqmEndLuminosityBlock ( edm::LuminosityBlock const &  _lumi,
edm::EventSetup const &  _es 
)
protected

Definition at line 106 of file EcalDQMonitor.cc.

106  {
108  [&_lumi, &_es](DQWorker *worker) {
109  if (worker->onlineMode())
110  worker->setTime(time(nullptr));
111  worker->setLumiNumber(_lumi.luminosityBlock());
112  worker->endLuminosityBlock(_lumi, _es);
113  },
114  "endLumi");
115 
116  if (verbosity_ > 2)
117  edm::LogInfo("EcalDQM") << moduleName_ << "::ecaldqmEndLuminosityBlock";
118  }

References ecaldqm::DQWorker::endLuminosityBlock(), executeOnWorkers_(), edm::LuminosityBlockBase::luminosityBlock(), moduleName_, ecaldqm::DQWorker::onlineMode(), ecaldqm::DQWorker::setLumiNumber(), ecaldqm::DQWorker::setTime(), protons_cff::time, and verbosity_.

Referenced by EcalDQMonitorClient::dqmEndLuminosityBlock(), and EcalDQMonitorTask::globalEndLuminosityBlock().

◆ ecaldqmEndRun()

void ecaldqm::EcalDQMonitor::ecaldqmEndRun ( edm::Run const &  _run,
edm::EventSetup const &  _es 
)
protected

Definition at line 78 of file EcalDQMonitor.cc.

78  {
80  [&_run, &_es](DQWorker *worker) {
81  if (worker->onlineMode())
82  worker->setTime(time(nullptr));
83  worker->setRunNumber(_run.run());
84  worker->endRun(_run, _es);
85  },
86  "endRun");
87 
88  if (verbosity_ > 0)
89  edm::LogInfo("EcalDQM") << moduleName_ << "::ecaldqmEndRun";
90  }

References ecaldqm::DQWorker::endRun(), executeOnWorkers_(), moduleName_, ecaldqm::DQWorker::onlineMode(), edm::RunBase::run(), ecaldqm::DQWorker::setRunNumber(), ecaldqm::DQWorker::setTime(), protons_cff::time, and verbosity_.

Referenced by EcalDQMonitorTask::dqmEndRun(), and EcalDQMonitorClient::endRun().

◆ executeOnWorkers_()

template<typename FuncOnWorker >
void ecaldqm::EcalDQMonitor::executeOnWorkers_ ( FuncOnWorker  _func,
std::string const &  _context,
std::string const &  _message = "",
int  _verbThreshold = 1 
) const
protected

Definition at line 50 of file EcalDQMonitor.h.

53  {
54  std::for_each(workers_.begin(), workers_.end(), [&](DQWorker *worker) {
55  if (verbosity_ > _verbThreshold && !_message.empty())
56  edm::LogInfo("EcalDQM") << moduleName_ << ": " << _message << " @ " << worker->getName();
57  try {
58  _func(worker);
59  } catch (std::exception &) {
60  edm::LogError("EcalDQM") << moduleName_ << ": Exception in " << _context << " @ " << worker->getName();
61  throw;
62  }
63  });
64  }

References cppFunctionSkipper::exception, moduleName_, verbosity_, and workers_.

Referenced by EcalDQMonitorTask::analyze(), EcalDQMonitorClient::beginRun(), EcalDQMonitorTask::bookHistograms(), EcalDQMonitorClient::dqmEndJob(), EcalDQMonitorClient::dqmEndLuminosityBlock(), EcalDQMonitorTask::dqmEndRun(), ecaldqmBeginLuminosityBlock(), ecaldqmBeginRun(), ecaldqmEndLuminosityBlock(), ecaldqmEndRun(), EcalDQMonitorClient::EcalDQMonitorClient(), EcalDQMonitorTask::EcalDQMonitorTask(), EcalDQMonitorTask::globalBeginLuminosityBlock(), EcalDQMonitorTask::runOnCollection(), EcalDQMonitorClient::runWorkers(), and ~EcalDQMonitor().

◆ fillDescriptions()

void ecaldqm::EcalDQMonitor::fillDescriptions ( edm::ParameterSetDescription _desc)
static

Definition at line 53 of file EcalDQMonitor.cc.

53  {
54  _desc.addUntracked<std::string>("moduleName", "Ecal Monitor Module");
55  _desc.addUntracked<std::vector<std::string>>("workers");
56  _desc.addUntracked<int>("verbosity", 0);
57 
59  commonParameters.addUntracked<bool>("onlineMode", false);
60  commonParameters.addUntracked<bool>("willConvertToEDM", true);
61  _desc.addUntracked("commonParameters", commonParameters);
62  }

References edm::ParameterSetDescription::addUntracked(), EcalCalibMonitorClient_cfi::commonParameters, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by EcalDQMonitorClient::fillDescriptions(), and EcalDQMonitorTask::fillDescriptions().

Member Data Documentation

◆ moduleName_

const std::string ecaldqm::EcalDQMonitor::moduleName_
protected

◆ verbosity_

const int ecaldqm::EcalDQMonitor::verbosity_
protected

◆ workers_

std::vector<DQWorker *> ecaldqm::EcalDQMonitor::workers_
protected

Definition at line 44 of file EcalDQMonitor.h.

Referenced by EcalDQMonitor(), and executeOnWorkers_().

ecaldqm::EcalDQMonitor::moduleName_
const std::string moduleName_
Definition: EcalDQMonitor.h:45
ecaldqm::EcalDQMonitor::executeOnWorkers_
void executeOnWorkers_(FuncOnWorker, std::string const &, std::string const &="", int=1) const
Definition: EcalDQMonitor.h:50
ecaldqm::EcalDQMonitor::verbosity_
const int verbosity_
Definition: EcalDQMonitor.h:46
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
protons_cff.time
time
Definition: protons_cff.py:39
edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
ecaldqm::EcalDQMonitor::workers_
std::vector< DQWorker * > workers_
Definition: EcalDQMonitor.h:44
EcalCalibMonitorClient_cfi.commonParameters
commonParameters
Definition: EcalCalibMonitorClient_cfi.py:39
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
cppFunctionSkipper.exception
exception
Definition: cppFunctionSkipper.py:10
edm::ParameterSetDescription::addUntracked
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
Definition: ParameterSetDescription.h:100
EcalCondDBWriter_cfi.workerParams
workerParams
Definition: EcalCondDBWriter_cfi.py:68
edm::ParameterSet
Definition: ParameterSet.h:47
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
ecaldqm::WorkerFactoryStore::singleton
static WorkerFactoryStore * singleton()
Definition: DQWorker.cc:161
edm::Log
Definition: MessageLogger.h:70