CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
EcalDQMStatusWriter.cc
Go to the documentation of this file.
2 
4 
7 
9 
11 
13  : channelStatus_(),
14  towerStatus_(),
15  firstRun_(_ps.getUntrackedParameter<unsigned>("firstRun")),
16  inputFile_(_ps.getUntrackedParameter<std::string>("inputFile")),
17  electronicsMap_(nullptr),
18  elecMapHandle_(esConsumes<edm::Transition::BeginRun>()) {
19  if (!inputFile_.is_open())
20  throw cms::Exception("Invalid input for EcalDQMStatusWriter");
21 }
22 
24  setElectronicsMap(_es);
25 
26  ecaldqm::StatusManager statusManager;
27 
29  statusManager.writeToObj(channelStatus_, towerStatus_);
30 }
31 
32 void EcalDQMStatusWriter::endRun(edm::Run const &_run, edm::EventSetup const &_es) {}
33 
36  if (firstRun_ == dbOutput.endOfTime())
37  return;
38 
39  dbOutput.writeOneIOV(channelStatus_, firstRun_, "EcalDQMChannelStatusRcd");
40  dbOutput.writeOneIOV(towerStatus_, firstRun_, "EcalDQMTowerStatusRcd");
41 
42  firstRun_ = dbOutput.endOfTime(); // avoid accidentally re-writing the conditions
43 }
44 
47 }
48 
50  if (!electronicsMap_)
51  throw cms::Exception("InvalidCall") << "Electronics Mapping not initialized";
52  return electronicsMap_;
53 }
54 
void endRun(edm::Run const &, edm::EventSetup const &) override
void analyze(edm::Event const &, edm::EventSetup const &) override
void setElectronicsMap(edm::EventSetup const &)
EcalDQMChannelStatus channelStatus_
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
edm::ESGetToken< EcalElectronicsMapping, EcalMappingRcd > elecMapHandle_
EcalDQMStatusWriter(edm::ParameterSet const &)
EcalDQMTowerStatus towerStatus_
bool getData(T &iHolder) const
Definition: EventSetup.h:128
Hash writeOneIOV(const T &payload, Time_t time, const std::string &recordName)
Transition
Definition: Transition.h:12
EcalElectronicsMapping const * GetElectronicsMap()
void readFromStream(std::istream &, EcalElectronicsMapping const *)
void writeToObj(EcalDQMChannelStatus &, EcalDQMTowerStatus &) const
ESGetTokenH3DDVariant esConsumes(std::string const &Reccord, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
Definition: Run.h:45
void beginRun(edm::Run const &, edm::EventSetup const &) override
EcalElectronicsMapping const * electronicsMap_