diff --git a/ARCdigi/include/ARCdigitizer.h b/ARCdigi/include/ARCdigitizer.h index a771c70..7e06eb3 100644 --- a/ARCdigi/include/ARCdigitizer.h +++ b/ARCdigi/include/ARCdigitizer.h @@ -11,7 +11,6 @@ // EDM4HEP #include "edm4hep/SimTrackerHitCollection.h" -#include "edm4hep/TrackCollection.h" #if __has_include("edm4hep/TrackerHit3DCollection.h") #include "edm4hep/TrackerHit3DCollection.h" #else @@ -63,7 +62,7 @@ class ARCdigitizer : public Gaudi::Algorithm { // Detector geometry dd4hep::Detector* m_detector; // Random Number Service - IRndmGenSvc* m_randSvc; + SmartIF m_randSvc; // Uniform random number generator used for the SiPM quantum efficiency Rndm::Numbers m_uniform; }; diff --git a/ARCdigi/src/ARCdigitizer.cpp b/ARCdigi/src/ARCdigitizer.cpp index 5f4a3ba..6ce7fa1 100644 --- a/ARCdigi/src/ARCdigitizer.cpp +++ b/ARCdigi/src/ARCdigitizer.cpp @@ -27,7 +27,8 @@ StatusCode ARCdigitizer::initialize() { return StatusCode::FAILURE; } // Initialize random number service - if (service("RndmGenSvc", m_randSvc).isFailure()) { + m_randSvc = service("RndmGenSvc", false); + if (!m_randSvc) { error() << "Couldn't get RndmGenSvc!" << endmsg; return StatusCode::FAILURE; } diff --git a/DCHdigi/include/DCHsimpleDigitizer.h b/DCHdigi/include/DCHsimpleDigitizer.h index 76b2573..90eef13 100644 --- a/DCHdigi/include/DCHsimpleDigitizer.h +++ b/DCHdigi/include/DCHsimpleDigitizer.h @@ -12,7 +12,6 @@ // EDM4HEP #include "edm4hep/SimTrackerHitCollection.h" -#include "edm4hep/TrackCollection.h" #if __has_include("edm4hep/TrackerHit3DCollection.h") #include "edm4hep/TrackerHit3DCollection.h" #else @@ -75,7 +74,7 @@ class DCHsimpleDigitizer : public Gaudi::Algorithm { FloatProperty m_xy_resolution{this, "xyResolution", 0.1, "Spatial resolution in the xy direction [mm]"}; // Random Number Service - IRndmGenSvc* m_randSvc; + SmartIF m_randSvc; // Gaussian random number generator used for the smearing of the z position Rndm::Numbers m_gauss_z; // Gaussian random number generator used for the smearing of the xy position diff --git a/DCHdigi/include/DCHsimpleDigitizerExtendedEdm.h b/DCHdigi/include/DCHsimpleDigitizerExtendedEdm.h index 38a1e72..6ecdaea 100644 --- a/DCHdigi/include/DCHsimpleDigitizerExtendedEdm.h +++ b/DCHdigi/include/DCHsimpleDigitizerExtendedEdm.h @@ -83,7 +83,7 @@ class DCHsimpleDigitizerExtendedEdm : public Gaudi::Algorithm { mutable DataHandle> m_rightHitSimHitDeltaLocalZ{"rightHitSimHitDeltaLocalZ", Gaudi::DataHandle::Writer, this}; // mm // Random Number Service - IRndmGenSvc* m_randSvc; + SmartIF m_randSvc; // Gaussian random number generator used for the smearing of the z position Rndm::Numbers m_gauss_z; // Gaussian random number generator used for the smearing of the xy position diff --git a/DCHdigi/src/DCHsimpleDigitizer.cpp b/DCHdigi/src/DCHsimpleDigitizer.cpp index f45930e..97d96dc 100644 --- a/DCHdigi/src/DCHsimpleDigitizer.cpp +++ b/DCHdigi/src/DCHsimpleDigitizer.cpp @@ -19,7 +19,8 @@ DCHsimpleDigitizer::~DCHsimpleDigitizer() {} StatusCode DCHsimpleDigitizer::initialize() { // Initialize random services - if (service("RndmGenSvc", m_randSvc).isFailure()) { + m_randSvc = service("RndmGenSvc", false); + if (!m_randSvc) { error() << "Couldn't get RndmGenSvc!" << endmsg; return StatusCode::FAILURE; } diff --git a/DCHdigi/src/DCHsimpleDigitizerExtendedEdm.cpp b/DCHdigi/src/DCHsimpleDigitizerExtendedEdm.cpp index 6c9d0b9..9507b3e 100644 --- a/DCHdigi/src/DCHsimpleDigitizerExtendedEdm.cpp +++ b/DCHdigi/src/DCHsimpleDigitizerExtendedEdm.cpp @@ -20,7 +20,8 @@ DCHsimpleDigitizerExtendedEdm::~DCHsimpleDigitizerExtendedEdm() {} StatusCode DCHsimpleDigitizerExtendedEdm::initialize() { // Initialize random services - if (service("RndmGenSvc", m_randSvc).isFailure()) { + m_randSvc = service("RndmGenSvc", false); + if (!m_randSvc) { error() << "Couldn't get RndmGenSvc!" << endmsg; return StatusCode::FAILURE; } diff --git a/VTXdigi/include/VTXdigitizer.h b/VTXdigi/include/VTXdigitizer.h index 84515e5..00c7a4e 100644 --- a/VTXdigi/include/VTXdigitizer.h +++ b/VTXdigi/include/VTXdigitizer.h @@ -93,7 +93,7 @@ class VTXdigitizer : public Gaudi::Algorithm { BooleanProperty m_forceHitsOntoSurface{this, "forceHitsOntoSurface", false, "Project hits onto the surface in case they are not yet on the surface (default: false"}; // Random Number Service - IRndmGenSvc* m_randSvc; + SmartIF m_randSvc; // Gaussian random number generator used for smearing std::vector m_gauss_x_vec; diff --git a/VTXdigi/src/VTXdigitizer.cpp b/VTXdigi/src/VTXdigitizer.cpp index ff6d35a..02a7399 100644 --- a/VTXdigi/src/VTXdigitizer.cpp +++ b/VTXdigi/src/VTXdigitizer.cpp @@ -13,7 +13,8 @@ VTXdigitizer::~VTXdigitizer() {} StatusCode VTXdigitizer::initialize() { // Initialize random services - if (service("RndmGenSvc", m_randSvc).isFailure()) { + m_randSvc = service("RndmGenSvc", false); + if (!m_randSvc) { error() << "Couldn't get RndmGenSvc!" << endmsg; return StatusCode::FAILURE; }