CMS 3D CMS Logo

EcalDQMonitor.h
Go to the documentation of this file.
1 #ifndef EcalDQMonitor_H
2 #define EcalDQMonitor_H
3 
4 #include <string>
5 #include <vector>
6 
7 #include "DQWorker.h"
8 
11 
12 namespace edm {
13  class ParameterSet;
14  class Run;
15  class LuminosityBlock;
16  class EventSetup;
17 } // namespace edm
18 
19 namespace ecaldqm {
20  struct EcalLSCache {
21  std::map<std::string, bool> ByLumiPlotsResetSwitches;
23  };
24 
25  class EcalDQMonitor {
26  public:
28  virtual ~EcalDQMonitor() noexcept(false);
29 
31 
32  protected:
34  void ecaldqmBeginRun(edm::Run const &, edm::EventSetup const &);
35  void ecaldqmEndRun(edm::Run const &, edm::EventSetup const &);
38 
39  template <typename FuncOnWorker>
40  void executeOnWorkers_(FuncOnWorker,
41  std::string const &,
42  std::string const & = "",
43  int = 1) const; // loop over workers and capture exceptions
44 
45  std::vector<DQWorker *> workers_;
47  const int verbosity_;
48  };
49 
50  template <typename FuncOnWorker>
51  void EcalDQMonitor::executeOnWorkers_(FuncOnWorker _func,
52  std::string const &_context,
53  std::string const &_message /* = ""*/,
54  int _verbThreshold /* = 1*/) const {
55  std::for_each(workers_.begin(), workers_.end(), [&](DQWorker *worker) {
56  if (verbosity_ > _verbThreshold && !_message.empty())
57  edm::LogInfo("EcalDQM") << moduleName_ << ": " << _message << " @ " << worker->getName();
58  try {
59  _func(worker);
60  } catch (std::exception &) {
61  edm::LogError("EcalDQM") << moduleName_ << ": Exception in " << _context << " @ " << worker->getName();
62  throw;
63  }
64  });
65  }
66 } // namespace ecaldqm
67 
68 #endif
ecaldqm::EcalLSCache
Definition: EcalDQMonitor.h:20
MessageLogger.h
ecaldqm::EcalDQMonitor::moduleName_
const std::string moduleName_
Definition: EcalDQMonitor.h:46
ecaldqm
Definition: DQWorker.h:24
edm::LuminosityBlock
Definition: LuminosityBlock.h:50
edm::Run
Definition: Run.h:45
ecaldqm::EcalDQMonitor::executeOnWorkers_
void executeOnWorkers_(FuncOnWorker, std::string const &, std::string const &="", int=1) const
Definition: EcalDQMonitor.h:51
edm
HLT enums.
Definition: AlignableModifier.h:19
ecaldqm::EcalDQMonitor::verbosity_
const int verbosity_
Definition: EcalDQMonitor.h:47
ecaldqm::EcalDQMonitor::ecaldqmBeginRun
void ecaldqmBeginRun(edm::Run const &, edm::EventSetup const &)
Definition: EcalDQMonitor.cc:87
ecaldqm::EcalDQMonitor::EcalDQMonitor
EcalDQMonitor(edm::ParameterSet const &)
Definition: EcalDQMonitor.cc:21
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
DQMStore.h
ecaldqm::EcalDQMonitor::fillDescriptions
static void fillDescriptions(edm::ParameterSetDescription &)
Definition: EcalDQMonitor.cc:53
ecaldqm::EcalDQMonitor
Definition: EcalDQMonitor.h:25
ecaldqm::EcalDQMonitor::workers_
std::vector< DQWorker * > workers_
Definition: EcalDQMonitor.h:45
ecaldqm::DQWorker
Definition: DQWorker.h:28
LuminosityBlock
ecaldqm::EcalLSCache::lhcStatusSet_
bool lhcStatusSet_
Definition: EcalDQMonitor.h:22
ecaldqm::EcalDQMonitor::ecaldqmEndLuminosityBlock
void ecaldqmEndLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &)
Definition: EcalDQMonitor.cc:129
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
cppFunctionSkipper.exception
exception
Definition: cppFunctionSkipper.py:10
edm::ParameterSet
Definition: ParameterSet.h:47
ParameterSet
Definition: Functions.h:16
ecaldqm::EcalDQMonitor::ecaldqmBeginLuminosityBlock
void ecaldqmBeginLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &) const
Definition: EcalDQMonitor.cc:115
DQWorker.h
edm::EventSetup
Definition: EventSetup.h:57
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
ecaldqm::EcalDQMonitor::ecaldqmEndRun
void ecaldqmEndRun(edm::Run const &, edm::EventSetup const &)
Definition: EcalDQMonitor.cc:101
EventSetup
ecaldqm::EcalDQMonitor::~EcalDQMonitor
virtual ~EcalDQMonitor() noexcept(false)
Definition: EcalDQMonitor.cc:45
edm::Log
Definition: MessageLogger.h:70
ecaldqm::EcalDQMonitor::ecaldqmGetSetupObjects
void ecaldqmGetSetupObjects(edm::EventSetup const &)
Definition: EcalDQMonitor.cc:64
ecaldqm::EcalLSCache::ByLumiPlotsResetSwitches
std::map< std::string, bool > ByLumiPlotsResetSwitches
Definition: EcalDQMonitor.h:21
Run