CMS 3D CMS Logo

EcalDQMStatusWriter.cc
Go to the documentation of this file.
2 
4 
7 
9 
11 
12 #include <fstream>
13 
15  channelStatus_(),
16  towerStatus_(),
17  firstRun_(_ps.getUntrackedParameter<unsigned>("firstRun"))
18 {
19  std::ifstream inputFile(_ps.getUntrackedParameter<std::string>("inputFile"));
20  if(!inputFile.is_open())
21  throw cms::Exception("Invalid input for EcalDQMStatusWriter");
22 
23  ecaldqm::StatusManager statusManager;
24 
25  statusManager.readFromStream(inputFile);
26  statusManager.writeToObj(channelStatus_, towerStatus_);
27 }
28 
29 void
31 {
33  if(firstRun_ == dbOutput.endOfTime()) return;
34 
35  dbOutput.writeOne(&channelStatus_, firstRun_, "EcalDQMChannelStatusRcd");
36  dbOutput.writeOne(&towerStatus_, firstRun_, "EcalDQMTowerStatusRcd");
37 
38  firstRun_ = dbOutput.endOfTime(); // avoid accidentally re-writing the conditions
39 }
40 
T getUntrackedParameter(std::string const &, T const &) const
void analyze(edm::Event const &, edm::EventSetup const &) override
EcalDQMChannelStatus channelStatus_
void readFromStream(std::istream &)
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
EcalDQMStatusWriter(edm::ParameterSet const &)
EcalDQMTowerStatus towerStatus_
void writeOne(T *payload, Time_t time, const std::string &recordName, bool withlogging=false)
void writeToObj(EcalDQMChannelStatus &, EcalDQMTowerStatus &) const