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 
T getUntrackedParameter(std::string const &, T const &) const
void analyze(edm::Event const &, edm::EventSetup const &) override
EcalDQMChannelStatus channelStatus_
void readFromStream(std::istream &)
EcalDQMStatusWriter(edm::ParameterSet const &)
EcalDQMTowerStatus towerStatus_
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
void writeOne(T *payload, Time_t time, const std::string &recordName, bool withlogging=false)
void writeToObj(EcalDQMChannelStatus &, EcalDQMTowerStatus &) const