DQM
EcalMonitorDbModule
plugins
EcalDQMStatusWriter.cc
Go to the documentation of this file.
1
#include "
DQM/EcalMonitorDbModule/interface/EcalDQMStatusWriter.h
"
2
3
#include "
DQM/EcalCommon/interface/StatusManager.h
"
4
5
#include "
CondCore/DBOutputService/interface/PoolDBOutputService.h
"
6
#include "
FWCore/ServiceRegistry/interface/Service.h
"
7
8
#include "
CommonTools/Utils/interface/Exception.h
"
9
10
#include "
FWCore/Framework/interface/MakerMacros.h
"
11
12
#include <fstream>
13
14
EcalDQMStatusWriter::EcalDQMStatusWriter
(
edm::ParameterSet
const
&_ps)
15
: channelStatus_(), towerStatus_(), firstRun_(_ps.getUntrackedParameter<unsigned>(
"firstRun"
)) {
16
std::ifstream
inputFile
(_ps.
getUntrackedParameter
<
std::string
>(
"inputFile"
));
17
if
(!
inputFile
.is_open())
18
throw
cms::Exception
(
"Invalid input for EcalDQMStatusWriter"
);
19
20
ecaldqm::StatusManager
statusManager;
21
22
statusManager.
readFromStream
(
inputFile
);
23
statusManager.
writeToObj
(
channelStatus_
,
towerStatus_
);
24
}
25
26
void
EcalDQMStatusWriter::analyze
(
edm::Event
const
&,
edm::EventSetup
const
&_es) {
27
cond::service::PoolDBOutputService
&dbOutput(*
edm::Service<cond::service::PoolDBOutputService>
());
28
if
(
firstRun_
== dbOutput.
endOfTime
())
29
return
;
30
31
dbOutput.
writeOne
(&
channelStatus_
,
firstRun_
,
"EcalDQMChannelStatusRcd"
);
32
dbOutput.
writeOne
(&
towerStatus_
,
firstRun_
,
"EcalDQMTowerStatusRcd"
);
33
34
firstRun_
= dbOutput.
endOfTime
();
// avoid accidentally re-writing the conditions
35
}
36
37
DEFINE_FWK_MODULE
(
EcalDQMStatusWriter
);
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
cond::service::PoolDBOutputService
Definition:
PoolDBOutputService.h:33
EcalDQMStatusWriter::towerStatus_
EcalDQMTowerStatus towerStatus_
Definition:
EcalDQMStatusWriter.h:18
ecaldqm::StatusManager::readFromStream
void readFromStream(std::istream &)
Definition:
StatusManager.cc:124
MakerMacros.h
StatusManager.h
PoolDBOutputService.h
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition:
MakerMacros.h:16
Exception.h
Service.h
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:256
edm::ParameterSet
Definition:
ParameterSet.h:47
EcalDQMStatusWriter::analyze
void analyze(edm::Event const &, edm::EventSetup const &) override
Definition:
EcalDQMStatusWriter.cc:26
EcalDQMStatusWriter.h
edm::Service< cond::service::PoolDBOutputService >
dtResolutionTest_cfi.inputFile
inputFile
Definition:
dtResolutionTest_cfi.py:14
edm::EventSetup
Definition:
EventSetup.h:57
ecaldqm::StatusManager::writeToObj
void writeToObj(EcalDQMChannelStatus &, EcalDQMTowerStatus &) const
Definition:
StatusManager.cc:224
cond::service::PoolDBOutputService::endOfTime
cond::Time_t endOfTime() const
Definition:
PoolDBOutputService.cc:213
EcalDQMStatusWriter::firstRun_
unsigned firstRun_
Definition:
EcalDQMStatusWriter.h:19
ecaldqm::StatusManager
Definition:
StatusManager.h:14
EcalDQMStatusWriter::EcalDQMStatusWriter
EcalDQMStatusWriter(edm::ParameterSet const &)
Definition:
EcalDQMStatusWriter.cc:14
EcalDQMStatusWriter
Definition:
EcalDQMStatusWriter.h:9
cond::service::PoolDBOutputService::writeOne
Hash writeOne(const T *payload, Time_t time, const std::string &recordName)
Definition:
PoolDBOutputService.h:63
EcalDQMStatusWriter::channelStatus_
EcalDQMChannelStatus channelStatus_
Definition:
EcalDQMStatusWriter.h:17
cms::Exception
Definition:
Exception.h:70
edm::Event
Definition:
Event.h:73
Generated for CMSSW Reference Manual by
1.8.16