From 00a49745a686b256e27cbb8f19d658e681876ebd Mon Sep 17 00:00:00 2001 From: jmcarcell Date: Fri, 1 Nov 2024 16:53:10 +0100 Subject: [PATCH] Fix the service retrieval after deprecations in Gaudi v39r1 --- SimG4Fast/src/components/SimG4ParticleSmearSimple.cpp | 8 -------- SimG4Fast/src/components/SimG4ParticleSmearSimple.h | 4 ++-- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/SimG4Fast/src/components/SimG4ParticleSmearSimple.cpp b/SimG4Fast/src/components/SimG4ParticleSmearSimple.cpp index 1a5a616..cdea4c4 100644 --- a/SimG4Fast/src/components/SimG4ParticleSmearSimple.cpp +++ b/SimG4Fast/src/components/SimG4ParticleSmearSimple.cpp @@ -1,9 +1,5 @@ #include "SimG4ParticleSmearSimple.h" -// Gaudi - -#include "GaudiKernel/IRndmGenSvc.h" - // CLHEP #include "CLHEP/Vector/ThreeVector.h" @@ -21,10 +17,6 @@ StatusCode SimG4ParticleSmearSimple::initialize() { if (AlgTool::initialize().isFailure()) { return StatusCode::FAILURE; } - if (service("RndmGenSvc", m_randSvc).isFailure()) { - error() << "Couldn't get RndmGenSvc" << endmsg; - return StatusCode::FAILURE; - } m_gauss.initialize(m_randSvc, Rndm::Gauss(1, m_sigma)).ignore(); info() << "Tool used for smearing particles initialized with constant sigma = " << m_sigma << endmsg; return StatusCode::SUCCESS; diff --git a/SimG4Fast/src/components/SimG4ParticleSmearSimple.h b/SimG4Fast/src/components/SimG4ParticleSmearSimple.h index 5b2850e..beba9b2 100644 --- a/SimG4Fast/src/components/SimG4ParticleSmearSimple.h +++ b/SimG4Fast/src/components/SimG4ParticleSmearSimple.h @@ -4,7 +4,7 @@ // Gaudi #include "GaudiKernel/AlgTool.h" #include "GaudiKernel/RndmGenerators.h" -class IRndmGenSvc; +#include "GaudiKernel/IRndmGenSvc.h" // FCCSW #include "SimG4Interface/ISimG4ParticleSmearTool.h" @@ -51,7 +51,7 @@ class SimG4ParticleSmearSimple : public AlgTool, virtual public ISimG4ParticleSm private: /// Random Number Service - IRndmGenSvc* m_randSvc; + SmartIF m_randSvc; /// Gaussian random number generator used for smearing with a constant resolution (m_sigma) Rndm::Numbers m_gauss; /// Constant resolution for the smearing (set by job options)