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:
33  void ecaldqmBeginRun(edm::Run const &, edm::EventSetup const &);
34  void ecaldqmEndRun(edm::Run const &, edm::EventSetup const &);
37 
38  template <typename FuncOnWorker>
39  void executeOnWorkers_(FuncOnWorker,
40  std::string const &,
41  std::string const & = "",
42  int = 1) const; // loop over workers and capture exceptions
43 
44  std::vector<DQWorker *> workers_;
46  const int verbosity_;
47  };
48 
49  template <typename FuncOnWorker>
50  void EcalDQMonitor::executeOnWorkers_(FuncOnWorker _func,
51  std::string const &_context,
52  std::string const &_message /* = ""*/,
53  int _verbThreshold /* = 1*/) const {
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  }
65 } // namespace ecaldqm
66 
67 #endif
ecaldqm::EcalLSCache
Definition: EcalDQMonitor.h:20
MessageLogger.h
ecaldqm::EcalDQMonitor::moduleName_
const std::string moduleName_
Definition: EcalDQMonitor.h:45
ecaldqm
Definition: DQWorker.h:29
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:50
edm
HLT enums.
Definition: AlignableModifier.h:19
ecaldqm::EcalDQMonitor::verbosity_
const int verbosity_
Definition: EcalDQMonitor.h:46
ecaldqm::EcalDQMonitor::ecaldqmBeginRun
void ecaldqmBeginRun(edm::Run const &, edm::EventSetup const &)
Definition: EcalDQMonitor.cc:64
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:44
ecaldqm::DQWorker
Definition: DQWorker.h:33
LuminosityBlock
ecaldqm::EcalLSCache::lhcStatusSet_
bool lhcStatusSet_
Definition: EcalDQMonitor.h:22
ecaldqm::EcalDQMonitor::ecaldqmEndLuminosityBlock
void ecaldqmEndLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &)
Definition: EcalDQMonitor.cc:106
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:92
DQWorker.h
edm::EventSetup
Definition: EventSetup.h:58
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:78
EventSetup
ecaldqm::EcalDQMonitor::~EcalDQMonitor
virtual ~EcalDQMonitor() noexcept(false)
Definition: EcalDQMonitor.cc:45
edm::Log
Definition: MessageLogger.h:70
ecaldqm::EcalLSCache::ByLumiPlotsResetSwitches
std::map< std::string, bool > ByLumiPlotsResetSwitches
Definition: EcalDQMonitor.h:21
Run