CMS 3D CMS Logo

EcalDQMonitorClient.cc
Go to the documentation of this file.
2 
4 
9 
14 
16 
18 
23 
24 #include <ctime>
25 #include <fstream>
26 
28  : DQMEDHarvester(), ecaldqm::EcalDQMonitor(_ps), iEvt_(0), statusManager_() {
30  [this](ecaldqm::DQWorker* worker) {
31  ecaldqm::DQWorkerClient* client(dynamic_cast<ecaldqm::DQWorkerClient*>(worker));
32  if (!client)
33  throw cms::Exception("InvalidConfiguration") << "Non-client DQWorker " << worker->getName() << " passed";
34  client->setStatusManager(this->statusManager_);
35  },
36  "initialization");
37 
38  if (_ps.existsAs<edm::FileInPath>("PNMaskFile", false)) {
39  std::ifstream maskFile(_ps.getUntrackedParameter<edm::FileInPath>("PNMaskFile").fullPath());
40  if (maskFile.is_open())
42  }
43 }
44 
46 
47 /*static*/
51 
52  edm::ParameterSetDescription clientParameters;
55  allWorkers.addNode(
57  desc.addUntracked("workerParameters", allWorkers);
58 
59  desc.addOptionalUntracked<edm::FileInPath>("PNMaskFile");
60 
61  _descs.addDefault(desc);
62 }
63 
66 
67  if (_es.find(edm::eventsetup::EventSetupRecordKey::makeKey<EcalDQMChannelStatusRcd>()) &&
68  _es.find(edm::eventsetup::EventSetupRecordKey::makeKey<EcalDQMTowerStatusRcd>())) {
70  _es.get<EcalDQMChannelStatusRcd>().get(cStHndl);
71 
73  _es.get<EcalDQMTowerStatusRcd>().get(tStHndl);
74 
75  statusManager_.readFromObj(*cStHndl, *tStHndl);
76  }
77 
78  ecaldqmBeginRun(_run, _es);
79 }
80 
81 void EcalDQMonitorClient::endRun(edm::Run const& _run, edm::EventSetup const& _es) { ecaldqmEndRun(_run, _es); }
82 
84  DQMStore::IGetter& _igetter,
85  edm::LuminosityBlock const& _lumi,
86  edm::EventSetup const& _es) {
88  [&_ibooker](ecaldqm::DQWorker* worker) {
89  ecaldqm::DQWorkerClient* client(static_cast<ecaldqm::DQWorkerClient*>(worker));
90  if (!client->onlineMode() && !client->runsOn(ecaldqm::DQWorkerClient::kLumi))
91  return;
92  client->bookMEs(_ibooker);
93  },
94  "bookMEs",
95  "Booking MEs");
96 
97  ecaldqmEndLuminosityBlock(_lumi, _es);
98 
100 
102  [](ecaldqm::DQWorker* worker) {
103  ecaldqm::DQWorkerClient* client(static_cast<ecaldqm::DQWorkerClient*>(worker));
104  client->resetPerLumi();
105  },
106  "dqmEndLuminosityBlock",
107  "Reset per-lumi MEs");
108 }
109 
112  [&_ibooker](ecaldqm::DQWorker* worker) {
113  worker->bookMEs(_ibooker); // worker returns if already booked
114  },
115  "bookMEs",
116  "Booking MEs");
117 
119 
120  executeOnWorkers_([](ecaldqm::DQWorker* worker) { worker->releaseMEs(); }, "releaseMEs", "releasing histograms");
121 }
122 
124  if (verbosity_ > 0)
125  edm::LogInfo("EcalDQM") << moduleName_ << ": Starting worker modules..";
126 
128  [&_igetter, &_type](ecaldqm::DQWorker* worker) {
129  ecaldqm::DQWorkerClient* client(static_cast<ecaldqm::DQWorkerClient*>(worker));
130  if (!client->onlineMode() && !client->runsOn(_type))
131  return;
132  client->releaseSource();
133  client->resetMEs();
134  if (!client->retrieveSource(_igetter, _type))
135  return;
136  if (client->onlineMode())
137  client->setTime(time(nullptr));
138  client->producePlots(_type);
139  },
140  "retrieveAndRun",
141  "producing plots");
142 
143  if (verbosity_ > 0)
144  edm::LogInfo("EcalDQM") << " done." << std::endl;
145 }
146 
ConfigurationDescriptions.h
MessageLogger.h
ecaldqm::EcalDQMonitor::moduleName_
const std::string moduleName_
Definition: EcalDQMonitor.h:46
ecaldqm
Definition: DQWorker.h:24
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:110
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
EcalDQMonitorClient::dqmEndLuminosityBlock
void dqmEndLuminosityBlock(DQMStore::IBooker &, DQMStore::IGetter &, edm::LuminosityBlock const &, edm::EventSetup const &) override
Definition: EcalDQMonitorClient.cc:83
EcalDQMonitorClient::fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &)
Definition: EcalDQMonitorClient.cc:48
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
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
EcalDQMonitorClient::runWorkers
void runWorkers(DQMStore::IGetter &, ecaldqm::DQWorkerClient::ProcessType)
Definition: EcalDQMonitorClient.cc:123
EcalDQMTowerStatus.h
ecaldqm::EcalDQMonitor::fillDescriptions
static void fillDescriptions(edm::ParameterSetDescription &)
Definition: EcalDQMonitor.cc:53
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
ecaldqm::DQWorker::bookMEs
virtual void bookMEs(DQMStore::IBooker &)
Definition: DQWorker.cc:66
edm::ParameterSet::existsAs
bool existsAs(std::string const &parameterName, bool trackiness=true) const
checks if a parameter exists as a given type
Definition: ParameterSet.h:171
edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
EcalDQMonitorClient::~EcalDQMonitorClient
~EcalDQMonitorClient() override
Definition: EcalDQMonitorClient.cc:45
EcalDQMChannelStatusRcd.h
ecaldqm::StatusManager::readFromStream
void readFromStream(std::istream &)
Definition: StatusManager.cc:124
ecaldqm::DQWorker::releaseMEs
virtual void releaseMEs()
Definition: DQWorker.cc:60
FileInPath.h
ecaldqm::StatusManager::readFromObj
void readFromObj(EcalDQMChannelStatus const &, EcalDQMTowerStatus const &)
Definition: StatusManager.cc:200
ecaldqm::DQWorker
Definition: DQWorker.h:28
edm::FileInPath
Definition: FileInPath.h:64
MakerMacros.h
edm::EventSetup::get
T get() const
Definition: EventSetup.h:80
EcalDQMonitorClient::EcalDQMonitorClient
EcalDQMonitorClient(edm::ParameterSet const &)
Definition: EcalDQMonitorClient.cc:27
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:15
Service.h
ecaldqm::DQWorkerClient::ProcessType
ProcessType
Definition: DQWorkerClient.h:15
edm::ESHandle
Definition: DTSurvey.h:22
l1RctEmulDigis_ECALGREN1_cff.maskFile
maskFile
Definition: l1RctEmulDigis_ECALGREN1_cff.py:5
ParameterSetDescription.h
ecaldqm::DQWorkerClient::kLumi
Definition: DQWorkerClient.h:15
edm::ConfigurationDescriptions
Definition: ConfigurationDescriptions.h:28
ecaldqm::EcalDQMonitor::ecaldqmEndLuminosityBlock
void ecaldqmEndLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &)
Definition: EcalDQMonitor.cc:129
EcalDQMTowerStatusRcd
Definition: EcalDQMTowerStatusRcd.h:5
EcalDQMTowerStatusRcd.h
edm::ParameterSet
Definition: ParameterSet.h:47
EcalDQMonitorClient::beginRun
void beginRun(edm::Run const &, edm::EventSetup const &) override
Definition: EcalDQMonitorClient.cc:64
EcalDQMonitorClient.h
EcalDQMChannelStatusRcd
Definition: EcalDQMChannelStatusRcd.h:5
edm::EventSetup
Definition: EventSetup.h:57
edm::ParameterSetDescription::addNode
ParameterDescriptionNode * addNode(ParameterDescriptionNode const &node)
Definition: ParameterSetDescription.cc:41
ecaldqm::DQWorkerClient
Definition: DQWorkerClient.h:13
edm::EventSetup::find
std::optional< eventsetup::EventSetupRecordGeneric > find(const eventsetup::EventSetupRecordKey &iKey) const
Definition: EventSetup.h:169
get
#define get
EcalDQMonitorClient::endRun
void endRun(edm::Run const &, edm::EventSetup const &) override
Definition: EcalDQMonitorClient.cc:81
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:101
ecaldqm::DQWorker::getName
const std::string & getName() const
Definition: DQWorker.h:71
dqm::implementation::IGetter
Definition: DQMStore.h:484
Exception
Definition: hltDiff.cc:246
EventSetup.h
dqm::implementation::IBooker
Definition: DQMStore.h:43
EcalDQMonitorClient
Definition: EcalDQMonitorClient.h:10
ParameterSet.h
EventSetupRecordKey.h
ntuplemaker.time
time
Definition: ntuplemaker.py:310
EcalDQMChannelStatus.h
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:31
ecaldqm::EcalDQMonitor::ecaldqmGetSetupObjects
void ecaldqmGetSetupObjects(edm::EventSetup const &)
Definition: EcalDQMonitor.cc:64
edm::FileInPath::fullPath
std::string fullPath() const
Definition: FileInPath.cc:163
EcalDQMCommonUtils.h