From 5441f6a79bd70170c0c9d3b9d685155e47d7cccb Mon Sep 17 00:00:00 2001 From: jmcarcell Date: Sat, 27 Jul 2024 15:56:54 +0200 Subject: [PATCH 1/2] Do not use GaudiAlg --- Detector/DetComponents/CMakeLists.txt | 1 - Detector/DetComponents/src/MergeCells.cpp | 11 ++++++----- Detector/DetComponents/src/MergeCells.h | 11 ++++++----- Detector/DetComponents/src/MergeLayers.cpp | 8 ++++---- Detector/DetComponents/src/MergeLayers.h | 10 +++++----- Detector/DetComponents/src/RedoSegmentation.cpp | 8 ++++---- Detector/DetComponents/src/RedoSegmentation.h | 10 +++++----- Detector/DetComponents/src/RewriteBitfield.cpp | 8 ++++---- Detector/DetComponents/src/RewriteBitfield.h | 10 +++++----- Detector/DetStudies/CMakeLists.txt | 1 - .../src/components/EnergyInCaloLayers.cpp | 8 ++++---- .../src/components/EnergyInCaloLayers.h | 16 ++++++++-------- .../src/components/SamplingFractionInLayers.cpp | 8 ++++---- .../src/components/SamplingFractionInLayers.h | 8 ++++---- SimG4Common/CMakeLists.txt | 3 +-- SimG4Components/CMakeLists.txt | 1 - .../src/InspectHitsCollectionsTool.cpp | 6 +++--- SimG4Components/src/InspectHitsCollectionsTool.h | 4 ++-- SimG4Components/src/SimG4Alg.cpp | 8 ++++---- SimG4Components/src/SimG4Alg.h | 10 +++++----- .../src/SimG4ConstantMagneticFieldTool.cpp | 6 +++--- .../src/SimG4ConstantMagneticFieldTool.h | 4 ++-- SimG4Components/src/SimG4CrossingAngleBoost.cpp | 8 ++++---- SimG4Components/src/SimG4CrossingAngleBoost.h | 10 +++++----- SimG4Components/src/SimG4DD4hepDetector.cpp | 6 +++--- SimG4Components/src/SimG4DD4hepDetector.h | 4 ++-- .../src/SimG4GeantinosFromEdmTool.cpp | 4 ++-- SimG4Components/src/SimG4GeantinosFromEdmTool.h | 6 +++--- .../src/SimG4MagneticFieldFromMapTool.cpp | 6 +++--- .../src/SimG4MagneticFieldFromMapTool.h | 4 ++-- SimG4Components/src/SimG4MagneticFieldTool.cpp | 6 +++--- SimG4Components/src/SimG4MagneticFieldTool.h | 4 ++-- .../src/SimG4PrimariesFromEdmTool.cpp | 4 ++-- SimG4Components/src/SimG4PrimariesFromEdmTool.h | 6 +++--- SimG4Components/src/SimG4SaveCalHits.cpp | 6 +++--- SimG4Components/src/SimG4SaveCalHits.h | 6 +++--- SimG4Components/src/SimG4SaveParticleHistory.cpp | 2 +- SimG4Components/src/SimG4SaveParticleHistory.h | 6 +++--- .../src/SimG4SaveSmearedParticles.cpp | 6 +++--- SimG4Components/src/SimG4SaveSmearedParticles.h | 8 ++++---- SimG4Components/src/SimG4SaveTrackerHits.cpp | 6 +++--- SimG4Components/src/SimG4SaveTrackerHits.h | 6 +++--- SimG4Components/src/SimG4SaveTrajectory.cpp | 6 +++--- SimG4Components/src/SimG4SaveTrajectory.h | 6 +++--- .../src/SimG4SingleParticleGeneratorTool.cpp | 4 ++-- .../src/SimG4SingleParticleGeneratorTool.h | 6 +++--- SimG4Components/src/SimG4SmearGenParticles.cpp | 8 ++++---- SimG4Components/src/SimG4SmearGenParticles.h | 12 ++++++------ SimG4Fast/CMakeLists.txt | 4 ++-- .../components/SimG4FastSimCalorimeterRegion.cpp | 6 +++--- .../components/SimG4FastSimCalorimeterRegion.h | 4 ++-- .../src/components/SimG4FastSimHistograms.cpp | 8 ++++---- .../src/components/SimG4FastSimHistograms.h | 8 ++++---- .../src/components/SimG4FastSimTrackerRegion.cpp | 6 +++--- .../src/components/SimG4FastSimTrackerRegion.h | 4 ++-- SimG4Fast/src/components/SimG4GflashHomoCalo.cpp | 6 +++--- SimG4Fast/src/components/SimG4GflashHomoCalo.h | 4 ++-- .../src/components/SimG4GflashSamplingCalo.cpp | 6 +++--- .../src/components/SimG4GflashSamplingCalo.h | 4 ++-- .../src/components/SimG4ParticleSmearFormula.cpp | 6 +++--- .../src/components/SimG4ParticleSmearFormula.h | 4 ++-- .../components/SimG4ParticleSmearRootFile.cpp | 6 +++--- .../src/components/SimG4ParticleSmearRootFile.h | 4 ++-- .../src/components/SimG4ParticleSmearSimple.cpp | 6 +++--- .../src/components/SimG4ParticleSmearSimple.h | 4 ++-- SimG4Full/CMakeLists.txt | 4 ++-- .../src/components/SimG4FullSimDCHRegion.cpp | 6 +++--- SimG4Full/src/components/SimG4FullSimDCHRegion.h | 4 ++-- .../src/components/SimG4UserLimitRegion.cpp | 6 +++--- SimG4Full/src/components/SimG4UserLimitRegion.h | 4 ++-- 70 files changed, 214 insertions(+), 216 deletions(-) diff --git a/Detector/DetComponents/CMakeLists.txt b/Detector/DetComponents/CMakeLists.txt index c0afa45..8e2c3ff 100644 --- a/Detector/DetComponents/CMakeLists.txt +++ b/Detector/DetComponents/CMakeLists.txt @@ -12,7 +12,6 @@ gaudi_add_module(DetComponents DD4hep::DDRec k4FWCore::k4FWCore k4FWCore::k4Interface - Gaudi::GaudiAlgLib Gaudi::GaudiKernel EDM4HEP::edm4hep ROOT::Core diff --git a/Detector/DetComponents/src/MergeCells.cpp b/Detector/DetComponents/src/MergeCells.cpp index b4e1e3c..bc0c143 100644 --- a/Detector/DetComponents/src/MergeCells.cpp +++ b/Detector/DetComponents/src/MergeCells.cpp @@ -1,5 +1,7 @@ #include "MergeCells.h" +#include "GaudiKernel/EventContext.h" + // FCCSW #include "k4Interface/IGeoSvc.h" @@ -8,13 +10,12 @@ // DD4hep #include "DD4hep/Detector.h" -#include "DD4hep/BitFieldCoder.h" using dd4hep::DDSegmentation::CellID; DECLARE_COMPONENT(MergeCells) -MergeCells::MergeCells(const std::string& aName, ISvcLocator* aSvcLoc) : GaudiAlgorithm(aName, aSvcLoc), m_geoSvc("GeoSvc", aName) { +MergeCells::MergeCells(const std::string& aName, ISvcLocator* aSvcLoc) : Gaudi::Algorithm(aName, aSvcLoc), m_geoSvc("GeoSvc", aName) { declareProperty("inhits", m_inHits, "Hit collection to merge (input)"); declareProperty("outhits", m_outHits, "Merged hit collection (output)"); } @@ -22,7 +23,7 @@ MergeCells::MergeCells(const std::string& aName, ISvcLocator* aSvcLoc) : GaudiAl MergeCells::~MergeCells() {} StatusCode MergeCells::initialize() { - if (GaudiAlgorithm::initialize().isFailure()) return StatusCode::FAILURE; + if (Gaudi::Algorithm::initialize().isFailure()) return StatusCode::FAILURE; if (m_idToMerge.empty()) { error() << "No identifier to merge specified." << endmsg; return StatusCode::FAILURE; @@ -72,7 +73,7 @@ StatusCode MergeCells::initialize() { return StatusCode::SUCCESS; } -StatusCode MergeCells::execute() { +StatusCode MergeCells::execute(const EventContext&) const { const auto inHits = m_inHits.get(); auto outHits = new edm4hep::CalorimeterHitCollection(); @@ -116,4 +117,4 @@ StatusCode MergeCells::execute() { return StatusCode::SUCCESS; } -StatusCode MergeCells::finalize() { return GaudiAlgorithm::finalize(); } +StatusCode MergeCells::finalize() { return Gaudi::Algorithm::finalize(); } diff --git a/Detector/DetComponents/src/MergeCells.h b/Detector/DetComponents/src/MergeCells.h index 579cf7b..695ed76 100644 --- a/Detector/DetComponents/src/MergeCells.h +++ b/Detector/DetComponents/src/MergeCells.h @@ -2,7 +2,8 @@ #define DETCOMPONENTS_MERGECELLS_H // GAUDI -#include "GaudiAlg/GaudiAlgorithm.h" +#include "Gaudi/Algorithm.h" +#include "GaudiKernel/EventContext.h" // FCCSW #include "k4FWCore/DataHandle.h" @@ -30,7 +31,7 @@ class CalorimeterHitCollection; * @author Anna Zaborowska */ -class MergeCells : public GaudiAlgorithm { +class MergeCells : public Gaudi::Algorithm { public: explicit MergeCells(const std::string&, ISvcLocator*); virtual ~MergeCells(); @@ -41,7 +42,7 @@ class MergeCells : public GaudiAlgorithm { /** Execute. * @return status code */ - virtual StatusCode execute() final; + virtual StatusCode execute(const EventContext& ctx) const final; /** Finalize. * @return status code @@ -52,9 +53,9 @@ class MergeCells : public GaudiAlgorithm { /// Pointer to the geometry service ServiceHandle m_geoSvc; /// Handle for the EDM Hits to be read - DataHandle m_inHits{"hits/caloInHits", Gaudi::DataHandle::Reader, this}; + mutable DataHandle m_inHits{"hits/caloInHits", Gaudi::DataHandle::Reader, this}; /// Handle for the EDM Hits to be written - DataHandle m_outHits{"hits/caloOutHits", Gaudi::DataHandle::Writer, this}; + mutable DataHandle m_outHits{"hits/caloOutHits", Gaudi::DataHandle::Writer, this}; // Handle to the detector ID descriptor dd4hep::IDDescriptor m_descriptor; /// Name of the detector readout diff --git a/Detector/DetComponents/src/MergeLayers.cpp b/Detector/DetComponents/src/MergeLayers.cpp index 5e5ccc2..d090bd0 100644 --- a/Detector/DetComponents/src/MergeLayers.cpp +++ b/Detector/DetComponents/src/MergeLayers.cpp @@ -17,7 +17,7 @@ DECLARE_COMPONENT(MergeLayers) -MergeLayers::MergeLayers(const std::string& aName, ISvcLocator* aSvcLoc) : GaudiAlgorithm(aName, aSvcLoc), m_geoSvc("GeoSvc", aName) { +MergeLayers::MergeLayers(const std::string& aName, ISvcLocator* aSvcLoc) : Gaudi::Algorithm(aName, aSvcLoc), m_geoSvc("GeoSvc", aName) { declareProperty("inhits", m_inHits, "Hit collection to merge (input)"); declareProperty("outhits", m_outHits, "Merged hit collection (output)"); } @@ -25,7 +25,7 @@ MergeLayers::MergeLayers(const std::string& aName, ISvcLocator* aSvcLoc) : Gaudi MergeLayers::~MergeLayers() {} StatusCode MergeLayers::initialize() { - if (GaudiAlgorithm::initialize().isFailure()) return StatusCode::FAILURE; + if (Gaudi::Algorithm::initialize().isFailure()) return StatusCode::FAILURE; if (m_idToMerge.empty()) { error() << "No identifier to merge specified." << endmsg; return StatusCode::FAILURE; @@ -61,7 +61,7 @@ StatusCode MergeLayers::initialize() { return StatusCode::SUCCESS; } -StatusCode MergeLayers::execute() { +StatusCode MergeLayers::execute(const EventContext&) const { const auto inHits = m_inHits.get(); auto outHits = new edm4hep::CalorimeterHitCollection(); @@ -109,4 +109,4 @@ StatusCode MergeLayers::execute() { return StatusCode::SUCCESS; } -StatusCode MergeLayers::finalize() { return GaudiAlgorithm::finalize(); } +StatusCode MergeLayers::finalize() { return Gaudi::Algorithm::finalize(); } diff --git a/Detector/DetComponents/src/MergeLayers.h b/Detector/DetComponents/src/MergeLayers.h index fcca1cd..92d67c3 100644 --- a/Detector/DetComponents/src/MergeLayers.h +++ b/Detector/DetComponents/src/MergeLayers.h @@ -2,7 +2,7 @@ #define DETCOMPONENTS_MERGELAYERS_H // GAUDI -#include "GaudiAlg/GaudiAlgorithm.h" +#include "Gaudi/Algorithm.h" // FCCSW #include "k4FWCore/DataHandle.h" @@ -34,7 +34,7 @@ class CalorimeterHitCollection; * @author Anna Zaborowska */ -class MergeLayers : public GaudiAlgorithm { +class MergeLayers : public Gaudi::Algorithm { public: explicit MergeLayers(const std::string&, ISvcLocator*); virtual ~MergeLayers(); @@ -45,7 +45,7 @@ class MergeLayers : public GaudiAlgorithm { /** Execute. * @return status code */ - virtual StatusCode execute() final; + virtual StatusCode execute(const EventContext&) const final; /** Finalize. * @return status code @@ -56,9 +56,9 @@ class MergeLayers : public GaudiAlgorithm { /// Pointer to the geometry service ServiceHandle m_geoSvc; /// Handle for the EDM Hits to be read - DataHandle m_inHits{"hits/caloInHits", Gaudi::DataHandle::Reader, this}; + mutable DataHandle m_inHits{"hits/caloInHits", Gaudi::DataHandle::Reader, this}; /// Handle for the EDM Hits to be written - DataHandle m_outHits{"hits/caloOutHits", Gaudi::DataHandle::Writer, this}; + mutable DataHandle m_outHits{"hits/caloOutHits", Gaudi::DataHandle::Writer, this}; // Handle to the detector ID descriptor dd4hep::IDDescriptor m_descriptor; /// Name of the detector readout diff --git a/Detector/DetComponents/src/RedoSegmentation.cpp b/Detector/DetComponents/src/RedoSegmentation.cpp index fa05f5e..67240e1 100644 --- a/Detector/DetComponents/src/RedoSegmentation.cpp +++ b/Detector/DetComponents/src/RedoSegmentation.cpp @@ -5,7 +5,7 @@ DECLARE_COMPONENT(RedoSegmentation) -RedoSegmentation::RedoSegmentation(const std::string& aName, ISvcLocator* aSvcLoc) : GaudiAlgorithm(aName, aSvcLoc), m_geoSvc("GeoSvc", aName) { +RedoSegmentation::RedoSegmentation(const std::string& aName, ISvcLocator* aSvcLoc) : Gaudi::Algorithm(aName, aSvcLoc), m_geoSvc("GeoSvc", aName) { declareProperty("inhits", m_inHits, "Hit collection with old segmentation (input)"); declareProperty("outhits", m_outHits, "Hit collection with modified segmentation (output)"); } @@ -13,7 +13,7 @@ RedoSegmentation::RedoSegmentation(const std::string& aName, ISvcLocator* aSvcLo RedoSegmentation::~RedoSegmentation() {} StatusCode RedoSegmentation::initialize() { - if (GaudiAlgorithm::initialize().isFailure()) return StatusCode::FAILURE; + if (Gaudi::Algorithm::initialize().isFailure()) return StatusCode::FAILURE; if (!m_geoSvc) { error() << "Unable to locate Geometry Service. " @@ -79,7 +79,7 @@ StatusCode RedoSegmentation::initialize() { return StatusCode::SUCCESS; } -StatusCode RedoSegmentation::execute() { +StatusCode RedoSegmentation::execute(const EventContext&) const { const auto inHits = m_inHits.get(); auto outHits = m_outHits.createAndPut(); // loop over positioned hits to get the energy deposits: position and cellID @@ -140,7 +140,7 @@ StatusCode RedoSegmentation::execute() { StatusCode RedoSegmentation::finalize() { info() << "RedoSegmentation finalize! " << endmsg; - return GaudiAlgorithm::finalize(); } + return Gaudi::Algorithm::finalize(); } uint64_t RedoSegmentation::volumeID(uint64_t aCellId) const { dd4hep::DDSegmentation::CellID cID = aCellId; diff --git a/Detector/DetComponents/src/RedoSegmentation.h b/Detector/DetComponents/src/RedoSegmentation.h index 943f9ca..779069f 100644 --- a/Detector/DetComponents/src/RedoSegmentation.h +++ b/Detector/DetComponents/src/RedoSegmentation.h @@ -2,7 +2,7 @@ #define DETCOMPONENTS_REDOSEGMENTATION_H // GAUDI -#include "GaudiAlg/GaudiAlgorithm.h" +#include "Gaudi/Algorithm.h" #include "GaudiKernel/ToolHandle.h" // k4FWCore @@ -34,7 +34,7 @@ * @author Anna Zaborowska */ -class RedoSegmentation : public GaudiAlgorithm { +class RedoSegmentation : public Gaudi::Algorithm { public: explicit RedoSegmentation(const std::string&, ISvcLocator*); virtual ~RedoSegmentation(); @@ -45,7 +45,7 @@ class RedoSegmentation : public GaudiAlgorithm { /** Execute. * @return status code */ - virtual StatusCode execute() final; + virtual StatusCode execute(const EventContext&) const final; /** Finalize. * @return status code */ @@ -60,10 +60,10 @@ class RedoSegmentation : public GaudiAlgorithm { /// Pointer to the geometry service ServiceHandle m_geoSvc; /// Handle for the EDM positioned hits to be read - DataHandle m_inHits{ + mutable DataHandle m_inHits{ "hits/caloInHits", Gaudi::DataHandle::Reader, this}; /// Handle for the EDM hits to be written - DataHandle m_outHits{ + mutable DataHandle m_outHits{ "hits/caloOutHits", Gaudi::DataHandle::Writer, this}; /// Handle for the output hits cell id encoding. MetaDataHandle m_outHitsCellIDEncoding{ diff --git a/Detector/DetComponents/src/RewriteBitfield.cpp b/Detector/DetComponents/src/RewriteBitfield.cpp index 1792691..ebe6974 100644 --- a/Detector/DetComponents/src/RewriteBitfield.cpp +++ b/Detector/DetComponents/src/RewriteBitfield.cpp @@ -12,7 +12,7 @@ DECLARE_COMPONENT(RewriteBitfield) -RewriteBitfield::RewriteBitfield(const std::string& aName, ISvcLocator* aSvcLoc) : GaudiAlgorithm(aName, aSvcLoc), m_geoSvc("GeoSvc", aName) { +RewriteBitfield::RewriteBitfield(const std::string& aName, ISvcLocator* aSvcLoc) : Gaudi::Algorithm(aName, aSvcLoc), m_geoSvc("GeoSvc", aName) { declareProperty("inhits", m_inHits, "Hit collection with old segmentation (input)"); declareProperty("outhits", m_outHits, "Hit collection with modified segmentation (output)"); } @@ -20,7 +20,7 @@ RewriteBitfield::RewriteBitfield(const std::string& aName, ISvcLocator* aSvcLoc) RewriteBitfield::~RewriteBitfield() {} StatusCode RewriteBitfield::initialize() { - if (GaudiAlgorithm::initialize().isFailure()) return StatusCode::FAILURE; + if (Gaudi::Algorithm::initialize().isFailure()) return StatusCode::FAILURE; if (!m_geoSvc) { error() << "Unable to locate Geometry Service. " @@ -71,7 +71,7 @@ StatusCode RewriteBitfield::initialize() { return StatusCode::SUCCESS; } -StatusCode RewriteBitfield::execute() { +StatusCode RewriteBitfield::execute(const EventContext&) const { const auto inHits = m_inHits.get(); auto outHits = m_outHits.createAndPut(); // loop over positioned hits to get the energy deposits: position and cellID @@ -101,4 +101,4 @@ StatusCode RewriteBitfield::execute() { return StatusCode::SUCCESS; } -StatusCode RewriteBitfield::finalize() { return GaudiAlgorithm::finalize(); } +StatusCode RewriteBitfield::finalize() { return Gaudi::Algorithm::finalize(); } diff --git a/Detector/DetComponents/src/RewriteBitfield.h b/Detector/DetComponents/src/RewriteBitfield.h index 8276794..1ee8dc5 100644 --- a/Detector/DetComponents/src/RewriteBitfield.h +++ b/Detector/DetComponents/src/RewriteBitfield.h @@ -2,7 +2,7 @@ #define DETCOMPONENTS_REWRITEBITFIELD_H // GAUDI -#include "GaudiAlg/GaudiAlgorithm.h" +#include "Gaudi/Algorithm.h" #include "GaudiKernel/ToolHandle.h" // FCCSW @@ -36,7 +36,7 @@ class CalorimeterHitCollection; * @author Anna Zaborowska */ -class RewriteBitfield : public GaudiAlgorithm { +class RewriteBitfield : public Gaudi::Algorithm { public: explicit RewriteBitfield(const std::string&, ISvcLocator*); virtual ~RewriteBitfield(); @@ -47,7 +47,7 @@ class RewriteBitfield : public GaudiAlgorithm { /** Execute. * @return status code */ - virtual StatusCode execute() final; + virtual StatusCode execute(const EventContext&) const final; /** Finalize. * @return status code */ @@ -57,9 +57,9 @@ class RewriteBitfield : public GaudiAlgorithm { /// Pointer to the geometry service ServiceHandle m_geoSvc; /// Handle for the EDM hits to be read - DataHandle m_inHits{"hits/caloInHits", Gaudi::DataHandle::Reader, this}; + mutable DataHandle m_inHits{"hits/caloInHits", Gaudi::DataHandle::Reader, this}; /// Handle for the EDM hits to be written - DataHandle m_outHits{"hits/caloOutHits", Gaudi::DataHandle::Writer, this}; + mutable DataHandle m_outHits{"hits/caloOutHits", Gaudi::DataHandle::Writer, this}; /// Name of the detector readout used in simulation Gaudi::Property m_oldReadoutName{this, "oldReadoutName", "", "Name of the detector readout used in simulation"}; diff --git a/Detector/DetStudies/CMakeLists.txt b/Detector/DetStudies/CMakeLists.txt index 544ff7c..7c96345 100644 --- a/Detector/DetStudies/CMakeLists.txt +++ b/Detector/DetStudies/CMakeLists.txt @@ -14,7 +14,6 @@ gaudi_add_module(DetStudies DD4hep::DDG4 k4FWCore::k4FWCore k4FWCore::k4Interface - Gaudi::GaudiAlgLib Gaudi::GaudiKernel EDM4HEP::edm4hep ROOT::Core diff --git a/Detector/DetStudies/src/components/EnergyInCaloLayers.cpp b/Detector/DetStudies/src/components/EnergyInCaloLayers.cpp index 6b6df12..cdab1d6 100644 --- a/Detector/DetStudies/src/components/EnergyInCaloLayers.cpp +++ b/Detector/DetStudies/src/components/EnergyInCaloLayers.cpp @@ -13,7 +13,7 @@ DECLARE_COMPONENT(EnergyInCaloLayers) EnergyInCaloLayers::EnergyInCaloLayers(const std::string& aName, ISvcLocator* aSvcLoc) - : GaudiAlgorithm(aName, aSvcLoc), m_geoSvc("GeoSvc", aName) { + : Gaudi::Algorithm(aName, aSvcLoc), m_geoSvc("GeoSvc", aName) { declareProperty("deposits", m_deposits, "Energy deposits (input)"); declareProperty("particle", m_particle, "Generated single-particle event (input)"); @@ -27,7 +27,7 @@ EnergyInCaloLayers::~EnergyInCaloLayers() {} StatusCode EnergyInCaloLayers::initialize() { - if (GaudiAlgorithm::initialize().isFailure()) return StatusCode::FAILURE; + if (Gaudi::Algorithm::initialize().isFailure()) return StatusCode::FAILURE; // Check geometry service if (!m_geoSvc) { @@ -60,7 +60,7 @@ StatusCode EnergyInCaloLayers::initialize() { } -StatusCode EnergyInCaloLayers::execute() { +StatusCode EnergyInCaloLayers::execute(const EventContext&) const { auto decoder = m_geoSvc->getDetector()->readout(m_readoutName).idSpec().decoder(); // Initialize output variables @@ -145,5 +145,5 @@ StatusCode EnergyInCaloLayers::execute() { StatusCode EnergyInCaloLayers::finalize() { - return GaudiAlgorithm::finalize(); + return Gaudi::Algorithm::finalize(); } diff --git a/Detector/DetStudies/src/components/EnergyInCaloLayers.h b/Detector/DetStudies/src/components/EnergyInCaloLayers.h index a9b4037..f68821c 100644 --- a/Detector/DetStudies/src/components/EnergyInCaloLayers.h +++ b/Detector/DetStudies/src/components/EnergyInCaloLayers.h @@ -2,7 +2,7 @@ #define DETSTUDIES_ENERGYINCALOLAYERS_H // GAUDI -#include "GaudiAlg/GaudiAlgorithm.h" +#include "Gaudi/Algorithm.h" // Key4HEP #include "k4Interface/IGeoSvc.h" @@ -28,7 +28,7 @@ * @author Juraj Smiesko */ -class EnergyInCaloLayers : public GaudiAlgorithm { +class EnergyInCaloLayers : public Gaudi::Algorithm { public: explicit EnergyInCaloLayers(const std::string&, ISvcLocator*); virtual ~EnergyInCaloLayers(); @@ -39,7 +39,7 @@ class EnergyInCaloLayers : public GaudiAlgorithm { /** Fills the histograms. * @return status code */ - virtual StatusCode execute() final; + virtual StatusCode execute(const EventContext&) const final; /** Finalize. * @return status code */ @@ -47,15 +47,15 @@ class EnergyInCaloLayers : public GaudiAlgorithm { private: /// Handle for the energy deposits - DataHandle m_deposits{"det/caloDeposits", Gaudi::DataHandle::Reader, this}; + mutable DataHandle m_deposits{"det/caloDeposits", Gaudi::DataHandle::Reader, this}; /// Handle for the particle - DataHandle m_particle{"det/particles", Gaudi::DataHandle::Reader, this}; + mutable DataHandle m_particle{"det/particles", Gaudi::DataHandle::Reader, this}; /// Handle for vector with energy deposited in every layer - DataHandle> m_energyInLayer {"energyInLayer", Gaudi::DataHandle::Writer, this}; + mutable DataHandle> m_energyInLayer {"energyInLayer", Gaudi::DataHandle::Writer, this}; /// Handle for vector with energy deposited in cryostat and in its parts - DataHandle> m_energyInCryo {"energyInCryo", Gaudi::DataHandle::Writer, this}; + mutable DataHandle> m_energyInCryo {"energyInCryo", Gaudi::DataHandle::Writer, this}; /// Handle for initial particle vector - DataHandle> m_particleVec {"particleVec", Gaudi::DataHandle::Writer, this}; + mutable DataHandle> m_particleVec {"particleVec", Gaudi::DataHandle::Writer, this}; /// Pointer to the geometry service ServiceHandle m_geoSvc; diff --git a/Detector/DetStudies/src/components/SamplingFractionInLayers.cpp b/Detector/DetStudies/src/components/SamplingFractionInLayers.cpp index 1c1fca5..763a1b7 100644 --- a/Detector/DetStudies/src/components/SamplingFractionInLayers.cpp +++ b/Detector/DetStudies/src/components/SamplingFractionInLayers.cpp @@ -17,7 +17,7 @@ DECLARE_COMPONENT(SamplingFractionInLayers) SamplingFractionInLayers::SamplingFractionInLayers(const std::string& aName, ISvcLocator* aSvcLoc) - : GaudiAlgorithm(aName, aSvcLoc), + : Gaudi::Algorithm(aName, aSvcLoc), m_histSvc("THistSvc", "SamplingFractionInLayers"), m_geoSvc("GeoSvc", "SamplingFractionInLayers"), m_totalEnergy(nullptr), @@ -28,7 +28,7 @@ SamplingFractionInLayers::SamplingFractionInLayers(const std::string& aName, ISv SamplingFractionInLayers::~SamplingFractionInLayers() {} StatusCode SamplingFractionInLayers::initialize() { - if (GaudiAlgorithm::initialize().isFailure()) { + if (Gaudi::Algorithm::initialize().isFailure()) { return StatusCode::FAILURE; } // check if readouts exist @@ -77,7 +77,7 @@ StatusCode SamplingFractionInLayers::initialize() { return StatusCode::SUCCESS; } -StatusCode SamplingFractionInLayers::execute() { +StatusCode SamplingFractionInLayers::execute(const EventContext&) const { auto decoder = m_geoSvc->getDetector()->readout(m_readoutName).idSpec().decoder(); double sumE = 0.; std::vector sumElayers; @@ -124,4 +124,4 @@ StatusCode SamplingFractionInLayers::execute() { return StatusCode::SUCCESS; } -StatusCode SamplingFractionInLayers::finalize() { return GaudiAlgorithm::finalize(); } +StatusCode SamplingFractionInLayers::finalize() { return Gaudi::Algorithm::finalize(); } diff --git a/Detector/DetStudies/src/components/SamplingFractionInLayers.h b/Detector/DetStudies/src/components/SamplingFractionInLayers.h index ce2bc13..25e560b 100644 --- a/Detector/DetStudies/src/components/SamplingFractionInLayers.h +++ b/Detector/DetStudies/src/components/SamplingFractionInLayers.h @@ -2,7 +2,7 @@ #define DETSTUDIES_SAMPLINGFRACTIONINLAYERS_H // GAUDI -#include "GaudiAlg/GaudiAlgorithm.h" +#include "Gaudi/Algorithm.h" #include "GaudiKernel/ServiceHandle.h" // FCCSW @@ -26,7 +26,7 @@ class ITHistSvc; * @author Anna Zaborowska */ -class SamplingFractionInLayers : public GaudiAlgorithm { +class SamplingFractionInLayers : public Gaudi::Algorithm { public: explicit SamplingFractionInLayers(const std::string&, ISvcLocator*); virtual ~SamplingFractionInLayers(); @@ -37,7 +37,7 @@ class SamplingFractionInLayers : public GaudiAlgorithm { /** Fills the histograms. * @return status code */ - virtual StatusCode execute() final; + virtual StatusCode execute(const EventContext&) const final; /** Finalize. * @return status code */ @@ -49,7 +49,7 @@ class SamplingFractionInLayers : public GaudiAlgorithm { /// Pointer to the geometry service ServiceHandle m_geoSvc; /// Handle for the energy deposits - DataHandle m_deposits{"rec/caloHits", Gaudi::DataHandle::Reader, this}; + mutable DataHandle m_deposits{"rec/caloHits", Gaudi::DataHandle::Reader, this}; /// Name of the active field Gaudi::Property m_activeFieldName{this, "activeFieldName", "", "Identifier of active material"}; /// Value of the active material diff --git a/SimG4Common/CMakeLists.txt b/SimG4Common/CMakeLists.txt index c036d99..bd4cdee 100644 --- a/SimG4Common/CMakeLists.txt +++ b/SimG4Common/CMakeLists.txt @@ -6,8 +6,7 @@ file(GLOB _lib_sources src/*.cpp) gaudi_add_library(SimG4Common SOURCES ${_lib_sources} - LINK Gaudi::GaudiAlgLib - k4FWCore::k4FWCore + LINK k4FWCore::k4FWCore ${Geant4_LIBRARIES} EDM4HEP::edm4hep DD4hep::DDCore diff --git a/SimG4Components/CMakeLists.txt b/SimG4Components/CMakeLists.txt index fc8e0ec..9ebcb7a 100644 --- a/SimG4Components/CMakeLists.txt +++ b/SimG4Components/CMakeLists.txt @@ -16,7 +16,6 @@ gaudi_add_module(SimG4Components k4FWCore::k4FWCore k4FWCore::k4Interface EDM4HEP::edm4hep - Gaudi::GaudiAlgLib ) add_test(NAME CrossingAngleBoost diff --git a/SimG4Components/src/InspectHitsCollectionsTool.cpp b/SimG4Components/src/InspectHitsCollectionsTool.cpp index 3881858..692a41d 100644 --- a/SimG4Components/src/InspectHitsCollectionsTool.cpp +++ b/SimG4Components/src/InspectHitsCollectionsTool.cpp @@ -18,14 +18,14 @@ DECLARE_COMPONENT(InspectHitsCollectionsTool) InspectHitsCollectionsTool::InspectHitsCollectionsTool(const std::string& aType, const std::string& aName, const IInterface* aParent) - : GaudiTool(aType, aName, aParent), m_geoSvc("GeoSvc", aName) { + : AlgTool(aType, aName, aParent), m_geoSvc("GeoSvc", aName) { declareInterface(this); } InspectHitsCollectionsTool::~InspectHitsCollectionsTool() {} StatusCode InspectHitsCollectionsTool::initialize() { - if (GaudiTool::initialize().isFailure()) { + if (AlgTool::initialize().isFailure()) { error() << "Unable to initialize Service()" << endmsg; return StatusCode::FAILURE; } @@ -46,7 +46,7 @@ StatusCode InspectHitsCollectionsTool::initialize() { return StatusCode::SUCCESS; } -StatusCode InspectHitsCollectionsTool::finalize() { return GaudiTool::finalize(); } +StatusCode InspectHitsCollectionsTool::finalize() { return AlgTool::finalize(); } StatusCode InspectHitsCollectionsTool::saveOutput(const G4Event& aEvent) { G4HCofThisEvent* collections = aEvent.GetHCofThisEvent(); diff --git a/SimG4Components/src/InspectHitsCollectionsTool.h b/SimG4Components/src/InspectHitsCollectionsTool.h index 10352e0..1acbc21 100644 --- a/SimG4Components/src/InspectHitsCollectionsTool.h +++ b/SimG4Components/src/InspectHitsCollectionsTool.h @@ -2,7 +2,7 @@ #define TESTDD4HEP_INSPECTHITSCOLLECTIONSTOOL_H // Gaudi -#include "GaudiAlg/GaudiTool.h" +#include "GaudiKernel/AlgTool.h" // FCCSW #include "SimG4Interface/ISimG4SaveOutputTool.h" @@ -16,7 +16,7 @@ class IGeoSvc; * @author Anna Zaborowska */ -class InspectHitsCollectionsTool : public GaudiTool, virtual public ISimG4SaveOutputTool { +class InspectHitsCollectionsTool : public AlgTool, virtual public ISimG4SaveOutputTool { public: /// Constructor. explicit InspectHitsCollectionsTool(const std::string& type, const std::string& name, const IInterface* parent); diff --git a/SimG4Components/src/SimG4Alg.cpp b/SimG4Components/src/SimG4Alg.cpp index 52a2ba3..8b4731c 100644 --- a/SimG4Components/src/SimG4Alg.cpp +++ b/SimG4Components/src/SimG4Alg.cpp @@ -8,14 +8,14 @@ DECLARE_COMPONENT(SimG4Alg) -SimG4Alg::SimG4Alg(const std::string& aName, ISvcLocator* aSvcLoc) : GaudiAlgorithm(aName, aSvcLoc), +SimG4Alg::SimG4Alg(const std::string& aName, ISvcLocator* aSvcLoc) : Gaudi::Algorithm(aName, aSvcLoc), m_geantSvc("SimG4Svc", aName) { declareProperty("eventProvider", m_eventTool, "Handle for tool that creates the G4Event"); } SimG4Alg::~SimG4Alg() {} StatusCode SimG4Alg::initialize() { - if (GaudiAlgorithm::initialize().isFailure()) return StatusCode::FAILURE; + if (Gaudi::Algorithm::initialize().isFailure()) return StatusCode::FAILURE; if (!m_geantSvc) { error() << "Unable to locate Geant Simulation Service" << endmsg; return StatusCode::FAILURE; @@ -34,7 +34,7 @@ StatusCode SimG4Alg::initialize() { return StatusCode::SUCCESS; } -StatusCode SimG4Alg::execute() { +StatusCode SimG4Alg::execute(const EventContext&) const { // first translate the event G4Event* event = m_eventTool->g4Event(); @@ -52,4 +52,4 @@ StatusCode SimG4Alg::execute() { return StatusCode::SUCCESS; } -StatusCode SimG4Alg::finalize() { return GaudiAlgorithm::finalize(); } +StatusCode SimG4Alg::finalize() { return Gaudi::Algorithm::finalize(); } diff --git a/SimG4Components/src/SimG4Alg.h b/SimG4Components/src/SimG4Alg.h index 26d5266..7f9e949 100644 --- a/SimG4Components/src/SimG4Alg.h +++ b/SimG4Components/src/SimG4Alg.h @@ -2,7 +2,7 @@ #define SIMG4COMPONENTS_G4SIMALG_H // GAUDI -#include "GaudiAlg/GaudiAlgorithm.h" +#include "Gaudi/Algorithm.h" // FCCSW #include "k4FWCore/DataHandle.h" @@ -28,7 +28,7 @@ class G4Event; * @author Anna Zaborowska */ -class SimG4Alg : public GaudiAlgorithm { +class SimG4Alg : public Gaudi::Algorithm { public: explicit SimG4Alg(const std::string&, ISvcLocator*); virtual ~SimG4Alg(); @@ -43,7 +43,7 @@ class SimG4Alg : public GaudiAlgorithm { * Finally, the event is terminated. * @return status code */ - virtual StatusCode execute() final; + virtual StatusCode execute(const EventContext&) const final; /** Finalize. * @return status code */ @@ -53,10 +53,10 @@ class SimG4Alg : public GaudiAlgorithm { /// Pointer to the interface of Geant simulation service ServiceHandle m_geantSvc; /// Handle to the tools saving the output - PublicToolHandleArray m_saveTools { + mutable PublicToolHandleArray m_saveTools { this, "outputs", {}}; /// Handle for the tool that creates the G4Event - ToolHandle m_eventTool{ + mutable ToolHandle m_eventTool{ "SimG4PrimariesFromEdmTool", this}; }; #endif /* SIMG4COMPONENTS_G4SIMALG_H */ diff --git a/SimG4Components/src/SimG4ConstantMagneticFieldTool.cpp b/SimG4Components/src/SimG4ConstantMagneticFieldTool.cpp index 7ccb130..c357adb 100644 --- a/SimG4Components/src/SimG4ConstantMagneticFieldTool.cpp +++ b/SimG4Components/src/SimG4ConstantMagneticFieldTool.cpp @@ -27,7 +27,7 @@ DECLARE_COMPONENT(SimG4ConstantMagneticFieldTool) SimG4ConstantMagneticFieldTool::SimG4ConstantMagneticFieldTool(const std::string& type, const std::string& name, const IInterface* parent) - : GaudiTool(type, name, parent), m_field(nullptr) { + : AlgTool(type, name, parent), m_field(nullptr) { declareInterface(this); } @@ -36,7 +36,7 @@ SimG4ConstantMagneticFieldTool::~SimG4ConstantMagneticFieldTool() { } StatusCode SimG4ConstantMagneticFieldTool::initialize() { - StatusCode sc = GaudiTool::initialize(); + StatusCode sc = AlgTool::initialize(); if (sc.isFailure()) return sc; if (m_fieldOn) { @@ -64,7 +64,7 @@ StatusCode SimG4ConstantMagneticFieldTool::initialize() { } StatusCode SimG4ConstantMagneticFieldTool::finalize() { - StatusCode sc = GaudiTool::finalize(); + StatusCode sc = AlgTool::finalize(); return sc; } diff --git a/SimG4Components/src/SimG4ConstantMagneticFieldTool.h b/SimG4Components/src/SimG4ConstantMagneticFieldTool.h index dc2b066..33335ea 100644 --- a/SimG4Components/src/SimG4ConstantMagneticFieldTool.h +++ b/SimG4Components/src/SimG4ConstantMagneticFieldTool.h @@ -2,7 +2,7 @@ #define SIMG4COMPONENTS_G4CONSTANTMAGNETICFIELDTOOL_H // Gaudi -#include "GaudiAlg/GaudiTool.h" +#include "GaudiKernel/AlgTool.h" // FCCSW #include "SimG4Interface/ISimG4MagneticFieldTool.h" @@ -28,7 +28,7 @@ class ConstantField; * @date 2016-02-22 */ -class SimG4ConstantMagneticFieldTool : public GaudiTool, virtual public ISimG4MagneticFieldTool { +class SimG4ConstantMagneticFieldTool : public AlgTool, virtual public ISimG4MagneticFieldTool { public: /// Standard constructor SimG4ConstantMagneticFieldTool(const std::string& type, const std::string& name, const IInterface* parent); diff --git a/SimG4Components/src/SimG4CrossingAngleBoost.cpp b/SimG4Components/src/SimG4CrossingAngleBoost.cpp index 3aee84e..fa1e078 100644 --- a/SimG4Components/src/SimG4CrossingAngleBoost.cpp +++ b/SimG4Components/src/SimG4CrossingAngleBoost.cpp @@ -12,7 +12,7 @@ DECLARE_COMPONENT(SimG4CrossingAngleBoost) SimG4CrossingAngleBoost::SimG4CrossingAngleBoost( const std::string& aName, - ISvcLocator* aSvcLoc) : GaudiAlgorithm(aName, aSvcLoc) { + ISvcLocator* aSvcLoc) : Gaudi::Algorithm(aName, aSvcLoc) { declareProperty("InParticles", m_inParticles, "Handle for the input particles"); declareProperty("OutParticles", m_outParticles, @@ -26,7 +26,7 @@ StatusCode SimG4CrossingAngleBoost::initialize() { if (m_alpha != 0.) { debug() << "Boosting particle according to the crossing angle alpha = " << m_alpha << "rad" << endmsg; - sc = GaudiAlgorithm::initialize(); + sc = Gaudi::Algorithm::initialize(); } else { warning() << "Crossing angle alpha = " << m_alpha.value() << " rad." << endmsg; warning() << "There is no need to run this algorithm." << endmsg; @@ -36,7 +36,7 @@ StatusCode SimG4CrossingAngleBoost::initialize() { } -StatusCode SimG4CrossingAngleBoost::execute() { +StatusCode SimG4CrossingAngleBoost::execute(const EventContext&) const { auto outParticles = m_outParticles.createAndPut(); auto inParticles = m_inParticles.get(); @@ -114,5 +114,5 @@ StatusCode SimG4CrossingAngleBoost::execute() { StatusCode SimG4CrossingAngleBoost::finalize() { - return GaudiAlgorithm::finalize(); + return Gaudi::Algorithm::finalize(); } diff --git a/SimG4Components/src/SimG4CrossingAngleBoost.h b/SimG4Components/src/SimG4CrossingAngleBoost.h index c602955..40882f4 100644 --- a/SimG4Components/src/SimG4CrossingAngleBoost.h +++ b/SimG4Components/src/SimG4CrossingAngleBoost.h @@ -2,7 +2,7 @@ #define SIMG4COMPONENTS_CROSSINGANGLEBOOST_H // Gaudi -#include "GaudiAlg/GaudiAlgorithm.h" +#include "Gaudi/Algorithm.h" // FCCSW #include "k4FWCore/DataHandle.h" @@ -19,7 +19,7 @@ class MCParticleCollection; * @author Juraj Smiesko, Gerri Ganis */ -class SimG4CrossingAngleBoost : public GaudiAlgorithm { +class SimG4CrossingAngleBoost : public Gaudi::Algorithm { public: SimG4CrossingAngleBoost(const std::string& aName, ISvcLocator* svcLoc); /** Initialize. @@ -35,13 +35,13 @@ class SimG4CrossingAngleBoost : public GaudiAlgorithm { * @param[in] aEvent Event with data to save. * @return status code */ - StatusCode execute(); + StatusCode execute(const EventContext&) const; private: /// Handle for the particles to be read - DataHandle m_inParticles{"InParticles", Gaudi::DataHandle::Reader, this}; + mutable DataHandle m_inParticles{"InParticles", Gaudi::DataHandle::Reader, this}; /// Handle for the particles to be written - DataHandle m_outParticles{"OutParticles", Gaudi::DataHandle::Writer, this}; + mutable DataHandle m_outParticles{"OutParticles", Gaudi::DataHandle::Writer, this}; /// Value of the crossing angle in radians Gaudi::Property m_alpha{this, "CrossingAngle", 0., "Crossing angle (alpha) in radians"}; }; diff --git a/SimG4Components/src/SimG4DD4hepDetector.cpp b/SimG4Components/src/SimG4DD4hepDetector.cpp index 2ef500e..0522605 100644 --- a/SimG4Components/src/SimG4DD4hepDetector.cpp +++ b/SimG4Components/src/SimG4DD4hepDetector.cpp @@ -9,7 +9,7 @@ DECLARE_COMPONENT(SimG4DD4hepDetector) SimG4DD4hepDetector::SimG4DD4hepDetector(const std::string& aType, const std::string& aName, const IInterface* aParent) - : GaudiTool(aType, aName, aParent), m_geoSvc("GeoSvc", aName) { + : AlgTool(aType, aName, aParent), m_geoSvc("GeoSvc", aName) { declareInterface(this); declareProperty("GeoSvc", m_geoSvc); } @@ -17,7 +17,7 @@ SimG4DD4hepDetector::SimG4DD4hepDetector(const std::string& aType, const std::st SimG4DD4hepDetector::~SimG4DD4hepDetector() {} StatusCode SimG4DD4hepDetector::initialize() { - if (GaudiTool::initialize().isFailure()) { + if (AlgTool::initialize().isFailure()) { return StatusCode::FAILURE; } if (!m_geoSvc) { @@ -28,6 +28,6 @@ StatusCode SimG4DD4hepDetector::initialize() { return StatusCode::SUCCESS; } -StatusCode SimG4DD4hepDetector::finalize() { return GaudiTool::finalize(); } +StatusCode SimG4DD4hepDetector::finalize() { return AlgTool::finalize(); } G4VUserDetectorConstruction* SimG4DD4hepDetector::detectorConstruction() { return m_geoSvc->getGeant4Geo(); } diff --git a/SimG4Components/src/SimG4DD4hepDetector.h b/SimG4Components/src/SimG4DD4hepDetector.h index 5250d93..b2eba2f 100644 --- a/SimG4Components/src/SimG4DD4hepDetector.h +++ b/SimG4Components/src/SimG4DD4hepDetector.h @@ -2,7 +2,7 @@ #define SIMG4COMPONENTS_G4DD4HEPDETECTOR_H // Gaudi -#include "GaudiAlg/GaudiTool.h" +#include "GaudiKernel/AlgTool.h" // FCCSW #include "SimG4Interface/ISimG4DetectorConstruction.h" @@ -16,7 +16,7 @@ class IGeoSvc; * @author Anna Zaborowska */ -class SimG4DD4hepDetector : public GaudiTool, virtual public ISimG4DetectorConstruction { +class SimG4DD4hepDetector : public AlgTool, virtual public ISimG4DetectorConstruction { public: explicit SimG4DD4hepDetector(const std::string& aType, const std::string& aName, const IInterface* aParent); virtual ~SimG4DD4hepDetector(); diff --git a/SimG4Components/src/SimG4GeantinosFromEdmTool.cpp b/SimG4Components/src/SimG4GeantinosFromEdmTool.cpp index f8ecbe6..a1f2a82 100644 --- a/SimG4Components/src/SimG4GeantinosFromEdmTool.cpp +++ b/SimG4Components/src/SimG4GeantinosFromEdmTool.cpp @@ -22,13 +22,13 @@ DECLARE_COMPONENT(SimG4GeantinosFromEdmTool) SimG4GeantinosFromEdmTool::SimG4GeantinosFromEdmTool(const std::string& type, const std::string& name, const IInterface* parent) - : GaudiTool(type, name, parent) { + : AlgTool(type, name, parent) { declareProperty("GenParticles", m_genParticles, "Handle for the EDM MC particles to be read"); } SimG4GeantinosFromEdmTool::~SimG4GeantinosFromEdmTool() {} -StatusCode SimG4GeantinosFromEdmTool::initialize() { return GaudiTool::initialize(); } +StatusCode SimG4GeantinosFromEdmTool::initialize() { return AlgTool::initialize(); } G4Event* SimG4GeantinosFromEdmTool::g4Event() { G4ParticleTable* particleTable = G4ParticleTable::GetParticleTable(); diff --git a/SimG4Components/src/SimG4GeantinosFromEdmTool.h b/SimG4Components/src/SimG4GeantinosFromEdmTool.h index 36b9238..0f11c6e 100644 --- a/SimG4Components/src/SimG4GeantinosFromEdmTool.h +++ b/SimG4Components/src/SimG4GeantinosFromEdmTool.h @@ -3,7 +3,7 @@ // from Gaudi #include "k4FWCore/DataHandle.h" -#include "GaudiAlg/GaudiTool.h" +#include "GaudiKernel/AlgTool.h" #include "SimG4Interface/ISimG4EventProviderTool.h" @@ -15,7 +15,7 @@ namespace edm4hep { class MCParticleCollection; } -class SimG4GeantinosFromEdmTool : public GaudiTool, virtual public ISimG4EventProviderTool { +class SimG4GeantinosFromEdmTool : public AlgTool, virtual public ISimG4EventProviderTool { public: /// Standard constructor SimG4GeantinosFromEdmTool(const std::string& type, const std::string& name, const IInterface* parent); @@ -30,7 +30,7 @@ class SimG4GeantinosFromEdmTool : public GaudiTool, virtual public ISimG4EventPr private: /// Handle for the EDM MC particles to be read - DataHandle m_genParticles{"GenParticles", Gaudi::DataHandle::Reader, this}; + mutable DataHandle m_genParticles{"GenParticles", Gaudi::DataHandle::Reader, this}; }; #endif diff --git a/SimG4Components/src/SimG4MagneticFieldFromMapTool.cpp b/SimG4Components/src/SimG4MagneticFieldFromMapTool.cpp index c6b4b3b..cedc24c 100644 --- a/SimG4Components/src/SimG4MagneticFieldFromMapTool.cpp +++ b/SimG4Components/src/SimG4MagneticFieldFromMapTool.cpp @@ -37,14 +37,14 @@ DECLARE_COMPONENT(SimG4MagneticFieldFromMapTool) SimG4MagneticFieldFromMapTool::SimG4MagneticFieldFromMapTool(const std::string& type, const std::string& name, const IInterface* parent) - : GaudiTool(type, name, parent), m_field(nullptr) { + : AlgTool(type, name, parent), m_field(nullptr) { declareInterface(this); } SimG4MagneticFieldFromMapTool::~SimG4MagneticFieldFromMapTool() {} StatusCode SimG4MagneticFieldFromMapTool::initialize() { - StatusCode sc = GaudiTool::initialize(); + StatusCode sc = AlgTool::initialize(); if (!sc.isSuccess()) { return sc; } @@ -125,7 +125,7 @@ StatusCode SimG4MagneticFieldFromMapTool::initialize() { StatusCode SimG4MagneticFieldFromMapTool::finalize() { - StatusCode sc = GaudiTool::finalize(); + StatusCode sc = AlgTool::finalize(); return sc; } diff --git a/SimG4Components/src/SimG4MagneticFieldFromMapTool.h b/SimG4Components/src/SimG4MagneticFieldFromMapTool.h index 7e22355..be6826a 100644 --- a/SimG4Components/src/SimG4MagneticFieldFromMapTool.h +++ b/SimG4Components/src/SimG4MagneticFieldFromMapTool.h @@ -2,7 +2,7 @@ #define SIMG4COMPONENTS_G4MAGNETICFIELDFROMMAPTOOL_H // Gaudi -#include "GaudiAlg/GaudiTool.h" +#include "GaudiKernel/AlgTool.h" // FCCSW #include "SimG4Interface/ISimG4MagneticFieldTool.h" @@ -31,7 +31,7 @@ namespace sim { * @date 2022-11-29 */ -class SimG4MagneticFieldFromMapTool : public GaudiTool, virtual public ISimG4MagneticFieldTool { +class SimG4MagneticFieldFromMapTool : public AlgTool, virtual public ISimG4MagneticFieldTool { public: /// Standard constructor SimG4MagneticFieldFromMapTool(const std::string& type, const std::string& name, const IInterface* parent); diff --git a/SimG4Components/src/SimG4MagneticFieldTool.cpp b/SimG4Components/src/SimG4MagneticFieldTool.cpp index 71c923b..2fb9718 100644 --- a/SimG4Components/src/SimG4MagneticFieldTool.cpp +++ b/SimG4Components/src/SimG4MagneticFieldTool.cpp @@ -30,7 +30,7 @@ DECLARE_COMPONENT(SimG4MagneticFieldTool) SimG4MagneticFieldTool::SimG4MagneticFieldTool(const std::string& type, const std::string& name, const IInterface* parent) - : GaudiTool(type, name, parent), m_geoSvc("GeoSvc", name), m_field(nullptr) { + : AlgTool(type, name, parent), m_geoSvc("GeoSvc", name), m_field(nullptr) { declareInterface(this); } @@ -38,7 +38,7 @@ SimG4MagneticFieldTool::~SimG4MagneticFieldTool() {} StatusCode SimG4MagneticFieldTool::initialize() { { - StatusCode sc = GaudiTool::initialize(); + StatusCode sc = AlgTool::initialize(); if (!sc.isSuccess()) { return sc; } @@ -88,7 +88,7 @@ StatusCode SimG4MagneticFieldTool::initialize() { StatusCode SimG4MagneticFieldTool::finalize() { - StatusCode sc = GaudiTool::finalize(); + StatusCode sc = AlgTool::finalize(); return sc; } diff --git a/SimG4Components/src/SimG4MagneticFieldTool.h b/SimG4Components/src/SimG4MagneticFieldTool.h index cac7bf3..8c17269 100644 --- a/SimG4Components/src/SimG4MagneticFieldTool.h +++ b/SimG4Components/src/SimG4MagneticFieldTool.h @@ -2,7 +2,7 @@ #define SIMG4COMPONENTS_G4MAGNETICFIELDTOOL_H // Gaudi -#include "GaudiAlg/GaudiTool.h" +#include "GaudiKernel/AlgTool.h" // k4FWCore #include "k4Interface/ISimG4MagneticFieldTool.h" @@ -27,7 +27,7 @@ class G4MagIntegratorStepper; * @date 2023-06-21 */ -class SimG4MagneticFieldTool : public GaudiTool, virtual public ISimG4MagneticFieldTool { +class SimG4MagneticFieldTool : public AlgTool, virtual public ISimG4MagneticFieldTool { public: /// Standard constructor SimG4MagneticFieldTool(const std::string& type, diff --git a/SimG4Components/src/SimG4PrimariesFromEdmTool.cpp b/SimG4Components/src/SimG4PrimariesFromEdmTool.cpp index be21535..03fdc24 100644 --- a/SimG4Components/src/SimG4PrimariesFromEdmTool.cpp +++ b/SimG4Components/src/SimG4PrimariesFromEdmTool.cpp @@ -20,13 +20,13 @@ DECLARE_COMPONENT(SimG4PrimariesFromEdmTool) SimG4PrimariesFromEdmTool::SimG4PrimariesFromEdmTool(const std::string& type, const std::string& name, const IInterface* parent) - : GaudiTool(type, name, parent) { + : AlgTool(type, name, parent) { declareProperty("GenParticles", m_genParticles, "Handle for the EDM MC particles to be read"); } SimG4PrimariesFromEdmTool::~SimG4PrimariesFromEdmTool() {} -StatusCode SimG4PrimariesFromEdmTool::initialize() { return GaudiTool::initialize(); } +StatusCode SimG4PrimariesFromEdmTool::initialize() { return AlgTool::initialize(); } G4Event* SimG4PrimariesFromEdmTool::g4Event() { auto theEvent = new G4Event(); diff --git a/SimG4Components/src/SimG4PrimariesFromEdmTool.h b/SimG4Components/src/SimG4PrimariesFromEdmTool.h index b413d1c..7babd8e 100644 --- a/SimG4Components/src/SimG4PrimariesFromEdmTool.h +++ b/SimG4Components/src/SimG4PrimariesFromEdmTool.h @@ -3,7 +3,7 @@ // from Gaudi #include "k4FWCore/DataHandle.h" -#include "GaudiAlg/GaudiTool.h" +#include "GaudiKernel/AlgTool.h" #include "SimG4Interface/ISimG4EventProviderTool.h" @@ -22,7 +22,7 @@ class MCParticleCollection; * @author A. Zaborowska, J. Lingemann, A. Dell'Acqua * @date 2016-01-11 */ -class SimG4PrimariesFromEdmTool : public GaudiTool, virtual public ISimG4EventProviderTool { +class SimG4PrimariesFromEdmTool : public AlgTool, virtual public ISimG4EventProviderTool { public: /// Standard constructor SimG4PrimariesFromEdmTool(const std::string& type, const std::string& name, const IInterface* parent); @@ -37,7 +37,7 @@ class SimG4PrimariesFromEdmTool : public GaudiTool, virtual public ISimG4EventPr private: /// Handle for the EDM MC particles to be read - DataHandle m_genParticles{"GenParticles", Gaudi::DataHandle::Reader, this}; + mutable DataHandle m_genParticles{"GenParticles", Gaudi::DataHandle::Reader, this}; }; #endif diff --git a/SimG4Components/src/SimG4SaveCalHits.cpp b/SimG4Components/src/SimG4SaveCalHits.cpp index 4a6d2bc..d134bf2 100644 --- a/SimG4Components/src/SimG4SaveCalHits.cpp +++ b/SimG4Components/src/SimG4SaveCalHits.cpp @@ -17,7 +17,7 @@ DECLARE_COMPONENT(SimG4SaveCalHits) SimG4SaveCalHits::SimG4SaveCalHits(const std::string& aType, const std::string& aName, const IInterface* aParent) : - GaudiTool(aType, aName, aParent), m_geoSvc("GeoSvc", aName) { + AlgTool(aType, aName, aParent), m_geoSvc("GeoSvc", aName) { declareInterface(this); declareProperty("CaloHits", m_caloHits, "Handle for calo hits"); declareProperty("GeoSvc", m_geoSvc); @@ -26,7 +26,7 @@ SimG4SaveCalHits::SimG4SaveCalHits(const std::string& aType, SimG4SaveCalHits::~SimG4SaveCalHits() {} StatusCode SimG4SaveCalHits::initialize() { - if (GaudiTool::initialize().isFailure()) { + if (AlgTool::initialize().isFailure()) { return StatusCode::FAILURE; } @@ -88,7 +88,7 @@ StatusCode SimG4SaveCalHits::initialize() { return StatusCode::SUCCESS; } -StatusCode SimG4SaveCalHits::finalize() { return GaudiTool::finalize(); } +StatusCode SimG4SaveCalHits::finalize() { return AlgTool::finalize(); } StatusCode SimG4SaveCalHits::saveOutput(const G4Event& aEvent) { G4HCofThisEvent* collections = aEvent.GetHCofThisEvent(); diff --git a/SimG4Components/src/SimG4SaveCalHits.h b/SimG4Components/src/SimG4SaveCalHits.h index 1d733b5..639a67e 100644 --- a/SimG4Components/src/SimG4SaveCalHits.h +++ b/SimG4Components/src/SimG4SaveCalHits.h @@ -6,7 +6,7 @@ #include // Gaudi -#include "GaudiAlg/GaudiTool.h" +#include "GaudiKernel/AlgTool.h" // k4FWCore #include "k4FWCore/DataHandle.h" @@ -42,7 +42,7 @@ * @author Juraj Smiesko (deprecated `readoutNames`) */ -class SimG4SaveCalHits : public GaudiTool, virtual public ISimG4SaveOutputTool { +class SimG4SaveCalHits : public AlgTool, virtual public ISimG4SaveOutputTool { public: explicit SimG4SaveCalHits(const std::string& aType, const std::string& aName, const IInterface* aParent); virtual ~SimG4SaveCalHits(); @@ -65,7 +65,7 @@ class SimG4SaveCalHits : public GaudiTool, virtual public ISimG4SaveOutputTool { /// Pointer to the geometry service ServiceHandle m_geoSvc; /// Output handle for calo hits - DataHandle m_caloHits{ + mutable DataHandle m_caloHits{ "CaloHits", Gaudi::DataHandle::Writer, this}; /// Output handle for cell ID encoding string MetaDataHandle m_cellIDEncoding{ diff --git a/SimG4Components/src/SimG4SaveParticleHistory.cpp b/SimG4Components/src/SimG4SaveParticleHistory.cpp index 768509a..df75bea 100644 --- a/SimG4Components/src/SimG4SaveParticleHistory.cpp +++ b/SimG4Components/src/SimG4SaveParticleHistory.cpp @@ -17,7 +17,7 @@ DECLARE_COMPONENT(SimG4SaveParticleHistory) SimG4SaveParticleHistory::SimG4SaveParticleHistory(const std::string& aType, const std::string& aName, const IInterface* aParent) - : GaudiTool(aType, aName, aParent) { + : AlgTool(aType, aName, aParent) { declareInterface(this); declareProperty("GenParticles", m_mcParticles, "Handle to the secondary particles"); } diff --git a/SimG4Components/src/SimG4SaveParticleHistory.h b/SimG4Components/src/SimG4SaveParticleHistory.h index 8e45011..dd5b4de 100644 --- a/SimG4Components/src/SimG4SaveParticleHistory.h +++ b/SimG4Components/src/SimG4SaveParticleHistory.h @@ -2,7 +2,7 @@ #define SIMG4COMPONENTS_SIMG4SAVEPARTICLEHISTORY_H // Gaudi -#include "GaudiAlg/GaudiTool.h" +#include "GaudiKernel/AlgTool.h" // FCCSW #include "k4FWCore/DataHandle.h" @@ -28,7 +28,7 @@ class EventInformation; * @author V. Volkl */ -class SimG4SaveParticleHistory : public GaudiTool, virtual public ISimG4SaveOutputTool { +class SimG4SaveParticleHistory : public AlgTool, virtual public ISimG4SaveOutputTool { public: explicit SimG4SaveParticleHistory(const std::string& aType, const std::string& aName, const IInterface* aParent); virtual ~SimG4SaveParticleHistory() = default; @@ -42,7 +42,7 @@ class SimG4SaveParticleHistory : public GaudiTool, virtual public ISimG4SaveOutp private: /// Handle for collection of MC particles to create - DataHandle m_mcParticles{"SimParticleSecondaries", Gaudi::DataHandle::Writer, this}; + mutable DataHandle m_mcParticles{"SimParticleSecondaries", Gaudi::DataHandle::Writer, this}; /// Pointer to the particle collection, ownership should be handled in a algorithm / tool edm4hep::MCParticleCollection* m_mcParticleColl; }; diff --git a/SimG4Components/src/SimG4SaveSmearedParticles.cpp b/SimG4Components/src/SimG4SaveSmearedParticles.cpp index 2afbde4..495c329 100644 --- a/SimG4Components/src/SimG4SaveSmearedParticles.cpp +++ b/SimG4Components/src/SimG4SaveSmearedParticles.cpp @@ -18,7 +18,7 @@ DECLARE_COMPONENT(SimG4SaveSmearedParticles) SimG4SaveSmearedParticles::SimG4SaveSmearedParticles(const std::string& aType, const std::string& aName, const IInterface* aParent) - : GaudiTool(aType, aName, aParent) { + : AlgTool(aType, aName, aParent) { declareInterface(this); declareProperty("RecParticles", m_particles, "Handle for the particles to be written"); declareProperty("MCRecoParticleAssoc", m_particlesMCparticles, @@ -27,9 +27,9 @@ SimG4SaveSmearedParticles::SimG4SaveSmearedParticles(const std::string& aType, c SimG4SaveSmearedParticles::~SimG4SaveSmearedParticles() {} -StatusCode SimG4SaveSmearedParticles::initialize() { return GaudiTool::initialize(); } +StatusCode SimG4SaveSmearedParticles::initialize() { return AlgTool::initialize(); } -StatusCode SimG4SaveSmearedParticles::finalize() { return GaudiTool::finalize(); } +StatusCode SimG4SaveSmearedParticles::finalize() { return AlgTool::finalize(); } StatusCode SimG4SaveSmearedParticles::saveOutput(const G4Event& aEvent) { auto particles = m_particles.createAndPut(); diff --git a/SimG4Components/src/SimG4SaveSmearedParticles.h b/SimG4Components/src/SimG4SaveSmearedParticles.h index 7aa3064..acaaad2 100644 --- a/SimG4Components/src/SimG4SaveSmearedParticles.h +++ b/SimG4Components/src/SimG4SaveSmearedParticles.h @@ -2,7 +2,7 @@ #define SIMG4COMPONENTS_G4SAVESMEAREDPARTICLES_H // Gaudi -#include "GaudiAlg/GaudiTool.h" +#include "GaudiKernel/AlgTool.h" // FCCSW #include "k4FWCore/DataHandle.h" @@ -21,7 +21,7 @@ class MCRecoParticleAssociationCollection; * @author Anna Zaborowska */ -class SimG4SaveSmearedParticles : public GaudiTool, virtual public ISimG4SaveOutputTool { +class SimG4SaveSmearedParticles : public AlgTool, virtual public ISimG4SaveOutputTool { public: explicit SimG4SaveSmearedParticles(const std::string& aType, const std::string& aName, const IInterface* aParent); virtual ~SimG4SaveSmearedParticles(); @@ -42,9 +42,9 @@ class SimG4SaveSmearedParticles : public GaudiTool, virtual public ISimG4SaveOut private: /// Handle for the particles to be written - DataHandle m_particles{"RecParticlesSmeared", Gaudi::DataHandle::Writer, this}; + mutable DataHandle m_particles{"RecParticlesSmeared", Gaudi::DataHandle::Writer, this}; /// Handle for the associations between particles and MC particles to be written - DataHandle m_particlesMCparticles{"SmearedParticlesToParticles", + mutable DataHandle m_particlesMCparticles{"SmearedParticlesToParticles", Gaudi::DataHandle::Writer, this}; }; diff --git a/SimG4Components/src/SimG4SaveTrackerHits.cpp b/SimG4Components/src/SimG4SaveTrackerHits.cpp index 9a82a26..535ed13 100644 --- a/SimG4Components/src/SimG4SaveTrackerHits.cpp +++ b/SimG4Components/src/SimG4SaveTrackerHits.cpp @@ -16,7 +16,7 @@ DECLARE_COMPONENT(SimG4SaveTrackerHits) SimG4SaveTrackerHits::SimG4SaveTrackerHits(const std::string& aType, const std::string& aName, const IInterface* aParent) - : GaudiTool(aType, aName, aParent), + : AlgTool(aType, aName, aParent), m_geoSvc("GeoSvc", aName) { declareInterface(this); declareProperty("SimTrackHits", m_trackHits, "Handle for tracker hits"); @@ -26,7 +26,7 @@ SimG4SaveTrackerHits::SimG4SaveTrackerHits(const std::string& aType, SimG4SaveTrackerHits::~SimG4SaveTrackerHits() {} StatusCode SimG4SaveTrackerHits::initialize() { - if (GaudiTool::initialize().isFailure()) { + if (AlgTool::initialize().isFailure()) { return StatusCode::FAILURE; } if (!m_geoSvc) { @@ -88,7 +88,7 @@ StatusCode SimG4SaveTrackerHits::initialize() { return StatusCode::SUCCESS; } -StatusCode SimG4SaveTrackerHits::finalize() { return GaudiTool::finalize(); } +StatusCode SimG4SaveTrackerHits::finalize() { return AlgTool::finalize(); } StatusCode SimG4SaveTrackerHits::saveOutput(const G4Event& aEvent) { G4HCofThisEvent* collections = aEvent.GetHCofThisEvent(); diff --git a/SimG4Components/src/SimG4SaveTrackerHits.h b/SimG4Components/src/SimG4SaveTrackerHits.h index da3caf5..7eb3625 100644 --- a/SimG4Components/src/SimG4SaveTrackerHits.h +++ b/SimG4Components/src/SimG4SaveTrackerHits.h @@ -6,7 +6,7 @@ #include // Gaudi -#include "GaudiAlg/GaudiTool.h" +#include "GaudiKernel/AlgTool.h" // k4FWCore #include "k4FWCore/DataHandle.h" @@ -43,7 +43,7 @@ * @author Juraj Smiesko (deprecated `readoutNames`) */ -class SimG4SaveTrackerHits : public GaudiTool, virtual public ISimG4SaveOutputTool { +class SimG4SaveTrackerHits : public AlgTool, virtual public ISimG4SaveOutputTool { public: explicit SimG4SaveTrackerHits(const std::string& aType, const std::string& aName, const IInterface* aParent); virtual ~SimG4SaveTrackerHits(); @@ -66,7 +66,7 @@ class SimG4SaveTrackerHits : public GaudiTool, virtual public ISimG4SaveOutputTo /// Pointer to the geometry service ServiceHandle m_geoSvc; /// Handle for output tracker hits - DataHandle m_trackHits { + mutable DataHandle m_trackHits { "TrackerHits", Gaudi::DataHandle::Writer, this}; /// Output handle for cell ID encoding string MetaDataHandle m_cellIDEncoding { diff --git a/SimG4Components/src/SimG4SaveTrajectory.cpp b/SimG4Components/src/SimG4SaveTrajectory.cpp index e56e7c0..5a100bd 100644 --- a/SimG4Components/src/SimG4SaveTrajectory.cpp +++ b/SimG4Components/src/SimG4SaveTrajectory.cpp @@ -16,7 +16,7 @@ DECLARE_COMPONENT(SimG4SaveTrajectory) SimG4SaveTrajectory::SimG4SaveTrajectory(const std::string& aType, const std::string& aName, const IInterface* aParent) - : GaudiTool(aType, aName, aParent), m_geoSvc("GeoSvc", aName) { + : AlgTool(aType, aName, aParent), m_geoSvc("GeoSvc", aName) { declareInterface(this); declareProperty("TrajectoryPoints", m_trackHits, "Handle for trajectory hits"); } @@ -24,13 +24,13 @@ SimG4SaveTrajectory::SimG4SaveTrajectory(const std::string& aType, const std::st SimG4SaveTrajectory::~SimG4SaveTrajectory() {} StatusCode SimG4SaveTrajectory::initialize() { - if (GaudiTool::initialize().isFailure()) { + if (AlgTool::initialize().isFailure()) { return StatusCode::FAILURE; } return StatusCode::SUCCESS; } -StatusCode SimG4SaveTrajectory::finalize() { return GaudiTool::finalize(); } +StatusCode SimG4SaveTrajectory::finalize() { return AlgTool::finalize(); } StatusCode SimG4SaveTrajectory::saveOutput(const G4Event& aEvent) { auto edmPositions = m_trackHits.createAndPut(); diff --git a/SimG4Components/src/SimG4SaveTrajectory.h b/SimG4Components/src/SimG4SaveTrajectory.h index 9f0abad..6302712 100644 --- a/SimG4Components/src/SimG4SaveTrajectory.h +++ b/SimG4Components/src/SimG4SaveTrajectory.h @@ -2,7 +2,7 @@ #define SIMG4COMPONENTS_G4SAVETRAJECTORY // Gaudi -#include "GaudiAlg/GaudiTool.h" +#include "GaudiKernel/AlgTool.h" // FCCSW #include "k4FWCore/DataHandle.h" @@ -25,7 +25,7 @@ namespace edm4hep { * */ -class SimG4SaveTrajectory : public GaudiTool, virtual public ISimG4SaveOutputTool { +class SimG4SaveTrajectory : public AlgTool, virtual public ISimG4SaveOutputTool { public: explicit SimG4SaveTrajectory(const std::string& aType, const std::string& aName, const IInterface* aParent); virtual ~SimG4SaveTrajectory(); @@ -47,7 +47,7 @@ class SimG4SaveTrajectory : public GaudiTool, virtual public ISimG4SaveOutputToo /// Pointer to the geometry service ServiceHandle m_geoSvc; /// Handle for trajectory hits including position information - DataHandle m_trackHits{"Hits/Trajectory", + mutable DataHandle m_trackHits{"Hits/Trajectory", Gaudi::DataHandle::Writer, this}; }; diff --git a/SimG4Components/src/SimG4SingleParticleGeneratorTool.cpp b/SimG4Components/src/SimG4SingleParticleGeneratorTool.cpp index 4c4af83..4fd3cbd 100644 --- a/SimG4Components/src/SimG4SingleParticleGeneratorTool.cpp +++ b/SimG4Components/src/SimG4SingleParticleGeneratorTool.cpp @@ -24,7 +24,7 @@ DECLARE_COMPONENT(SimG4SingleParticleGeneratorTool) SimG4SingleParticleGeneratorTool::SimG4SingleParticleGeneratorTool(const std::string& type, const std::string& nam, const IInterface* parent) - : GaudiTool(type, nam, parent) { + : AlgTool(type, nam, parent) { declareInterface(this); declareProperty("GenParticles", m_genParticlesHandle, "Handle for the genparticles to be written"); } @@ -32,7 +32,7 @@ SimG4SingleParticleGeneratorTool::SimG4SingleParticleGeneratorTool(const std::st SimG4SingleParticleGeneratorTool::~SimG4SingleParticleGeneratorTool() {} StatusCode SimG4SingleParticleGeneratorTool::initialize() { - if (GaudiTool::initialize().isFailure()) { + if (AlgTool::initialize().isFailure()) { return StatusCode::FAILURE; } if (!G4ParticleTable::GetParticleTable()->contains(m_particleName.value())) { diff --git a/SimG4Components/src/SimG4SingleParticleGeneratorTool.h b/SimG4Components/src/SimG4SingleParticleGeneratorTool.h index c594293..cb0bbec 100644 --- a/SimG4Components/src/SimG4SingleParticleGeneratorTool.h +++ b/SimG4Components/src/SimG4SingleParticleGeneratorTool.h @@ -2,7 +2,7 @@ #define SIMG4COMPONENTS_G4SINGLEPARTICLEGENERATORTOOL_H // Gaudi -#include "GaudiAlg/GaudiTool.h" +#include "GaudiKernel/AlgTool.h" // FCCSW #include "k4FWCore/DataHandle.h" @@ -29,7 +29,7 @@ class MCParticleCollection; * @date 2014-10-01 */ -class SimG4SingleParticleGeneratorTool : public GaudiTool, virtual public ISimG4EventProviderTool { +class SimG4SingleParticleGeneratorTool : public AlgTool, virtual public ISimG4EventProviderTool { public: /// Standard constructor SimG4SingleParticleGeneratorTool(const std::string& type, const std::string& name, const IInterface* parent); @@ -69,7 +69,7 @@ class SimG4SingleParticleGeneratorTool : public GaudiTool, virtual public ISimG4 /// Flag whether to save primary particle to EDM, set with saveEdm Gaudi::Property m_saveEdm{this, "saveEdm", false}; /// Handle for the genparticles to be written - DataHandle m_genParticlesHandle{"GenParticles", Gaudi::DataHandle::Writer, this}; + mutable DataHandle m_genParticlesHandle{"GenParticles", Gaudi::DataHandle::Writer, this}; }; #endif diff --git a/SimG4Components/src/SimG4SmearGenParticles.cpp b/SimG4Components/src/SimG4SmearGenParticles.cpp index eea02a6..ce75a25 100644 --- a/SimG4Components/src/SimG4SmearGenParticles.cpp +++ b/SimG4Components/src/SimG4SmearGenParticles.cpp @@ -15,7 +15,7 @@ DECLARE_COMPONENT(SimG4SmearGenParticles) -SimG4SmearGenParticles::SimG4SmearGenParticles(const std::string& aName,ISvcLocator* aSvcLoc) : GaudiAlgorithm(aName, aSvcLoc) { +SimG4SmearGenParticles::SimG4SmearGenParticles(const std::string& aName,ISvcLocator* aSvcLoc) : Gaudi::Algorithm(aName, aSvcLoc) { declareProperty("inParticles", m_inParticles, "Handle for the input particles"); declareProperty("smearedParticles", m_particles, "Handle for the particles to be written"); declareProperty("smearTool", m_smearTool, "Handle to smear generated particles tool"); @@ -23,7 +23,7 @@ SimG4SmearGenParticles::SimG4SmearGenParticles(const std::string& aName,ISvcLoca StatusCode SimG4SmearGenParticles::initialize() { - StatusCode sc = GaudiAlgorithm::initialize(); + StatusCode sc = Gaudi::Algorithm::initialize(); // Use smearing tool if (!m_smearTool.retrieve()) { info() << "Generated particles will not be smeared!!!" << endmsg; @@ -32,7 +32,7 @@ StatusCode SimG4SmearGenParticles::initialize() { return sc; } -StatusCode SimG4SmearGenParticles::execute() { +StatusCode SimG4SmearGenParticles::execute(const EventContext&) const { auto particles = m_particles.createAndPut(); const edm4hep::MCParticleCollection* coll = m_inParticles.get(); @@ -80,4 +80,4 @@ StatusCode SimG4SmearGenParticles::execute() { return StatusCode::SUCCESS; } -StatusCode SimG4SmearGenParticles::finalize() { return GaudiAlgorithm::finalize(); } +StatusCode SimG4SmearGenParticles::finalize() { return Gaudi::Algorithm::finalize(); } diff --git a/SimG4Components/src/SimG4SmearGenParticles.h b/SimG4Components/src/SimG4SmearGenParticles.h index 7d1048d..ede6db8 100644 --- a/SimG4Components/src/SimG4SmearGenParticles.h +++ b/SimG4Components/src/SimG4SmearGenParticles.h @@ -2,7 +2,7 @@ #define SIMG4COMPONENTS_G4SMEARGENPARTICLES_H // Gaudi -#include "GaudiAlg/GaudiAlgorithm.h" +#include "Gaudi/Algorithm.h" #include "GaudiKernel/ToolHandle.h" // FCCSW @@ -22,7 +22,7 @@ class MCParticleCollection; * @author Coralie Neubüser */ -class SimG4SmearGenParticles : public GaudiAlgorithm { +class SimG4SmearGenParticles : public Gaudi::Algorithm { public: SimG4SmearGenParticles(const std::string& aName, ISvcLocator* svcLoc); /** Initialize. @@ -38,15 +38,15 @@ class SimG4SmearGenParticles : public GaudiAlgorithm { * @param[in] aEvent Event with data to save. * @return status code */ - StatusCode execute(); + StatusCode execute(const EventContext&) const; private: /// Handle for the particles to be written - DataHandle m_inParticles{"GenParticles", Gaudi::DataHandle::Reader, this}; + mutable DataHandle m_inParticles{"GenParticles", Gaudi::DataHandle::Reader, this}; /// Handle for the particles to be written - DataHandle m_particles{"SimParticlesSmeared", Gaudi::DataHandle::Writer, this}; + mutable DataHandle m_particles{"SimParticlesSmeared", Gaudi::DataHandle::Writer, this}; /// Handle for the calorimeter cells noise tool - ToolHandle m_smearTool{"SimG4ParticleSmearRootFile", this}; + mutable ToolHandle m_smearTool{"SimG4ParticleSmearRootFile", this}; /// Flag to decide on wether to only smear and write out charged particles Gaudi::Property m_simTracker{this, "simulateTracker", true}; }; diff --git a/SimG4Fast/CMakeLists.txt b/SimG4Fast/CMakeLists.txt index c710fa1..26be88d 100644 --- a/SimG4Fast/CMakeLists.txt +++ b/SimG4Fast/CMakeLists.txt @@ -6,11 +6,11 @@ file(GLOB _lib_sources src/lib/*.cpp) gaudi_add_library(SimG4Fast SOURCES ${_lib_sources} - LINK DD4hep::DDCore SimG4Common SimG4Interface Gaudi::GaudiAlgLib k4FWCore::k4FWCore EDM4HEP::edm4hep) + LINK DD4hep::DDCore SimG4Common SimG4Interface k4FWCore::k4FWCore EDM4HEP::edm4hep) file(GLOB _module_sources src/components/*.cpp) gaudi_add_module(SimG4FastPlugins SOURCES ${_module_sources} - LINK DD4hep::DDCore SimG4Common SimG4Interface SimG4Fast Gaudi::GaudiAlgLib k4FWCore::k4FWCore EDM4HEP::edm4hep) + LINK DD4hep::DDCore SimG4Common SimG4Interface SimG4Fast k4FWCore::k4FWCore EDM4HEP::edm4hep) diff --git a/SimG4Fast/src/components/SimG4FastSimCalorimeterRegion.cpp b/SimG4Fast/src/components/SimG4FastSimCalorimeterRegion.cpp index 201c3cb..241becd 100644 --- a/SimG4Fast/src/components/SimG4FastSimCalorimeterRegion.cpp +++ b/SimG4Fast/src/components/SimG4FastSimCalorimeterRegion.cpp @@ -14,7 +14,7 @@ DECLARE_COMPONENT(SimG4FastSimCalorimeterRegion) SimG4FastSimCalorimeterRegion::SimG4FastSimCalorimeterRegion(const std::string& type, const std::string& name, const IInterface* parent) - : GaudiTool(type, name, parent) { + : AlgTool(type, name, parent) { declareInterface(this); declareProperty("parametrisation", m_parametrisationTool, "Pointer to a parametrisation tool, to retrieve calorimeter parametrisation"); @@ -23,7 +23,7 @@ SimG4FastSimCalorimeterRegion::SimG4FastSimCalorimeterRegion(const std::string& SimG4FastSimCalorimeterRegion::~SimG4FastSimCalorimeterRegion() {} StatusCode SimG4FastSimCalorimeterRegion::initialize() { - if (GaudiTool::initialize().isFailure()) { + if (AlgTool::initialize().isFailure()) { return StatusCode::FAILURE; } if (m_volumeNames.size() == 0) { @@ -41,7 +41,7 @@ StatusCode SimG4FastSimCalorimeterRegion::initialize() { return StatusCode::SUCCESS; } -StatusCode SimG4FastSimCalorimeterRegion::finalize() { return GaudiTool::finalize(); } +StatusCode SimG4FastSimCalorimeterRegion::finalize() { return AlgTool::finalize(); } StatusCode SimG4FastSimCalorimeterRegion::create() { G4LogicalVolume* world = diff --git a/SimG4Fast/src/components/SimG4FastSimCalorimeterRegion.h b/SimG4Fast/src/components/SimG4FastSimCalorimeterRegion.h index d81aa91..c780b4c 100644 --- a/SimG4Fast/src/components/SimG4FastSimCalorimeterRegion.h +++ b/SimG4Fast/src/components/SimG4FastSimCalorimeterRegion.h @@ -2,7 +2,7 @@ #define SIMG4FAST_SIMG4FASTSIMCALORIMETERREGION_H // Gaudi -#include "GaudiAlg/GaudiTool.h" +#include "GaudiKernel/AlgTool.h" #include "GaudiKernel/SystemOfUnits.h" #include "GaudiKernel/ToolHandle.h" @@ -28,7 +28,7 @@ class G4Region; * @author Anna Zaborowska */ -class SimG4FastSimCalorimeterRegion : public GaudiTool, virtual public ISimG4RegionTool { +class SimG4FastSimCalorimeterRegion : public AlgTool, virtual public ISimG4RegionTool { public: explicit SimG4FastSimCalorimeterRegion(const std::string& type, const std::string& name, const IInterface* parent); virtual ~SimG4FastSimCalorimeterRegion(); diff --git a/SimG4Fast/src/components/SimG4FastSimHistograms.cpp b/SimG4Fast/src/components/SimG4FastSimHistograms.cpp index 3f1c22f..c41a975 100644 --- a/SimG4Fast/src/components/SimG4FastSimHistograms.cpp +++ b/SimG4Fast/src/components/SimG4FastSimHistograms.cpp @@ -14,14 +14,14 @@ DECLARE_COMPONENT(SimG4FastSimHistograms) SimG4FastSimHistograms::SimG4FastSimHistograms(const std::string& aName, ISvcLocator* aSvcLoc) - : GaudiAlgorithm(aName, aSvcLoc) { + : Gaudi::Algorithm(aName, aSvcLoc) { declareProperty("particlesMCparticles", m_particlesMCparticles, "Handle for the EDM particles and MC particles associations to be read"); } SimG4FastSimHistograms::~SimG4FastSimHistograms() {} StatusCode SimG4FastSimHistograms::initialize() { - if (GaudiAlgorithm::initialize().isFailure()) return StatusCode::FAILURE; + if (Gaudi::Algorithm::initialize().isFailure()) return StatusCode::FAILURE; m_histSvc = service("THistSvc"); if (!m_histSvc) { error() << "Unable to locate Histogram Service" << endmsg; @@ -46,7 +46,7 @@ StatusCode SimG4FastSimHistograms::initialize() { return StatusCode::SUCCESS; } -StatusCode SimG4FastSimHistograms::execute() { +StatusCode SimG4FastSimHistograms::execute(const EventContext&) const { const auto associations = m_particlesMCparticles.get(); for (const auto& assoc : *associations) { auto mom_edm = assoc.getRec().getMomentum(); @@ -61,4 +61,4 @@ StatusCode SimG4FastSimHistograms::execute() { return StatusCode::SUCCESS; } -StatusCode SimG4FastSimHistograms::finalize() { return GaudiAlgorithm::finalize(); } +StatusCode SimG4FastSimHistograms::finalize() { return Gaudi::Algorithm::finalize(); } diff --git a/SimG4Fast/src/components/SimG4FastSimHistograms.h b/SimG4Fast/src/components/SimG4FastSimHistograms.h index 27c6efa..b7ae230 100644 --- a/SimG4Fast/src/components/SimG4FastSimHistograms.h +++ b/SimG4Fast/src/components/SimG4FastSimHistograms.h @@ -2,7 +2,7 @@ #define SIMG4FAST_G4FASTSIMHISTOGRAMS_H // GAUDI -#include "GaudiAlg/GaudiAlgorithm.h" +#include "Gaudi/Algorithm.h" // FCCSW #include "k4FWCore/DataHandle.h" @@ -25,7 +25,7 @@ class TH1F; * @author Anna Zaborowska */ -class SimG4FastSimHistograms : public GaudiAlgorithm { +class SimG4FastSimHistograms : public Gaudi::Algorithm { public: explicit SimG4FastSimHistograms(const std::string&, ISvcLocator*); virtual ~SimG4FastSimHistograms(); @@ -36,7 +36,7 @@ class SimG4FastSimHistograms : public GaudiAlgorithm { /** Fills the histograms. * @return status code */ - virtual StatusCode execute() final; + virtual StatusCode execute(const EventContext&) const final; /** Finalize. * @return status code */ @@ -44,7 +44,7 @@ class SimG4FastSimHistograms : public GaudiAlgorithm { private: /// Handle for the EDM particles and MC particles associations to be read - DataHandle m_particlesMCparticles{"ParticlesMCparticles", + mutable DataHandle m_particlesMCparticles{"ParticlesMCparticles", Gaudi::DataHandle::Reader, this}; /// Pointer to the interface of histogram service SmartIF m_histSvc; diff --git a/SimG4Fast/src/components/SimG4FastSimTrackerRegion.cpp b/SimG4Fast/src/components/SimG4FastSimTrackerRegion.cpp index fab75c7..87a677c 100644 --- a/SimG4Fast/src/components/SimG4FastSimTrackerRegion.cpp +++ b/SimG4Fast/src/components/SimG4FastSimTrackerRegion.cpp @@ -12,7 +12,7 @@ DECLARE_COMPONENT(SimG4FastSimTrackerRegion) SimG4FastSimTrackerRegion::SimG4FastSimTrackerRegion(const std::string& type, const std::string& name, const IInterface* parent) - : GaudiTool(type, name, parent) { + : AlgTool(type, name, parent) { declareInterface(this); declareProperty("smearing", m_smearTool, "Pointer to a smearing tool, to retrieve tracker configuration (names of volumes)"); @@ -21,7 +21,7 @@ SimG4FastSimTrackerRegion::SimG4FastSimTrackerRegion(const std::string& type, co SimG4FastSimTrackerRegion::~SimG4FastSimTrackerRegion() {} StatusCode SimG4FastSimTrackerRegion::initialize() { - if (GaudiTool::initialize().isFailure()) { + if (AlgTool::initialize().isFailure()) { return StatusCode::FAILURE; } if (m_volumeNames.size() == 0) { @@ -43,7 +43,7 @@ StatusCode SimG4FastSimTrackerRegion::initialize() { return StatusCode::SUCCESS; } -StatusCode SimG4FastSimTrackerRegion::finalize() { return GaudiTool::finalize(); } +StatusCode SimG4FastSimTrackerRegion::finalize() { return AlgTool::finalize(); } StatusCode SimG4FastSimTrackerRegion::create() { G4LogicalVolume* world = diff --git a/SimG4Fast/src/components/SimG4FastSimTrackerRegion.h b/SimG4Fast/src/components/SimG4FastSimTrackerRegion.h index 25bc182..d8c87c5 100644 --- a/SimG4Fast/src/components/SimG4FastSimTrackerRegion.h +++ b/SimG4Fast/src/components/SimG4FastSimTrackerRegion.h @@ -2,7 +2,7 @@ #define SIMG4FAST_SIMG4FASTSIMTRACKERREGION_H // Gaudi -#include "GaudiAlg/GaudiTool.h" +#include "GaudiKernel/AlgTool.h" #include "GaudiKernel/ToolHandle.h" // FCCSW @@ -24,7 +24,7 @@ class G4Region; * @author Anna Zaborowska */ -class SimG4FastSimTrackerRegion : public GaudiTool, virtual public ISimG4RegionTool { +class SimG4FastSimTrackerRegion : public AlgTool, virtual public ISimG4RegionTool { public: explicit SimG4FastSimTrackerRegion(const std::string& type, const std::string& name, const IInterface* parent); virtual ~SimG4FastSimTrackerRegion(); diff --git a/SimG4Fast/src/components/SimG4GflashHomoCalo.cpp b/SimG4Fast/src/components/SimG4GflashHomoCalo.cpp index f19c73b..1202ce6 100644 --- a/SimG4Fast/src/components/SimG4GflashHomoCalo.cpp +++ b/SimG4Fast/src/components/SimG4GflashHomoCalo.cpp @@ -7,12 +7,12 @@ DECLARE_COMPONENT(SimG4GflashHomoCalo) SimG4GflashHomoCalo::SimG4GflashHomoCalo(const std::string& type, const std::string& name, const IInterface* parent) - : GaudiTool(type, name, parent) {} + : AlgTool(type, name, parent) {} SimG4GflashHomoCalo::~SimG4GflashHomoCalo() {} StatusCode SimG4GflashHomoCalo::initialize() { - if (GaudiTool::initialize().isFailure()) { + if (AlgTool::initialize().isFailure()) { return StatusCode::FAILURE; } if (m_material.empty()) { @@ -27,7 +27,7 @@ StatusCode SimG4GflashHomoCalo::initialize() { return StatusCode::SUCCESS; } -StatusCode SimG4GflashHomoCalo::finalize() { return GaudiTool::finalize(); } +StatusCode SimG4GflashHomoCalo::finalize() { return AlgTool::finalize(); } std::unique_ptr SimG4GflashHomoCalo::parametrisation() { G4NistManager* nist = G4NistManager::Instance(); diff --git a/SimG4Fast/src/components/SimG4GflashHomoCalo.h b/SimG4Fast/src/components/SimG4GflashHomoCalo.h index 7b8f23a..00a6c19 100644 --- a/SimG4Fast/src/components/SimG4GflashHomoCalo.h +++ b/SimG4Fast/src/components/SimG4GflashHomoCalo.h @@ -2,7 +2,7 @@ #define SIMG4FAST_SIMG4GFLASHHOMOCALO_H // Gaudi -#include "GaudiAlg/GaudiTool.h" +#include "GaudiKernel/AlgTool.h" // FCCSW #include "SimG4Interface/ISimG4GflashTool.h" @@ -16,7 +16,7 @@ * @author Anna Zaborowska */ -class SimG4GflashHomoCalo : public GaudiTool, virtual public ISimG4GflashTool { +class SimG4GflashHomoCalo : public AlgTool, virtual public ISimG4GflashTool { public: explicit SimG4GflashHomoCalo(const std::string& type, const std::string& name, const IInterface* parent); virtual ~SimG4GflashHomoCalo(); diff --git a/SimG4Fast/src/components/SimG4GflashSamplingCalo.cpp b/SimG4Fast/src/components/SimG4GflashSamplingCalo.cpp index f289420..5bd95eb 100644 --- a/SimG4Fast/src/components/SimG4GflashSamplingCalo.cpp +++ b/SimG4Fast/src/components/SimG4GflashSamplingCalo.cpp @@ -8,12 +8,12 @@ DECLARE_COMPONENT(SimG4GflashSamplingCalo) SimG4GflashSamplingCalo::SimG4GflashSamplingCalo(const std::string& type, const std::string& name, const IInterface* parent) - : GaudiTool(type, name, parent) {} + : AlgTool(type, name, parent) {} SimG4GflashSamplingCalo::~SimG4GflashSamplingCalo() {} StatusCode SimG4GflashSamplingCalo::initialize() { - if (GaudiTool::initialize().isFailure()) { + if (AlgTool::initialize().isFailure()) { return StatusCode::FAILURE; } if (m_thicknessActive == 0 || m_thicknessPassive == 0) { @@ -32,7 +32,7 @@ StatusCode SimG4GflashSamplingCalo::initialize() { return StatusCode::SUCCESS; } -StatusCode SimG4GflashSamplingCalo::finalize() { return GaudiTool::finalize(); } +StatusCode SimG4GflashSamplingCalo::finalize() { return AlgTool::finalize(); } std::unique_ptr SimG4GflashSamplingCalo::parametrisation() { G4NistManager* nist = G4NistManager::Instance(); diff --git a/SimG4Fast/src/components/SimG4GflashSamplingCalo.h b/SimG4Fast/src/components/SimG4GflashSamplingCalo.h index 6bb1adc..11bf428 100644 --- a/SimG4Fast/src/components/SimG4GflashSamplingCalo.h +++ b/SimG4Fast/src/components/SimG4GflashSamplingCalo.h @@ -2,7 +2,7 @@ #define SIMG4FAST_SIMG4GFLASHSAMPLINGCALO_H // Gaudi -#include "GaudiAlg/GaudiTool.h" +#include "GaudiKernel/AlgTool.h" // FCCSW #include "SimG4Interface/ISimG4GflashTool.h" @@ -18,7 +18,7 @@ * @author Anna Zaborowska */ -class SimG4GflashSamplingCalo : public GaudiTool, virtual public ISimG4GflashTool { +class SimG4GflashSamplingCalo : public AlgTool, virtual public ISimG4GflashTool { public: explicit SimG4GflashSamplingCalo(const std::string& type, const std::string& name, const IInterface* parent); virtual ~SimG4GflashSamplingCalo(); diff --git a/SimG4Fast/src/components/SimG4ParticleSmearFormula.cpp b/SimG4Fast/src/components/SimG4ParticleSmearFormula.cpp index 77199f2..2485a6b 100644 --- a/SimG4Fast/src/components/SimG4ParticleSmearFormula.cpp +++ b/SimG4Fast/src/components/SimG4ParticleSmearFormula.cpp @@ -15,14 +15,14 @@ DECLARE_COMPONENT(SimG4ParticleSmearFormula) SimG4ParticleSmearFormula::SimG4ParticleSmearFormula(const std::string& type, const std::string& name, const IInterface* parent) - : GaudiTool(type, name, parent), m_resolutionMomentum() { + : AlgTool(type, name, parent), m_resolutionMomentum() { declareInterface(this); } SimG4ParticleSmearFormula::~SimG4ParticleSmearFormula() {} StatusCode SimG4ParticleSmearFormula::initialize() { - if (GaudiTool::initialize().isFailure()) { + if (AlgTool::initialize().isFailure()) { return StatusCode::FAILURE; } m_randSvc = service("RndmGenSvc"); @@ -39,7 +39,7 @@ StatusCode SimG4ParticleSmearFormula::initialize() { return StatusCode::SUCCESS; } -StatusCode SimG4ParticleSmearFormula::finalize() { return GaudiTool::finalize(); } +StatusCode SimG4ParticleSmearFormula::finalize() { return AlgTool::finalize(); } StatusCode SimG4ParticleSmearFormula::smearMomentum(CLHEP::Hep3Vector& aMom, int /*aPdg*/) { if (!m_resolutionMomentum.IsValid()) { diff --git a/SimG4Fast/src/components/SimG4ParticleSmearFormula.h b/SimG4Fast/src/components/SimG4ParticleSmearFormula.h index e39d344..17c0ba9 100644 --- a/SimG4Fast/src/components/SimG4ParticleSmearFormula.h +++ b/SimG4Fast/src/components/SimG4ParticleSmearFormula.h @@ -2,7 +2,7 @@ #define SIMG4FAST_G4PARTICLESMEARFORMULA_H // Gaudi -#include "GaudiAlg/GaudiTool.h" +#include "GaudiKernel/AlgTool.h" #include "GaudiKernel/RndmGenerators.h" class IRndmGenSvc; class IRndmGen; @@ -23,7 +23,7 @@ class IRndmGen; * @author Anna Zaborowska */ -class SimG4ParticleSmearFormula : public GaudiTool, virtual public ISimG4ParticleSmearTool { +class SimG4ParticleSmearFormula : public AlgTool, virtual public ISimG4ParticleSmearTool { public: explicit SimG4ParticleSmearFormula(const std::string& type, const std::string& name, const IInterface* parent); virtual ~SimG4ParticleSmearFormula(); diff --git a/SimG4Fast/src/components/SimG4ParticleSmearRootFile.cpp b/SimG4Fast/src/components/SimG4ParticleSmearRootFile.cpp index 148736e..1b6c44c 100644 --- a/SimG4Fast/src/components/SimG4ParticleSmearRootFile.cpp +++ b/SimG4Fast/src/components/SimG4ParticleSmearRootFile.cpp @@ -19,14 +19,14 @@ DECLARE_COMPONENT(SimG4ParticleSmearRootFile) SimG4ParticleSmearRootFile::SimG4ParticleSmearRootFile(const std::string& type, const std::string& name, const IInterface* parent) - : GaudiTool(type, name, parent) { + : AlgTool(type, name, parent) { declareInterface(this); } SimG4ParticleSmearRootFile::~SimG4ParticleSmearRootFile() {} StatusCode SimG4ParticleSmearRootFile::initialize() { - if (GaudiTool::initialize().isFailure()) { + if (AlgTool::initialize().isFailure()) { return StatusCode::FAILURE; } m_randSvc = service("RndmGenSvc"); @@ -41,7 +41,7 @@ StatusCode SimG4ParticleSmearRootFile::initialize() { return StatusCode::SUCCESS; } -StatusCode SimG4ParticleSmearRootFile::finalize() { return GaudiTool::finalize(); } +StatusCode SimG4ParticleSmearRootFile::finalize() { return AlgTool::finalize(); } StatusCode SimG4ParticleSmearRootFile::smearMomentum(CLHEP::Hep3Vector& aMom, int /*aPdg*/) { double res = resolution(aMom.pseudoRapidity(), aMom.mag() / CLHEP::GeV); diff --git a/SimG4Fast/src/components/SimG4ParticleSmearRootFile.h b/SimG4Fast/src/components/SimG4ParticleSmearRootFile.h index eafb6c9..336656f 100644 --- a/SimG4Fast/src/components/SimG4ParticleSmearRootFile.h +++ b/SimG4Fast/src/components/SimG4ParticleSmearRootFile.h @@ -2,7 +2,7 @@ #define SIMG4FAST_G4PARTICLESMEARROOTFILE_H // Gaudi -#include "GaudiAlg/GaudiTool.h" +#include "GaudiKernel/AlgTool.h" #include "GaudiKernel/RndmGenerators.h" class IRndmGenSvc; class IRndmGen; @@ -28,7 +28,7 @@ class IRndmGen; * @author Anna Zaborowska */ -class SimG4ParticleSmearRootFile : public GaudiTool, virtual public ISimG4ParticleSmearTool { +class SimG4ParticleSmearRootFile : public AlgTool, virtual public ISimG4ParticleSmearTool { public: explicit SimG4ParticleSmearRootFile(const std::string& type, const std::string& name, const IInterface* parent); virtual ~SimG4ParticleSmearRootFile(); diff --git a/SimG4Fast/src/components/SimG4ParticleSmearSimple.cpp b/SimG4Fast/src/components/SimG4ParticleSmearSimple.cpp index bb1fee4..1a5a616 100644 --- a/SimG4Fast/src/components/SimG4ParticleSmearSimple.cpp +++ b/SimG4Fast/src/components/SimG4ParticleSmearSimple.cpp @@ -11,14 +11,14 @@ DECLARE_COMPONENT(SimG4ParticleSmearSimple) SimG4ParticleSmearSimple::SimG4ParticleSmearSimple(const std::string& type, const std::string& name, const IInterface* parent) - : GaudiTool(type, name, parent) { + : AlgTool(type, name, parent) { declareInterface(this); } SimG4ParticleSmearSimple::~SimG4ParticleSmearSimple() {} StatusCode SimG4ParticleSmearSimple::initialize() { - if (GaudiTool::initialize().isFailure()) { + if (AlgTool::initialize().isFailure()) { return StatusCode::FAILURE; } if (service("RndmGenSvc", m_randSvc).isFailure()) { @@ -30,7 +30,7 @@ StatusCode SimG4ParticleSmearSimple::initialize() { return StatusCode::SUCCESS; } -StatusCode SimG4ParticleSmearSimple::finalize() { return GaudiTool::finalize(); } +StatusCode SimG4ParticleSmearSimple::finalize() { return AlgTool::finalize(); } StatusCode SimG4ParticleSmearSimple::smearMomentum(CLHEP::Hep3Vector& aMom, int /*aPdg*/) { double tmp = m_gauss.shoot(); diff --git a/SimG4Fast/src/components/SimG4ParticleSmearSimple.h b/SimG4Fast/src/components/SimG4ParticleSmearSimple.h index 5f6e522..5b2850e 100644 --- a/SimG4Fast/src/components/SimG4ParticleSmearSimple.h +++ b/SimG4Fast/src/components/SimG4ParticleSmearSimple.h @@ -2,7 +2,7 @@ #define SIMG4FAST_G4PARTICLESMEARSIMPLE_H // Gaudi -#include "GaudiAlg/GaudiTool.h" +#include "GaudiKernel/AlgTool.h" #include "GaudiKernel/RndmGenerators.h" class IRndmGenSvc; @@ -19,7 +19,7 @@ class IRndmGenSvc; * @author Anna Zaborowska */ -class SimG4ParticleSmearSimple : public GaudiTool, virtual public ISimG4ParticleSmearTool { +class SimG4ParticleSmearSimple : public AlgTool, virtual public ISimG4ParticleSmearTool { public: explicit SimG4ParticleSmearSimple(const std::string& type, const std::string& name, const IInterface* parent); virtual ~SimG4ParticleSmearSimple(); diff --git a/SimG4Full/CMakeLists.txt b/SimG4Full/CMakeLists.txt index 6e04ce3..3f5dbfe 100644 --- a/SimG4Full/CMakeLists.txt +++ b/SimG4Full/CMakeLists.txt @@ -5,7 +5,7 @@ file(GLOB _lib_sources src/lib/*.cpp) gaudi_add_library(SimG4Full SOURCES ${_lib_sources} - LINK SimG4Common SimG4Interface Gaudi::GaudiAlgLib k4FWCore::k4FWCore EDM4HEP::edm4hep) + LINK SimG4Common SimG4Interface k4FWCore::k4FWCore EDM4HEP::edm4hep) #target_include_directories(SimG4Full PUBLIC ${Geant4_INCLUDE_DIRS} # $ @@ -14,4 +14,4 @@ gaudi_add_library(SimG4Full file(GLOB _module_sources src/components/*.cpp) gaudi_add_module(SimG4FullPlugins SOURCES ${_module_sources} - LINK SimG4Full SimG4Common SimG4Interface Gaudi::GaudiAlgLib k4FWCore::k4FWCore EDM4HEP::edm4hep) + LINK SimG4Full SimG4Common SimG4Interface k4FWCore::k4FWCore EDM4HEP::edm4hep) diff --git a/SimG4Full/src/components/SimG4FullSimDCHRegion.cpp b/SimG4Full/src/components/SimG4FullSimDCHRegion.cpp index b40bf06..27ab467 100644 --- a/SimG4Full/src/components/SimG4FullSimDCHRegion.cpp +++ b/SimG4Full/src/components/SimG4FullSimDCHRegion.cpp @@ -13,7 +13,7 @@ DECLARE_COMPONENT(SimG4FullSimDCHRegion) SimG4FullSimDCHRegion::SimG4FullSimDCHRegion(const std::string& type, const std::string& name, const IInterface* parent) - : GaudiTool(type, name, parent) { + : AlgTool(type, name, parent) { declareInterface(this); } @@ -25,7 +25,7 @@ SimG4FullSimDCHRegion::~SimG4FullSimDCHRegion() StatusCode SimG4FullSimDCHRegion::initialize() { std::cout << "nalipourTest: SimG4FullSimDCHRegion ---> initialize" << std::endl; - if (GaudiTool::initialize().isFailure()) { + if (AlgTool::initialize().isFailure()) { return StatusCode::FAILURE; } if (m_volumeNames.size() == 0) { @@ -42,7 +42,7 @@ StatusCode SimG4FullSimDCHRegion::initialize() { StatusCode SimG4FullSimDCHRegion::finalize() { std::cout << "nalipourTest: SimG4FullSimDCHRegion ---> finalize" << std::endl; - return GaudiTool::finalize(); + return AlgTool::finalize(); } StatusCode SimG4FullSimDCHRegion::create() { diff --git a/SimG4Full/src/components/SimG4FullSimDCHRegion.h b/SimG4Full/src/components/SimG4FullSimDCHRegion.h index c4bb4b3..bcbea3d 100644 --- a/SimG4Full/src/components/SimG4FullSimDCHRegion.h +++ b/SimG4Full/src/components/SimG4FullSimDCHRegion.h @@ -2,7 +2,7 @@ #define SIMG4FAST_SIMG4FULLSIMDCHREGION_H // Gaudi -#include "GaudiAlg/GaudiTool.h" +#include "GaudiKernel/AlgTool.h" #include "GaudiKernel/ToolHandle.h" // FCCSW @@ -25,7 +25,7 @@ class G4Region; * @author nalipour */ -class SimG4FullSimDCHRegion : public GaudiTool, virtual public ISimG4RegionTool { +class SimG4FullSimDCHRegion : public AlgTool, virtual public ISimG4RegionTool { public: explicit SimG4FullSimDCHRegion(const std::string& type, const std::string& name, const IInterface* parent); virtual ~SimG4FullSimDCHRegion(); diff --git a/SimG4Full/src/components/SimG4UserLimitRegion.cpp b/SimG4Full/src/components/SimG4UserLimitRegion.cpp index 6441146..991d724 100644 --- a/SimG4Full/src/components/SimG4UserLimitRegion.cpp +++ b/SimG4Full/src/components/SimG4UserLimitRegion.cpp @@ -10,7 +10,7 @@ DECLARE_COMPONENT(SimG4UserLimitRegion) SimG4UserLimitRegion::SimG4UserLimitRegion(const std::string& type, const std::string& name, const IInterface* parent) - : GaudiTool(type, name, parent) { + : AlgTool(type, name, parent) { declareInterface(this); } @@ -18,7 +18,7 @@ SimG4UserLimitRegion::~SimG4UserLimitRegion() {} StatusCode SimG4UserLimitRegion::initialize() { - if (GaudiTool::initialize().isFailure()) { + if (AlgTool::initialize().isFailure()) { return StatusCode::FAILURE; } if (m_volumeNames.size() == 0) { @@ -28,7 +28,7 @@ StatusCode SimG4UserLimitRegion::initialize() { return StatusCode::SUCCESS; } -StatusCode SimG4UserLimitRegion::finalize() { return GaudiTool::finalize(); } +StatusCode SimG4UserLimitRegion::finalize() { return AlgTool::finalize(); } StatusCode SimG4UserLimitRegion::create() { G4LogicalVolume* world = diff --git a/SimG4Full/src/components/SimG4UserLimitRegion.h b/SimG4Full/src/components/SimG4UserLimitRegion.h index c519aa7..d1d3ccd 100644 --- a/SimG4Full/src/components/SimG4UserLimitRegion.h +++ b/SimG4Full/src/components/SimG4UserLimitRegion.h @@ -4,7 +4,7 @@ #include // Gaudi -#include "GaudiAlg/GaudiTool.h" +#include "GaudiKernel/AlgTool.h" #include "GaudiKernel/ToolHandle.h" // FCCSW @@ -23,7 +23,7 @@ class G4Region; * @author Anna Zaborowska */ -class SimG4UserLimitRegion : public GaudiTool, virtual public ISimG4RegionTool { +class SimG4UserLimitRegion : public AlgTool, virtual public ISimG4RegionTool { public: explicit SimG4UserLimitRegion(const std::string& type, const std::string& name, const IInterface* parent); virtual ~SimG4UserLimitRegion(); From 85b5ce38ccd87b625580f5717ed6f0b347b4679d Mon Sep 17 00:00:00 2001 From: jmcarcell Date: Sat, 27 Jul 2024 16:07:11 +0200 Subject: [PATCH 2/2] Remove ctx for consistency with all the other definitions --- Detector/DetComponents/src/MergeCells.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Detector/DetComponents/src/MergeCells.h b/Detector/DetComponents/src/MergeCells.h index 695ed76..8bf1288 100644 --- a/Detector/DetComponents/src/MergeCells.h +++ b/Detector/DetComponents/src/MergeCells.h @@ -42,7 +42,7 @@ class MergeCells : public Gaudi::Algorithm { /** Execute. * @return status code */ - virtual StatusCode execute(const EventContext& ctx) const final; + virtual StatusCode execute(const EventContext&) const final; /** Finalize. * @return status code