Skip to content

Commit

Permalink
Fix another deprecated service retrieval instance (#43)
Browse files Browse the repository at this point in the history
  • Loading branch information
jmcarcell authored Nov 8, 2024
1 parent 5217a86 commit 23506f8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion k4Gen/src/components/HepMCHistograms.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ HepMCHistograms::HepMCHistograms(const std::string& name, ISvcLocator* svcLoc) :
StatusCode HepMCHistograms::initialize() {
if (Gaudi::Algorithm::initialize().isFailure()) return StatusCode::FAILURE;

if (service("THistSvc", m_ths).isFailure()) {
m_ths = service("THistSvc", true);
if (!m_ths) {
error() << "Couldn't get THistSvc" << endmsg;
return StatusCode::FAILURE;
}
Expand Down
2 changes: 1 addition & 1 deletion k4Gen/src/components/HepMCHistograms.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class HepMCHistograms : public Gaudi::Algorithm {
/// Handle for the HepMC to be read
mutable DataHandle<HepMC3::GenEvent> m_hepmchandle{"HepMC", Gaudi::DataHandle::Reader, this};

ITHistSvc* m_ths{nullptr}; ///< THistogram service
SmartIF<ITHistSvc> m_ths; ///< THistogram service

TH1F* m_pt{nullptr}; ///< histogram for pT of particles
TH1F* m_eta{nullptr}; ///< histogram for pseudorapidity of particles
Expand Down

0 comments on commit 23506f8

Please sign in to comment.