diff --git a/RecCalorimeter/src/components/CorrectECalBarrelSliWinCluster.cpp b/RecCalorimeter/src/components/CorrectECalBarrelSliWinCluster.cpp index 20b5b7e..d5e784d 100644 --- a/RecCalorimeter/src/components/CorrectECalBarrelSliWinCluster.cpp +++ b/RecCalorimeter/src/components/CorrectECalBarrelSliWinCluster.cpp @@ -163,7 +163,8 @@ StatusCode CorrectECalBarrelSliWinCluster::initialize() { m_decoder.insert (std::make_pair(m_systemId[iSys], m_geoSvc->getDetector()->readout(m_readoutName[iSys]).idSpec().decoder())); } // Initialize random 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/RecCalorimeter/src/components/CorrectECalBarrelSliWinCluster.h b/RecCalorimeter/src/components/CorrectECalBarrelSliWinCluster.h index 21b4f27..53921b8 100644 --- a/RecCalorimeter/src/components/CorrectECalBarrelSliWinCluster.h +++ b/RecCalorimeter/src/components/CorrectECalBarrelSliWinCluster.h @@ -160,7 +160,7 @@ class CorrectECalBarrelSliWinCluster : public Gaudi::Algorithm { /// Histogram of pileup noise added to energy of clusters mutable TH1F* m_hPileupEnergy; /// Random Number Service - IRndmGenSvc* m_randSvc; + SmartIF m_randSvc; /// Gaussian random number generator used for the generation of random noise hits Rndm::Numbers m_gauss; /// Name of the file with noise constants diff --git a/RecCalorimeter/src/components/CreateCaloClusters.cpp b/RecCalorimeter/src/components/CreateCaloClusters.cpp index cab3f91..908ac74 100644 --- a/RecCalorimeter/src/components/CreateCaloClusters.cpp +++ b/RecCalorimeter/src/components/CreateCaloClusters.cpp @@ -50,7 +50,8 @@ StatusCode CreateCaloClusters::initialize() { } // Histogram service - if (service("THistSvc", m_histSvc).isFailure()) { + m_histSvc = service("THistSvc", false); + if (!m_histSvc) { error() << "Unable to locate Histogram Service" << endmsg; return StatusCode::FAILURE; } diff --git a/RecCalorimeter/src/components/CreateCaloClusters.h b/RecCalorimeter/src/components/CreateCaloClusters.h index 8ecab01..d761796 100644 --- a/RecCalorimeter/src/components/CreateCaloClusters.h +++ b/RecCalorimeter/src/components/CreateCaloClusters.h @@ -59,7 +59,7 @@ class CreateCaloClusters : public Gaudi::Algorithm { private: /// Pointer to the interface of histogram service - ITHistSvc* m_histSvc{nullptr}; + SmartIF m_histSvc; /// Pointer to the geometry service SmartIF m_geoSvc; diff --git a/RecCalorimeter/src/components/MassInv.cpp b/RecCalorimeter/src/components/MassInv.cpp index 1e761f6..4b9a45f 100644 --- a/RecCalorimeter/src/components/MassInv.cpp +++ b/RecCalorimeter/src/components/MassInv.cpp @@ -320,7 +320,8 @@ StatusCode MassInv::initialize() { m_decoder.insert (std::make_pair(m_systemId[iSys], m_geoSvc->getDetector()->readout(m_readoutName[iSys]).idSpec().decoder())); } // Initialize random 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/RecCalorimeter/src/components/MassInv.h b/RecCalorimeter/src/components/MassInv.h index 8c9830e..32b0748 100644 --- a/RecCalorimeter/src/components/MassInv.h +++ b/RecCalorimeter/src/components/MassInv.h @@ -193,7 +193,7 @@ class MassInv : public Gaudi::Algorithm { /// Histogram of pileup noise added to energy of clusters TH1F* m_hPileupEnergy; /// Random Number Service - IRndmGenSvc* m_randSvc; + SmartIF m_randSvc; /// Gaussian random number generator used for the generation of random noise hits Rndm::Numbers m_gauss; /// Name of the file with noise constants diff --git a/RecCalorimeter/src/components/NoiseCaloCellsFlatTool.cpp b/RecCalorimeter/src/components/NoiseCaloCellsFlatTool.cpp index 9803bea..c9604b2 100644 --- a/RecCalorimeter/src/components/NoiseCaloCellsFlatTool.cpp +++ b/RecCalorimeter/src/components/NoiseCaloCellsFlatTool.cpp @@ -16,7 +16,8 @@ StatusCode NoiseCaloCellsFlatTool::initialize() { } // Initialize random service - if (service("RndmGenSvc", m_randSvc).isFailure()) { + m_randSvc = service("RndmGenSvc", true); + if (!m_randSvc) { error() << "Couldn't get RndmGenSvc" << endmsg; return StatusCode::FAILURE; } diff --git a/RecCalorimeter/src/components/NoiseCaloCellsFlatTool.h b/RecCalorimeter/src/components/NoiseCaloCellsFlatTool.h index ab149de..3db823a 100644 --- a/RecCalorimeter/src/components/NoiseCaloCellsFlatTool.h +++ b/RecCalorimeter/src/components/NoiseCaloCellsFlatTool.h @@ -47,7 +47,7 @@ class NoiseCaloCellsFlatTool : public AlgTool, virtual public INoiseCaloCellsToo this, "filterNoiseThreshold", 3, "remove cells with energy below offset + threshold * noise RMS"}; /// 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; }; diff --git a/RecCalorimeter/src/components/NoiseCaloCellsFromFileTool.cpp b/RecCalorimeter/src/components/NoiseCaloCellsFromFileTool.cpp index e086f87..517a589 100644 --- a/RecCalorimeter/src/components/NoiseCaloCellsFromFileTool.cpp +++ b/RecCalorimeter/src/components/NoiseCaloCellsFromFileTool.cpp @@ -33,7 +33,8 @@ StatusCode NoiseCaloCellsFromFileTool::initialize() { } // Initialize random 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/RecCalorimeter/src/components/NoiseCaloCellsFromFileTool.h b/RecCalorimeter/src/components/NoiseCaloCellsFromFileTool.h index 2379641..8d830f9 100644 --- a/RecCalorimeter/src/components/NoiseCaloCellsFromFileTool.h +++ b/RecCalorimeter/src/components/NoiseCaloCellsFromFileTool.h @@ -90,7 +90,7 @@ class NoiseCaloCellsFromFileTool : public AlgTool, virtual public INoiseCaloCell std::vector m_histoElecNoiseRMS; /// Random Number Service - IRndmGenSvc* m_randSvc; + SmartIF m_randSvc; /// Gaussian random number generator used for the generation of random noise hits Rndm::Numbers m_gauss; diff --git a/RecFCCeeCalorimeter/src/components/NoiseCaloCellsVsThetaFromFileTool.cpp b/RecFCCeeCalorimeter/src/components/NoiseCaloCellsVsThetaFromFileTool.cpp index edb058d..b09191a 100644 --- a/RecFCCeeCalorimeter/src/components/NoiseCaloCellsVsThetaFromFileTool.cpp +++ b/RecFCCeeCalorimeter/src/components/NoiseCaloCellsVsThetaFromFileTool.cpp @@ -40,7 +40,8 @@ StatusCode NoiseCaloCellsVsThetaFromFileTool::initialize() { } // Initialize random 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/RecFCCeeCalorimeter/src/components/NoiseCaloCellsVsThetaFromFileTool.h b/RecFCCeeCalorimeter/src/components/NoiseCaloCellsVsThetaFromFileTool.h index efbd99b..8dec5ba 100644 --- a/RecFCCeeCalorimeter/src/components/NoiseCaloCellsVsThetaFromFileTool.h +++ b/RecFCCeeCalorimeter/src/components/NoiseCaloCellsVsThetaFromFileTool.h @@ -112,7 +112,7 @@ class NoiseCaloCellsVsThetaFromFileTool : public AlgTool, virtual public INoiseC std::vector m_histoElecNoiseOffset; /// Random Number Service - IRndmGenSvc* m_randSvc; + SmartIF m_randSvc; /// Gaussian random number generator used for the generation of random noise hits Rndm::Numbers m_gauss;