Skip to content

Commit

Permalink
Fix service retrieval after deprecations in Gaudi v39r1 (#42)
Browse files Browse the repository at this point in the history
  • Loading branch information
jmcarcell authored Nov 8, 2024
1 parent ac694a3 commit 5217a86
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion k4Gen/src/components/ConstPtParticleGun.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ StatusCode ConstPtParticleGun::initialize() {
StatusCode sc = AlgTool::initialize();
if (!sc.isSuccess()) return sc;
// initialize random number generator
IRndmGenSvc* randSvc = service<IRndmGenSvc>("RndmGenSvc", true);
auto randSvc = service<IRndmGenSvc>("RndmGenSvc", true);
sc = m_flatGenerator.initialize(randSvc, Rndm::Flat(0., 1.));
if (!sc.isSuccess()) {
error() << "Cannot initialize flat generator";
Expand Down
2 changes: 1 addition & 1 deletion k4Gen/src/components/FlatSmearVertex.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ StatusCode FlatSmearVertex::initialize() {
StatusCode sc = AlgTool::initialize();
if (sc.isFailure()) return sc;

IRndmGenSvc* randSvc = service<IRndmGenSvc>("RndmGenSvc", true);
auto randSvc = service<IRndmGenSvc>("RndmGenSvc", true);
if (m_xmin > m_xmax) {
error() << "xMin > xMax !";
return StatusCode::FAILURE;
Expand Down
4 changes: 1 addition & 3 deletions k4Gen/src/components/GaussSmearVertex.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,7 @@ StatusCode GaussSmearVertex::initialize() {
StatusCode sc = AlgTool::initialize();
if (sc.isFailure()) return sc;

IRndmGenSvc* randSvc = service<IRndmGenSvc>("RndmGenSvc", true);


auto randSvc = service<IRndmGenSvc>("RndmGenSvc", true);

sc = m_gaussDist.initialize(randSvc, Rndm::Gauss(0., 1));
if (sc.isFailure()) return sc;
Expand Down
2 changes: 1 addition & 1 deletion k4Gen/src/components/MomentumRangeParticleGun.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ StatusCode MomentumRangeParticleGun::initialize() {
StatusCode sc = AlgTool::initialize();
if (!sc.isSuccess()) return sc;

IRndmGenSvc* randSvc = service<IRndmGenSvc>("RndmGenSvc", true);
auto randSvc = service<IRndmGenSvc>("RndmGenSvc", true);
sc = m_flatGenerator.initialize(randSvc, Rndm::Flat(0., 1.));
if (!sc.isSuccess()) {
error() << "Cannot initialize flat generator";
Expand Down
2 changes: 1 addition & 1 deletion k4Gen/src/components/PoissonPileUp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ PoissonPileUp::~PoissonPileUp() { ; }
StatusCode PoissonPileUp::initialize() {
StatusCode sc = AlgTool::initialize();
if (sc.isFailure()) return sc;
IRndmGenSvc* randSvc = service<IRndmGenSvc>("RndmGenSvc", true);
auto randSvc = service<IRndmGenSvc>("RndmGenSvc", true);
if (m_meanPileUpEvents < 0) {
error() << "Number of Pileup events cannot be negative!";
return StatusCode::FAILURE;
Expand Down

0 comments on commit 5217a86

Please sign in to comment.