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  inputFile_(_ps.getUntrackedParameter<std::string>("inputFile")) {
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 
34  if (firstRun_ == dbOutput.endOfTime())
35  return;
36 
37  dbOutput.writeOne(&channelStatus_, firstRun_, "EcalDQMChannelStatusRcd");
38  dbOutput.writeOne(&towerStatus_, firstRun_, "EcalDQMTowerStatusRcd");
39 
40  firstRun_ = dbOutput.endOfTime(); // avoid accidentally re-writing the conditions
41 }
42 
45  _es.get<EcalMappingRcd>().get(elecMapHandle);
46  electronicsMap = elecMapHandle.product();
47 }
48 
50  if (!electronicsMap)
51  throw cms::Exception("InvalidCall") << "Electronics Mapping not initialized";
52  return electronicsMap;
53 }
54 
edm::ESHandle::product
T const * product() const
Definition: ESHandle.h:86
EcalElectronicsMapping
Definition: EcalElectronicsMapping.h:28
edm::Run
Definition: Run.h:45
EcalDQMStatusWriter::GetElectronicsMap
const EcalElectronicsMapping * GetElectronicsMap()
Definition: EcalDQMStatusWriter.cc:49
EcalDQMStatusWriter::setElectronicsMap
void setElectronicsMap(edm::EventSetup const &)
Definition: EcalDQMStatusWriter.cc:43
EcalDQMStatusWriter::electronicsMap
const EcalElectronicsMapping * electronicsMap
Definition: EcalDQMStatusWriter.h:28
cond::service::PoolDBOutputService
Definition: PoolDBOutputService.h:33
EcalDQMStatusWriter::towerStatus_
EcalDQMTowerStatus towerStatus_
Definition: EcalDQMStatusWriter.h:24
EcalDQMStatusWriter::inputFile_
std::ifstream inputFile_
Definition: EcalDQMStatusWriter.h:26
EcalDQMStatusWriter::beginRun
void beginRun(edm::Run const &, edm::EventSetup const &) override
Definition: EcalDQMStatusWriter.cc:23
MakerMacros.h
StatusManager.h
PoolDBOutputService.h
edm::EventSetup::get
T get() const
Definition: EventSetup.h:87
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
Exception.h
Service.h
edm::ESHandle< EcalElectronicsMapping >
ecaldqm::StatusManager::readFromStream
void readFromStream(std::istream &, EcalElectronicsMapping const *)
Definition: StatusManager.cc:124
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:32
EcalDQMStatusWriter.h
edm::Service< cond::service::PoolDBOutputService >
edm::EventSetup
Definition: EventSetup.h:58
get
#define get
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:25
ecaldqm::StatusManager
Definition: StatusManager.h:16
std
Definition: JetResolutionObject.h:76
EcalMappingRcd
Definition: EcalMappingRcd.h:15
EcalDQMStatusWriter::EcalDQMStatusWriter
EcalDQMStatusWriter(edm::ParameterSet const &)
Definition: EcalDQMStatusWriter.cc:14
EcalDQMStatusWriter
Definition: EcalDQMStatusWriter.h:14
Exception
Definition: hltDiff.cc:245
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:23
cms::Exception
Definition: Exception.h:70
edm::Event
Definition: Event.h:73