Skip to content

Commit

Permalink
Fix the service retrieval after deprecations in Gaudi v39r1
Browse files Browse the repository at this point in the history
  • Loading branch information
jmcarcell committed Nov 1, 2024
1 parent 2e155ff commit 00a4974
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
8 changes: 0 additions & 8 deletions SimG4Fast/src/components/SimG4ParticleSmearSimple.cpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
#include "SimG4ParticleSmearSimple.h"

// Gaudi

#include "GaudiKernel/IRndmGenSvc.h"

// CLHEP
#include "CLHEP/Vector/ThreeVector.h"

Expand All @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions SimG4Fast/src/components/SimG4ParticleSmearSimple.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// Gaudi
#include "GaudiKernel/AlgTool.h"
#include "GaudiKernel/RndmGenerators.h"
class IRndmGenSvc;
#include "GaudiKernel/IRndmGenSvc.h"

// FCCSW
#include "SimG4Interface/ISimG4ParticleSmearTool.h"
Expand Down Expand Up @@ -51,7 +51,7 @@ class SimG4ParticleSmearSimple : public AlgTool, virtual public ISimG4ParticleSm

private:
/// Random Number Service
IRndmGenSvc* m_randSvc;
SmartIF<IRndmGenSvc> 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)
Expand Down

0 comments on commit 00a4974

Please sign in to comment.