CMS 3D CMS Logo

EcalDQMonitorClient.cc
Go to the documentation of this file.
2 
4 
9 
14 
16 
18 
19 #include <ctime>
20 #include <fstream>
21 
23  : DQMEDHarvester(),
24  ecaldqm::EcalDQMonitor(_ps),
25  iEvt_(0),
26  cStHndl(esConsumes<edm::Transition::BeginRun>()),
27  tStHndl(esConsumes<edm::Transition::BeginRun>()),
28  statusManager_() {
31  [this, &collector](ecaldqm::DQWorker* worker) {
32  ecaldqm::DQWorkerClient* client(dynamic_cast<ecaldqm::DQWorkerClient*>(worker));
33  if (!client)
34  throw cms::Exception("InvalidConfiguration") << "Non-client DQWorker " << worker->getName() << " passed";
35  client->setStatusManager(this->statusManager_);
36  client->setTokens(collector);
37  worker->setTokens(collector);
38  },
39  "initialization");
40 
41  // This is no longer used since run 2
42  //
43  //if (_ps.existsAs<edm::FileInPath>("PNMaskFile", false)) {
44  // std::ifstream maskFile(_ps.getUntrackedParameter<edm::FileInPath>("PNMaskFile").fullPath());
45  // if (maskFile.is_open())
46  // statusManager_.readFromStream(maskFile);
47  //}
48 }
49 
51 
52 /*static*/
56 
57  edm::ParameterSetDescription clientParameters;
60  allWorkers.addNode(
62  desc.addUntracked("workerParameters", allWorkers);
63 
64  desc.addOptionalUntracked<edm::FileInPath>("PNMaskFile");
65 
66  _descs.addDefault(desc);
67 }
68 
70  executeOnWorkers_([&_es](ecaldqm::DQWorker* worker) { worker->setSetupObjects(_es); },
71  "ecaldqmGetSetupObjects",
72  "Getting EventSetup Objects");
73 
74  if (_es.find(edm::eventsetup::EventSetupRecordKey::makeKey<EcalDQMChannelStatusRcd>()) &&
75  _es.find(edm::eventsetup::EventSetupRecordKey::makeKey<EcalDQMTowerStatusRcd>())) {
77  const EcalDQMTowerStatus* TStatus = &_es.getData(tStHndl);
78 
80  }
81 
82  ecaldqmBeginRun(_run, _es);
83 }
84 
85 void EcalDQMonitorClient::endRun(edm::Run const& _run, edm::EventSetup const& _es) { ecaldqmEndRun(_run, _es); }
86 
88  DQMStore::IGetter& _igetter,
89  edm::LuminosityBlock const& _lumi,
90  edm::EventSetup const& _es) {
92  [&_ibooker](ecaldqm::DQWorker* worker) {
93  ecaldqm::DQWorkerClient* client(static_cast<ecaldqm::DQWorkerClient*>(worker));
94  if (!client->onlineMode() && !client->runsOn(ecaldqm::DQWorkerClient::kLumi))
95  return;
96  client->bookMEs(_ibooker);
97  },
98  "bookMEs",
99  "Booking MEs");
100 
101  ecaldqmEndLuminosityBlock(_lumi, _es);
102 
104 
106  [](ecaldqm::DQWorker* worker) {
107  ecaldqm::DQWorkerClient* client(static_cast<ecaldqm::DQWorkerClient*>(worker));
108  client->resetPerLumi();
109  },
110  "dqmEndLuminosityBlock",
111  "Reset per-lumi MEs");
112 }
113 
116  [&_ibooker](ecaldqm::DQWorker* worker) {
117  worker->bookMEs(_ibooker); // worker returns if already booked
118  },
119  "bookMEs",
120  "Booking MEs");
121 
123 
124  executeOnWorkers_([](ecaldqm::DQWorker* worker) { worker->releaseMEs(); }, "releaseMEs", "releasing histograms");
125 }
126 
128  if (verbosity_ > 0)
129  edm::LogInfo("EcalDQM") << moduleName_ << ": Starting worker modules..";
130 
132  [&_igetter, &_type](ecaldqm::DQWorker* worker) {
133  ecaldqm::DQWorkerClient* client(static_cast<ecaldqm::DQWorkerClient*>(worker));
134  if (!client->onlineMode() && !client->runsOn(_type))
135  return;
136  client->releaseSource();
137  client->resetMEs();
138  if (!client->retrieveSource(_igetter, _type))
139  return;
140  if (client->onlineMode())
141  client->setTime(time(nullptr));
142  client->producePlots(_type);
143  },
144  "retrieveAndRun",
145  "producing plots");
146 
147  if (verbosity_ > 0)
148  edm::LogInfo("EcalDQM") << " done." << std::endl;
149 }
150 
ConfigurationDescriptions.h
MessageLogger.h
ecaldqm::EcalDQMonitor::moduleName_
const std::string moduleName_
Definition: EcalDQMonitor.h:45
ecaldqm::DQWorker::setTokens
void setTokens(edm::ConsumesCollector &)
Definition: DQWorker.cc:53
ecaldqm
Definition: DQWorker.h:37
ecaldqm::DQWorkerClient::fillDescriptions
static void fillDescriptions(edm::ParameterSetDescription &)
Definition: DQWorkerClient.cc:21
ESHandle.h
edm::ParameterWildcard
Definition: ParameterWildcard.h:23
EcalDQMonitorClient::dqmEndJob
void dqmEndJob(DQMStore::IBooker &, DQMStore::IGetter &) override
Definition: EcalDQMonitorClient.cc:114
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
EcalDQMonitorClient::dqmEndLuminosityBlock
void dqmEndLuminosityBlock(DQMStore::IBooker &, DQMStore::IGetter &, edm::LuminosityBlock const &, edm::EventSetup const &) override
Definition: EcalDQMonitorClient.cc:87
edm
HLT enums.
Definition: AlignableModifier.h:19
EcalDQMonitorClient::fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &)
Definition: EcalDQMonitorClient.cc:53
ecaldqm::EcalDQMonitor::verbosity_
const int verbosity_
Definition: EcalDQMonitor.h:46
ecaldqm::EcalDQMonitor::ecaldqmBeginRun
void ecaldqmBeginRun(edm::Run const &, edm::EventSetup const &)
Definition: EcalDQMonitor.cc:66
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
EcalDQMonitorClient::runWorkers
void runWorkers(DQMStore::IGetter &, ecaldqm::DQWorkerClient::ProcessType)
Definition: EcalDQMonitorClient.cc:127
protons_cff.time
time
Definition: protons_cff.py:35
edm::EDConsumerBase::consumesCollector
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
Definition: EDConsumerBase.cc:47
ecaldqm::EcalDQMonitor::fillDescriptions
static void fillDescriptions(edm::ParameterSetDescription &)
Definition: EcalDQMonitor.cc:55
ecaldqm::DQWorker::bookMEs
virtual void bookMEs(DQMStore::IBooker &)
Definition: DQWorker.cc:96
edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
EcalDQMonitorClient::~EcalDQMonitorClient
~EcalDQMonitorClient() override
Definition: EcalDQMonitorClient.cc:50
EcalCondObjectContainer
Definition: EcalCondObjectContainer.h:13
ecaldqm::DQWorker::releaseMEs
virtual void releaseMEs()
Definition: DQWorker.cc:90
EcalCondTowerObjectContainer
Definition: EcalCondTowerObjectContainer.h:13
ecaldqm::StatusManager::readFromObj
void readFromObj(EcalDQMChannelStatus const &, EcalDQMTowerStatus const &)
Definition: StatusManager.cc:200
ecaldqm::DQWorker
Definition: DQWorker.h:41
edm::FileInPath
Definition: FileInPath.h:61
ecaldqm::DQWorker::setSetupObjects
void setSetupObjects(edm::EventSetup const &)
Definition: DQWorker.cc:104
MakerMacros.h
IntegrityClient_cfi.ChStatus
ChStatus
Definition: IntegrityClient_cfi.py:38
EcalDQMonitorClient::EcalDQMonitorClient
EcalDQMonitorClient(edm::ParameterSet const &)
Definition: EcalDQMonitorClient.cc:22
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
HLTObjectMonitor_Client_cff.client
client
Definition: HLTObjectMonitor_Client_cff.py:6
ecaldqm::DQWorkerClient::kJob
Definition: DQWorkerClient.h:19
EcalDQMonitorClient::cStHndl
edm::ESGetToken< EcalDQMChannelStatus, EcalDQMChannelStatusRcd > cStHndl
Definition: EcalDQMonitorClient.h:34
Service.h
ecaldqm::DQWorkerClient::ProcessType
ProcessType
Definition: DQWorkerClient.h:19
ParameterSetDescription.h
ecaldqm::DQWorkerClient::kLumi
Definition: DQWorkerClient.h:19
edm::ConfigurationDescriptions
Definition: ConfigurationDescriptions.h:28
ecaldqm::EcalDQMonitor::ecaldqmEndLuminosityBlock
void ecaldqmEndLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &)
Definition: EcalDQMonitor.cc:108
FileInPath.h
ecaldqm::DQWorkerClient::setTokens
virtual void setTokens(edm::ConsumesCollector &)
Definition: DQWorkerClient.h:40
edm::ParameterSet
Definition: ParameterSet.h:47
edm::Transition
Transition
Definition: Transition.h:12
EcalDQMonitorClient::beginRun
void beginRun(edm::Run const &, edm::EventSetup const &) override
Definition: EcalDQMonitorClient.cc:69
EcalDQMonitorClient.h
EcalDQMonitorClient::tStHndl
edm::ESGetToken< EcalDQMTowerStatus, EcalDQMTowerStatusRcd > tStHndl
Definition: EcalDQMonitorClient.h:35
edm::EventSetup
Definition: EventSetup.h:58
edm::ParameterSetDescription::addNode
ParameterDescriptionNode * addNode(ParameterDescriptionNode const &node)
Definition: ParameterSetDescription.cc:41
ecaldqm::DQWorkerClient
Definition: DQWorkerClient.h:17
edm::EventSetup::find
std::optional< eventsetup::EventSetupRecordGeneric > find(const eventsetup::EventSetupRecordKey &iKey) const
Definition: EventSetup.h:176
EcalDQMonitorClient::endRun
void endRun(edm::Run const &, edm::EventSetup const &) override
Definition: EcalDQMonitorClient.cc:85
edm::EventSetup::getData
bool getData(T &iHolder) const
Definition: EventSetup.h:127
DQMEDHarvester
Definition: DQMEDHarvester.py:1
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
ecaldqm::EcalDQMonitor::ecaldqmEndRun
void ecaldqmEndRun(edm::Run const &, edm::EventSetup const &)
Definition: EcalDQMonitor.cc:80
ecaldqm::DQWorker::getName
const std::string & getName() const
Definition: DQWorker.h:118
dqm::implementation::IGetter
Definition: DQMStore.h:484
Exception
Definition: hltDiff.cc:245
EventSetup.h
dqm::implementation::IBooker
Definition: DQMStore.h:43
EcalDQMonitorClient
Definition: EcalDQMonitorClient.h:14
ParameterSet.h
EventSetupRecordKey.h
DeDxTools::esConsumes
ESGetTokenH3DDVariant esConsumes(std::string const &Reccord, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
edm::ConfigurationDescriptions::addDefault
void addDefault(ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:99
edm::RequireZeroOrMore
Definition: ParameterWildcardBase.h:17
EcalDQMonitorClient::statusManager_
ecaldqm::StatusManager statusManager_
Definition: EcalDQMonitorClient.h:36
edm::ConsumesCollector
Definition: ConsumesCollector.h:45
EcalDQMCommonUtils.h