Skip to content
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

Update service retrieval after deprecations in Gaudi v39.1 #256

Merged
merged 1 commit into from
Nov 1, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 11 additions & 8 deletions k4FWCore/src/PodioDataSvc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,12 @@ StatusCode PodioDataSvc::initialize() {
m_metadataframe = podio::Frame();
}

IProperty* property;
auto sc = service("ApplicationMgr", property);
if (sc == StatusCode::FAILURE) {
error() << "Could not get ApplicationMgr properties" << std::endl;
auto appMgr = service<IProperty>("ApplicationMgr", false);
if (!appMgr) {
throw std::runtime_error("Could not get ApplicationMgr");
}
Gaudi::Property<int> evtMax;
evtMax.assign(property->getProperty("EvtMax"));
evtMax.assign(appMgr->getProperty("EvtMax"));
m_requestedEventMax = evtMax;
m_requestedEventMax -= m_1stEvtEntry;

Expand Down Expand Up @@ -133,11 +132,15 @@ void PodioDataSvc::endOfRead() {
if (m_eventNum >= m_numAvailableEvents) {
info() << "Reached end of file with event " << m_eventNum << " (" << m_requestedEventMax << " events requested)"
<< endmsg;
IEventProcessor* eventProcessor;
sc = service("ApplicationMgr", eventProcessor);
auto eventProcessor = service<IEventProcessor>("ApplicationMgr", false);
if (!eventProcessor) {
throw std::runtime_error("Could not retrieve ApplicationMgr to schedule a stop");
}
sc = eventProcessor->stopRun();
if (sc.isFailure()) {
throw std::runtime_error("Failed to stop the run");
}
}
// todo: figure out sthg to do with sc (added to silence -Wunused-result)
}

/// Standard Constructor
Expand Down
Loading