-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix EcalDQMStatusWriter to watch runs and load the input file #35466
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,14 +9,13 @@ | |
|
||
#include "FWCore/Framework/interface/MakerMacros.h" | ||
|
||
#include <fstream> | ||
|
||
EcalDQMStatusWriter::EcalDQMStatusWriter(edm::ParameterSet const &_ps) | ||
: channelStatus_(), | ||
towerStatus_(), | ||
firstRun_(_ps.getUntrackedParameter<unsigned>("firstRun")), | ||
inputFile_(_ps.getUntrackedParameter<std::string>("inputFile")), | ||
elecMapHandle(esConsumes<edm::Transition::BeginRun>()) { | ||
electronicsMap_(nullptr), | ||
elecMapHandle_(esConsumes<edm::Transition::BeginRun>()) { | ||
if (!inputFile_.is_open()) | ||
throw cms::Exception("Invalid input for EcalDQMStatusWriter"); | ||
} | ||
|
@@ -30,25 +29,27 @@ void EcalDQMStatusWriter::beginRun(edm::Run const &_run, edm::EventSetup const & | |
statusManager.writeToObj(channelStatus_, towerStatus_); | ||
} | ||
|
||
void EcalDQMStatusWriter::endRun(edm::Run const &_run, edm::EventSetup const &_es) {} | ||
|
||
void EcalDQMStatusWriter::analyze(edm::Event const &, edm::EventSetup const &_es) { | ||
cond::service::PoolDBOutputService &dbOutput(*edm::Service<cond::service::PoolDBOutputService>()); | ||
if (firstRun_ == dbOutput.endOfTime()) | ||
return; | ||
|
||
dbOutput.writeOne(&channelStatus_, firstRun_, "EcalDQMChannelStatusRcd"); | ||
dbOutput.writeOne(&towerStatus_, firstRun_, "EcalDQMTowerStatusRcd"); | ||
dbOutput.writeOne(channelStatus_, firstRun_, "EcalDQMChannelStatusRcd"); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hi @ggovi There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @thomreis Can you please dump the error that you get with conddb dump? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sure. I have also sent it in an email to you last week already.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @thomreis thanks, i'll investigate. |
||
dbOutput.writeOne(towerStatus_, firstRun_, "EcalDQMTowerStatusRcd"); | ||
|
||
firstRun_ = dbOutput.endOfTime(); // avoid accidentally re-writing the conditions | ||
} | ||
|
||
void EcalDQMStatusWriter::setElectronicsMap(edm::EventSetup const &_es) { | ||
electronicsMap = &_es.getData(elecMapHandle); | ||
electronicsMap_ = &_es.getData(elecMapHandle_); | ||
} | ||
|
||
EcalElectronicsMapping const *EcalDQMStatusWriter::GetElectronicsMap() { | ||
if (!electronicsMap) | ||
if (!electronicsMap_) | ||
throw cms::Exception("InvalidCall") << "Electronics Mapping not initialized"; | ||
return electronicsMap; | ||
return electronicsMap_; | ||
} | ||
|
||
DEFINE_FWK_MODULE(EcalDQMStatusWriter); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@thomreis This is the change producing a valid sqlite... nothing to do with conddb dump
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Without changing the
writeOne()
functions in DQM/EcalMonitorDbModule/plugins/EcalDQMStatusWriter.cc from pointer based to reference based the produced sqlite file was not valid. Or at least the payload in it could not be printed.