CMS 3D CMS Logo

EcalDQMStatusWriter.cc
Go to the documentation of this file.
2 
4 
7 
9 
11 
12 #include <fstream>
13 
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 
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 
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
cond::service::PoolDBOutputService
Definition: PoolDBOutputService.h:32
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:36
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:175
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:56
EcalDQMStatusWriter::channelStatus_
EcalDQMChannelStatus channelStatus_
Definition: EcalDQMStatusWriter.h:17
cms::Exception
Definition: Exception.h:70
edm::Event
Definition: Event.h:73