From c78aa79a14be633436d7f45de616db1f2b839cfa Mon Sep 17 00:00:00 2001 From: jmcarcell Date: Sat, 27 Jul 2024 16:21:45 +0200 Subject: [PATCH 1/3] Do not use GaudiAlg - Change headers and add EventContext in algorithms not to use GaudiAlg - Replace `GaudiTool` with `AlgTool` --- RecCalorimeter/CMakeLists.txt | 1 - .../src/components/CalibrateBenchmarkMethod.cpp | 8 ++++---- .../src/components/CalibrateBenchmarkMethod.h | 12 ++++++------ RecCalorimeter/src/components/CaloTopoCluster.cpp | 8 ++++---- RecCalorimeter/src/components/CaloTopoCluster.h | 10 +++++----- .../src/components/CaloTopoClusterInputTool.h | 14 +++++++------- RecCalorimeter/src/components/CaloTowerTool.h | 14 +++++++------- RecCalorimeter/src/components/ConeSelection.cpp | 8 ++++---- RecCalorimeter/src/components/ConeSelection.h | 12 ++++++------ .../src/components/CorrectCaloClusters.cpp | 8 ++++---- .../src/components/CorrectCaloClusters.h | 12 ++++++------ .../components/CorrectECalBarrelSliWinCluster.cpp | 8 ++++---- .../components/CorrectECalBarrelSliWinCluster.h | 14 +++++++------- RecCalorimeter/src/components/CreateCaloCells.cpp | 8 ++++---- RecCalorimeter/src/components/CreateCaloCells.h | 10 +++++----- .../src/components/CreateCaloCellsNoise.cpp | 8 ++++---- .../src/components/CreateCaloCellsNoise.h | 10 +++++----- .../src/components/CreateCaloClusters.cpp | 8 ++++---- RecCalorimeter/src/components/CreateCaloClusters.h | 12 ++++++------ .../components/CreateCaloClustersSlidingWindow.cpp | 8 ++++---- .../components/CreateCaloClustersSlidingWindow.h | 10 +++++----- .../components/CreateEmptyCaloCellsCollection.cpp | 8 ++++---- .../components/CreateEmptyCaloCellsCollection.h | 8 ++++---- .../src/components/LayeredCaloTowerTool.h | 2 +- RecCalorimeter/src/components/MassInv.cpp | 8 ++++---- RecCalorimeter/src/components/MassInv.h | 12 ++++++------ RecCalorimeter/src/components/PreparePileup.cpp | 8 ++++---- RecCalorimeter/src/components/PreparePileup.h | 8 ++++---- RecCalorimeter/src/components/SplitClusters.cpp | 8 ++++---- RecCalorimeter/src/components/SplitClusters.h | 12 ++++++------ RecFCCeeCalorimeter/CMakeLists.txt | 1 - .../src/components/CaloTopoClusterFCCee.cpp | 8 ++++---- .../src/components/CaloTopoClusterFCCee.h | 10 +++++----- .../src/components/CaloTowerToolFCCee.h | 14 +++++++------- .../components/CreateCaloCellPositionsFCCee.cpp | 8 ++++---- .../src/components/CreateCaloCellPositionsFCCee.h | 10 +++++----- .../CreateCaloClustersSlidingWindowFCCee.cpp | 8 ++++---- .../CreateCaloClustersSlidingWindowFCCee.h | 10 +++++----- RecFCChhCalorimeter/CMakeLists.txt | 1 - .../src/components/CreateCaloCellPositions.cpp | 8 ++++---- .../src/components/CreateCaloCellPositions.h | 10 +++++----- .../src/components/CreateCellPositions.cpp | 8 ++++---- .../src/components/CreateCellPositions.h | 10 +++++----- 43 files changed, 190 insertions(+), 193 deletions(-) diff --git a/RecCalorimeter/CMakeLists.txt b/RecCalorimeter/CMakeLists.txt index e67e2e9b..f488d18c 100644 --- a/RecCalorimeter/CMakeLists.txt +++ b/RecCalorimeter/CMakeLists.txt @@ -8,7 +8,6 @@ gaudi_add_module(k4RecCalorimeterPlugins SOURCES ${_module_sources} LINK k4FWCore::k4FWCore k4FWCore::k4Interface - Gaudi::GaudiAlgLib Gaudi::GaudiKernel DD4hep::DDCore DD4hep::DDG4 diff --git a/RecCalorimeter/src/components/CalibrateBenchmarkMethod.cpp b/RecCalorimeter/src/components/CalibrateBenchmarkMethod.cpp index 52698d3e..97ad7e70 100644 --- a/RecCalorimeter/src/components/CalibrateBenchmarkMethod.cpp +++ b/RecCalorimeter/src/components/CalibrateBenchmarkMethod.cpp @@ -26,7 +26,7 @@ DECLARE_COMPONENT(CalibrateBenchmarkMethod) CalibrateBenchmarkMethod::CalibrateBenchmarkMethod(const std::string& aName, ISvcLocator* aSvcLoc) - : GaudiAlgorithm(aName, aSvcLoc), + : Gaudi::Algorithm(aName, aSvcLoc), m_geoSvc("GeoSvc", aName), m_histSvc("THistSvc", aName), m_totalEnergyECal(nullptr), @@ -43,7 +43,7 @@ CalibrateBenchmarkMethod::~CalibrateBenchmarkMethod() {} StatusCode CalibrateBenchmarkMethod::initialize() { - if (GaudiAlgorithm::initialize().isFailure()) return StatusCode::FAILURE; + if (Gaudi::Algorithm::initialize().isFailure()) return StatusCode::FAILURE; // Check geometry service if (!m_geoSvc) { @@ -102,7 +102,7 @@ StatusCode CalibrateBenchmarkMethod::initialize() { } -StatusCode CalibrateBenchmarkMethod::execute() { +StatusCode CalibrateBenchmarkMethod::execute(const EventContext&) const { double totalEnergyInECal = 0.; double totalEnergyInHCal = 0.; double energyInFirstLayerECal = 0; @@ -253,7 +253,7 @@ StatusCode CalibrateBenchmarkMethod::finalize() { runMinimization(n_param, variable, steps, m_fixedParameters); - return GaudiAlgorithm::finalize(); + return Gaudi::Algorithm::finalize(); } void CalibrateBenchmarkMethod::registerHistogram(const std::string& path, TH1F*& histogramName) { diff --git a/RecCalorimeter/src/components/CalibrateBenchmarkMethod.h b/RecCalorimeter/src/components/CalibrateBenchmarkMethod.h index 8512efec..47f607f9 100644 --- a/RecCalorimeter/src/components/CalibrateBenchmarkMethod.h +++ b/RecCalorimeter/src/components/CalibrateBenchmarkMethod.h @@ -2,7 +2,7 @@ #define RECCALORIMETER_CALIBRATEBENCHMARKMETHOD_H // GAUDI -#include "GaudiAlg/GaudiAlgorithm.h" +#include "Gaudi/Algorithm.h" // Key4HEP #include "k4FWCore/DataHandle.h" @@ -39,7 +39,7 @@ class ITHistSvc; * @author Michaela Mlynarikova */ -class CalibrateBenchmarkMethod : public GaudiAlgorithm { +class CalibrateBenchmarkMethod : public Gaudi::Algorithm { public: explicit CalibrateBenchmarkMethod(const std::string&, ISvcLocator*); virtual ~CalibrateBenchmarkMethod(); @@ -50,7 +50,7 @@ class CalibrateBenchmarkMethod : public GaudiAlgorithm { /** Fills the histograms. * @return status code */ - virtual StatusCode execute() final; + virtual StatusCode execute(const EventContext&) const final; /** Finalize. * @return status code */ @@ -68,9 +68,9 @@ class CalibrateBenchmarkMethod : public GaudiAlgorithm { void runMinimization(int n_param, const std::vector& variable, const std::vector& steps, const std::vector& fixedParameters) const; /// Handle for electromagnetic barrel cells (input collection) - DataHandle m_ecalBarrelCells{"ecalBarrelCells", Gaudi::DataHandle::Reader, this}; + mutable DataHandle m_ecalBarrelCells{"ecalBarrelCells", Gaudi::DataHandle::Reader, this}; /// Handle for hadronic barrel cells (input collection) - DataHandle m_hcalBarrelCells{"hcalBarrelCells", Gaudi::DataHandle::Reader, this}; + mutable DataHandle m_hcalBarrelCells{"hcalBarrelCells", Gaudi::DataHandle::Reader, this}; /// Histogram of total deposited energy in the calorimeters TH1F* m_totalEnergyECal; @@ -116,4 +116,4 @@ class CalibrateBenchmarkMethod : public GaudiAlgorithm { Gaudi::Property> m_fixedParameters = {this, "fixedParameters", {1,5},"Fixed parameters that will not be minimized"}; }; -#endif /* RECCALORIMETER_CALIBRATEBENCHMARKMETHOD_H */ \ No newline at end of file +#endif /* RECCALORIMETER_CALIBRATEBENCHMARKMETHOD_H */ diff --git a/RecCalorimeter/src/components/CaloTopoCluster.cpp b/RecCalorimeter/src/components/CaloTopoCluster.cpp index d8e96a53..d2ef6bee 100644 --- a/RecCalorimeter/src/components/CaloTopoCluster.cpp +++ b/RecCalorimeter/src/components/CaloTopoCluster.cpp @@ -27,7 +27,7 @@ DECLARE_COMPONENT(CaloTopoCluster) -CaloTopoCluster::CaloTopoCluster(const std::string& name, ISvcLocator* svcLoc) : GaudiAlgorithm(name, svcLoc) { +CaloTopoCluster::CaloTopoCluster(const std::string& name, ISvcLocator* svcLoc) : Gaudi::Algorithm(name, svcLoc) { declareProperty("TopoClusterInput", m_inputTool, "Handle for input map of cells"); declareProperty("noiseTool", m_noiseTool, "Handle for the cells noise tool"); declareProperty("neigboursTool", m_neighboursTool, "Handle for tool to retrieve cell neighbours"); @@ -47,7 +47,7 @@ CaloTopoCluster::CaloTopoCluster(const std::string& name, ISvcLocator* svcLoc) : declareProperty("clusterCells", m_clusterCellsCollection, "Handle for clusters (output collection)"); } StatusCode CaloTopoCluster::initialize() { - if (GaudiAlgorithm::initialize().isFailure()) return StatusCode::FAILURE; + if (Gaudi::Algorithm::initialize().isFailure()) return StatusCode::FAILURE; m_geoSvc = service("GeoSvc"); if (!m_geoSvc) { error() << "Unable to locate Geometry Service. " @@ -82,7 +82,7 @@ StatusCode CaloTopoCluster::initialize() { return StatusCode::SUCCESS; } -StatusCode CaloTopoCluster::execute() { +StatusCode CaloTopoCluster::execute(const EventContext&) const { std::unordered_map allCells; std::vector> firstSeeds; @@ -396,4 +396,4 @@ CaloTopoCluster::searchForNeighbours(const uint64_t aCellId, return addedNeighbourIds; } -StatusCode CaloTopoCluster::finalize() { return GaudiAlgorithm::finalize(); } +StatusCode CaloTopoCluster::finalize() { return Gaudi::Algorithm::finalize(); } diff --git a/RecCalorimeter/src/components/CaloTopoCluster.h b/RecCalorimeter/src/components/CaloTopoCluster.h index d4d8a930..3143c5ee 100644 --- a/RecCalorimeter/src/components/CaloTopoCluster.h +++ b/RecCalorimeter/src/components/CaloTopoCluster.h @@ -2,7 +2,7 @@ #define RECCALORIMETER_CALOTOPOCLUSTER_H // Gaudi -#include "GaudiAlg/GaudiAlgorithm.h" +#include "Gaudi/Algorithm.h" #include "GaudiKernel/ToolHandle.h" // k4FWCore @@ -42,7 +42,7 @@ class Segmentation; * @author Coralie Neubueser */ -class CaloTopoCluster : public GaudiAlgorithm { +class CaloTopoCluster : public Gaudi::Algorithm { public: CaloTopoCluster(const std::string& name, ISvcLocator* svcLoc); @@ -88,15 +88,15 @@ class CaloTopoCluster : public GaudiAlgorithm { std::map>>& aPreClusterCollection, bool aAllowClusterMerge); - StatusCode execute(); + StatusCode execute(const EventContext&) const; StatusCode finalize(); private: // Cluster collection - DataHandle m_clusterCollection{"calo/clusters", Gaudi::DataHandle::Writer, this}; + mutable DataHandle m_clusterCollection{"calo/clusters", Gaudi::DataHandle::Writer, this}; // Cluster cells in collection - DataHandle m_clusterCellsCollection{"calo/clusterCells", Gaudi::DataHandle::Writer, this}; + mutable DataHandle m_clusterCellsCollection{"calo/clusterCells", Gaudi::DataHandle::Writer, this}; /// Pointer to the geometry service SmartIF m_geoSvc; /// Handle for the input tool diff --git a/RecCalorimeter/src/components/CaloTopoClusterInputTool.h b/RecCalorimeter/src/components/CaloTopoClusterInputTool.h index c67b91c3..38a47276 100644 --- a/RecCalorimeter/src/components/CaloTopoClusterInputTool.h +++ b/RecCalorimeter/src/components/CaloTopoClusterInputTool.h @@ -55,19 +55,19 @@ class CaloTopoClusterInputTool : public GaudiTool, virtual public ITopoClusterIn private: /// Handle for electromagnetic barrel cells (input collection) - DataHandle m_ecalBarrelCells{"ecalBarrelCells", Gaudi::DataHandle::Reader, this}; + mutable DataHandle m_ecalBarrelCells{"ecalBarrelCells", Gaudi::DataHandle::Reader, this}; /// Handle for ecal endcap calorimeter cells (input collection) - DataHandle m_ecalEndcapCells{"ecalEndcapCells", Gaudi::DataHandle::Reader, this}; + mutable DataHandle m_ecalEndcapCells{"ecalEndcapCells", Gaudi::DataHandle::Reader, this}; /// Handle for ecal forward calorimeter cells (input collection) - DataHandle m_ecalFwdCells{"ecalFwdCells", Gaudi::DataHandle::Reader, this}; + mutable DataHandle m_ecalFwdCells{"ecalFwdCells", Gaudi::DataHandle::Reader, this}; /// Handle for hadronic barrel cells (input collection) - DataHandle m_hcalBarrelCells{"hcalBarrelCells", Gaudi::DataHandle::Reader, this}; + mutable DataHandle m_hcalBarrelCells{"hcalBarrelCells", Gaudi::DataHandle::Reader, this}; /// Handle for hadronic extended barrel cells (input collection) - DataHandle m_hcalExtBarrelCells{"hcalExtBarrelCells", Gaudi::DataHandle::Reader, this}; + mutable DataHandle m_hcalExtBarrelCells{"hcalExtBarrelCells", Gaudi::DataHandle::Reader, this}; /// Handle for hcal endcap calorimeter cells (input collection) - DataHandle m_hcalEndcapCells{"hcalEndcapCells", Gaudi::DataHandle::Reader, this}; + mutable DataHandle m_hcalEndcapCells{"hcalEndcapCells", Gaudi::DataHandle::Reader, this}; /// Handle for hcal forward calorimeter cells (input collection) - DataHandle m_hcalFwdCells{"hcalFwdCells", Gaudi::DataHandle::Reader, this}; + mutable DataHandle m_hcalFwdCells{"hcalFwdCells", Gaudi::DataHandle::Reader, this}; /// Pointer to the geometry service SmartIF m_geoSvc; /// Name of the electromagnetic barrel readout diff --git a/RecCalorimeter/src/components/CaloTowerTool.h b/RecCalorimeter/src/components/CaloTowerTool.h index 815bf6cc..605a32ca 100644 --- a/RecCalorimeter/src/components/CaloTowerTool.h +++ b/RecCalorimeter/src/components/CaloTowerTool.h @@ -138,19 +138,19 @@ class CaloTowerTool : public GaudiTool, virtual public ITowerTool { std::pair retrievePhiEtaExtrema(dd4hep::DDSegmentation::Segmentation* aSegmentation, SegmentationType aType); std::pair retrieveSegmentation(std::string aReadoutName); /// Handle for electromagnetic barrel cells (input collection) - DataHandle m_ecalBarrelCells{"ecalBarrelCells", Gaudi::DataHandle::Reader, this}; + mutable DataHandle m_ecalBarrelCells{"ecalBarrelCells", Gaudi::DataHandle::Reader, this}; /// Handle for ecal endcap calorimeter cells (input collection) - DataHandle m_ecalEndcapCells{"ecalEndcapCells", Gaudi::DataHandle::Reader, this}; + mutable DataHandle m_ecalEndcapCells{"ecalEndcapCells", Gaudi::DataHandle::Reader, this}; /// Handle for ecal forward calorimeter cells (input collection) - DataHandle m_ecalFwdCells{"ecalFwdCells", Gaudi::DataHandle::Reader, this}; + mutable DataHandle m_ecalFwdCells{"ecalFwdCells", Gaudi::DataHandle::Reader, this}; /// Handle for hadronic barrel cells (input collection) - DataHandle m_hcalBarrelCells{"hcalBarrelCells", Gaudi::DataHandle::Reader, this}; + mutable DataHandle m_hcalBarrelCells{"hcalBarrelCells", Gaudi::DataHandle::Reader, this}; /// Handle for hadronic extended barrel cells (input collection) - DataHandle m_hcalExtBarrelCells{"hcalExtBarrelCells", Gaudi::DataHandle::Reader, this}; + mutable DataHandle m_hcalExtBarrelCells{"hcalExtBarrelCells", Gaudi::DataHandle::Reader, this}; /// Handle for hcal endcap calorimeter cells (input collection) - DataHandle m_hcalEndcapCells{"hcalEndcapCells", Gaudi::DataHandle::Reader, this}; + mutable DataHandle m_hcalEndcapCells{"hcalEndcapCells", Gaudi::DataHandle::Reader, this}; /// Handle for hcal forward calorimeter cells (input collection) - DataHandle m_hcalFwdCells{"hcalFwdCells", Gaudi::DataHandle::Reader, this}; + mutable DataHandle m_hcalFwdCells{"hcalFwdCells", Gaudi::DataHandle::Reader, this}; /// Pointer to the geometry service ServiceHandle m_geoSvc; /// Name of the electromagnetic barrel readout diff --git a/RecCalorimeter/src/components/ConeSelection.cpp b/RecCalorimeter/src/components/ConeSelection.cpp index ad7a28fb..c2a940cf 100644 --- a/RecCalorimeter/src/components/ConeSelection.cpp +++ b/RecCalorimeter/src/components/ConeSelection.cpp @@ -18,7 +18,7 @@ DECLARE_COMPONENT(ConeSelection) -ConeSelection::ConeSelection(const std::string& name, ISvcLocator* svcLoc) : GaudiAlgorithm(name, svcLoc) { +ConeSelection::ConeSelection(const std::string& name, ISvcLocator* svcLoc) : Gaudi::Algorithm(name, svcLoc) { declareProperty("cells", m_cells, "The cells (input)"); declareProperty("particles", m_particles, "The geant particles (input)"); declareProperty("selCells", m_selCells, "The selected cells (output)"); @@ -36,13 +36,13 @@ StatusCode ConeSelection::initialize() { info() << "ConeSelection initialized" << endmsg; debug() << "Cone radius: " << m_r << endmsg; - StatusCode sc = GaudiAlgorithm::initialize(); + StatusCode sc = Gaudi::Algorithm::initialize(); if (sc.isFailure()) return sc; return StatusCode::SUCCESS; } -StatusCode ConeSelection::execute() { +StatusCode ConeSelection::execute(const EventContext&) const { m_cellsMap.clear(); @@ -89,4 +89,4 @@ StatusCode ConeSelection::execute() { return StatusCode::SUCCESS; } -StatusCode ConeSelection::finalize() { return GaudiAlgorithm::finalize(); } +StatusCode ConeSelection::finalize() { return Gaudi::Algorithm::finalize(); } diff --git a/RecCalorimeter/src/components/ConeSelection.h b/RecCalorimeter/src/components/ConeSelection.h index 56fd6acc..becd0e5f 100644 --- a/RecCalorimeter/src/components/ConeSelection.h +++ b/RecCalorimeter/src/components/ConeSelection.h @@ -2,7 +2,7 @@ #define RECCALORIMETER_CONESELECTION_H // Gaudi -#include "GaudiAlg/GaudiAlgorithm.h" +#include "Gaudi/Algorithm.h" // Key4HEP #include "k4FWCore/DataHandle.h" @@ -24,14 +24,14 @@ class IGeoSvc; * */ -class ConeSelection : public GaudiAlgorithm { +class ConeSelection : public Gaudi::Algorithm { public: ConeSelection(const std::string& name, ISvcLocator* svcLoc); StatusCode initialize(); - StatusCode execute(); + StatusCode execute(const EventContext&) const; StatusCode finalize(); @@ -40,11 +40,11 @@ class ConeSelection : public GaudiAlgorithm { ToolHandle m_cellPositionsTool{"CellPositionsTool", this}; /// Handle for calo hits (input collection) - DataHandle m_cells{"cells", Gaudi::DataHandle::Reader, this}; + mutable DataHandle m_cells{"cells", Gaudi::DataHandle::Reader, this}; /// Handle for calo hits (input collection) - DataHandle m_particles{"particles", Gaudi::DataHandle::Reader, this}; + mutable DataHandle m_particles{"particles", Gaudi::DataHandle::Reader, this}; /// Handle for calo cells (output collection) - DataHandle m_selCells{"selCells", Gaudi::DataHandle::Writer, this}; + mutable DataHandle m_selCells{"selCells", Gaudi::DataHandle::Writer, this}; /// Map of cell IDs (corresponding to DD4hep IDs) and energy std::unordered_map m_cellsMap; diff --git a/RecCalorimeter/src/components/CorrectCaloClusters.cpp b/RecCalorimeter/src/components/CorrectCaloClusters.cpp index 5552e47c..5ad7ed87 100644 --- a/RecCalorimeter/src/components/CorrectCaloClusters.cpp +++ b/RecCalorimeter/src/components/CorrectCaloClusters.cpp @@ -33,7 +33,7 @@ DECLARE_COMPONENT(CorrectCaloClusters) CorrectCaloClusters::CorrectCaloClusters(const std::string& name, ISvcLocator* svcLoc) - : GaudiAlgorithm(name, svcLoc), + : Gaudi::Algorithm(name, svcLoc), m_geoSvc("GeoSvc", "CorrectCaloClusters") { declareProperty("inClusters", m_inClusters, "Input cluster collection"); @@ -43,7 +43,7 @@ CorrectCaloClusters::CorrectCaloClusters(const std::string& name, StatusCode CorrectCaloClusters::initialize() { { - StatusCode sc = GaudiAlgorithm::initialize(); + StatusCode sc = Gaudi::Algorithm::initialize(); if (sc.isFailure()) { return sc; } @@ -215,7 +215,7 @@ StatusCode CorrectCaloClusters::initialize() { } -StatusCode CorrectCaloClusters::execute() { +StatusCode CorrectCaloClusters::execute(const EventContext&) const { verbose() << "-------------------------------------------" << endmsg; // Get the input collection with clusters @@ -276,7 +276,7 @@ StatusCode CorrectCaloClusters::execute() { StatusCode CorrectCaloClusters::finalize() { - return GaudiAlgorithm::finalize(); + return Gaudi::Algorithm::finalize(); } diff --git a/RecCalorimeter/src/components/CorrectCaloClusters.h b/RecCalorimeter/src/components/CorrectCaloClusters.h index 3d5168f1..64c575f9 100644 --- a/RecCalorimeter/src/components/CorrectCaloClusters.h +++ b/RecCalorimeter/src/components/CorrectCaloClusters.h @@ -5,7 +5,7 @@ #include "k4FWCore/DataHandle.h" // Gaudi -#include "GaudiAlg/GaudiAlgorithm.h" +#include "Gaudi/Algorithm.h" #include "GaudiKernel/ToolHandle.h" #include "GaudiKernel/MsgStream.h" #include "GaudiKernel/RndmGenerators.h" @@ -59,14 +59,14 @@ namespace dd4hep { * @author Juraj Smiesko, benchmark calibration added by Michaela Mlynarikova */ -class CorrectCaloClusters : public GaudiAlgorithm { +class CorrectCaloClusters : public Gaudi::Algorithm { public: CorrectCaloClusters(const std::string& name, ISvcLocator* svcLoc); StatusCode initialize(); - StatusCode execute(); + StatusCode execute(const EventContext&) const; StatusCode finalize(); @@ -163,11 +163,11 @@ class CorrectCaloClusters : public GaudiAlgorithm { double getClusterTheta(edm4hep::Cluster cluster); /// Handle for input calorimeter clusters collection - DataHandle m_inClusters { + mutable DataHandle m_inClusters { "inClusters", Gaudi::DataHandle::Reader, this }; /// Handle for corrected (output) calorimeter clusters collection - DataHandle m_outClusters { + mutable DataHandle m_outClusters { "outClusters", Gaudi::DataHandle::Writer, this }; @@ -244,4 +244,4 @@ class CorrectCaloClusters : public GaudiAlgorithm { Gaudi::Property m_benchmarkCorr{this, "benchmarkCorr", false}; }; -#endif /* RECCALORIMETER_CORRECTCALOCLUSTERS_H */ \ No newline at end of file +#endif /* RECCALORIMETER_CORRECTCALOCLUSTERS_H */ diff --git a/RecCalorimeter/src/components/CorrectECalBarrelSliWinCluster.cpp b/RecCalorimeter/src/components/CorrectECalBarrelSliWinCluster.cpp index 502a58ab..21863ecb 100644 --- a/RecCalorimeter/src/components/CorrectECalBarrelSliWinCluster.cpp +++ b/RecCalorimeter/src/components/CorrectECalBarrelSliWinCluster.cpp @@ -32,7 +32,7 @@ DECLARE_COMPONENT(CorrectECalBarrelSliWinCluster) CorrectECalBarrelSliWinCluster::CorrectECalBarrelSliWinCluster(const std::string& name, ISvcLocator* svcLoc) - : GaudiAlgorithm(name, svcLoc), + : Gaudi::Algorithm(name, svcLoc), m_histSvc("THistSvc", "CorrectECalBarrelSliWinCluster"), m_geoSvc("GeoSvc", "CorrectECalBarrelSliWinCluster"), m_hEnergyPreAnyCorrections(nullptr), @@ -47,7 +47,7 @@ CorrectECalBarrelSliWinCluster::CorrectECalBarrelSliWinCluster(const std::string StatusCode CorrectECalBarrelSliWinCluster::initialize() { { - StatusCode sc = GaudiAlgorithm::initialize(); + StatusCode sc = Gaudi::Algorithm::initialize(); if (sc.isFailure()) return sc; } @@ -214,7 +214,7 @@ StatusCode CorrectECalBarrelSliWinCluster::initialize() { return StatusCode::SUCCESS; } -StatusCode CorrectECalBarrelSliWinCluster::execute() { +StatusCode CorrectECalBarrelSliWinCluster::execute(const EventContext&) const { // Get the input collection with clusters const edm4hep::ClusterCollection* inClusters = m_inClusters.get(); edm4hep::ClusterCollection* correctedClusters = m_correctedClusters.createAndPut(); @@ -428,7 +428,7 @@ StatusCode CorrectECalBarrelSliWinCluster::execute() { return StatusCode::SUCCESS; } -StatusCode CorrectECalBarrelSliWinCluster::finalize() { return GaudiAlgorithm::finalize(); } +StatusCode CorrectECalBarrelSliWinCluster::finalize() { return Gaudi::Algorithm::finalize(); } StatusCode CorrectECalBarrelSliWinCluster::initNoiseFromFile() { // Check if file exists diff --git a/RecCalorimeter/src/components/CorrectECalBarrelSliWinCluster.h b/RecCalorimeter/src/components/CorrectECalBarrelSliWinCluster.h index e0174de4..3c24a229 100644 --- a/RecCalorimeter/src/components/CorrectECalBarrelSliWinCluster.h +++ b/RecCalorimeter/src/components/CorrectECalBarrelSliWinCluster.h @@ -8,7 +8,7 @@ class IRndmGenSvc; class ITHistSvc; // Gaudi -#include "GaudiAlg/GaudiAlgorithm.h" +#include "Gaudi/Algorithm.h" #include "GaudiKernel/ToolHandle.h" #include "GaudiKernel/RndmGenerators.h" @@ -57,14 +57,14 @@ class BitFieldCoder; * */ -class CorrectECalBarrelSliWinCluster : public GaudiAlgorithm { +class CorrectECalBarrelSliWinCluster : public Gaudi::Algorithm { public: CorrectECalBarrelSliWinCluster(const std::string& name, ISvcLocator* svcLoc); StatusCode initialize(); - StatusCode execute(); + StatusCode execute(const EventContext&) const; StatusCode finalize(); @@ -88,13 +88,13 @@ class CorrectECalBarrelSliWinCluster : public GaudiAlgorithm { */ double getNoiseRMSPerCluster(double aEta, uint numCells); /// Handle for clusters (input collection) - DataHandle m_inClusters{"clusters", Gaudi::DataHandle::Reader, this}; + mutable DataHandle m_inClusters{"clusters", Gaudi::DataHandle::Reader, this}; /// Handle for corrected clusters (output collection) - DataHandle m_correctedClusters{"correctedClusters", Gaudi::DataHandle::Writer, this}; + mutable DataHandle m_correctedClusters{"correctedClusters", Gaudi::DataHandle::Writer, this}; /// Handle for particles with truth position and energy information: for SINGLE PARTICLE EVENTS (input collection) - DataHandle m_particle{"particles", Gaudi::DataHandle::Reader, this}; + mutable DataHandle m_particle{"particles", Gaudi::DataHandle::Reader, this}; /// Handle for the genvertices to read vertex position information - DataHandle m_vertex{"vertices", Gaudi::DataHandle::Reader, this}; + mutable DataHandle m_vertex{"vertices", Gaudi::DataHandle::Reader, this}; /// Pointer to the interface of histogram service ServiceHandle m_histSvc; /// Pointer to the geometry service diff --git a/RecCalorimeter/src/components/CreateCaloCells.cpp b/RecCalorimeter/src/components/CreateCaloCells.cpp index 4b254956..c370e6cc 100644 --- a/RecCalorimeter/src/components/CreateCaloCells.cpp +++ b/RecCalorimeter/src/components/CreateCaloCells.cpp @@ -17,7 +17,7 @@ DECLARE_COMPONENT(CreateCaloCells) CreateCaloCells::CreateCaloCells(const std::string& name, ISvcLocator* svcLoc) : -GaudiAlgorithm(name, svcLoc), m_geoSvc("GeoSvc", name) { +Gaudi::Algorithm(name, svcLoc), m_geoSvc("GeoSvc", name) { declareProperty("hits", m_hits, "Hits from which to create cells (input)"); declareProperty("cells", m_cells, "The created calorimeter cells (output)"); @@ -28,7 +28,7 @@ GaudiAlgorithm(name, svcLoc), m_geoSvc("GeoSvc", name) { } StatusCode CreateCaloCells::initialize() { - StatusCode sc = GaudiAlgorithm::initialize(); + StatusCode sc = Gaudi::Algorithm::initialize(); if (sc.isFailure()) return sc; info() << "CreateCaloCells initialized" << endmsg; @@ -86,7 +86,7 @@ StatusCode CreateCaloCells::initialize() { return StatusCode::SUCCESS; } -StatusCode CreateCaloCells::execute() { +StatusCode CreateCaloCells::execute(const EventContext&) const { // Get the input collection with Geant4 hits const edm4hep::SimCalorimeterHitCollection* hits = m_hits.get(); debug() << "Input Hit collection size: " << hits->size() << endmsg; @@ -179,4 +179,4 @@ StatusCode CreateCaloCells::execute() { return StatusCode::SUCCESS; } -StatusCode CreateCaloCells::finalize() { return GaudiAlgorithm::finalize(); } +StatusCode CreateCaloCells::finalize() { return Gaudi::Algorithm::finalize(); } diff --git a/RecCalorimeter/src/components/CreateCaloCells.h b/RecCalorimeter/src/components/CreateCaloCells.h index 685e2841..87af00e5 100644 --- a/RecCalorimeter/src/components/CreateCaloCells.h +++ b/RecCalorimeter/src/components/CreateCaloCells.h @@ -10,7 +10,7 @@ #include "k4Interface/ICaloReadCrosstalkMap.h" // Gaudi -#include "GaudiAlg/GaudiAlgorithm.h" +#include "Gaudi/Algorithm.h" #include "GaudiKernel/ToolHandle.h" // edm4hep @@ -50,14 +50,14 @@ class IGeoSvc; * */ -class CreateCaloCells : public GaudiAlgorithm { +class CreateCaloCells : public Gaudi::Algorithm { public: CreateCaloCells(const std::string& name, ISvcLocator* svcLoc); StatusCode initialize(); - StatusCode execute(); + StatusCode execute(const EventContext&) const; StatusCode finalize(); @@ -85,11 +85,11 @@ class CreateCaloCells : public GaudiAlgorithm { Gaudi::Property m_addPosition{this, "addPosition", false, "Add position information to the cells?"}; /// Handle for calo hits (input collection) - DataHandle m_hits{"hits", Gaudi::DataHandle::Reader, this}; + mutable DataHandle m_hits{"hits", Gaudi::DataHandle::Reader, this}; /// Handle for the cellID encoding string of the input collection MetaDataHandle m_hitsCellIDEncoding{m_hits, edm4hep::labels::CellIDEncoding, Gaudi::DataHandle::Reader}; /// Handle for calo cells (output collection) - DataHandle m_cells{"cells", Gaudi::DataHandle::Writer, this}; + mutable DataHandle m_cells{"cells", Gaudi::DataHandle::Writer, this}; MetaDataHandle m_cellsCellIDEncoding{m_cells, edm4hep::labels::CellIDEncoding, Gaudi::DataHandle::Writer}; /// Name of the detector readout Gaudi::Property m_readoutName{this, "readoutName", "ECalBarrelPhiEta", "Name of the detector readout"}; diff --git a/RecCalorimeter/src/components/CreateCaloCellsNoise.cpp b/RecCalorimeter/src/components/CreateCaloCellsNoise.cpp index d44d8243..b2d9967e 100644 --- a/RecCalorimeter/src/components/CreateCaloCellsNoise.cpp +++ b/RecCalorimeter/src/components/CreateCaloCellsNoise.cpp @@ -19,7 +19,7 @@ DECLARE_COMPONENT(CreateCaloCellsNoise) CreateCaloCellsNoise::CreateCaloCellsNoise(const std::string& name, ISvcLocator* svcLoc) : -GaudiAlgorithm(name, svcLoc), m_geoSvc("GeoSvc", name) { +Gaudi::Algorithm(name, svcLoc), m_geoSvc("GeoSvc", name) { declareProperty("hits", m_hits, "Hits from which to create cells (input)"); declareProperty("cells", m_cells, "The created calorimeter cells (output)"); @@ -29,7 +29,7 @@ GaudiAlgorithm(name, svcLoc), m_geoSvc("GeoSvc", name) { } StatusCode CreateCaloCellsNoise::initialize() { - StatusCode sc = GaudiAlgorithm::initialize(); + StatusCode sc = Gaudi::Algorithm::initialize(); if (sc.isFailure()) return sc; info() << "CreateCaloCellsNoise initialized" << endmsg; @@ -70,7 +70,7 @@ StatusCode CreateCaloCellsNoise::initialize() { return StatusCode::SUCCESS; } -StatusCode CreateCaloCellsNoise::execute() { +StatusCode CreateCaloCellsNoise::execute(const EventContext&) const { // Get the input collection with Geant4 hits const edm4hep::CalorimeterHitCollection* hits = m_hits.get(); debug() << "Input Hit collection size: " << hits->size() << endmsg; @@ -131,4 +131,4 @@ StatusCode CreateCaloCellsNoise::execute() { return StatusCode::SUCCESS; } -StatusCode CreateCaloCellsNoise::finalize() { return GaudiAlgorithm::finalize(); } +StatusCode CreateCaloCellsNoise::finalize() { return Gaudi::Algorithm::finalize(); } diff --git a/RecCalorimeter/src/components/CreateCaloCellsNoise.h b/RecCalorimeter/src/components/CreateCaloCellsNoise.h index 9aedacce..3d9a1a53 100644 --- a/RecCalorimeter/src/components/CreateCaloCellsNoise.h +++ b/RecCalorimeter/src/components/CreateCaloCellsNoise.h @@ -8,7 +8,7 @@ #include "k4Interface/INoiseCaloCellsTool.h" // Gaudi -#include "GaudiAlg/GaudiAlgorithm.h" +#include "Gaudi/Algorithm.h" #include "GaudiKernel/ToolHandle.h" // EDM4HEP @@ -46,14 +46,14 @@ class IGeoSvc; * */ -class CreateCaloCellsNoise : public GaudiAlgorithm { +class CreateCaloCellsNoise : public Gaudi::Algorithm { public: CreateCaloCellsNoise(const std::string& name, ISvcLocator* svcLoc); StatusCode initialize(); - StatusCode execute(); + StatusCode execute(const EventContext&) const; StatusCode finalize(); @@ -76,9 +76,9 @@ class CreateCaloCellsNoise : public GaudiAlgorithm { Gaudi::Property m_addPosition{this, "addPosition", false, "Add position information to the cells?"}; /// Handle for calo hits (input collection) - DataHandle m_hits{"hits", Gaudi::DataHandle::Reader, this}; + mutable DataHandle m_hits{"hits", Gaudi::DataHandle::Reader, this}; /// Handle for calo cells (output collection) - DataHandle m_cells{"cells", Gaudi::DataHandle::Writer, this}; + mutable DataHandle m_cells{"cells", Gaudi::DataHandle::Writer, this}; /// Name of the detector readout Gaudi::Property m_readoutName{this, "readoutName", "ECalBarrelPhiEta", "Name of the detector readout"}; /// Name of active volumes diff --git a/RecCalorimeter/src/components/CreateCaloClusters.cpp b/RecCalorimeter/src/components/CreateCaloClusters.cpp index 4a37ff25..cab3f915 100644 --- a/RecCalorimeter/src/components/CreateCaloClusters.cpp +++ b/RecCalorimeter/src/components/CreateCaloClusters.cpp @@ -22,7 +22,7 @@ DECLARE_COMPONENT(CreateCaloClusters) -CreateCaloClusters::CreateCaloClusters(const std::string& name, ISvcLocator* svcLoc) : GaudiAlgorithm(name, svcLoc) { +CreateCaloClusters::CreateCaloClusters(const std::string& name, ISvcLocator* svcLoc) : Gaudi::Algorithm(name, svcLoc) { declareProperty("clusters", m_clusters, "Input clusters (input)"); declareProperty("genParticles", m_genParticles, "Input gen particles (input)"); declareProperty("outClusters", m_newClusters, "Output clusters (output)"); @@ -41,7 +41,7 @@ CreateCaloClusters::CreateCaloClusters(const std::string& name, ISvcLocator* svc } StatusCode CreateCaloClusters::initialize() { - StatusCode sc = GaudiAlgorithm::initialize(); + StatusCode sc = Gaudi::Algorithm::initialize(); if (sc.isFailure()) return sc; m_geoSvc = service("GeoSvc"); if (!m_geoSvc) { @@ -143,7 +143,7 @@ StatusCode CreateCaloClusters::initialize() { return StatusCode::SUCCESS; } -StatusCode CreateCaloClusters::execute() { +StatusCode CreateCaloClusters::execute(const EventContext&) const { // Get the input collection with Geant4 hits const edm4hep::ClusterCollection* clusters = m_clusters.get(); debug() << "Input Cluster collection size: " << clusters->size() << endmsg; @@ -358,4 +358,4 @@ StatusCode CreateCaloClusters::finalize() { m_clusterEnergyBenchmark->Scale(1/allCluster); m_energyScale->Scale(1/allCluster); -return GaudiAlgorithm::finalize(); } +return Gaudi::Algorithm::finalize(); } diff --git a/RecCalorimeter/src/components/CreateCaloClusters.h b/RecCalorimeter/src/components/CreateCaloClusters.h index 021736f7..3138c7c6 100644 --- a/RecCalorimeter/src/components/CreateCaloClusters.h +++ b/RecCalorimeter/src/components/CreateCaloClusters.h @@ -2,7 +2,7 @@ #define RECCALORIMETER_CREATECALOCLUSTERS_H // Gaudi -#include "GaudiAlg/GaudiAlgorithm.h" +#include "Gaudi/Algorithm.h" #include "GaudiKernel/ToolHandle.h" #include "GaudiKernel/ITHistSvc.h" @@ -46,14 +46,14 @@ class TH1F; * */ -class CreateCaloClusters : public GaudiAlgorithm { +class CreateCaloClusters : public Gaudi::Algorithm { public: CreateCaloClusters(const std::string& name, ISvcLocator* svcLoc); StatusCode initialize(); - StatusCode execute(); + StatusCode execute(const EventContext&) const; StatusCode finalize(); @@ -66,11 +66,11 @@ class CreateCaloClusters : public GaudiAlgorithm { /// Handle for calo clusters (input collection) DataHandle m_clusters{"calo/clusters", Gaudi::DataHandle::Reader, this}; /// Handle for calo clusters (input collection) - DataHandle m_genParticles{"calo/genParticles", Gaudi::DataHandle::Reader, this}; + mutable DataHandle m_genParticles{"calo/genParticles", Gaudi::DataHandle::Reader, this}; /// Handle for calo clusters (output collection) - DataHandle m_newClusters{"calo/calibClusters", Gaudi::DataHandle::Writer, this}; + mutable DataHandle m_newClusters{"calo/calibClusters", Gaudi::DataHandle::Writer, this}; // Handle for calo cells (output collection) - DataHandle m_newCells{"calo/calibClusterCells", Gaudi::DataHandle::Writer, this}; + mutable DataHandle m_newCells{"calo/calibClusterCells", Gaudi::DataHandle::Writer, this}; /// Handle for tool to get positions in ECal Barrel ToolHandle m_cellPositionsECalTool{"CellPositionsECalBarrelTool", this}; diff --git a/RecCalorimeter/src/components/CreateCaloClustersSlidingWindow.cpp b/RecCalorimeter/src/components/CreateCaloClustersSlidingWindow.cpp index 3c307481..ab6d208e 100644 --- a/RecCalorimeter/src/components/CreateCaloClustersSlidingWindow.cpp +++ b/RecCalorimeter/src/components/CreateCaloClustersSlidingWindow.cpp @@ -10,14 +10,14 @@ DECLARE_COMPONENT(CreateCaloClustersSlidingWindow) CreateCaloClustersSlidingWindow::CreateCaloClustersSlidingWindow(const std::string& name, ISvcLocator* svcLoc) - : GaudiAlgorithm(name, svcLoc) { + : Gaudi::Algorithm(name, svcLoc) { declareProperty("clusters", m_clusters, "Handle for calo clusters (output collection)"); declareProperty("clusterCells", m_clusterCells, "Handle for calo cluster cells (output collection)"); declareProperty("towerTool", m_towerTool, "Handle for the tower building tool"); } StatusCode CreateCaloClustersSlidingWindow::initialize() { - if (GaudiAlgorithm::initialize().isFailure()) { + if (Gaudi::Algorithm::initialize().isFailure()) { return StatusCode::FAILURE; } if (!m_towerTool.retrieve()) { @@ -37,7 +37,7 @@ StatusCode CreateCaloClustersSlidingWindow::initialize() { return StatusCode::SUCCESS; } -StatusCode CreateCaloClustersSlidingWindow::execute() { +StatusCode CreateCaloClustersSlidingWindow::execute(const EventContext&) const { // 1. Create calorimeter towers (calorimeter grid in eta phi, all layers merged) m_towers.assign(m_nEtaTower, std::vector(m_nPhiTower, 0)); // Create an output collection @@ -298,7 +298,7 @@ StatusCode CreateCaloClustersSlidingWindow::execute() { return StatusCode::SUCCESS; } -StatusCode CreateCaloClustersSlidingWindow::finalize() { return GaudiAlgorithm::finalize(); } +StatusCode CreateCaloClustersSlidingWindow::finalize() { return Gaudi::Algorithm::finalize(); } unsigned int CreateCaloClustersSlidingWindow::phiNeighbour(int aIPhi) const { if (aIPhi < 0) { diff --git a/RecCalorimeter/src/components/CreateCaloClustersSlidingWindow.h b/RecCalorimeter/src/components/CreateCaloClustersSlidingWindow.h index c945c9db..e19ff851 100644 --- a/RecCalorimeter/src/components/CreateCaloClustersSlidingWindow.h +++ b/RecCalorimeter/src/components/CreateCaloClustersSlidingWindow.h @@ -2,7 +2,7 @@ #define RECCALORIMETER_CREATECALOCLUSTERSSLIDINGWINDOW_H // GAUDI -#include "GaudiAlg/GaudiAlgorithm.h" +#include "Gaudi/Algorithm.h" #include "GaudiKernel/ToolHandle.h" // k4FWCore @@ -56,7 +56,7 @@ class ClusterCollection; * @author Anna Zaborowska */ -class CreateCaloClustersSlidingWindow : public GaudiAlgorithm { +class CreateCaloClustersSlidingWindow : public Gaudi::Algorithm { public: CreateCaloClustersSlidingWindow(const std::string& name, ISvcLocator* svcLoc); /** Initialize. @@ -67,7 +67,7 @@ class CreateCaloClustersSlidingWindow : public GaudiAlgorithm { * Perform the sliding window algorithm and build clusters. * @return status code */ - StatusCode execute(); + StatusCode execute(const EventContext&) const; /** Finalize. * @return status code */ @@ -89,9 +89,9 @@ class CreateCaloClustersSlidingWindow : public GaudiAlgorithm { */ unsigned int phiNeighbour(int aIPhi) const; /// Handle for calo clusters (output collection) - DataHandle m_clusters{"calo/clusters", Gaudi::DataHandle::Writer, this}; + mutable DataHandle m_clusters{"calo/clusters", Gaudi::DataHandle::Writer, this}; /// Handle for calo cluster cells (output collection) - DataHandle m_clusterCells{"calo/clusterCells", Gaudi::DataHandle::Writer, this}; + mutable DataHandle m_clusterCells{"calo/clusterCells", Gaudi::DataHandle::Writer, this}; /// Handle for the tower building tool ToolHandle m_towerTool; // calorimeter towers diff --git a/RecCalorimeter/src/components/CreateEmptyCaloCellsCollection.cpp b/RecCalorimeter/src/components/CreateEmptyCaloCellsCollection.cpp index aac406c3..fb65a1c8 100644 --- a/RecCalorimeter/src/components/CreateEmptyCaloCellsCollection.cpp +++ b/RecCalorimeter/src/components/CreateEmptyCaloCellsCollection.cpp @@ -5,21 +5,21 @@ DECLARE_COMPONENT(CreateEmptyCaloCellsCollection) -CreateEmptyCaloCellsCollection::CreateEmptyCaloCellsCollection(const std::string& name, ISvcLocator* svcLoc) : GaudiAlgorithm(name, svcLoc) { +CreateEmptyCaloCellsCollection::CreateEmptyCaloCellsCollection(const std::string& name, ISvcLocator* svcLoc) : Gaudi::Algorithm(name, svcLoc) { declareProperty("cells", m_caloCells, "Empty calorimeter cells output)"); } StatusCode CreateEmptyCaloCellsCollection::initialize() { - StatusCode sc = GaudiAlgorithm::initialize(); + StatusCode sc = Gaudi::Algorithm::initialize(); if (sc.isFailure()) return sc; info() << "Create dummy cells collection initialized" << endmsg; return StatusCode::SUCCESS; } -StatusCode CreateEmptyCaloCellsCollection::execute() { +StatusCode CreateEmptyCaloCellsCollection::execute(const EventContext&) const { //create a new empty calo cells collection m_caloCells.createAndPut(); return StatusCode::SUCCESS; } -StatusCode CreateEmptyCaloCellsCollection::finalize() { return GaudiAlgorithm::finalize(); } +StatusCode CreateEmptyCaloCellsCollection::finalize() { return Gaudi::Algorithm::finalize(); } diff --git a/RecCalorimeter/src/components/CreateEmptyCaloCellsCollection.h b/RecCalorimeter/src/components/CreateEmptyCaloCellsCollection.h index ace72737..b06cbe60 100644 --- a/RecCalorimeter/src/components/CreateEmptyCaloCellsCollection.h +++ b/RecCalorimeter/src/components/CreateEmptyCaloCellsCollection.h @@ -5,7 +5,7 @@ #include "k4FWCore/DataHandle.h" // Gaudi -#include "GaudiAlg/GaudiAlgorithm.h" +#include "Gaudi/Algorithm.h" #include "GaudiKernel/ToolHandle.h" // edm4hep @@ -27,20 +27,20 @@ class IGeoSvc; * */ -class CreateEmptyCaloCellsCollection : public GaudiAlgorithm { +class CreateEmptyCaloCellsCollection : public Gaudi::Algorithm { public: CreateEmptyCaloCellsCollection(const std::string& name, ISvcLocator* svcLoc); StatusCode initialize(); - StatusCode execute(); + StatusCode execute(const EventContext&) const; StatusCode finalize(); private: /// Handle for the calo cells (output collection) - DataHandle m_caloCells{"cells", Gaudi::DataHandle::Writer, this}; + mutable DataHandle m_caloCells{"cells", Gaudi::DataHandle::Writer, this}; }; #endif /* RECCALORIMETER_CREATEEMPTYCALOCELLSCOLLECTION_H */ diff --git a/RecCalorimeter/src/components/LayeredCaloTowerTool.h b/RecCalorimeter/src/components/LayeredCaloTowerTool.h index 3e1384fc..3c642167 100644 --- a/RecCalorimeter/src/components/LayeredCaloTowerTool.h +++ b/RecCalorimeter/src/components/LayeredCaloTowerTool.h @@ -135,7 +135,7 @@ class LayeredCaloTowerTool : public GaudiTool, virtual public ITowerTool { private: /// Handle for calo cells (input collection) - DataHandle m_cells{"calo/cells", Gaudi::DataHandle::Reader, this}; + mutable DataHandle m_cells{"calo/cells", Gaudi::DataHandle::Reader, this}; /// Pointer to the geometry service ServiceHandle m_geoSvc; /// Name of the detector readout diff --git a/RecCalorimeter/src/components/MassInv.cpp b/RecCalorimeter/src/components/MassInv.cpp index 707684df..6a0baa2b 100644 --- a/RecCalorimeter/src/components/MassInv.cpp +++ b/RecCalorimeter/src/components/MassInv.cpp @@ -30,7 +30,7 @@ DECLARE_COMPONENT(MassInv) MassInv::MassInv(const std::string& name, ISvcLocator* svcLoc) - : GaudiAlgorithm(name, svcLoc), + : Gaudi::Algorithm(name, svcLoc), m_histSvc("THistSvc", "MassInv"), m_geoSvc("GeoSvc", "MassInv"), m_hEnergyPreAnyCorrections(nullptr), @@ -45,7 +45,7 @@ MassInv::MassInv(const std::string& name, ISvcLocator* svcLoc) StatusCode MassInv::initialize() { { - StatusCode sc = GaudiAlgorithm::initialize(); + StatusCode sc = Gaudi::Algorithm::initialize(); if (sc.isFailure()) return sc; } @@ -382,7 +382,7 @@ StatusCode MassInv::initialize() { return StatusCode::SUCCESS; } -StatusCode MassInv::execute() { +StatusCode MassInv::execute(const EventContext&) const { // Get the input collection with clusters const edm4hep::ClusterCollection* inClusters = m_inClusters.get(); edm4hep::ClusterCollection* correctedClusters = m_correctedClusters.createAndPut(); @@ -805,7 +805,7 @@ StatusCode MassInv::execute() { return StatusCode::SUCCESS; } -StatusCode MassInv::finalize() { return GaudiAlgorithm::finalize(); } +StatusCode MassInv::finalize() { return Gaudi::Algorithm::finalize(); } StatusCode MassInv::initNoiseFromFile() { // Check if file exists diff --git a/RecCalorimeter/src/components/MassInv.h b/RecCalorimeter/src/components/MassInv.h index 28ae4df9..9d28ce5b 100644 --- a/RecCalorimeter/src/components/MassInv.h +++ b/RecCalorimeter/src/components/MassInv.h @@ -3,7 +3,7 @@ // Gaudi #include "GaudiKernel/RndmGenerators.h" -#include "GaudiAlg/GaudiAlgorithm.h" +#include "Gaudi/Algorithm.h" #include "GaudiKernel/ToolHandle.h" // Key4HEP @@ -58,14 +58,14 @@ class BitFieldCoder; * */ -class MassInv : public GaudiAlgorithm { +class MassInv : public Gaudi::Algorithm { public: MassInv(const std::string& name, ISvcLocator* svcLoc); StatusCode initialize(); - StatusCode execute(); + StatusCode execute(const EventContext&) const; StatusCode finalize(); @@ -89,11 +89,11 @@ class MassInv : public GaudiAlgorithm { */ double getNoiseRMSPerCluster(double aEta, uint numCells); /// Handle for clusters (input collection) - DataHandle m_inClusters{"clusters", Gaudi::DataHandle::Reader, this}; + mutable DataHandle m_inClusters{"clusters", Gaudi::DataHandle::Reader, this}; /// Handle for corrected clusters (output collection) - DataHandle m_correctedClusters{"correctedClusters", Gaudi::DataHandle::Writer, this}; + mutable DataHandle m_correctedClusters{"correctedClusters", Gaudi::DataHandle::Writer, this}; /// Handle for particles with truth position and energy information: for SINGLE PARTICLE EVENTS (input collection) - DataHandle m_particle{"particles", Gaudi::DataHandle::Reader, this}; + mutable DataHandle m_particle{"particles", Gaudi::DataHandle::Reader, this}; /// Pointer to the interface of histogram service ServiceHandle m_histSvc; /// Pointer to the geometry service diff --git a/RecCalorimeter/src/components/PreparePileup.cpp b/RecCalorimeter/src/components/PreparePileup.cpp index d51a0e8a..d2d631c2 100644 --- a/RecCalorimeter/src/components/PreparePileup.cpp +++ b/RecCalorimeter/src/components/PreparePileup.cpp @@ -20,14 +20,14 @@ DECLARE_COMPONENT(PreparePileup) -PreparePileup::PreparePileup(const std::string& name, ISvcLocator* svcLoc) : GaudiAlgorithm(name, svcLoc) { +PreparePileup::PreparePileup(const std::string& name, ISvcLocator* svcLoc) : Gaudi::Algorithm(name, svcLoc) { declareProperty("hits", m_hits, "Hits from which to create cells (input)"); declareProperty("geometryTool", m_geoTool, "Handle for the geometry tool"); declareProperty("towerTool", m_towerTool, "Handle for the tower building tool"); } StatusCode PreparePileup::initialize() { - StatusCode sc = GaudiAlgorithm::initialize(); + StatusCode sc = Gaudi::Algorithm::initialize(); if (sc.isFailure()) return sc; m_geoSvc = service("GeoSvc"); @@ -144,7 +144,7 @@ StatusCode PreparePileup::initialize() { return StatusCode::SUCCESS; } -StatusCode PreparePileup::execute() { +StatusCode PreparePileup::execute(const EventContext&) const { // Get the input collection with Geant4 hits const edm4hep::CalorimeterHitCollection* hits = m_hits.get(); debug() << "Input Hit collection size: " << hits->size() << endmsg; @@ -274,5 +274,5 @@ StatusCode PreparePileup::finalize() { m_energyAllEventsVsAbsEta[layerId]->Fill(fabs(cellEta), cellEnergy); } - return GaudiAlgorithm::finalize(); + return Gaudi::Algorithm::finalize(); } diff --git a/RecCalorimeter/src/components/PreparePileup.h b/RecCalorimeter/src/components/PreparePileup.h index ebf0561f..5a39a8bd 100644 --- a/RecCalorimeter/src/components/PreparePileup.h +++ b/RecCalorimeter/src/components/PreparePileup.h @@ -11,7 +11,7 @@ class IGeoSvc; #include "detectorSegmentations/FCCSWGridPhiEta_k4geo.h" // Gaudi -#include "GaudiAlg/GaudiAlgorithm.h" +#include "Gaudi/Algorithm.h" #include "GaudiKernel/ToolHandle.h" // EDM4HEP @@ -43,14 +43,14 @@ class ITHistSvc; * */ -class PreparePileup : public GaudiAlgorithm { +class PreparePileup : public Gaudi::Algorithm { public: PreparePileup(const std::string& name, ISvcLocator* svcLoc); StatusCode initialize(); - StatusCode execute(); + StatusCode execute(const EventContext&) const; StatusCode finalize(); @@ -74,7 +74,7 @@ class PreparePileup : public GaudiAlgorithm { int m_nPhiTower; /// Handle for calo hits (input collection) - DataHandle m_hits{"hits", Gaudi::DataHandle::Reader, this}; + mutable DataHandle m_hits{"hits", Gaudi::DataHandle::Reader, this}; /// Map of cell IDs (corresponding to DD4hep IDs) and energy std::unordered_map m_cellsMap; diff --git a/RecCalorimeter/src/components/SplitClusters.cpp b/RecCalorimeter/src/components/SplitClusters.cpp index f169eac9..03464c22 100644 --- a/RecCalorimeter/src/components/SplitClusters.cpp +++ b/RecCalorimeter/src/components/SplitClusters.cpp @@ -23,7 +23,7 @@ DECLARE_COMPONENT(SplitClusters) -SplitClusters::SplitClusters(const std::string& name, ISvcLocator* svcLoc) : GaudiAlgorithm(name, svcLoc) { +SplitClusters::SplitClusters(const std::string& name, ISvcLocator* svcLoc) : Gaudi::Algorithm(name, svcLoc) { declareProperty("clusters", m_clusters, "Input clusters (input)"); declareProperty("neigboursTool", m_neighboursTool, "Handle for tool to retrieve cell neighbours"); @@ -40,7 +40,7 @@ SplitClusters::SplitClusters(const std::string& name, ISvcLocator* svcLoc) : Gau } StatusCode SplitClusters::initialize() { - StatusCode sc = GaudiAlgorithm::initialize(); + StatusCode sc = Gaudi::Algorithm::initialize(); if (sc.isFailure()) return sc; m_geoSvc = service("GeoSvc"); if (!m_geoSvc) { @@ -76,7 +76,7 @@ StatusCode SplitClusters::initialize() { return StatusCode::SUCCESS; } -StatusCode SplitClusters::execute() { +StatusCode SplitClusters::execute(const EventContext&) const { // Get the input collection with Geant4 hits const edm4hep::ClusterCollection* clusters = m_clusters.get(); debug() << "Input Cluster collection size: " << clusters->size() << endmsg; @@ -531,4 +531,4 @@ SplitClusters::searchForNeighbours(const uint64_t aCellId, StatusCode SplitClusters::finalize() { -return GaudiAlgorithm::finalize(); } +return Gaudi::Algorithm::finalize(); } diff --git a/RecCalorimeter/src/components/SplitClusters.h b/RecCalorimeter/src/components/SplitClusters.h index 8fe77902..24fb4bf5 100644 --- a/RecCalorimeter/src/components/SplitClusters.h +++ b/RecCalorimeter/src/components/SplitClusters.h @@ -12,7 +12,7 @@ #include "DDSegmentation/Segmentation.h" // Gaudi -#include "GaudiAlg/GaudiAlgorithm.h" +#include "Gaudi/Algorithm.h" #include "GaudiKernel/ToolHandle.h" #include "GaudiKernel/ITHistSvc.h" @@ -59,7 +59,7 @@ class TLorentzVector; * */ -class SplitClusters : public GaudiAlgorithm { +class SplitClusters : public Gaudi::Algorithm { public: SplitClusters(const std::string& name, ISvcLocator* svcLoc); @@ -84,7 +84,7 @@ class SplitClusters : public GaudiAlgorithm { std::map& aClusterPositions ); - StatusCode execute(); + StatusCode execute(const EventContext&) const; StatusCode finalize(); @@ -93,11 +93,11 @@ class SplitClusters : public GaudiAlgorithm { SmartIF m_geoSvc; /// Handle for calo clusters (input collection) - DataHandle m_clusters{"calo/clusters", Gaudi::DataHandle::Reader, this}; + mutable DataHandle m_clusters{"calo/clusters", Gaudi::DataHandle::Reader, this}; /// Handle for calo clusters (output collection) - DataHandle m_newClusters{"calo/calibClusters", Gaudi::DataHandle::Writer, this}; + mutable DataHandle m_newClusters{"calo/calibClusters", Gaudi::DataHandle::Writer, this}; // Handle for calo cells (output collection) - DataHandle m_newCells{"calo/calibClusterCells", Gaudi::DataHandle::Writer, this}; + mutable DataHandle m_newCells{"calo/calibClusterCells", Gaudi::DataHandle::Writer, this}; /// Handle for neighbours tool ToolHandle m_neighboursTool{"TopoCaloNeighbours", this}; diff --git a/RecFCCeeCalorimeter/CMakeLists.txt b/RecFCCeeCalorimeter/CMakeLists.txt index d7672479..356d57e4 100644 --- a/RecFCCeeCalorimeter/CMakeLists.txt +++ b/RecFCCeeCalorimeter/CMakeLists.txt @@ -18,7 +18,6 @@ gaudi_add_module(k4RecFCCeeCalorimeterPlugins SOURCES ${_module_sources} LINK k4FWCore::k4FWCore k4FWCore::k4Interface - Gaudi::GaudiAlgLib Gaudi::GaudiKernel DD4hep::DDCore EDM4HEP::edm4hep diff --git a/RecFCCeeCalorimeter/src/components/CaloTopoClusterFCCee.cpp b/RecFCCeeCalorimeter/src/components/CaloTopoClusterFCCee.cpp index 3ac9af91..181f7440 100644 --- a/RecFCCeeCalorimeter/src/components/CaloTopoClusterFCCee.cpp +++ b/RecFCCeeCalorimeter/src/components/CaloTopoClusterFCCee.cpp @@ -24,7 +24,7 @@ DECLARE_COMPONENT(CaloTopoClusterFCCee) -CaloTopoClusterFCCee::CaloTopoClusterFCCee(const std::string& name, ISvcLocator* svcLoc) : GaudiAlgorithm(name, svcLoc) { +CaloTopoClusterFCCee::CaloTopoClusterFCCee(const std::string& name, ISvcLocator* svcLoc) : Gaudi::Algorithm(name, svcLoc) { declareProperty("TopoClusterInput", m_inputTool, "Handle for input map of cells"); declareProperty("noiseTool", m_noiseTool, "Handle for the cells noise tool"); declareProperty("neigboursTool", m_neighboursTool, "Handle for tool to retrieve cell neighbours"); @@ -45,7 +45,7 @@ CaloTopoClusterFCCee::CaloTopoClusterFCCee(const std::string& name, ISvcLocator* } StatusCode CaloTopoClusterFCCee::initialize() { - if (GaudiAlgorithm::initialize().isFailure()) return StatusCode::FAILURE; + if (Gaudi::Algorithm::initialize().isFailure()) return StatusCode::FAILURE; m_geoSvc = service("GeoSvc"); if (!m_geoSvc) { error() << "Unable to locate Geometry Service. " @@ -89,7 +89,7 @@ StatusCode CaloTopoClusterFCCee::initialize() { return StatusCode::SUCCESS; } -StatusCode CaloTopoClusterFCCee::execute() { +StatusCode CaloTopoClusterFCCee::execute(const EventContext&) const { // Create output collections auto edmClusters = m_clusterCollection.createAndPut(); auto edmClusterCells = m_clusterCellsCollection.createAndPut(); @@ -457,7 +457,7 @@ CaloTopoClusterFCCee::searchForNeighbours(const uint64_t aCellId, return addedNeighbourIds; } -StatusCode CaloTopoClusterFCCee::finalize() { return GaudiAlgorithm::finalize(); } +StatusCode CaloTopoClusterFCCee::finalize() { return Gaudi::Algorithm::finalize(); } /** diff --git a/RecFCCeeCalorimeter/src/components/CaloTopoClusterFCCee.h b/RecFCCeeCalorimeter/src/components/CaloTopoClusterFCCee.h index dd502a6c..ee23f91f 100644 --- a/RecFCCeeCalorimeter/src/components/CaloTopoClusterFCCee.h +++ b/RecFCCeeCalorimeter/src/components/CaloTopoClusterFCCee.h @@ -7,7 +7,7 @@ #include // Gaudi -#include "GaudiAlg/GaudiAlgorithm.h" +#include "Gaudi/Algorithm.h" #include "GaudiKernel/ToolHandle.h" // k4FWCore @@ -47,7 +47,7 @@ class Segmentation; * @author Coralie Neubueser */ -class CaloTopoClusterFCCee : public GaudiAlgorithm { +class CaloTopoClusterFCCee : public Gaudi::Algorithm { public: CaloTopoClusterFCCee(const std::string& name, ISvcLocator* svcLoc); @@ -93,15 +93,15 @@ class CaloTopoClusterFCCee : public GaudiAlgorithm { std::map>>& aPreClusterCollection, bool aAllowClusterMerge); - StatusCode execute(); + StatusCode execute(const EventContext&) const; StatusCode finalize(); private: // Cluster collection - DataHandle m_clusterCollection{"calo/clusters", Gaudi::DataHandle::Writer, this}; + mutable DataHandle m_clusterCollection{"calo/clusters", Gaudi::DataHandle::Writer, this}; // Cluster cells in collection - DataHandle m_clusterCellsCollection{"calo/clusterCells", Gaudi::DataHandle::Writer, this}; + mutable DataHandle m_clusterCellsCollection{"calo/clusterCells", Gaudi::DataHandle::Writer, this}; /// Pointer to the geometry service SmartIF m_geoSvc; /// Handle for the input tool diff --git a/RecFCCeeCalorimeter/src/components/CaloTowerToolFCCee.h b/RecFCCeeCalorimeter/src/components/CaloTowerToolFCCee.h index 08c9c361..8389f719 100644 --- a/RecFCCeeCalorimeter/src/components/CaloTowerToolFCCee.h +++ b/RecFCCeeCalorimeter/src/components/CaloTowerToolFCCee.h @@ -132,19 +132,19 @@ class CaloTowerToolFCCee : public GaudiTool, virtual public ITowerToolThetaModul std::pair retrievePhiThetaExtrema(dd4hep::DDSegmentation::Segmentation* aSegmentation, SegmentationType aType); std::pair retrieveSegmentation(std::string aReadoutName); /// Handle for electromagnetic barrel cells (input collection) - DataHandle m_ecalBarrelCells{"ecalBarrelCells", Gaudi::DataHandle::Reader, this}; + mutable DataHandle m_ecalBarrelCells{"ecalBarrelCells", Gaudi::DataHandle::Reader, this}; /// Handle for ecal endcap calorimeter cells (input collection) - DataHandle m_ecalEndcapCells{"ecalEndcapCells", Gaudi::DataHandle::Reader, this}; + mutable DataHandle m_ecalEndcapCells{"ecalEndcapCells", Gaudi::DataHandle::Reader, this}; /// Handle for ecal forward calorimeter cells (input collection) - DataHandle m_ecalFwdCells{"ecalFwdCells", Gaudi::DataHandle::Reader, this}; + mutable DataHandle m_ecalFwdCells{"ecalFwdCells", Gaudi::DataHandle::Reader, this}; /// Handle for hadronic barrel cells (input collection) - DataHandle m_hcalBarrelCells{"hcalBarrelCells", Gaudi::DataHandle::Reader, this}; + mutable DataHandle m_hcalBarrelCells{"hcalBarrelCells", Gaudi::DataHandle::Reader, this}; /// Handle for hadronic extended barrel cells (input collection) - DataHandle m_hcalExtBarrelCells{"hcalExtBarrelCells", Gaudi::DataHandle::Reader, this}; + mutable DataHandle m_hcalExtBarrelCells{"hcalExtBarrelCells", Gaudi::DataHandle::Reader, this}; /// Handle for hcal endcap calorimeter cells (input collection) - DataHandle m_hcalEndcapCells{"hcalEndcapCells", Gaudi::DataHandle::Reader, this}; + mutable DataHandle m_hcalEndcapCells{"hcalEndcapCells", Gaudi::DataHandle::Reader, this}; /// Handle for hcal forward calorimeter cells (input collection) - DataHandle m_hcalFwdCells{"hcalFwdCells", Gaudi::DataHandle::Reader, this}; + mutable DataHandle m_hcalFwdCells{"hcalFwdCells", Gaudi::DataHandle::Reader, this}; /// Pointer to the geometry service ServiceHandle m_geoSvc; diff --git a/RecFCCeeCalorimeter/src/components/CreateCaloCellPositionsFCCee.cpp b/RecFCCeeCalorimeter/src/components/CreateCaloCellPositionsFCCee.cpp index a29793ca..0d7c7f04 100644 --- a/RecFCCeeCalorimeter/src/components/CreateCaloCellPositionsFCCee.cpp +++ b/RecFCCeeCalorimeter/src/components/CreateCaloCellPositionsFCCee.cpp @@ -15,7 +15,7 @@ DECLARE_COMPONENT(CreateCaloCellPositionsFCCee) CreateCaloCellPositionsFCCee::CreateCaloCellPositionsFCCee(const std::string& name, ISvcLocator* svcLoc) - : GaudiAlgorithm(name, svcLoc) { + : Gaudi::Algorithm(name, svcLoc) { declareProperty("hits", m_hits, "Hit collection (input)"); declareProperty("positionsTool", m_cellPositionsTool, "Handle for tool to retrieve cell positions from"); @@ -25,7 +25,7 @@ CreateCaloCellPositionsFCCee::CreateCaloCellPositionsFCCee(const std::string& na StatusCode CreateCaloCellPositionsFCCee::initialize() { { - StatusCode sc = GaudiAlgorithm::initialize(); + StatusCode sc = Gaudi::Algorithm::initialize(); if (sc.isFailure()) return sc; } @@ -44,7 +44,7 @@ StatusCode CreateCaloCellPositionsFCCee::initialize() { return StatusCode::SUCCESS; } -StatusCode CreateCaloCellPositionsFCCee::execute() { +StatusCode CreateCaloCellPositionsFCCee::execute(const EventContext&) const { // Get the input hit collection const auto* hits = m_hits.get(); debug() << "Input hit collection size: " << hits->size() << endmsg; @@ -88,4 +88,4 @@ StatusCode CreateCaloCellPositionsFCCee::execute() { return StatusCode::SUCCESS; } -StatusCode CreateCaloCellPositionsFCCee::finalize() { return GaudiAlgorithm::finalize(); } +StatusCode CreateCaloCellPositionsFCCee::finalize() { return Gaudi::Algorithm::finalize(); } diff --git a/RecFCCeeCalorimeter/src/components/CreateCaloCellPositionsFCCee.h b/RecFCCeeCalorimeter/src/components/CreateCaloCellPositionsFCCee.h index 4c7332cc..a90b8b5d 100644 --- a/RecFCCeeCalorimeter/src/components/CreateCaloCellPositionsFCCee.h +++ b/RecFCCeeCalorimeter/src/components/CreateCaloCellPositionsFCCee.h @@ -7,7 +7,7 @@ #include "k4Interface/ICellPositionsTool.h" // Gaudi -#include "GaudiAlg/GaudiAlgorithm.h" +#include "Gaudi/Algorithm.h" #include "GaudiKernel/ToolHandle.h" // edm4hep @@ -29,7 +29,7 @@ class IGeoSvc; * */ -class CreateCaloCellPositionsFCCee : public GaudiAlgorithm { +class CreateCaloCellPositionsFCCee : public Gaudi::Algorithm { public: CreateCaloCellPositionsFCCee(const std::string& name, ISvcLocator* svcLoc); @@ -40,7 +40,7 @@ class CreateCaloCellPositionsFCCee : public GaudiAlgorithm { /** Execute. * @return status code */ - StatusCode execute(); + StatusCode execute(const EventContext&) const; /** Finalize. * @return status code */ @@ -50,11 +50,11 @@ class CreateCaloCellPositionsFCCee : public GaudiAlgorithm { /// Handle for tool to get positions width ToolHandle m_cellPositionsTool{}; /// Input collection - DataHandle m_hits{"hits/hits", Gaudi::DataHandle::Reader, this}; + mutable DataHandle m_hits{"hits/hits", Gaudi::DataHandle::Reader, this}; /// Input collection metadata handle MetaDataHandle m_hitsCellIDEncoding{m_hits, edm4hep::labels::CellIDEncoding, Gaudi::DataHandle::Reader}; /// Output collection - DataHandle m_positionedHits{"hits/positionedHits", Gaudi::DataHandle::Writer, this}; + mutable DataHandle m_positionedHits{"hits/positionedHits", Gaudi::DataHandle::Writer, this}; /// Output collection metadata handle MetaDataHandle m_positionedHitsCellIDEncoding{m_positionedHits, edm4hep::labels::CellIDEncoding, Gaudi::DataHandle::Writer}; diff --git a/RecFCCeeCalorimeter/src/components/CreateCaloClustersSlidingWindowFCCee.cpp b/RecFCCeeCalorimeter/src/components/CreateCaloClustersSlidingWindowFCCee.cpp index d5b81798..7d66e94a 100644 --- a/RecFCCeeCalorimeter/src/components/CreateCaloClustersSlidingWindowFCCee.cpp +++ b/RecFCCeeCalorimeter/src/components/CreateCaloClustersSlidingWindowFCCee.cpp @@ -10,14 +10,14 @@ DECLARE_COMPONENT(CreateCaloClustersSlidingWindowFCCee) CreateCaloClustersSlidingWindowFCCee::CreateCaloClustersSlidingWindowFCCee(const std::string& name, ISvcLocator* svcLoc) - : GaudiAlgorithm(name, svcLoc) { + : Gaudi::Algorithm(name, svcLoc) { declareProperty("clusters", m_clusters, "Handle for calo clusters (output collection)"); declareProperty("clusterCells", m_clusterCells, "Handle for calo cluster cells (output collection)"); declareProperty("towerTool", m_towerTool, "Handle for the tower building tool"); } StatusCode CreateCaloClustersSlidingWindowFCCee::initialize() { - if (GaudiAlgorithm::initialize().isFailure()) { + if (Gaudi::Algorithm::initialize().isFailure()) { return StatusCode::FAILURE; } if (!m_towerTool.retrieve()) { @@ -38,7 +38,7 @@ StatusCode CreateCaloClustersSlidingWindowFCCee::initialize() { return StatusCode::SUCCESS; } -StatusCode CreateCaloClustersSlidingWindowFCCee::execute() { +StatusCode CreateCaloClustersSlidingWindowFCCee::execute(const EventContext&) const { // 1. Create calorimeter towers (calorimeter grid in theta phi, all layers merged) m_towers.assign(m_nThetaTower, std::vector(m_nPhiTower, 0)); // Create an output collection @@ -312,7 +312,7 @@ StatusCode CreateCaloClustersSlidingWindowFCCee::execute() { return StatusCode::SUCCESS; } -StatusCode CreateCaloClustersSlidingWindowFCCee::finalize() { return GaudiAlgorithm::finalize(); } +StatusCode CreateCaloClustersSlidingWindowFCCee::finalize() { return Gaudi::Algorithm::finalize(); } unsigned int CreateCaloClustersSlidingWindowFCCee::phiNeighbour(int aIPhi) const { if (aIPhi < 0) { diff --git a/RecFCCeeCalorimeter/src/components/CreateCaloClustersSlidingWindowFCCee.h b/RecFCCeeCalorimeter/src/components/CreateCaloClustersSlidingWindowFCCee.h index 8b60e158..5051b910 100644 --- a/RecFCCeeCalorimeter/src/components/CreateCaloClustersSlidingWindowFCCee.h +++ b/RecFCCeeCalorimeter/src/components/CreateCaloClustersSlidingWindowFCCee.h @@ -2,7 +2,7 @@ #define RECFCCEECALORIMETER_CREATECALOCLUSTERSSLIDINGWINDOWFCCEE_H // GAUDI -#include "GaudiAlg/GaudiAlgorithm.h" +#include "Gaudi/Algorithm.h" #include "GaudiKernel/ToolHandle.h" // k4FWCore @@ -51,7 +51,7 @@ class ClusterCollection; * @Modified by Tong Li, for Theta-Module Merged readouts in FCCee */ -class CreateCaloClustersSlidingWindowFCCee : public GaudiAlgorithm { +class CreateCaloClustersSlidingWindowFCCee : public Gaudi::Algorithm { public: CreateCaloClustersSlidingWindowFCCee(const std::string& name, ISvcLocator* svcLoc); /** Initialize. @@ -62,7 +62,7 @@ class CreateCaloClustersSlidingWindowFCCee : public GaudiAlgorithm { * Perform the sliding window algorithm and build clusters. * @return status code */ - StatusCode execute(); + StatusCode execute(const EventContext&) const; /** Finalize. * @return status code */ @@ -87,9 +87,9 @@ class CreateCaloClustersSlidingWindowFCCee : public GaudiAlgorithm { */ unsigned int phiNeighbour(int aIPhi) const; /// Handle for calo clusters (output collection) - DataHandle m_clusters{"calo/clusters", Gaudi::DataHandle::Writer, this}; + mutable DataHandle m_clusters{"calo/clusters", Gaudi::DataHandle::Writer, this}; /// Handle for calo cluster cells (output collection) - DataHandle m_clusterCells{"calo/clusterCells", Gaudi::DataHandle::Writer, this}; + mutable DataHandle m_clusterCells{"calo/clusterCells", Gaudi::DataHandle::Writer, this}; /// Handle for the tower building tool ToolHandle m_towerTool; // calorimeter towers diff --git a/RecFCChhCalorimeter/CMakeLists.txt b/RecFCChhCalorimeter/CMakeLists.txt index 8e14e9f7..1cc795e1 100644 --- a/RecFCChhCalorimeter/CMakeLists.txt +++ b/RecFCChhCalorimeter/CMakeLists.txt @@ -7,7 +7,6 @@ gaudi_add_module(k4RecFCChhCalorimeterPlugins SOURCES ${_module_sources} LINK k4FWCore::k4FWCore k4FWCore::k4Interface - Gaudi::GaudiAlgLib Gaudi::GaudiKernel DD4hep::DDCore EDM4HEP::edm4hep diff --git a/RecFCChhCalorimeter/src/components/CreateCaloCellPositions.cpp b/RecFCChhCalorimeter/src/components/CreateCaloCellPositions.cpp index cd2e9f80..8dd01e78 100644 --- a/RecFCChhCalorimeter/src/components/CreateCaloCellPositions.cpp +++ b/RecFCChhCalorimeter/src/components/CreateCaloCellPositions.cpp @@ -13,7 +13,7 @@ DECLARE_COMPONENT(CreateCaloCellPositions) CreateCaloCellPositions::CreateCaloCellPositions(const std::string& name, ISvcLocator* svcLoc) - : GaudiAlgorithm(name, svcLoc) { + : Gaudi::Algorithm(name, svcLoc) { declareProperty("hits", m_hits, "Hit collection (input)"); declareProperty("positionsECalBarrelTool", m_cellPositionsECalBarrelTool, "Handle for tool to retrieve cell positions in ECal Barrel"); @@ -29,12 +29,12 @@ CreateCaloCellPositions::CreateCaloCellPositions(const std::string& name, ISvcLo } StatusCode CreateCaloCellPositions::initialize() { - StatusCode sc = GaudiAlgorithm::initialize(); + StatusCode sc = Gaudi::Algorithm::initialize(); if (sc.isFailure()) return sc; return StatusCode::SUCCESS; } -StatusCode CreateCaloCellPositions::execute() { +StatusCode CreateCaloCellPositions::execute(const EventContext&) const { // Get the input hit collection const auto* hits = m_hits.get(); debug() << "Input hit collection size: " << hits->size() << endmsg; @@ -81,4 +81,4 @@ StatusCode CreateCaloCellPositions::execute() { return StatusCode::SUCCESS; } -StatusCode CreateCaloCellPositions::finalize() { return GaudiAlgorithm::finalize(); } +StatusCode CreateCaloCellPositions::finalize() { return Gaudi::Algorithm::finalize(); } diff --git a/RecFCChhCalorimeter/src/components/CreateCaloCellPositions.h b/RecFCChhCalorimeter/src/components/CreateCaloCellPositions.h index d1fdd627..f5a91147 100644 --- a/RecFCChhCalorimeter/src/components/CreateCaloCellPositions.h +++ b/RecFCChhCalorimeter/src/components/CreateCaloCellPositions.h @@ -6,7 +6,7 @@ #include "k4Interface/ICellPositionsTool.h" // Gaudi -#include "GaudiAlg/GaudiAlgorithm.h" +#include "Gaudi/Algorithm.h" #include "GaudiKernel/ToolHandle.h" #include "edm4hep/CalorimeterHit.h" @@ -24,7 +24,7 @@ class IGeoSvc; * */ -class CreateCaloCellPositions : public GaudiAlgorithm { +class CreateCaloCellPositions : public Gaudi::Algorithm { public: CreateCaloCellPositions(const std::string& name, ISvcLocator* svcLoc); @@ -35,7 +35,7 @@ class CreateCaloCellPositions : public GaudiAlgorithm { /** Execute. * @return status code */ - StatusCode execute(); + StatusCode execute(const EventContext&) const; /** Finalize. * @return status code */ @@ -59,9 +59,9 @@ class CreateCaloCellPositions : public GaudiAlgorithm { /// Decoder for system ID dd4hep::DDSegmentation::BitFieldCoder* m_decoder = new dd4hep::DDSegmentation::BitFieldCoder("system:4"); /// Input collection - DataHandle m_hits{"hits/hits", Gaudi::DataHandle::Reader, this}; + mutable DataHandle m_hits{"hits/hits", Gaudi::DataHandle::Reader, this}; /// Output collection - DataHandle m_positionedHits{"hits/positionedHits", Gaudi::DataHandle::Writer, this}; + mutable DataHandle m_positionedHits{"hits/positionedHits", Gaudi::DataHandle::Writer, this}; }; #endif /* DETCOMPONENTS_CREATECELLPOSITIONS_H */ diff --git a/RecFCChhCalorimeter/src/components/CreateCellPositions.cpp b/RecFCChhCalorimeter/src/components/CreateCellPositions.cpp index b932a6c5..f8571606 100644 --- a/RecFCChhCalorimeter/src/components/CreateCellPositions.cpp +++ b/RecFCChhCalorimeter/src/components/CreateCellPositions.cpp @@ -12,14 +12,14 @@ DECLARE_COMPONENT(CreateCellPositions) -CreateCellPositions::CreateCellPositions(const std::string& name, ISvcLocator* svcLoc) : GaudiAlgorithm(name, svcLoc) { +CreateCellPositions::CreateCellPositions(const std::string& name, ISvcLocator* svcLoc) : Gaudi::Algorithm(name, svcLoc) { declareProperty("hits", m_hits, "Hit collection (input)"); declareProperty("positionsTool", m_cellPositionsTool, "Handle for tool to retrieve cell positions"); declareProperty("positionedHits", m_positionedHits, "Output cell positions collection"); } StatusCode CreateCellPositions::initialize() { - StatusCode sc = GaudiAlgorithm::initialize(); + StatusCode sc = Gaudi::Algorithm::initialize(); if (sc.isFailure()) return sc; if (!m_cellPositionsTool.retrieve()) { error() << "Unable to retrieve the cell positions tool!!!" << endmsg; @@ -28,7 +28,7 @@ StatusCode CreateCellPositions::initialize() { return StatusCode::SUCCESS; } -StatusCode CreateCellPositions::execute() { +StatusCode CreateCellPositions::execute(const EventContext&) const { // Get the input hit collection const auto* hits = m_hits.get(); debug() << "Input hit collection size: " << hits->size() << endmsg; @@ -41,4 +41,4 @@ StatusCode CreateCellPositions::execute() { return StatusCode::SUCCESS; } -StatusCode CreateCellPositions::finalize() { return GaudiAlgorithm::finalize(); } +StatusCode CreateCellPositions::finalize() { return Gaudi::Algorithm::finalize(); } diff --git a/RecFCChhCalorimeter/src/components/CreateCellPositions.h b/RecFCChhCalorimeter/src/components/CreateCellPositions.h index 87e15928..08952fec 100644 --- a/RecFCChhCalorimeter/src/components/CreateCellPositions.h +++ b/RecFCChhCalorimeter/src/components/CreateCellPositions.h @@ -6,7 +6,7 @@ #include "k4Interface/ICellPositionsTool.h" // Gaudi -#include "GaudiAlg/GaudiAlgorithm.h" +#include "Gaudi/Algorithm.h" #include "GaudiKernel/ToolHandle.h" #include "edm4hep/CalorimeterHit.h" @@ -25,7 +25,7 @@ class IGeoSvc; * */ -class CreateCellPositions : public GaudiAlgorithm { +class CreateCellPositions : public Gaudi::Algorithm { public: CreateCellPositions(const std::string& name, ISvcLocator* svcLoc); @@ -36,7 +36,7 @@ class CreateCellPositions : public GaudiAlgorithm { /** Execute. * @return status code */ - StatusCode execute(); + StatusCode execute(const EventContext&) const; /** Finalize. * @return status code */ @@ -46,9 +46,9 @@ class CreateCellPositions : public GaudiAlgorithm { /// Handle for tool to get positions ToolHandle m_cellPositionsTool; /// Input collection - DataHandle m_hits{"hits/hits", Gaudi::DataHandle::Reader, this}; + mutable DataHandle m_hits{"hits/hits", Gaudi::DataHandle::Reader, this}; /// Output collection - DataHandle m_positionedHits{"hits/positionedHits", Gaudi::DataHandle::Writer, this}; + mutable DataHandle m_positionedHits{"hits/positionedHits", Gaudi::DataHandle::Writer, this}; }; #endif /* DETCOMPONENTS_CREATECELLPOSITIONS_H */ From d61bc7b634f9f316fc4a3c49d4f89dca11bea787 Mon Sep 17 00:00:00 2001 From: jmcarcell Date: Mon, 29 Jul 2024 10:08:34 +0200 Subject: [PATCH 2/3] Add many mutables in places where they are needed --- .../src/components/CalibrateBenchmarkMethod.h | 16 ++++----- .../src/components/CalibrateCaloHitsTool.cpp | 6 ++-- .../src/components/CalibrateCaloHitsTool.h | 4 +-- .../src/components/CalibrateInLayersTool.cpp | 6 ++-- .../src/components/CalibrateInLayersTool.h | 4 +-- .../src/components/CaloTopoCluster.cpp | 16 ++++----- .../src/components/CaloTopoCluster.h | 28 +++++++-------- .../components/CaloTopoClusterInputTool.cpp | 6 ++-- .../src/components/CaloTopoClusterInputTool.h | 4 +-- .../src/components/CaloTowerTool.cpp | 6 ++-- RecCalorimeter/src/components/CaloTowerTool.h | 4 +-- RecCalorimeter/src/components/ConeSelection.h | 2 +- .../src/components/ConstNoiseTool.cpp | 6 ++-- .../src/components/ConstNoiseTool.h | 4 +-- .../src/components/CorrectCaloClusters.cpp | 14 ++++---- .../src/components/CorrectCaloClusters.h | 14 ++++---- .../CorrectECalBarrelSliWinCluster.cpp | 2 +- .../CorrectECalBarrelSliWinCluster.h | 34 +++++++++---------- .../src/components/CreateCaloCells.h | 10 +++--- .../src/components/CreateCaloCellsNoise.h | 6 ++-- .../src/components/CreateCaloClusters.h | 34 +++++++++---------- .../CreateCaloClustersSlidingWindow.h | 6 ++-- .../src/components/LayerPhiEtaCaloTool.cpp | 6 ++-- .../src/components/LayerPhiEtaCaloTool.h | 4 +-- .../src/components/LayeredCaloTowerTool.cpp | 6 ++-- .../src/components/LayeredCaloTowerTool.h | 4 +-- RecCalorimeter/src/components/MassInv.cpp | 2 +- RecCalorimeter/src/components/MassInv.h | 12 +++---- .../src/components/NestedVolumesCaloTool.cpp | 6 ++-- .../src/components/NestedVolumesCaloTool.h | 4 +-- .../src/components/NoiseCaloCellsFlatTool.cpp | 6 ++-- .../src/components/NoiseCaloCellsFlatTool.h | 4 +-- .../components/NoiseCaloCellsFromFileTool.cpp | 6 ++-- .../components/NoiseCaloCellsFromFileTool.h | 4 +-- RecCalorimeter/src/components/PreparePileup.h | 10 +++--- .../src/components/ReadCaloCrosstalkMap.cpp | 6 ++-- .../src/components/ReadCaloCrosstalkMap.h | 4 +-- .../src/components/ReadNoiseFromFileTool.cpp | 6 ++-- .../src/components/ReadNoiseFromFileTool.h | 4 +-- .../src/components/SplitClusters.cpp | 2 +- RecCalorimeter/src/components/SplitClusters.h | 4 +-- .../src/components/TopoCaloNeighbours.cpp | 6 ++-- .../src/components/TopoCaloNeighbours.h | 4 +-- .../src/components/TopoCaloNoisyCells.cpp | 6 ++-- .../src/components/TopoCaloNoisyCells.h | 4 +-- .../components/TubeLayerPhiEtaCaloTool.cpp | 6 ++-- .../src/components/TubeLayerPhiEtaCaloTool.h | 4 +-- RecFCCeeCalorimeter/CMakeLists.txt | 4 +-- .../src/components/CaloTopoClusterFCCee.cpp | 16 ++++----- .../src/components/CaloTopoClusterFCCee.h | 18 +++++----- .../src/components/CaloTowerToolFCCee.cpp | 6 ++-- .../src/components/CaloTowerToolFCCee.h | 4 +-- ...lPositionsECalBarrelModuleThetaSegTool.cpp | 6 ++-- ...ellPositionsECalBarrelModuleThetaSegTool.h | 4 +-- ...CellPositionsECalBarrelPhiThetaSegTool.cpp | 6 ++-- .../CellPositionsECalBarrelPhiThetaSegTool.h | 4 +-- ...CellPositionsHCalBarrelPhiThetaSegTool.cpp | 6 ++-- .../CellPositionsHCalBarrelPhiThetaSegTool.h | 4 +-- .../components/CreateCaloCellPositionsFCCee.h | 2 +- .../CreateCaloClustersSlidingWindowFCCee.h | 6 ++-- .../NoiseCaloCellsVsThetaFromFileTool.cpp | 6 ++-- .../NoiseCaloCellsVsThetaFromFileTool.h | 4 +-- .../components/CellPositionsCaloDiscsTool.cpp | 6 ++-- .../components/CellPositionsCaloDiscsTool.h | 4 +-- .../src/components/CellPositionsDummyTool.cpp | 6 ++-- .../src/components/CellPositionsDummyTool.h | 4 +-- .../CellPositionsECalBarrelTool.cpp | 6 ++-- .../components/CellPositionsECalBarrelTool.h | 4 +-- .../CellPositionsHCalBarrelNoSegTool.cpp | 6 ++-- .../CellPositionsHCalBarrelNoSegTool.h | 4 +-- .../CellPositionsHCalBarrelPhiSegTool.cpp | 6 ++-- .../CellPositionsHCalBarrelPhiSegTool.h | 4 +-- .../CellPositionsHCalBarrelTool.cpp | 6 ++-- .../components/CellPositionsHCalBarrelTool.h | 4 +-- .../CellPositionsTailCatcherTool.cpp | 6 ++-- .../components/CellPositionsTailCatcherTool.h | 4 +-- .../src/components/CreateCellPositions.h | 2 +- 77 files changed, 265 insertions(+), 265 deletions(-) diff --git a/RecCalorimeter/src/components/CalibrateBenchmarkMethod.h b/RecCalorimeter/src/components/CalibrateBenchmarkMethod.h index 47f607f9..32182fa2 100644 --- a/RecCalorimeter/src/components/CalibrateBenchmarkMethod.h +++ b/RecCalorimeter/src/components/CalibrateBenchmarkMethod.h @@ -81,8 +81,8 @@ class CalibrateBenchmarkMethod : public Gaudi::Algorithm { TH1F* m_parameters; /// vectors to store the energy in each ECal/HCal layer - std::vector m_energyInLayerECal; - std::vector m_energyInLayerHCal; + mutable std::vector m_energyInLayerECal; + mutable std::vector m_energyInLayerHCal; /// Maximum energy for the x-axis range @@ -103,12 +103,12 @@ class CalibrateBenchmarkMethod : public Gaudi::Algorithm { Gaudi::Property m_systemIDHCal{this, "HCalSystemID", 8, "ID of the HCal system"}; /// vectors containing the energy deposits to be used for minimization - std::vector m_vecGeneratedEnergy; - std::vector m_vecTotalEnergyinECal; - std::vector m_vecTotalEnergyinHCal; - std::vector m_vecEnergyInFirstLayerECal; - std::vector m_vecEnergyInLastLayerECal; - std::vector m_vecEnergyInFirstLayerHCal; + mutable std::vector m_vecGeneratedEnergy; + mutable std::vector m_vecTotalEnergyinECal; + mutable std::vector m_vecTotalEnergyinHCal; + mutable std::vector m_vecEnergyInFirstLayerECal; + mutable std::vector m_vecEnergyInLastLayerECal; + mutable std::vector m_vecEnergyInFirstLayerHCal; // benchmark parameters which should be fixed // p[1] because HCal is already calibrated to HAD scale diff --git a/RecCalorimeter/src/components/CalibrateCaloHitsTool.cpp b/RecCalorimeter/src/components/CalibrateCaloHitsTool.cpp index 9e5e0622..1e269f50 100644 --- a/RecCalorimeter/src/components/CalibrateCaloHitsTool.cpp +++ b/RecCalorimeter/src/components/CalibrateCaloHitsTool.cpp @@ -3,12 +3,12 @@ DECLARE_COMPONENT(CalibrateCaloHitsTool) CalibrateCaloHitsTool::CalibrateCaloHitsTool(const std::string& type, const std::string& name, const IInterface* parent) - : GaudiTool(type, name, parent) { + : AlgTool(type, name, parent) { declareInterface(this); } StatusCode CalibrateCaloHitsTool::initialize() { - StatusCode sc = GaudiTool::initialize(); + StatusCode sc = AlgTool::initialize(); if (sc.isFailure()) { return sc; } @@ -22,4 +22,4 @@ void CalibrateCaloHitsTool::calibrate(std::unordered_map& aHit [this](std::pair& p) { p.second *= m_invSamplingFraction; }); } -StatusCode CalibrateCaloHitsTool::finalize() { return GaudiTool::finalize(); } +StatusCode CalibrateCaloHitsTool::finalize() { return AlgTool::finalize(); } diff --git a/RecCalorimeter/src/components/CalibrateCaloHitsTool.h b/RecCalorimeter/src/components/CalibrateCaloHitsTool.h index 4afc4c47..ed05e657 100644 --- a/RecCalorimeter/src/components/CalibrateCaloHitsTool.h +++ b/RecCalorimeter/src/components/CalibrateCaloHitsTool.h @@ -2,7 +2,7 @@ #define RECCALORIMETER_CALIBRATECALOHITSTOOL_H // from Gaudi -#include "GaudiAlg/GaudiTool.h" +#include "GaudiKernel/AlgTool.h" // k4FWCore #include "k4Interface/ICalibrateCaloHitsTool.h" @@ -21,7 +21,7 @@ * @date 2016-09 */ -class CalibrateCaloHitsTool : public GaudiTool, virtual public ICalibrateCaloHitsTool { +class CalibrateCaloHitsTool : public AlgTool, virtual public ICalibrateCaloHitsTool { public: CalibrateCaloHitsTool(const std::string& type, const std::string& name, const IInterface* parent); ~CalibrateCaloHitsTool() = default; diff --git a/RecCalorimeter/src/components/CalibrateInLayersTool.cpp b/RecCalorimeter/src/components/CalibrateInLayersTool.cpp index f8ae7437..8d9f0683 100644 --- a/RecCalorimeter/src/components/CalibrateInLayersTool.cpp +++ b/RecCalorimeter/src/components/CalibrateInLayersTool.cpp @@ -10,12 +10,12 @@ DECLARE_COMPONENT(CalibrateInLayersTool) CalibrateInLayersTool::CalibrateInLayersTool(const std::string& type, const std::string& name, const IInterface* parent) - : GaudiTool(type, name, parent), m_geoSvc("GeoSvc", "CalibrateInLayers") { + : AlgTool(type, name, parent), m_geoSvc("GeoSvc", "CalibrateInLayers") { declareInterface(this); } StatusCode CalibrateInLayersTool::initialize() { - if (GaudiTool::initialize().isFailure()) { + if (AlgTool::initialize().isFailure()) { return StatusCode::FAILURE; } // check if readout exists @@ -44,4 +44,4 @@ void CalibrateInLayersTool::calibrate(std::unordered_map& aHit }); } -StatusCode CalibrateInLayersTool::finalize() { return GaudiTool::finalize(); } +StatusCode CalibrateInLayersTool::finalize() { return AlgTool::finalize(); } diff --git a/RecCalorimeter/src/components/CalibrateInLayersTool.h b/RecCalorimeter/src/components/CalibrateInLayersTool.h index dde6576a..152808e4 100644 --- a/RecCalorimeter/src/components/CalibrateInLayersTool.h +++ b/RecCalorimeter/src/components/CalibrateInLayersTool.h @@ -2,7 +2,7 @@ #define RECCALORIMETER_CALIBRATEINLAYERSTOOL_H // from Gaudi -#include "GaudiAlg/GaudiTool.h" +#include "GaudiKernel/AlgTool.h" #include "GaudiKernel/ServiceHandle.h" // k4FWCore @@ -26,7 +26,7 @@ class IGeoSvc; * @author Anna Zaborowska */ -class CalibrateInLayersTool : public GaudiTool, virtual public ICalibrateCaloHitsTool { +class CalibrateInLayersTool : public AlgTool, virtual public ICalibrateCaloHitsTool { public: CalibrateInLayersTool(const std::string& type, const std::string& name, const IInterface* parent); ~CalibrateInLayersTool() = default; diff --git a/RecCalorimeter/src/components/CaloTopoCluster.cpp b/RecCalorimeter/src/components/CaloTopoCluster.cpp index d2ef6bee..c652ef44 100644 --- a/RecCalorimeter/src/components/CaloTopoCluster.cpp +++ b/RecCalorimeter/src/components/CaloTopoCluster.cpp @@ -110,11 +110,11 @@ StatusCode CaloTopoCluster::execute(const EventContext&) const { }); std::map>> preClusterCollection; - StatusCode sc = CaloTopoCluster::buildingProtoCluster(m_neighbourSigma, - m_lastNeighbourSigma, - firstSeeds, - allCells, - preClusterCollection); + StatusCode sc = buildingProtoCluster(m_neighbourSigma, + m_lastNeighbourSigma, + firstSeeds, + allCells, + preClusterCollection); if (sc.isFailure()) { error() << "Unable to build protocluster!" << endmsg; return sc; @@ -223,7 +223,7 @@ StatusCode CaloTopoCluster::execute(const EventContext&) const { void CaloTopoCluster::findingSeeds(const std::unordered_map& aCells, int aNumSigma, - std::vector>& aSeeds) { + std::vector>& aSeeds) const { for (const auto& cell : aCells) { // retrieve the noise const and offset assigned to cell double threshold = m_noiseTool->noiseOffset(cell.first) + ( m_noiseTool->noiseRMS(cell.first) * aNumSigma); @@ -243,7 +243,7 @@ StatusCode CaloTopoCluster::buildingProtoCluster( int aLastNumSigma, std::vector>& aSeeds, const std::unordered_map& aCells, - std::map>>& aPreClusterCollection) { + std::map>>& aPreClusterCollection) const { // Map of cellIDs to clusterIds std::map clusterOfCell; @@ -309,7 +309,7 @@ CaloTopoCluster::searchForNeighbours(const uint64_t aCellId, const std::unordered_map& aCells, std::map& aClusterOfCell, std::map>>& aPreClusterCollection, - bool aAllowClusterMerge) { + bool aAllowClusterMerge) const { // Fill vector to be returned, next cell ids and cluster id for which neighbours are found std::vector> addedNeighbourIds; // Retrieve cellIDs of neighbours diff --git a/RecCalorimeter/src/components/CaloTopoCluster.h b/RecCalorimeter/src/components/CaloTopoCluster.h index 3143c5ee..56d26e8c 100644 --- a/RecCalorimeter/src/components/CaloTopoCluster.h +++ b/RecCalorimeter/src/components/CaloTopoCluster.h @@ -54,7 +54,7 @@ class CaloTopoCluster : public Gaudi::Algorithm { * @param[in] aSeeds, the vector of seed cell ids anf their energy to build proto-clusters. */ virtual void findingSeeds(const std::unordered_map& aCells, int aNumSigma, - std::vector>& aSeeds); + std::vector>& aSeeds) const; /** Building proto-clusters from the found seeds. * First the function initialises a cluster in the preClusterCollection for the seed cells, @@ -69,7 +69,7 @@ class CaloTopoCluster : public Gaudi::Algorithm { int aLastNumSigma, std::vector>& aSeeds, const std::unordered_map& aCells, - std::map>>& aPreClusterCollection); + std::map>>& aPreClusterCollection) const; /** Search for neighbours and add them to preClusterCollection * The @@ -86,7 +86,7 @@ class CaloTopoCluster : public Gaudi::Algorithm { searchForNeighbours(const uint64_t aCellId, uint& aClusterID, int aNumSigma, const std::unordered_map& aCells, std::map& aClusterOfCell, std::map>>& aPreClusterCollection, - bool aAllowClusterMerge); + bool aAllowClusterMerge) const; StatusCode execute(const EventContext&) const; @@ -100,27 +100,27 @@ class CaloTopoCluster : public Gaudi::Algorithm { /// Pointer to the geometry service SmartIF m_geoSvc; /// Handle for the input tool - ToolHandle m_inputTool{"TopoClusterInput", this}; + mutable ToolHandle m_inputTool{"TopoClusterInput", this}; /// Handle for the cells noise tool - ToolHandle m_noiseTool{"TopoCaloNoisyCells", this}; + mutable ToolHandle m_noiseTool{"TopoCaloNoisyCells", this}; /// Handle for neighbours tool - ToolHandle m_neighboursTool{"TopoCaloNeighbours", this}; + mutable ToolHandle m_neighboursTool{"TopoCaloNeighbours", this}; /// Handle for tool to get positions in ECal Barrel - ToolHandle m_cellPositionsECalBarrelTool{"CellPositionsECalBarrelTool", this}; + mutable ToolHandle m_cellPositionsECalBarrelTool{"CellPositionsECalBarrelTool", this}; /// Handle for tool to get positions in HCal Barrel - ToolHandle m_cellPositionsHCalBarrelNoSegTool{"CellPositionsHCalBarrelNoSegTool", this}; + mutable ToolHandle m_cellPositionsHCalBarrelNoSegTool{"CellPositionsHCalBarrelNoSegTool", this}; /// Handle for tool to get positions in HCal Barrel - ToolHandle m_cellPositionsHCalBarrelTool{"CellPositionsHCalBarrelTool", this}; + mutable ToolHandle m_cellPositionsHCalBarrelTool{"CellPositionsHCalBarrelTool", this}; /// Handle for tool to get positions in HCal Barrel and Ext Barrel, no Segmentation - ToolHandle m_cellPositionsHCalExtBarrelTool{"CellPositionsHCalBarrelNoSegTool", this}; + mutable ToolHandle m_cellPositionsHCalExtBarrelTool{"CellPositionsHCalBarrelNoSegTool", this}; /// Handle for tool to get positions in Calo Discs - ToolHandle m_cellPositionsEMECTool{"CellPositionsCaloDiscsTool", this}; + mutable ToolHandle m_cellPositionsEMECTool{"CellPositionsCaloDiscsTool", this}; /// Handle for tool to get positions in Calo Discs - ToolHandle m_cellPositionsHECTool{"CellPositionsCaloDiscsTool", this}; + mutable ToolHandle m_cellPositionsHECTool{"CellPositionsCaloDiscsTool", this}; /// Handle for tool to get positions in Calo Discs - ToolHandle m_cellPositionsEMFwdTool{"CellPositionsCaloDiscsTool", this}; + mutable ToolHandle m_cellPositionsEMFwdTool{"CellPositionsCaloDiscsTool", this}; /// Handle for tool to get positions in Calo Discs - ToolHandle m_cellPositionsHFwdTool{"CellPositionsCaloDiscsTool", this}; + mutable ToolHandle m_cellPositionsHFwdTool{"CellPositionsCaloDiscsTool", this}; /// no segmentation used in HCal Gaudi::Property m_noSegmentationHCalUsed{this, "noSegmentationHCal", true, "HCal Barrel readout without DD4hep eta-phi segmentation used."}; diff --git a/RecCalorimeter/src/components/CaloTopoClusterInputTool.cpp b/RecCalorimeter/src/components/CaloTopoClusterInputTool.cpp index 6dc48fd5..458052d8 100644 --- a/RecCalorimeter/src/components/CaloTopoClusterInputTool.cpp +++ b/RecCalorimeter/src/components/CaloTopoClusterInputTool.cpp @@ -14,7 +14,7 @@ DECLARE_COMPONENT(CaloTopoClusterInputTool) CaloTopoClusterInputTool::CaloTopoClusterInputTool(const std::string& type, const std::string& name, const IInterface* parent) - : GaudiTool(type, name, parent) { + : AlgTool(type, name, parent) { declareProperty("ecalBarrelCells", m_ecalBarrelCells, ""); declareProperty("ecalEndcapCells", m_ecalEndcapCells, ""); declareProperty("ecalFwdCells", m_ecalFwdCells, ""); @@ -26,7 +26,7 @@ CaloTopoClusterInputTool::CaloTopoClusterInputTool(const std::string& type, cons } StatusCode CaloTopoClusterInputTool::initialize() { - if (GaudiTool::initialize().isFailure()) { + if (AlgTool::initialize().isFailure()) { return StatusCode::FAILURE; } m_geoSvc = service("GeoSvc"); @@ -39,7 +39,7 @@ StatusCode CaloTopoClusterInputTool::initialize() { return StatusCode::SUCCESS; } -StatusCode CaloTopoClusterInputTool::finalize() { return GaudiTool::finalize(); } +StatusCode CaloTopoClusterInputTool::finalize() { return AlgTool::finalize(); } StatusCode CaloTopoClusterInputTool::cellIDMap(std::unordered_map& aCells) { uint totalNumberOfCells = 0; diff --git a/RecCalorimeter/src/components/CaloTopoClusterInputTool.h b/RecCalorimeter/src/components/CaloTopoClusterInputTool.h index 38a47276..57941b67 100644 --- a/RecCalorimeter/src/components/CaloTopoClusterInputTool.h +++ b/RecCalorimeter/src/components/CaloTopoClusterInputTool.h @@ -1,7 +1,7 @@ #ifndef RECCALORIMETER_CALOTOPOCLUSTERINPUTTOOL_H // from Gaudi -#include "GaudiAlg/GaudiTool.h" +#include "GaudiKernel/AlgTool.h" // k4FWCore #include "k4FWCore/DataHandle.h" @@ -32,7 +32,7 @@ class Segmentation; * @author Coralie Neubueser */ -class CaloTopoClusterInputTool : public GaudiTool, virtual public ITopoClusterInputTool { +class CaloTopoClusterInputTool : public AlgTool, virtual public ITopoClusterInputTool { public: CaloTopoClusterInputTool(const std::string& type, const std::string& name, const IInterface* parent); virtual ~CaloTopoClusterInputTool() = default; diff --git a/RecCalorimeter/src/components/CaloTowerTool.cpp b/RecCalorimeter/src/components/CaloTowerTool.cpp index 5b05bd2e..8269236a 100644 --- a/RecCalorimeter/src/components/CaloTowerTool.cpp +++ b/RecCalorimeter/src/components/CaloTowerTool.cpp @@ -15,7 +15,7 @@ DECLARE_COMPONENT(CaloTowerTool) CaloTowerTool::CaloTowerTool(const std::string& type, const std::string& name, const IInterface* parent) - : GaudiTool(type, name, parent), m_geoSvc("GeoSvc", name) { + : AlgTool(type, name, parent), m_geoSvc("GeoSvc", name) { declareProperty("ecalBarrelCells", m_ecalBarrelCells, ""); declareProperty("ecalEndcapCells", m_ecalEndcapCells, ""); declareProperty("ecalFwdCells", m_ecalFwdCells, ""); @@ -27,7 +27,7 @@ CaloTowerTool::CaloTowerTool(const std::string& type, const std::string& name, c } StatusCode CaloTowerTool::initialize() { - if (GaudiTool::initialize().isFailure()) { + if (AlgTool::initialize().isFailure()) { return StatusCode::FAILURE; } @@ -107,7 +107,7 @@ StatusCode CaloTowerTool::finalize() { for (auto& towerInMap : m_cellsInTowers) { towerInMap.second.clear(); } - return GaudiTool::finalize(); + return AlgTool::finalize(); } std::pair CaloTowerTool::retrievePhiEtaExtrema(dd4hep::DDSegmentation::Segmentation* aSegmentation, SegmentationType aType) { diff --git a/RecCalorimeter/src/components/CaloTowerTool.h b/RecCalorimeter/src/components/CaloTowerTool.h index 605a32ca..fadd9dc4 100644 --- a/RecCalorimeter/src/components/CaloTowerTool.h +++ b/RecCalorimeter/src/components/CaloTowerTool.h @@ -2,7 +2,7 @@ #define RECCALORIMETER_CALOTOWERTOOL_H // from Gaudi -#include "GaudiAlg/GaudiTool.h" +#include "GaudiKernel/AlgTool.h" // k4geo #include "detectorSegmentations/FCCSWGridPhiEta_k4geo.h" @@ -48,7 +48,7 @@ class Cluster; * @author Jana Faltova */ -class CaloTowerTool : public GaudiTool, virtual public ITowerTool { +class CaloTowerTool : public AlgTool, virtual public ITowerTool { public: CaloTowerTool(const std::string& type, const std::string& name, const IInterface* parent); virtual ~CaloTowerTool() = default; diff --git a/RecCalorimeter/src/components/ConeSelection.h b/RecCalorimeter/src/components/ConeSelection.h index becd0e5f..013dfac0 100644 --- a/RecCalorimeter/src/components/ConeSelection.h +++ b/RecCalorimeter/src/components/ConeSelection.h @@ -46,7 +46,7 @@ class ConeSelection : public Gaudi::Algorithm { /// Handle for calo cells (output collection) mutable DataHandle m_selCells{"selCells", Gaudi::DataHandle::Writer, this}; /// Map of cell IDs (corresponding to DD4hep IDs) and energy - std::unordered_map m_cellsMap; + mutable std::unordered_map m_cellsMap; Gaudi::Property m_r{this, "radius", 0.4, "radius of selection cone"}; }; diff --git a/RecCalorimeter/src/components/ConstNoiseTool.cpp b/RecCalorimeter/src/components/ConstNoiseTool.cpp index f446d4cb..33595fdb 100644 --- a/RecCalorimeter/src/components/ConstNoiseTool.cpp +++ b/RecCalorimeter/src/components/ConstNoiseTool.cpp @@ -12,7 +12,7 @@ DECLARE_COMPONENT(ConstNoiseTool) ConstNoiseTool::ConstNoiseTool(const std::string& type, const std::string& name, const IInterface* parent) - : GaudiTool(type, name, parent) { + : AlgTool(type, name, parent) { declareInterface(this); } @@ -57,14 +57,14 @@ StatusCode ConstNoiseTool::initialize() { } } - StatusCode sc = GaudiTool::initialize(); + StatusCode sc = AlgTool::initialize(); if (sc.isFailure()) return sc; return sc; } StatusCode ConstNoiseTool::finalize() { - StatusCode sc = GaudiTool::finalize(); + StatusCode sc = AlgTool::finalize(); return sc; } diff --git a/RecCalorimeter/src/components/ConstNoiseTool.h b/RecCalorimeter/src/components/ConstNoiseTool.h index b4f2c798..6bf00825 100644 --- a/RecCalorimeter/src/components/ConstNoiseTool.h +++ b/RecCalorimeter/src/components/ConstNoiseTool.h @@ -2,7 +2,7 @@ #define RECCALORIMETER_CONSTNOISETOOL_H // from Gaudi -#include "GaudiAlg/GaudiTool.h" +#include "GaudiKernel/AlgTool.h" class IRndmGenSvc; // DD4HEP @@ -27,7 +27,7 @@ class IGeoSvc; * */ -class ConstNoiseTool : public GaudiTool, virtual public INoiseConstTool { +class ConstNoiseTool : public AlgTool, virtual public INoiseConstTool { public: ConstNoiseTool(const std::string& type, const std::string& name, const IInterface* parent); virtual ~ConstNoiseTool() = default; diff --git a/RecCalorimeter/src/components/CorrectCaloClusters.cpp b/RecCalorimeter/src/components/CorrectCaloClusters.cpp index 5ad7ed87..93b5f9cf 100644 --- a/RecCalorimeter/src/components/CorrectCaloClusters.cpp +++ b/RecCalorimeter/src/components/CorrectCaloClusters.cpp @@ -281,7 +281,7 @@ StatusCode CorrectCaloClusters::finalize() { edm4hep::ClusterCollection* CorrectCaloClusters::initializeOutputClusters( - const edm4hep::ClusterCollection* inClusters) { + const edm4hep::ClusterCollection* inClusters) const { edm4hep::ClusterCollection* outClusters = m_outClusters.createAndPut(); @@ -351,7 +351,7 @@ StatusCode CorrectCaloClusters::initializeCorrFunctions(std::vectorsize(); ++j) { double energyInFirstLayer = getEnergyInLayer(inClusters->at(j), @@ -388,7 +388,7 @@ StatusCode CorrectCaloClusters::applyUpstreamCorr(const edm4hep::ClusterCollecti StatusCode CorrectCaloClusters::applyDownstreamCorr(const edm4hep::ClusterCollection* inClusters, - edm4hep::ClusterCollection* outClusters) { + edm4hep::ClusterCollection* outClusters) const { for (size_t i = 0; i < m_readoutNames.size(); ++i) { for (size_t j = 0; j < inClusters->size(); ++j) { double energyInLastLayer = getEnergyInLayer(inClusters->at(j), @@ -424,7 +424,7 @@ StatusCode CorrectCaloClusters::applyDownstreamCorr(const edm4hep::ClusterCollec } StatusCode CorrectCaloClusters::applyBenchmarkCorr(const edm4hep::ClusterCollection* inClusters, - edm4hep::ClusterCollection* outClusters) { + edm4hep::ClusterCollection* outClusters) const { const size_t numReadoutNames = m_readoutNames.size(); @@ -531,7 +531,7 @@ StatusCode CorrectCaloClusters::applyBenchmarkCorr(const edm4hep::ClusterCollect double CorrectCaloClusters::getEnergyInLayer(edm4hep::Cluster cluster, const std::string& readoutName, int systemID, - int layerID) { + int layerID) const { dd4hep::DDSegmentation::BitFieldCoder* decoder = m_geoSvc->getDetector()->readout(readoutName).idSpec().decoder(); double energy = 0; @@ -550,7 +550,7 @@ double CorrectCaloClusters::getEnergyInLayer(edm4hep::Cluster cluster, } -double CorrectCaloClusters::getClusterTheta(edm4hep::Cluster cluster) { +double CorrectCaloClusters::getClusterTheta(edm4hep::Cluster cluster) const { double rxy = std::sqrt(std::pow(cluster.getPosition().x, 2) + std::pow(cluster.getPosition().y, 2)); double theta = ::fabs(std::atan2(rxy, cluster.getPosition().z)); theta = 180 * theta / M_PI; @@ -561,7 +561,7 @@ double CorrectCaloClusters::getClusterTheta(edm4hep::Cluster cluster) { double CorrectCaloClusters::getTotalEnergy(edm4hep::Cluster cluster, const std::string& readoutName, - int systemID) { + int systemID) const { dd4hep::DDSegmentation::BitFieldCoder* decoder = m_geoSvc->getDetector()->readout(readoutName).idSpec().decoder(); double energy = 0; diff --git a/RecCalorimeter/src/components/CorrectCaloClusters.h b/RecCalorimeter/src/components/CorrectCaloClusters.h index 64c575f9..45bc641c 100644 --- a/RecCalorimeter/src/components/CorrectCaloClusters.h +++ b/RecCalorimeter/src/components/CorrectCaloClusters.h @@ -78,7 +78,7 @@ class CorrectCaloClusters : public Gaudi::Algorithm { * * @return Pointer to the output cluster collection. */ - edm4hep::ClusterCollection* initializeOutputClusters(const edm4hep::ClusterCollection* inClusters); + edm4hep::ClusterCollection* initializeOutputClusters(const edm4hep::ClusterCollection* inClusters) const; /** * Initialize vectors of upstream and downstream correction functions. @@ -99,7 +99,7 @@ class CorrectCaloClusters : public Gaudi::Algorithm { * @return Status code. */ StatusCode applyUpstreamCorr(const edm4hep::ClusterCollection* inClusters, - edm4hep::ClusterCollection* outClusters); + edm4hep::ClusterCollection* outClusters) const; /** * Apply downstream correction to the output clusters. @@ -110,7 +110,7 @@ class CorrectCaloClusters : public Gaudi::Algorithm { * @return Status code. */ StatusCode applyDownstreamCorr(const edm4hep::ClusterCollection* inClusters, - edm4hep::ClusterCollection* outClusters); + edm4hep::ClusterCollection* outClusters) const; /** * Apply benchmark correction to the output clusters. @@ -121,7 +121,7 @@ class CorrectCaloClusters : public Gaudi::Algorithm { * @return Status code. */ StatusCode applyBenchmarkCorr(const edm4hep::ClusterCollection* inClusters, - edm4hep::ClusterCollection* outClusters); + edm4hep::ClusterCollection* outClusters) const; /** * Get sum of energy from cells in specified layer. @@ -137,7 +137,7 @@ class CorrectCaloClusters : public Gaudi::Algorithm { double getEnergyInLayer(edm4hep::Cluster cluster, const std::string& readoutName, int systemID, - int layerID); + int layerID) const; /** * Get sum of energy from cells in the whole calorimeter. @@ -151,7 +151,7 @@ class CorrectCaloClusters : public Gaudi::Algorithm { */ double getTotalEnergy(edm4hep::Cluster cluster, const std::string& readoutName, - int systemID); + int systemID) const; /** * Get the theta angle of the specified cluster. @@ -160,7 +160,7 @@ class CorrectCaloClusters : public Gaudi::Algorithm { * * @return theta angle value. */ - double getClusterTheta(edm4hep::Cluster cluster); + double getClusterTheta(edm4hep::Cluster cluster) const; /// Handle for input calorimeter clusters collection mutable DataHandle m_inClusters { diff --git a/RecCalorimeter/src/components/CorrectECalBarrelSliWinCluster.cpp b/RecCalorimeter/src/components/CorrectECalBarrelSliWinCluster.cpp index 21863ecb..20b5b7e4 100644 --- a/RecCalorimeter/src/components/CorrectECalBarrelSliWinCluster.cpp +++ b/RecCalorimeter/src/components/CorrectECalBarrelSliWinCluster.cpp @@ -472,7 +472,7 @@ StatusCode CorrectECalBarrelSliWinCluster::initNoiseFromFile() { return StatusCode::SUCCESS; } -double CorrectECalBarrelSliWinCluster::getNoiseRMSPerCluster(double aEta, uint aNumCells) { +double CorrectECalBarrelSliWinCluster::getNoiseRMSPerCluster(double aEta, uint aNumCells) const { double param0 = 0.; double param1 = 0.; diff --git a/RecCalorimeter/src/components/CorrectECalBarrelSliWinCluster.h b/RecCalorimeter/src/components/CorrectECalBarrelSliWinCluster.h index 3c24a229..21b4f275 100644 --- a/RecCalorimeter/src/components/CorrectECalBarrelSliWinCluster.h +++ b/RecCalorimeter/src/components/CorrectECalBarrelSliWinCluster.h @@ -86,7 +86,7 @@ class CorrectECalBarrelSliWinCluster : public Gaudi::Algorithm { * @param[in] aNumCells Number of cells in a cluster * @return Width of the Gaussian distribution of noise per cluster */ - double getNoiseRMSPerCluster(double aEta, uint numCells); + double getNoiseRMSPerCluster(double aEta, uint numCells) const; /// Handle for clusters (input collection) mutable DataHandle m_inClusters{"clusters", Gaudi::DataHandle::Reader, this}; /// Handle for corrected clusters (output collection) @@ -100,27 +100,27 @@ class CorrectECalBarrelSliWinCluster : public Gaudi::Algorithm { /// Pointer to the geometry service ServiceHandle m_geoSvc; /// Histogram of energy before any correction - TH1F* m_hEnergyPreAnyCorrections; + mutable TH1F* m_hEnergyPreAnyCorrections; /// Histogram of energy after all corrections - TH1F* m_hEnergyPostAllCorrections; + mutable TH1F* m_hEnergyPostAllCorrections; /// Histogram of energy after all corrections and scaled to restore response = 1 - TH1F* m_hEnergyPostAllCorrectionsAndScaling; + mutable TH1F* m_hEnergyPostAllCorrectionsAndScaling; /// Ratio of energy in layers - TH1F* m_hEnergyFractionInLayers; + mutable TH1F* m_hEnergyFractionInLayers; /// Histogram of eta resolution - TH1F* m_hDiffEta; - TH1F* m_hDiffEtaResWeight; - TH1F* m_hDiffEtaResWeight2point; + mutable TH1F* m_hDiffEta; + mutable TH1F* m_hDiffEtaResWeight; + mutable TH1F* m_hDiffEtaResWeight2point; /// Histogram of eta resolution per layer std::vector m_hDiffEtaLayer; /// Histogram of phi resolution - TH1F* m_hDiffPhi; + mutable TH1F* m_hDiffPhi; /// Histogram of eta - TH1F* m_hEta; + mutable TH1F* m_hEta; /// Histogram of phi - TH1F* m_hPhi; + mutable TH1F* m_hPhi; /// Number of cells inside cluster - TH1F* m_hNumCells; + mutable TH1F* m_hNumCells; /// Energy of the centre of energy distribution histograms Gaudi::Property m_response{this, "response", 0.95, "Reconstructed energy (in the cluster) used for scaling"}; /// Energy of the centre of energy distribution histograms @@ -153,12 +153,12 @@ class CorrectECalBarrelSliWinCluster : public Gaudi::Algorithm { Gaudi::Property> m_readoutName{ this, "readoutName", {"ECalBarrelPhiEta"}, "Names of the detector readout, corresponding to systemId"}; /// map of system Id to segmentation, created based on m_readoutName and m_systemId - std::map m_segmentationPhiEta; - std::map m_segmentationMulti; + mutable std::map m_segmentationPhiEta; + mutable std::map m_segmentationMulti; /// map of system Id to decoder, created based on m_readoutName and m_systemId - std::map m_decoder; + mutable std::map m_decoder; /// Histogram of pileup noise added to energy of clusters - TH1F* m_hPileupEnergy; + mutable TH1F* m_hPileupEnergy; /// Random Number Service IRndmGenSvc* m_randSvc; /// Gaussian random number generator used for the generation of random noise hits @@ -205,7 +205,7 @@ class CorrectECalBarrelSliWinCluster : public Gaudi::Algorithm { /// segmentation of detetor in phi (for number of bins in histograms) Gaudi::Property m_dPhi{this, "dPhi", 2*M_PI/704, "Segmentation in phi"}; /// Histogram of upstream energy added to energy of clusters - TH1F* m_hUpstreamEnergy; + mutable TH1F* m_hUpstreamEnergy; /// Size of the window in phi for the final cluster building, optimised for each layer (in units of cell size) /// If empty use same size for each layer, as in *nPhiFinal* Gaudi::Property> m_nPhiFinal{this, "nPhiOptimFinal", {}}; diff --git a/RecCalorimeter/src/components/CreateCaloCells.h b/RecCalorimeter/src/components/CreateCaloCells.h index 87af00e5..70e4b0ce 100644 --- a/RecCalorimeter/src/components/CreateCaloCells.h +++ b/RecCalorimeter/src/components/CreateCaloCells.h @@ -64,11 +64,11 @@ class CreateCaloCells : public Gaudi::Algorithm { private: /// Handle for the calorimeter cells crosstalk tool - ToolHandle m_crosstalksTool{"ReadCaloCrosstalkMap", this}; + mutable ToolHandle m_crosstalksTool{"ReadCaloCrosstalkMap", this}; /// Handle for tool to calibrate Geant4 energy to EM scale tool - ToolHandle m_calibTool{"CalibrateCaloHitsTool", this}; + mutable ToolHandle m_calibTool{"CalibrateCaloHitsTool", this}; /// Handle for the calorimeter cells noise tool - ToolHandle m_noiseTool{"NoiseCaloCellsFlatTool", this}; + mutable ToolHandle m_noiseTool{"NoiseCaloCellsFlatTool", this}; /// Handle for the geometry tool ToolHandle m_geoTool{"TubeLayerPhiEtaCaloTool", this}; @@ -123,9 +123,9 @@ class CreateCaloCells : public Gaudi::Algorithm { ServiceHandle m_geoSvc; dd4hep::VolumeManager m_volman; /// Maps of cell IDs (corresponding to DD4hep IDs) on final energies to be used for clustering - std::unordered_map m_cellsMap; + mutable std::unordered_map m_cellsMap; /// Maps of cell IDs (corresponding to DD4hep IDs) on transfer of signals due to crosstalk - std::unordered_map m_CrosstalkCellsMap; + mutable std::unordered_map m_CrosstalkCellsMap; }; #endif /* RECCALORIMETER_CREATECALOCELLS_H */ diff --git a/RecCalorimeter/src/components/CreateCaloCellsNoise.h b/RecCalorimeter/src/components/CreateCaloCellsNoise.h index 3d9a1a53..c7aab6a4 100644 --- a/RecCalorimeter/src/components/CreateCaloCellsNoise.h +++ b/RecCalorimeter/src/components/CreateCaloCellsNoise.h @@ -59,9 +59,9 @@ class CreateCaloCellsNoise : public Gaudi::Algorithm { private: /// Handle for tool to calibrate Geant4 energy to EM scale tool - ToolHandle m_calibTool{"CalibrateCaloHitsTool", this}; + mutable ToolHandle m_calibTool{"CalibrateCaloHitsTool", this}; /// Handle for the calorimeter cells noise tool - ToolHandle m_noiseTool{"NoiseCaloCellsFlatTool", this}; + mutable ToolHandle m_noiseTool{"NoiseCaloCellsFlatTool", this}; /// Handle for the geometry tool ToolHandle m_geoTool{"TubeLayerPhiEtaCaloTool", this}; @@ -111,7 +111,7 @@ class CreateCaloCellsNoise : public Gaudi::Algorithm { ServiceHandle m_geoSvc; dd4hep::VolumeManager m_volman; /// Map of cell IDs (corresponding to DD4hep IDs) and energy - std::unordered_map m_cellsMap; + mutable std::unordered_map m_cellsMap; }; #endif /* RECCALORIMETER_CREATECALOCELLS_H */ diff --git a/RecCalorimeter/src/components/CreateCaloClusters.h b/RecCalorimeter/src/components/CreateCaloClusters.h index 3138c7c6..8ecab012 100644 --- a/RecCalorimeter/src/components/CreateCaloClusters.h +++ b/RecCalorimeter/src/components/CreateCaloClusters.h @@ -64,7 +64,7 @@ class CreateCaloClusters : public Gaudi::Algorithm { SmartIF m_geoSvc; /// Handle for calo clusters (input collection) - DataHandle m_clusters{"calo/clusters", Gaudi::DataHandle::Reader, this}; + mutable DataHandle m_clusters{"calo/clusters", Gaudi::DataHandle::Reader, this}; /// Handle for calo clusters (input collection) mutable DataHandle m_genParticles{"calo/genParticles", Gaudi::DataHandle::Reader, this}; /// Handle for calo clusters (output collection) @@ -81,22 +81,22 @@ class CreateCaloClusters : public Gaudi::Algorithm { const char *types[2] = {"EM", "HAD"}; - TH1F* m_energyScale; - TH1F* m_benchmark; - TH1F* m_fractionEMcluster; - TH2F* m_energyScaleVsClusterEnergy; - TH1F* m_totEnergy; - TH1F* m_totCalibEnergy; - TH1F* m_totBenchmarkEnergy; - TH1F* m_clusterEnergy; - TH1F* m_sharedClusterEnergy; - TH1F* m_clusterEnergyCalibrated; - TH1F* m_clusterEnergyBenchmark; - TH1F* m_nCluster; - TH1F* m_nCluster_1GeV; - TH1F* m_nCluster_halfTrueEnergy; - TH1F* m_energyCalibCluster_1GeV; - TH1F* m_energyCalibCluster_halfTrueEnergy; + mutable TH1F* m_energyScale; + mutable TH1F* m_benchmark; + mutable TH1F* m_fractionEMcluster; + mutable TH2F* m_energyScaleVsClusterEnergy; + mutable TH1F* m_totEnergy; + mutable TH1F* m_totCalibEnergy; + mutable TH1F* m_totBenchmarkEnergy; + mutable TH1F* m_clusterEnergy; + mutable TH1F* m_sharedClusterEnergy; + mutable TH1F* m_clusterEnergyCalibrated; + mutable TH1F* m_clusterEnergyBenchmark; + mutable TH1F* m_nCluster; + mutable TH1F* m_nCluster_1GeV; + mutable TH1F* m_nCluster_halfTrueEnergy; + mutable TH1F* m_energyCalibCluster_1GeV; + mutable TH1F* m_energyCalibCluster_halfTrueEnergy; /// bool if calibration is applied bool m_doCalibration = true; diff --git a/RecCalorimeter/src/components/CreateCaloClustersSlidingWindow.h b/RecCalorimeter/src/components/CreateCaloClustersSlidingWindow.h index e19ff851..55cacf00 100644 --- a/RecCalorimeter/src/components/CreateCaloClustersSlidingWindow.h +++ b/RecCalorimeter/src/components/CreateCaloClustersSlidingWindow.h @@ -93,11 +93,11 @@ class CreateCaloClustersSlidingWindow : public Gaudi::Algorithm { /// Handle for calo cluster cells (output collection) mutable DataHandle m_clusterCells{"calo/clusterCells", Gaudi::DataHandle::Writer, this}; /// Handle for the tower building tool - ToolHandle m_towerTool; + mutable ToolHandle m_towerTool; // calorimeter towers - std::vector> m_towers; + mutable std::vector> m_towers; /// Vector of pre-clusters - std::vector m_preClusters; + mutable std::vector m_preClusters; /// number of towers in eta (calculated from m_deltaEtaTower and the eta size of the first layer) int m_nEtaTower; /// Number of towers in phi (calculated from m_deltaPhiTower) diff --git a/RecCalorimeter/src/components/LayerPhiEtaCaloTool.cpp b/RecCalorimeter/src/components/LayerPhiEtaCaloTool.cpp index cb1c25ba..471419ae 100644 --- a/RecCalorimeter/src/components/LayerPhiEtaCaloTool.cpp +++ b/RecCalorimeter/src/components/LayerPhiEtaCaloTool.cpp @@ -9,12 +9,12 @@ DECLARE_COMPONENT(LayerPhiEtaCaloTool) LayerPhiEtaCaloTool::LayerPhiEtaCaloTool(const std::string& type, const std::string& name, const IInterface* parent) - : GaudiTool(type, name, parent) { + : AlgTool(type, name, parent) { declareInterface(this); } StatusCode LayerPhiEtaCaloTool::initialize() { - StatusCode sc = GaudiTool::initialize(); + StatusCode sc = AlgTool::initialize(); if (sc.isFailure()) return sc; m_geoSvc = service("GeoSvc"); if (!m_geoSvc) { @@ -33,7 +33,7 @@ StatusCode LayerPhiEtaCaloTool::initialize() { return sc; } -StatusCode LayerPhiEtaCaloTool::finalize() { return GaudiTool::finalize(); } +StatusCode LayerPhiEtaCaloTool::finalize() { return AlgTool::finalize(); } StatusCode LayerPhiEtaCaloTool::prepareEmptyCells(std::unordered_map& aCells) { // Get the total number of active volumes in the geometry diff --git a/RecCalorimeter/src/components/LayerPhiEtaCaloTool.h b/RecCalorimeter/src/components/LayerPhiEtaCaloTool.h index b15cc756..01472a19 100644 --- a/RecCalorimeter/src/components/LayerPhiEtaCaloTool.h +++ b/RecCalorimeter/src/components/LayerPhiEtaCaloTool.h @@ -2,7 +2,7 @@ #define RECCALORIMETER_TUBELAYERPHIETACALOTOOL_H // Gaudi -#include "GaudiAlg/GaudiTool.h" +#include "GaudiKernel/AlgTool.h" // k4FWCore #include "k4Interface/ICalorimeterTool.h" @@ -18,7 +18,7 @@ class IGeoSvc; * @author Anna Zaborowska, Coralie Neubueser */ -class LayerPhiEtaCaloTool : public GaudiTool, virtual public ICalorimeterTool { +class LayerPhiEtaCaloTool : public AlgTool, virtual public ICalorimeterTool { public: LayerPhiEtaCaloTool(const std::string& type, const std::string& name, const IInterface* parent); virtual ~LayerPhiEtaCaloTool() = default; diff --git a/RecCalorimeter/src/components/LayeredCaloTowerTool.cpp b/RecCalorimeter/src/components/LayeredCaloTowerTool.cpp index 169018e2..70dc9fce 100644 --- a/RecCalorimeter/src/components/LayeredCaloTowerTool.cpp +++ b/RecCalorimeter/src/components/LayeredCaloTowerTool.cpp @@ -14,13 +14,13 @@ DECLARE_COMPONENT(LayeredCaloTowerTool) LayeredCaloTowerTool::LayeredCaloTowerTool(const std::string& type, const std::string& name, const IInterface* parent) - : GaudiTool(type, name, parent), m_geoSvc("GeoSvc", name) { + : AlgTool(type, name, parent), m_geoSvc("GeoSvc", name) { declareProperty("cells", m_cells, "Cells to create towers from (input)"); declareInterface(this); } StatusCode LayeredCaloTowerTool::initialize() { - if (GaudiTool::initialize().isFailure()) { + if (AlgTool::initialize().isFailure()) { return StatusCode::FAILURE; } @@ -62,7 +62,7 @@ StatusCode LayeredCaloTowerTool::initialize() { return StatusCode::SUCCESS; } -StatusCode LayeredCaloTowerTool::finalize() { return GaudiTool::finalize(); } +StatusCode LayeredCaloTowerTool::finalize() { return AlgTool::finalize(); } void LayeredCaloTowerTool::towersNumber(int& nEta, int& nPhi) { // maximum eta of the detector (== eta offset + half of the cell size) diff --git a/RecCalorimeter/src/components/LayeredCaloTowerTool.h b/RecCalorimeter/src/components/LayeredCaloTowerTool.h index 3c642167..69e3692a 100644 --- a/RecCalorimeter/src/components/LayeredCaloTowerTool.h +++ b/RecCalorimeter/src/components/LayeredCaloTowerTool.h @@ -2,7 +2,7 @@ #define RECCALORIMETER_LAYEREDCALOTOWERTOOL_H // Gaudi -#include "GaudiAlg/GaudiTool.h" +#include "GaudiKernel/AlgTool.h" // k4geo #include "detectorSegmentations/FCCSWGridPhiEta_k4geo.h" @@ -51,7 +51,7 @@ class Segmentation; * @author Jana Faltova */ -class LayeredCaloTowerTool : public GaudiTool, virtual public ITowerTool { +class LayeredCaloTowerTool : public AlgTool, virtual public ITowerTool { public: LayeredCaloTowerTool(const std::string& type, const std::string& name, const IInterface* parent); virtual ~LayeredCaloTowerTool() = default; diff --git a/RecCalorimeter/src/components/MassInv.cpp b/RecCalorimeter/src/components/MassInv.cpp index 6a0baa2b..1e761f60 100644 --- a/RecCalorimeter/src/components/MassInv.cpp +++ b/RecCalorimeter/src/components/MassInv.cpp @@ -849,7 +849,7 @@ StatusCode MassInv::initNoiseFromFile() { return StatusCode::SUCCESS; } -double MassInv::getNoiseRMSPerCluster(double aEta, uint aNumCells) { +double MassInv::getNoiseRMSPerCluster(double aEta, uint aNumCells) const { double param0 = 0.; double param1 = 0.; diff --git a/RecCalorimeter/src/components/MassInv.h b/RecCalorimeter/src/components/MassInv.h index 9d28ce5b..8c9830ed 100644 --- a/RecCalorimeter/src/components/MassInv.h +++ b/RecCalorimeter/src/components/MassInv.h @@ -87,7 +87,7 @@ class MassInv : public Gaudi::Algorithm { * @param[in] aNumCells Number of cells in a cluster * @return Width of the Gaussian distribution of noise per cluster */ - double getNoiseRMSPerCluster(double aEta, uint numCells); + double getNoiseRMSPerCluster(double aEta, uint numCells) const; /// Handle for clusters (input collection) mutable DataHandle m_inClusters{"clusters", Gaudi::DataHandle::Reader, this}; /// Handle for corrected clusters (output collection) @@ -186,10 +186,10 @@ class MassInv : public Gaudi::Algorithm { Gaudi::Property> m_readoutName{ this, "readoutName", {"ECalBarrelPhiEta"}, "Names of the detector readout, corresponding to systemId"}; /// map of system Id to segmentation, created based on m_readoutName and m_systemId - std::map m_segmentationPhiEta; - std::map m_segmentationMulti; + mutable std::map m_segmentationPhiEta; + mutable std::map m_segmentationMulti; /// map of system Id to decoder, created based on m_readoutName and m_systemId - std::map m_decoder; + mutable std::map m_decoder; /// Histogram of pileup noise added to energy of clusters TH1F* m_hPileupEnergy; /// Random Number Service @@ -263,9 +263,9 @@ class MassInv : public Gaudi::Algorithm { // ISOLATION /// Handle for the tower building tool - ToolHandle m_towerTool; + mutable ToolHandle m_towerTool; // calorimeter towers - std::vector> m_towers; + mutable std::vector> m_towers; /// number of towers in eta (calculated from m_deltaEtaTower and the eta size of the first layer) int m_nEtaTower; /// Number of towers in phi (calculated from m_deltaPhiTower) diff --git a/RecCalorimeter/src/components/NestedVolumesCaloTool.cpp b/RecCalorimeter/src/components/NestedVolumesCaloTool.cpp index 5d78d777..d324489f 100644 --- a/RecCalorimeter/src/components/NestedVolumesCaloTool.cpp +++ b/RecCalorimeter/src/components/NestedVolumesCaloTool.cpp @@ -8,12 +8,12 @@ DECLARE_COMPONENT(NestedVolumesCaloTool) NestedVolumesCaloTool::NestedVolumesCaloTool(const std::string& type, const std::string& name, const IInterface* parent) - : GaudiTool(type, name, parent), m_geoSvc("GeoSvc", name) { + : AlgTool(type, name, parent), m_geoSvc("GeoSvc", name) { declareInterface(this); } StatusCode NestedVolumesCaloTool::initialize() { - StatusCode sc = GaudiTool::initialize(); + StatusCode sc = AlgTool::initialize(); if (sc.isFailure()) return sc; if (!m_geoSvc) { @@ -30,7 +30,7 @@ StatusCode NestedVolumesCaloTool::initialize() { return sc; } -StatusCode NestedVolumesCaloTool::finalize() { return GaudiTool::finalize(); } +StatusCode NestedVolumesCaloTool::finalize() { return AlgTool::finalize(); } StatusCode NestedVolumesCaloTool::prepareEmptyCells(std::unordered_map& aCells) { // Take readout bitfield decoder from GeoSvc diff --git a/RecCalorimeter/src/components/NestedVolumesCaloTool.h b/RecCalorimeter/src/components/NestedVolumesCaloTool.h index 5c33899e..10ce2dc7 100644 --- a/RecCalorimeter/src/components/NestedVolumesCaloTool.h +++ b/RecCalorimeter/src/components/NestedVolumesCaloTool.h @@ -2,7 +2,7 @@ #define RECCALORIMETER_NESTEDVOLUMESCALOTOOL_H // Gaudi -#include "GaudiAlg/GaudiTool.h" +#include "GaudiKernel/AlgTool.h" // k4FWCore #include "k4Interface/ICalorimeterTool.h" @@ -19,7 +19,7 @@ class IGeoSvc; * @author Anna Zaborowska */ -class NestedVolumesCaloTool : public GaudiTool, virtual public ICalorimeterTool { +class NestedVolumesCaloTool : public AlgTool, virtual public ICalorimeterTool { public: NestedVolumesCaloTool(const std::string& type, const std::string& name, const IInterface* parent); virtual ~NestedVolumesCaloTool() = default; diff --git a/RecCalorimeter/src/components/NoiseCaloCellsFlatTool.cpp b/RecCalorimeter/src/components/NoiseCaloCellsFlatTool.cpp index 0e779adc..9803bea5 100644 --- a/RecCalorimeter/src/components/NoiseCaloCellsFlatTool.cpp +++ b/RecCalorimeter/src/components/NoiseCaloCellsFlatTool.cpp @@ -5,13 +5,13 @@ DECLARE_COMPONENT(NoiseCaloCellsFlatTool) NoiseCaloCellsFlatTool::NoiseCaloCellsFlatTool(const std::string& type, const std::string& name, const IInterface* parent) - : GaudiTool(type, name, parent) { + : AlgTool(type, name, parent) { declareInterface(this); } StatusCode NoiseCaloCellsFlatTool::initialize() { { - StatusCode sc = GaudiTool::initialize(); + StatusCode sc = AlgTool::initialize(); if (sc.isFailure()) return sc; } @@ -49,4 +49,4 @@ void NoiseCaloCellsFlatTool::filterCellNoise(std::unordered_map(this); declareProperty("cellPositionsTool", m_cellPositionsTool, "Handle for tool to retrieve cell positions"); } @@ -89,7 +89,7 @@ StatusCode NoiseCaloCellsFromFileTool::initialize() { debug() << "Filter noise threshold: " << m_filterThreshold << "*sigma" << endmsg; - StatusCode sc = GaudiTool::initialize(); + StatusCode sc = AlgTool::initialize(); if (sc.isFailure()) return sc; return sc; @@ -112,7 +112,7 @@ void NoiseCaloCellsFromFileTool::filterCellNoise(std::unordered_map m_geoTool{"TubeLayerPhiEtaCaloTool", this}; /// Handle for the tower building tool - ToolHandle m_towerTool; + mutable ToolHandle m_towerTool; // calorimeter towers - std::vector> m_towers; + mutable std::vector> m_towers; /// number of towers in eta (calculated from m_deltaEtaTower and the eta size of the first layer) int m_nEtaTower; /// Number of towers in phi (calculated from m_deltaPhiTower) @@ -77,9 +77,9 @@ class PreparePileup : public Gaudi::Algorithm { mutable DataHandle m_hits{"hits", Gaudi::DataHandle::Reader, this}; /// Map of cell IDs (corresponding to DD4hep IDs) and energy - std::unordered_map m_cellsMap; + mutable std::unordered_map m_cellsMap; /// Sum of energy in each cell per file - std::unordered_map m_sumEnergyCellsMap; + mutable std::unordered_map m_sumEnergyCellsMap; /// Pointer to the interface of histogram service SmartIF m_histSvc; @@ -121,7 +121,7 @@ class PreparePileup : public Gaudi::Algorithm { dd4hep::DDSegmentation::FCCSWGridPhiEta_k4geo* m_segmentation; dd4hep::DDSegmentation::BitFieldCoder* m_decoder; /// Sum of energy of optimised cluster centred around each eta/phi cell - std::vector> m_energyOptimised; + mutable std::vector> m_energyOptimised; /// Flag for the ellipse used in the final cluster instead of the rectangle Gaudi::Property m_ellipseCluster{this, "ellipse", false}; }; diff --git a/RecCalorimeter/src/components/ReadCaloCrosstalkMap.cpp b/RecCalorimeter/src/components/ReadCaloCrosstalkMap.cpp index 9bb5c50f..d0487443 100644 --- a/RecCalorimeter/src/components/ReadCaloCrosstalkMap.cpp +++ b/RecCalorimeter/src/components/ReadCaloCrosstalkMap.cpp @@ -9,7 +9,7 @@ DECLARE_COMPONENT(ReadCaloCrosstalkMap) ReadCaloCrosstalkMap::ReadCaloCrosstalkMap(const std::string& type, const std::string& name, const IInterface* parent) - : GaudiTool(type, name, parent) { + : AlgTool(type, name, parent) { declareInterface(this); } @@ -23,7 +23,7 @@ StatusCode ReadCaloCrosstalkMap::initialize() { } { - StatusCode sc = GaudiTool::initialize(); + StatusCode sc = AlgTool::initialize(); info() << "Loading crosstalk map..." << endmsg; if (sc.isFailure()) return sc; } @@ -71,7 +71,7 @@ StatusCode ReadCaloCrosstalkMap::initialize() { return StatusCode::SUCCESS; } -StatusCode ReadCaloCrosstalkMap::finalize() { return GaudiTool::finalize(); } +StatusCode ReadCaloCrosstalkMap::finalize() { return AlgTool::finalize(); } std::vector& ReadCaloCrosstalkMap::getNeighbours(uint64_t aCellId) { return m_mapNeighbours[aCellId]; diff --git a/RecCalorimeter/src/components/ReadCaloCrosstalkMap.h b/RecCalorimeter/src/components/ReadCaloCrosstalkMap.h index ed65fbe3..bee42093 100644 --- a/RecCalorimeter/src/components/ReadCaloCrosstalkMap.h +++ b/RecCalorimeter/src/components/ReadCaloCrosstalkMap.h @@ -2,7 +2,7 @@ #define RECCALORIMETER_READCALOXTALKMAP_H // from Gaudi -#include "GaudiAlg/GaudiTool.h" +#include "GaudiKernel/AlgTool.h" // k4FWCore #include "k4Interface/ICaloReadCrosstalkMap.h" @@ -18,7 +18,7 @@ class IGeoSvc; * @author Zhibo Wu */ -class ReadCaloCrosstalkMap : public GaudiTool, virtual public ICaloReadCrosstalkMap { +class ReadCaloCrosstalkMap : public AlgTool, virtual public ICaloReadCrosstalkMap { public: ReadCaloCrosstalkMap(const std::string& type, const std::string& name, const IInterface* parent); virtual ~ReadCaloCrosstalkMap() = default; diff --git a/RecCalorimeter/src/components/ReadNoiseFromFileTool.cpp b/RecCalorimeter/src/components/ReadNoiseFromFileTool.cpp index 6e5df2cd..6336946d 100644 --- a/RecCalorimeter/src/components/ReadNoiseFromFileTool.cpp +++ b/RecCalorimeter/src/components/ReadNoiseFromFileTool.cpp @@ -20,7 +20,7 @@ DECLARE_COMPONENT(ReadNoiseFromFileTool) ReadNoiseFromFileTool::ReadNoiseFromFileTool(const std::string& type, const std::string& name, const IInterface* parent) - : GaudiTool(type, name, parent) { + : AlgTool(type, name, parent) { declareInterface(this); } @@ -47,14 +47,14 @@ StatusCode ReadNoiseFromFileTool::initialize() { // Take readout bitfield decoder from GeoSvc m_decoder = m_geoSvc->getDetector()->readout(m_readoutName).idSpec().decoder(); - StatusCode sc = GaudiTool::initialize(); + StatusCode sc = AlgTool::initialize(); if (sc.isFailure()) return sc; return sc; } StatusCode ReadNoiseFromFileTool::finalize() { - StatusCode sc = GaudiTool::finalize(); + StatusCode sc = AlgTool::finalize(); return sc; } diff --git a/RecCalorimeter/src/components/ReadNoiseFromFileTool.h b/RecCalorimeter/src/components/ReadNoiseFromFileTool.h index 33f676a0..1be61186 100644 --- a/RecCalorimeter/src/components/ReadNoiseFromFileTool.h +++ b/RecCalorimeter/src/components/ReadNoiseFromFileTool.h @@ -2,7 +2,7 @@ #define RECCALORIMETER_READNOISEFROMFILETOOL_H // from Gaudi -#include "GaudiAlg/GaudiTool.h" +#include "GaudiKernel/AlgTool.h" #include "GaudiKernel/ToolHandle.h" // k4FWCore @@ -29,7 +29,7 @@ class TH1F; * */ -class ReadNoiseFromFileTool : public GaudiTool, virtual public INoiseConstTool { +class ReadNoiseFromFileTool : public AlgTool, virtual public INoiseConstTool { public: ReadNoiseFromFileTool(const std::string& type, const std::string& name, const IInterface* parent); virtual ~ReadNoiseFromFileTool() = default; diff --git a/RecCalorimeter/src/components/SplitClusters.cpp b/RecCalorimeter/src/components/SplitClusters.cpp index 03464c22..4f61daa1 100644 --- a/RecCalorimeter/src/components/SplitClusters.cpp +++ b/RecCalorimeter/src/components/SplitClusters.cpp @@ -462,7 +462,7 @@ SplitClusters::searchForNeighbours(const uint64_t aCellId, std::map& aClusterOfCell, std::map aCellPosition, std::map& aClusterPosition - ){ + ) const { // Fill vector to be returned, next cell ids and cluster id for which neighbours are found std::vector > addedNeighbourIds; diff --git a/RecCalorimeter/src/components/SplitClusters.h b/RecCalorimeter/src/components/SplitClusters.h index 24fb4bf5..66c8fb5f 100644 --- a/RecCalorimeter/src/components/SplitClusters.h +++ b/RecCalorimeter/src/components/SplitClusters.h @@ -82,7 +82,7 @@ class SplitClusters : public Gaudi::Algorithm { std::map& aClusterOfCell, std::map aCellPosition, std::map& aClusterPositions - ); + ) const; StatusCode execute(const EventContext&) const; @@ -99,7 +99,7 @@ class SplitClusters : public Gaudi::Algorithm { // Handle for calo cells (output collection) mutable DataHandle m_newCells{"calo/calibClusterCells", Gaudi::DataHandle::Writer, this}; /// Handle for neighbours tool - ToolHandle m_neighboursTool{"TopoCaloNeighbours", this}; + mutable ToolHandle m_neighboursTool{"TopoCaloNeighbours", this}; /// Handle for tool to get positions in ECal Barrel ToolHandle m_cellPositionsECalBarrelTool{"CellPositionsECalBarrelTool", this}; diff --git a/RecCalorimeter/src/components/TopoCaloNeighbours.cpp b/RecCalorimeter/src/components/TopoCaloNeighbours.cpp index abc0673b..fb8dc805 100644 --- a/RecCalorimeter/src/components/TopoCaloNeighbours.cpp +++ b/RecCalorimeter/src/components/TopoCaloNeighbours.cpp @@ -9,13 +9,13 @@ DECLARE_COMPONENT(TopoCaloNeighbours) TopoCaloNeighbours::TopoCaloNeighbours(const std::string& type, const std::string& name, const IInterface* parent) - : GaudiTool(type, name, parent) { + : AlgTool(type, name, parent) { declareInterface(this); } StatusCode TopoCaloNeighbours::initialize() { { - StatusCode sc = GaudiTool::initialize(); + StatusCode sc = AlgTool::initialize(); if (sc.isFailure()) return sc; } @@ -66,7 +66,7 @@ StatusCode TopoCaloNeighbours::initialize() { return StatusCode::SUCCESS; } -StatusCode TopoCaloNeighbours::finalize() { return GaudiTool::finalize(); } +StatusCode TopoCaloNeighbours::finalize() { return AlgTool::finalize(); } std::vector& TopoCaloNeighbours::neighbours(uint64_t aCellId) { return m_map[aCellId]; diff --git a/RecCalorimeter/src/components/TopoCaloNeighbours.h b/RecCalorimeter/src/components/TopoCaloNeighbours.h index bafd3807..e24be736 100644 --- a/RecCalorimeter/src/components/TopoCaloNeighbours.h +++ b/RecCalorimeter/src/components/TopoCaloNeighbours.h @@ -2,7 +2,7 @@ #define RECCALORIMETER_TOPOCALONEIGHBOURS_H // from Gaudi -#include "GaudiAlg/GaudiTool.h" +#include "GaudiKernel/AlgTool.h" // k4FWCore #include "k4Interface/ICaloReadNeighboursMap.h" @@ -19,7 +19,7 @@ class IGeoSvc; * @author Coralie Neubueser */ -class TopoCaloNeighbours : public GaudiTool, virtual public ICaloReadNeighboursMap { +class TopoCaloNeighbours : public AlgTool, virtual public ICaloReadNeighboursMap { public: TopoCaloNeighbours(const std::string& type, const std::string& name, const IInterface* parent); virtual ~TopoCaloNeighbours() = default; diff --git a/RecCalorimeter/src/components/TopoCaloNoisyCells.cpp b/RecCalorimeter/src/components/TopoCaloNoisyCells.cpp index 75709431..6e55fa12 100644 --- a/RecCalorimeter/src/components/TopoCaloNoisyCells.cpp +++ b/RecCalorimeter/src/components/TopoCaloNoisyCells.cpp @@ -8,13 +8,13 @@ DECLARE_COMPONENT(TopoCaloNoisyCells) TopoCaloNoisyCells::TopoCaloNoisyCells(const std::string& type, const std::string& name, const IInterface* parent) - : GaudiTool(type, name, parent) { + : AlgTool(type, name, parent) { declareInterface(this); } StatusCode TopoCaloNoisyCells::initialize() { { - StatusCode sc = GaudiTool::initialize(); + StatusCode sc = AlgTool::initialize(); if (sc.isFailure()) return sc; } @@ -56,7 +56,7 @@ StatusCode TopoCaloNoisyCells::initialize() { return StatusCode::SUCCESS; } -StatusCode TopoCaloNoisyCells::finalize() { return GaudiTool::finalize(); } +StatusCode TopoCaloNoisyCells::finalize() { return AlgTool::finalize(); } double TopoCaloNoisyCells::noiseRMS(uint64_t aCellId) { return m_map[aCellId].first; } double TopoCaloNoisyCells::noiseOffset(uint64_t aCellId) { return m_map[aCellId].second; } diff --git a/RecCalorimeter/src/components/TopoCaloNoisyCells.h b/RecCalorimeter/src/components/TopoCaloNoisyCells.h index af191678..b1671944 100644 --- a/RecCalorimeter/src/components/TopoCaloNoisyCells.h +++ b/RecCalorimeter/src/components/TopoCaloNoisyCells.h @@ -2,7 +2,7 @@ #define RECCALORIMETER_TOPOCALONOISYCELLS_H // from Gaudi -#include "GaudiAlg/GaudiTool.h" +#include "GaudiKernel/AlgTool.h" // k4FWCore #include "k4Interface/ICaloReadCellNoiseMap.h" @@ -18,7 +18,7 @@ class IGeoSvc; * @author Coralie Neubueser */ -class TopoCaloNoisyCells : public GaudiTool, virtual public ICaloReadCellNoiseMap { +class TopoCaloNoisyCells : public AlgTool, virtual public ICaloReadCellNoiseMap { public: TopoCaloNoisyCells(const std::string& type, const std::string& name, const IInterface* parent); virtual ~TopoCaloNoisyCells() = default; diff --git a/RecCalorimeter/src/components/TubeLayerPhiEtaCaloTool.cpp b/RecCalorimeter/src/components/TubeLayerPhiEtaCaloTool.cpp index 33953024..0ba883b1 100644 --- a/RecCalorimeter/src/components/TubeLayerPhiEtaCaloTool.cpp +++ b/RecCalorimeter/src/components/TubeLayerPhiEtaCaloTool.cpp @@ -10,12 +10,12 @@ DECLARE_COMPONENT(TubeLayerPhiEtaCaloTool) TubeLayerPhiEtaCaloTool::TubeLayerPhiEtaCaloTool(const std::string& type, const std::string& name, const IInterface* parent) - : GaudiTool(type, name, parent), m_geoSvc("GeoSvc", name) { + : AlgTool(type, name, parent), m_geoSvc("GeoSvc", name) { declareInterface(this); } StatusCode TubeLayerPhiEtaCaloTool::initialize() { - StatusCode sc = GaudiTool::initialize(); + StatusCode sc = AlgTool::initialize(); if (sc.isFailure()) return sc; if (!m_geoSvc) { @@ -34,7 +34,7 @@ StatusCode TubeLayerPhiEtaCaloTool::initialize() { return sc; } -StatusCode TubeLayerPhiEtaCaloTool::finalize() { return GaudiTool::finalize(); } +StatusCode TubeLayerPhiEtaCaloTool::finalize() { return AlgTool::finalize(); } StatusCode TubeLayerPhiEtaCaloTool::prepareEmptyCells(std::unordered_map& aCells) { // Get the total number of active volumes in the geometry diff --git a/RecCalorimeter/src/components/TubeLayerPhiEtaCaloTool.h b/RecCalorimeter/src/components/TubeLayerPhiEtaCaloTool.h index d00304ad..77728757 100644 --- a/RecCalorimeter/src/components/TubeLayerPhiEtaCaloTool.h +++ b/RecCalorimeter/src/components/TubeLayerPhiEtaCaloTool.h @@ -2,7 +2,7 @@ #define RECCALORIMETER_TUBELAYERPHIETACALOTOOL_H // from Gaudi -#include "GaudiAlg/GaudiTool.h" +#include "GaudiKernel/AlgTool.h" // k4FWCore #include "k4Interface/ICalorimeterTool.h" @@ -18,7 +18,7 @@ class IGeoSvc; * @author Anna Zaborowska */ -class TubeLayerPhiEtaCaloTool : public GaudiTool, virtual public ICalorimeterTool { +class TubeLayerPhiEtaCaloTool : public AlgTool, virtual public ICalorimeterTool { public: TubeLayerPhiEtaCaloTool(const std::string& type, const std::string& name, const IInterface* parent); virtual ~TubeLayerPhiEtaCaloTool() = default; diff --git a/RecFCCeeCalorimeter/CMakeLists.txt b/RecFCCeeCalorimeter/CMakeLists.txt index 356d57e4..e833d974 100644 --- a/RecFCCeeCalorimeter/CMakeLists.txt +++ b/RecFCCeeCalorimeter/CMakeLists.txt @@ -4,9 +4,9 @@ # ONNX DEPENDENCIES # includes -include_directories("${ONNXRUNTIME_INCLUDE_DIRS}") +# include_directories("${ONNXRUNTIME_INCLUDE_DIRS}") # libs -link_directories("${ONNXRUNTIME_LIBRARY_DIRS}") +# link_directories("${ONNXRUNTIME_LIBRARY_DIRS}") # New versions of ONNXRuntime add directories to include # through the target onnxruntime::onnxruntime if(onnxruntime_FOUND) diff --git a/RecFCCeeCalorimeter/src/components/CaloTopoClusterFCCee.cpp b/RecFCCeeCalorimeter/src/components/CaloTopoClusterFCCee.cpp index 181f7440..56a08287 100644 --- a/RecFCCeeCalorimeter/src/components/CaloTopoClusterFCCee.cpp +++ b/RecFCCeeCalorimeter/src/components/CaloTopoClusterFCCee.cpp @@ -125,10 +125,10 @@ StatusCode CaloTopoClusterFCCee::execute(const EventContext&) const { }); std::map>> preClusterCollection; - StatusCode sc_buildProtoClusters = CaloTopoClusterFCCee::buildingProtoCluster(m_neighbourSigma, - m_lastNeighbourSigma, - firstSeeds, allCells, - preClusterCollection); + StatusCode sc_buildProtoClusters = buildingProtoCluster(m_neighbourSigma, + m_lastNeighbourSigma, + firstSeeds, allCells, + preClusterCollection); if (sc_buildProtoClusters.isFailure()) { error() << "Unable to build the protoclusters!" << endmsg; return StatusCode::FAILURE; @@ -243,7 +243,7 @@ StatusCode CaloTopoClusterFCCee::execute(const EventContext&) const { void CaloTopoClusterFCCee::findingSeeds(const std::unordered_map& aCells, int aNumSigma, - std::vector>& aSeeds) { + std::vector>& aSeeds) const { for (const auto& cell : aCells) { // retrieve the noise const and offset assigned to cell // first try to use the cache @@ -284,7 +284,7 @@ StatusCode CaloTopoClusterFCCee::buildingProtoCluster( int aLastNumSigma, std::vector>& aSeeds, const std::unordered_map& aCells, - std::map>>& aPreClusterCollection) { + std::map>>& aPreClusterCollection) const { // Map of cellIDs to clusterIds std::map clusterOfCell; @@ -352,7 +352,7 @@ CaloTopoClusterFCCee::searchForNeighbours(const uint64_t aCellId, const std::unordered_map& aCells, std::map& aClusterOfCell, std::map>>& aPreClusterCollection, - bool aAllowClusterMerge) { + bool aAllowClusterMerge) const { // Fill vector to be returned, next cell ids and cluster id for which neighbours are found std::vector> addedNeighbourIds; // Retrieve cellIDs of neighbours @@ -464,7 +464,7 @@ StatusCode CaloTopoClusterFCCee::finalize() { return Gaudi::Algorithm::finalize( * \brief Cache the minimum offset and noise per layer for faster lookups down * the chain. */ -void CaloTopoClusterFCCee::createCache(const std::unordered_map& aCells) { +void CaloTopoClusterFCCee::createCache(const std::unordered_map& aCells) const { std::unordered_map> offsets; std::unordered_map> noises; std::unordered_set layers; diff --git a/RecFCCeeCalorimeter/src/components/CaloTopoClusterFCCee.h b/RecFCCeeCalorimeter/src/components/CaloTopoClusterFCCee.h index ee23f91f..86a48839 100644 --- a/RecFCCeeCalorimeter/src/components/CaloTopoClusterFCCee.h +++ b/RecFCCeeCalorimeter/src/components/CaloTopoClusterFCCee.h @@ -59,7 +59,7 @@ class CaloTopoClusterFCCee : public Gaudi::Algorithm { * @param[in] aSeeds, the vector of seed cell ids anf their energy to build proto-clusters. */ virtual void findingSeeds(const std::unordered_map& aCells, int aNumSigma, - std::vector>& aSeeds); + std::vector>& aSeeds) const; /** Building proto-clusters from the found seeds. * First the function initialises a cluster in the preClusterCollection for the seed cells, @@ -74,7 +74,7 @@ class CaloTopoClusterFCCee : public Gaudi::Algorithm { int aLastNumSigma, std::vector>& aSeeds, const std::unordered_map& aCells, - std::map>>& aPreClusterCollection); + std::map>>& aPreClusterCollection) const; /** Search for neighbours and add them to preClusterCollection * The @@ -91,7 +91,7 @@ class CaloTopoClusterFCCee : public Gaudi::Algorithm { searchForNeighbours(const uint64_t aCellId, uint& aClusterID, int aNumSigma, const std::unordered_map& aCells, std::map& aClusterOfCell, std::map>>& aPreClusterCollection, - bool aAllowClusterMerge); + bool aAllowClusterMerge) const; StatusCode execute(const EventContext&) const; @@ -105,11 +105,11 @@ class CaloTopoClusterFCCee : public Gaudi::Algorithm { /// Pointer to the geometry service SmartIF m_geoSvc; /// Handle for the input tool - ToolHandle m_inputTool{"TopoClusterInput", this}; + mutable ToolHandle m_inputTool{"TopoClusterInput", this}; /// Handle for the cells noise tool - ToolHandle m_noiseTool{"TopoCaloNoisyCells", this}; + mutable ToolHandle m_noiseTool{"TopoCaloNoisyCells", this}; /// Handle for neighbours tool - ToolHandle m_neighboursTool{"TopoCaloNeighbours", this}; + mutable ToolHandle m_neighboursTool{"TopoCaloNeighbours", this}; /// Handle for tool to get positions in ECal Barrel ToolHandle m_cellPositionsECalBarrelTool{"CellPositionsECalBarrelTool", this}; /// Handle for tool to get positions in HCal Barrel @@ -148,9 +148,9 @@ class CaloTopoClusterFCCee : public Gaudi::Algorithm { // minimum noise and offset per barrel ECal layer // this serves as a very small cache for fast lookups and avoid looking into the huge map for most of the cells. - std::vector m_min_offset; - std::vector m_min_noise; + mutable std::vector m_min_offset; + mutable std::vector m_min_noise; - void createCache(const std::unordered_map& aCells); + void createCache(const std::unordered_map& aCells) const; }; #endif /* RECFCCEECALORIMETER_CALOTOPOCLUSTERFCCEE_H */ diff --git a/RecFCCeeCalorimeter/src/components/CaloTowerToolFCCee.cpp b/RecFCCeeCalorimeter/src/components/CaloTowerToolFCCee.cpp index ccaa018e..ecc58254 100644 --- a/RecFCCeeCalorimeter/src/components/CaloTowerToolFCCee.cpp +++ b/RecFCCeeCalorimeter/src/components/CaloTowerToolFCCee.cpp @@ -15,7 +15,7 @@ DECLARE_COMPONENT(CaloTowerToolFCCee) CaloTowerToolFCCee::CaloTowerToolFCCee(const std::string& type, const std::string& name, const IInterface* parent) - : GaudiTool(type, name, parent), m_geoSvc("GeoSvc", name) { + : AlgTool(type, name, parent), m_geoSvc("GeoSvc", name) { declareProperty("ecalBarrelCells", m_ecalBarrelCells, ""); declareProperty("ecalEndcapCells", m_ecalEndcapCells, ""); declareProperty("ecalFwdCells", m_ecalFwdCells, ""); @@ -27,7 +27,7 @@ CaloTowerToolFCCee::CaloTowerToolFCCee(const std::string& type, const std::strin } StatusCode CaloTowerToolFCCee::initialize() { - if (GaudiTool::initialize().isFailure()) { + if (AlgTool::initialize().isFailure()) { return StatusCode::FAILURE; } @@ -107,7 +107,7 @@ StatusCode CaloTowerToolFCCee::finalize() { for (auto& towerInMap : m_cellsInTowers) { towerInMap.second.clear(); } - return GaudiTool::finalize(); + return AlgTool::finalize(); } std::pair CaloTowerToolFCCee::retrievePhiThetaExtrema(dd4hep::DDSegmentation::Segmentation* aSegmentation, SegmentationType aType) { diff --git a/RecFCCeeCalorimeter/src/components/CaloTowerToolFCCee.h b/RecFCCeeCalorimeter/src/components/CaloTowerToolFCCee.h index 8389f719..08098592 100644 --- a/RecFCCeeCalorimeter/src/components/CaloTowerToolFCCee.h +++ b/RecFCCeeCalorimeter/src/components/CaloTowerToolFCCee.h @@ -2,7 +2,7 @@ #define RECFCCEECALORIMETER_CALOTOWERTOOLFCCEE_H // from Gaudi -#include "GaudiAlg/GaudiTool.h" +#include "GaudiKernel/AlgTool.h" // k4geo #include "detectorSegmentations/FCCSWGridModuleThetaMerged_k4geo.h" @@ -45,7 +45,7 @@ class Cluster; * @Modified by Tong Li, for Theta-Module Merged readouts in FCCee */ -class CaloTowerToolFCCee : public GaudiTool, virtual public ITowerToolThetaModule { +class CaloTowerToolFCCee : public AlgTool, virtual public ITowerToolThetaModule { public: CaloTowerToolFCCee(const std::string& type, const std::string& name, const IInterface* parent); virtual ~CaloTowerToolFCCee() = default; diff --git a/RecFCCeeCalorimeter/src/components/CellPositionsECalBarrelModuleThetaSegTool.cpp b/RecFCCeeCalorimeter/src/components/CellPositionsECalBarrelModuleThetaSegTool.cpp index 7d97fe09..c6e569ab 100644 --- a/RecFCCeeCalorimeter/src/components/CellPositionsECalBarrelModuleThetaSegTool.cpp +++ b/RecFCCeeCalorimeter/src/components/CellPositionsECalBarrelModuleThetaSegTool.cpp @@ -9,12 +9,12 @@ DECLARE_COMPONENT(CellPositionsECalBarrelModuleThetaSegTool) CellPositionsECalBarrelModuleThetaSegTool::CellPositionsECalBarrelModuleThetaSegTool(const std::string& type, const std::string& name, const IInterface* parent) - : GaudiTool(type, name, parent) { + : AlgTool(type, name, parent) { declareInterface(this); } StatusCode CellPositionsECalBarrelModuleThetaSegTool::initialize() { - StatusCode sc = GaudiTool::initialize(); + StatusCode sc = AlgTool::initialize(); if (sc.isFailure()) return sc; m_geoSvc = service("GeoSvc"); if (!m_geoSvc) { @@ -143,4 +143,4 @@ int CellPositionsECalBarrelModuleThetaSegTool::layerId(const uint64_t& aCellId) return layer; } -StatusCode CellPositionsECalBarrelModuleThetaSegTool::finalize() { return GaudiTool::finalize(); } +StatusCode CellPositionsECalBarrelModuleThetaSegTool::finalize() { return AlgTool::finalize(); } diff --git a/RecFCCeeCalorimeter/src/components/CellPositionsECalBarrelModuleThetaSegTool.h b/RecFCCeeCalorimeter/src/components/CellPositionsECalBarrelModuleThetaSegTool.h index 9e9dfbe0..28ccefe2 100644 --- a/RecFCCeeCalorimeter/src/components/CellPositionsECalBarrelModuleThetaSegTool.h +++ b/RecFCCeeCalorimeter/src/components/CellPositionsECalBarrelModuleThetaSegTool.h @@ -2,7 +2,7 @@ #define RECCALORIMETER_CELLPOSITIONSECALBARRELMODULETHETASEGTOOL_H // GAUDI -#include "GaudiAlg/GaudiTool.h" +#include "GaudiKernel/AlgTool.h" #include "GaudiKernel/ServiceHandle.h" // k4FWCore @@ -37,7 +37,7 @@ class Segmentation; * @author Giovanni Marchiori */ -class CellPositionsECalBarrelModuleThetaSegTool : public GaudiTool, virtual public ICellPositionsTool { +class CellPositionsECalBarrelModuleThetaSegTool : public AlgTool, virtual public ICellPositionsTool { public: CellPositionsECalBarrelModuleThetaSegTool(const std::string& type, const std::string& name, const IInterface* parent); ~CellPositionsECalBarrelModuleThetaSegTool() = default; diff --git a/RecFCCeeCalorimeter/src/components/CellPositionsECalBarrelPhiThetaSegTool.cpp b/RecFCCeeCalorimeter/src/components/CellPositionsECalBarrelPhiThetaSegTool.cpp index 94d222dc..89d56f5f 100644 --- a/RecFCCeeCalorimeter/src/components/CellPositionsECalBarrelPhiThetaSegTool.cpp +++ b/RecFCCeeCalorimeter/src/components/CellPositionsECalBarrelPhiThetaSegTool.cpp @@ -7,12 +7,12 @@ DECLARE_COMPONENT(CellPositionsECalBarrelPhiThetaSegTool) CellPositionsECalBarrelPhiThetaSegTool::CellPositionsECalBarrelPhiThetaSegTool(const std::string& type, const std::string& name, const IInterface* parent) - : GaudiTool(type, name, parent) { + : AlgTool(type, name, parent) { declareInterface(this); } StatusCode CellPositionsECalBarrelPhiThetaSegTool::initialize() { - StatusCode sc = GaudiTool::initialize(); + StatusCode sc = AlgTool::initialize(); if (sc.isFailure()) return sc; m_geoSvc = service("GeoSvc"); if (!m_geoSvc) { @@ -93,4 +93,4 @@ int CellPositionsECalBarrelPhiThetaSegTool::layerId(const uint64_t& aCellId) { return layer; } -StatusCode CellPositionsECalBarrelPhiThetaSegTool::finalize() { return GaudiTool::finalize(); } +StatusCode CellPositionsECalBarrelPhiThetaSegTool::finalize() { return AlgTool::finalize(); } diff --git a/RecFCCeeCalorimeter/src/components/CellPositionsECalBarrelPhiThetaSegTool.h b/RecFCCeeCalorimeter/src/components/CellPositionsECalBarrelPhiThetaSegTool.h index 9a4b3987..f36d970a 100644 --- a/RecFCCeeCalorimeter/src/components/CellPositionsECalBarrelPhiThetaSegTool.h +++ b/RecFCCeeCalorimeter/src/components/CellPositionsECalBarrelPhiThetaSegTool.h @@ -2,7 +2,7 @@ #define RECCALORIMETER_CELLPOSITIONSECALBARRELPHITHETASEGTOOL_H // GAUDI -#include "GaudiAlg/GaudiTool.h" +#include "GaudiKernel/AlgTool.h" #include "GaudiKernel/ServiceHandle.h" // FCCSW @@ -35,7 +35,7 @@ class Segmentation; * @author Giovanni Marchiori */ -class CellPositionsECalBarrelPhiThetaSegTool : public GaudiTool, virtual public ICellPositionsTool { +class CellPositionsECalBarrelPhiThetaSegTool : public AlgTool, virtual public ICellPositionsTool { public: CellPositionsECalBarrelPhiThetaSegTool(const std::string& type, const std::string& name, const IInterface* parent); ~CellPositionsECalBarrelPhiThetaSegTool() = default; diff --git a/RecFCCeeCalorimeter/src/components/CellPositionsHCalBarrelPhiThetaSegTool.cpp b/RecFCCeeCalorimeter/src/components/CellPositionsHCalBarrelPhiThetaSegTool.cpp index 78a3327e..ac02f310 100644 --- a/RecFCCeeCalorimeter/src/components/CellPositionsHCalBarrelPhiThetaSegTool.cpp +++ b/RecFCCeeCalorimeter/src/components/CellPositionsHCalBarrelPhiThetaSegTool.cpp @@ -8,14 +8,14 @@ CellPositionsHCalBarrelPhiThetaSegTool::CellPositionsHCalBarrelPhiThetaSegTool( const std::string &type, const std::string &name, const IInterface *parent) - : GaudiTool(type, name, parent) + : AlgTool(type, name, parent) { declareInterface(this); } StatusCode CellPositionsHCalBarrelPhiThetaSegTool::initialize() { - StatusCode sc = GaudiTool::initialize(); + StatusCode sc = AlgTool::initialize(); if (sc.isFailure()) return sc; m_geoSvc = service("GeoSvc"); @@ -102,4 +102,4 @@ int CellPositionsHCalBarrelPhiThetaSegTool::layerId(const uint64_t &aCellId) return layer; } -StatusCode CellPositionsHCalBarrelPhiThetaSegTool::finalize() { return GaudiTool::finalize(); } +StatusCode CellPositionsHCalBarrelPhiThetaSegTool::finalize() { return AlgTool::finalize(); } diff --git a/RecFCCeeCalorimeter/src/components/CellPositionsHCalBarrelPhiThetaSegTool.h b/RecFCCeeCalorimeter/src/components/CellPositionsHCalBarrelPhiThetaSegTool.h index 64ceb635..5f25d46e 100644 --- a/RecFCCeeCalorimeter/src/components/CellPositionsHCalBarrelPhiThetaSegTool.h +++ b/RecFCCeeCalorimeter/src/components/CellPositionsHCalBarrelPhiThetaSegTool.h @@ -2,7 +2,7 @@ #define RECCALORIMETER_CellPositionsHCalBarrelPhiThetaSegTool_H // Gaudi -#include "GaudiAlg/GaudiTool.h" +#include "GaudiKernel/AlgTool.h" #include "GaudiKernel/ServiceHandle.h" // k4geo @@ -33,7 +33,7 @@ class Segmentation; * */ -class CellPositionsHCalBarrelPhiThetaSegTool : public GaudiTool, virtual public ICellPositionsTool { +class CellPositionsHCalBarrelPhiThetaSegTool : public AlgTool, virtual public ICellPositionsTool { public: CellPositionsHCalBarrelPhiThetaSegTool(const std::string& type, const std::string& name, const IInterface* parent); ~CellPositionsHCalBarrelPhiThetaSegTool() = default; diff --git a/RecFCCeeCalorimeter/src/components/CreateCaloCellPositionsFCCee.h b/RecFCCeeCalorimeter/src/components/CreateCaloCellPositionsFCCee.h index a90b8b5d..22890915 100644 --- a/RecFCCeeCalorimeter/src/components/CreateCaloCellPositionsFCCee.h +++ b/RecFCCeeCalorimeter/src/components/CreateCaloCellPositionsFCCee.h @@ -59,7 +59,7 @@ class CreateCaloCellPositionsFCCee : public Gaudi::Algorithm { MetaDataHandle m_positionedHitsCellIDEncoding{m_positionedHits, edm4hep::labels::CellIDEncoding, Gaudi::DataHandle::Writer}; // Cache - std::unordered_map m_positions_cache{}; + mutable std::unordered_map m_positions_cache{}; }; #endif /* DETCOMPONENTS_CREATECELLPOSITIONSFCCEE_H */ diff --git a/RecFCCeeCalorimeter/src/components/CreateCaloClustersSlidingWindowFCCee.h b/RecFCCeeCalorimeter/src/components/CreateCaloClustersSlidingWindowFCCee.h index 5051b910..a8385a6f 100644 --- a/RecFCCeeCalorimeter/src/components/CreateCaloClustersSlidingWindowFCCee.h +++ b/RecFCCeeCalorimeter/src/components/CreateCaloClustersSlidingWindowFCCee.h @@ -91,11 +91,11 @@ class CreateCaloClustersSlidingWindowFCCee : public Gaudi::Algorithm { /// Handle for calo cluster cells (output collection) mutable DataHandle m_clusterCells{"calo/clusterCells", Gaudi::DataHandle::Writer, this}; /// Handle for the tower building tool - ToolHandle m_towerTool; + mutable ToolHandle m_towerTool; // calorimeter towers - std::vector> m_towers; + mutable std::vector> m_towers; /// Vector of pre-clusters - std::vector m_preClusters; + mutable std::vector m_preClusters; /// number of towers in theta (calculated from m_deltaThetaTower and the theta size of the first layer) int m_nThetaTower; /// Number of towers in phi (calculated from m_deltaPhiTower) diff --git a/RecFCCeeCalorimeter/src/components/NoiseCaloCellsVsThetaFromFileTool.cpp b/RecFCCeeCalorimeter/src/components/NoiseCaloCellsVsThetaFromFileTool.cpp index 7a4039a6..edb058db 100644 --- a/RecFCCeeCalorimeter/src/components/NoiseCaloCellsVsThetaFromFileTool.cpp +++ b/RecFCCeeCalorimeter/src/components/NoiseCaloCellsVsThetaFromFileTool.cpp @@ -19,7 +19,7 @@ DECLARE_COMPONENT(NoiseCaloCellsVsThetaFromFileTool) NoiseCaloCellsVsThetaFromFileTool::NoiseCaloCellsVsThetaFromFileTool(const std::string& type, const std::string& name, const IInterface* parent) - : GaudiTool(type, name, parent), m_geoSvc("GeoSvc", name) { + : AlgTool(type, name, parent), m_geoSvc("GeoSvc", name) { declareInterface(this); declareInterface(this); declareProperty("cellPositionsTool", m_cellPositionsTool, "Handle for tool to retrieve cell positions"); @@ -64,7 +64,7 @@ StatusCode NoiseCaloCellsVsThetaFromFileTool::initialize() { debug() << "Filter noise threshold: " << m_filterThreshold << "*sigma" << endmsg; - StatusCode sc = GaudiTool::initialize(); + StatusCode sc = AlgTool::initialize(); if (sc.isFailure()) return sc; return sc; @@ -88,7 +88,7 @@ void NoiseCaloCellsVsThetaFromFileTool::filterCellNoise(std::unordered_map(this); } StatusCode CellPositionsCaloDiscsTool::initialize() { - StatusCode sc = GaudiTool::initialize(); + StatusCode sc = AlgTool::initialize(); if (sc.isFailure()) return sc; m_geoSvc = service("GeoSvc"); if (!m_geoSvc) { @@ -92,4 +92,4 @@ dd4hep::DDSegmentation::CellID cID = aCellId; return layer; } -StatusCode CellPositionsCaloDiscsTool::finalize() { return GaudiTool::finalize(); } +StatusCode CellPositionsCaloDiscsTool::finalize() { return AlgTool::finalize(); } diff --git a/RecFCChhCalorimeter/src/components/CellPositionsCaloDiscsTool.h b/RecFCChhCalorimeter/src/components/CellPositionsCaloDiscsTool.h index 5f851217..f45fbca2 100644 --- a/RecFCChhCalorimeter/src/components/CellPositionsCaloDiscsTool.h +++ b/RecFCChhCalorimeter/src/components/CellPositionsCaloDiscsTool.h @@ -2,7 +2,7 @@ #define RECCALORIMETER_CELLPOSITIONSCALODISCSTOOL_H // GAUDI -#include "GaudiAlg/GaudiTool.h" +#include "GaudiKernel/AlgTool.h" #include "GaudiKernel/ServiceHandle.h" // FCCSW @@ -35,7 +35,7 @@ class Segmentation; * @author Coralie Neubueser */ -class CellPositionsCaloDiscsTool : public GaudiTool, virtual public ICellPositionsTool { +class CellPositionsCaloDiscsTool : public AlgTool, virtual public ICellPositionsTool { public: CellPositionsCaloDiscsTool(const std::string& type, const std::string& name, const IInterface* parent); diff --git a/RecFCChhCalorimeter/src/components/CellPositionsDummyTool.cpp b/RecFCChhCalorimeter/src/components/CellPositionsDummyTool.cpp index 5dad5be6..428b18ff 100644 --- a/RecFCChhCalorimeter/src/components/CellPositionsDummyTool.cpp +++ b/RecFCChhCalorimeter/src/components/CellPositionsDummyTool.cpp @@ -6,12 +6,12 @@ DECLARE_COMPONENT(CellPositionsDummyTool) CellPositionsDummyTool::CellPositionsDummyTool(const std::string& type, const std::string& name, const IInterface* parent) - : GaudiTool(type, name, parent) { + : AlgTool(type, name, parent) { declareInterface(this); } StatusCode CellPositionsDummyTool::initialize() { - StatusCode sc = GaudiTool::initialize(); + StatusCode sc = AlgTool::initialize(); if (sc.isFailure()) return sc; m_geoSvc = service("GeoSvc"); if (!m_geoSvc) { @@ -54,4 +54,4 @@ int CellPositionsDummyTool::layerId(const uint64_t& /*aCellId*/) { return layer; } -StatusCode CellPositionsDummyTool::finalize() { return GaudiTool::finalize(); } +StatusCode CellPositionsDummyTool::finalize() { return AlgTool::finalize(); } diff --git a/RecFCChhCalorimeter/src/components/CellPositionsDummyTool.h b/RecFCChhCalorimeter/src/components/CellPositionsDummyTool.h index 9d49a2f2..57d7fc41 100644 --- a/RecFCChhCalorimeter/src/components/CellPositionsDummyTool.h +++ b/RecFCChhCalorimeter/src/components/CellPositionsDummyTool.h @@ -2,7 +2,7 @@ #define RECCALORIMETER_CELLPOSITIONSDUMMYTOOL_H // GAUDI -#include "GaudiAlg/GaudiTool.h" +#include "GaudiKernel/AlgTool.h" #include "GaudiKernel/ServiceHandle.h" // FCCSW @@ -21,7 +21,7 @@ class IGeoSvc; * @author Coralie Neubueser */ -class CellPositionsDummyTool : public GaudiTool, virtual public ICellPositionsTool { +class CellPositionsDummyTool : public AlgTool, virtual public ICellPositionsTool { public: CellPositionsDummyTool(const std::string& type, const std::string& name, const IInterface* parent); diff --git a/RecFCChhCalorimeter/src/components/CellPositionsECalBarrelTool.cpp b/RecFCChhCalorimeter/src/components/CellPositionsECalBarrelTool.cpp index d7f2feca..5177ff94 100644 --- a/RecFCChhCalorimeter/src/components/CellPositionsECalBarrelTool.cpp +++ b/RecFCChhCalorimeter/src/components/CellPositionsECalBarrelTool.cpp @@ -7,12 +7,12 @@ DECLARE_COMPONENT(CellPositionsECalBarrelTool) CellPositionsECalBarrelTool::CellPositionsECalBarrelTool(const std::string& type, const std::string& name, const IInterface* parent) - : GaudiTool(type, name, parent) { + : AlgTool(type, name, parent) { declareInterface(this); } StatusCode CellPositionsECalBarrelTool::initialize() { - StatusCode sc = GaudiTool::initialize(); + StatusCode sc = AlgTool::initialize(); if (sc.isFailure()) return sc; m_geoSvc = service("GeoSvc"); if (!m_geoSvc) { @@ -93,4 +93,4 @@ int CellPositionsECalBarrelTool::layerId(const uint64_t& aCellId) { return layer; } -StatusCode CellPositionsECalBarrelTool::finalize() { return GaudiTool::finalize(); } +StatusCode CellPositionsECalBarrelTool::finalize() { return AlgTool::finalize(); } diff --git a/RecFCChhCalorimeter/src/components/CellPositionsECalBarrelTool.h b/RecFCChhCalorimeter/src/components/CellPositionsECalBarrelTool.h index 92ede5bf..ef7991a9 100644 --- a/RecFCChhCalorimeter/src/components/CellPositionsECalBarrelTool.h +++ b/RecFCChhCalorimeter/src/components/CellPositionsECalBarrelTool.h @@ -2,7 +2,7 @@ #define RECCALORIMETER_CELLPOSITIONSECALBARRELTOOL_H // GAUDI -#include "GaudiAlg/GaudiTool.h" +#include "GaudiKernel/AlgTool.h" #include "GaudiKernel/ServiceHandle.h" // FCCSW @@ -35,7 +35,7 @@ class Segmentation; * @author Coralie Neubueser */ -class CellPositionsECalBarrelTool : public GaudiTool, virtual public ICellPositionsTool { +class CellPositionsECalBarrelTool : public AlgTool, virtual public ICellPositionsTool { public: CellPositionsECalBarrelTool(const std::string& type, const std::string& name, const IInterface* parent); ~CellPositionsECalBarrelTool() = default; diff --git a/RecFCChhCalorimeter/src/components/CellPositionsHCalBarrelNoSegTool.cpp b/RecFCChhCalorimeter/src/components/CellPositionsHCalBarrelNoSegTool.cpp index 6714cc55..f4466267 100644 --- a/RecFCChhCalorimeter/src/components/CellPositionsHCalBarrelNoSegTool.cpp +++ b/RecFCChhCalorimeter/src/components/CellPositionsHCalBarrelNoSegTool.cpp @@ -6,12 +6,12 @@ DECLARE_COMPONENT(CellPositionsHCalBarrelNoSegTool) CellPositionsHCalBarrelNoSegTool::CellPositionsHCalBarrelNoSegTool(const std::string& type, const std::string& name, const IInterface* parent) - : GaudiTool(type, name, parent) { + : AlgTool(type, name, parent) { declareInterface(this); } StatusCode CellPositionsHCalBarrelNoSegTool::initialize() { - StatusCode sc = GaudiTool::initialize(); + StatusCode sc = AlgTool::initialize(); if (sc.isFailure()) return sc; m_geoSvc = service("GeoSvc"); if (!m_geoSvc) { @@ -96,4 +96,4 @@ int CellPositionsHCalBarrelNoSegTool::layerId(const uint64_t& aCellId) { return layer; } -StatusCode CellPositionsHCalBarrelNoSegTool::finalize() { return GaudiTool::finalize(); } +StatusCode CellPositionsHCalBarrelNoSegTool::finalize() { return AlgTool::finalize(); } diff --git a/RecFCChhCalorimeter/src/components/CellPositionsHCalBarrelNoSegTool.h b/RecFCChhCalorimeter/src/components/CellPositionsHCalBarrelNoSegTool.h index 18c71212..746eca63 100644 --- a/RecFCChhCalorimeter/src/components/CellPositionsHCalBarrelNoSegTool.h +++ b/RecFCChhCalorimeter/src/components/CellPositionsHCalBarrelNoSegTool.h @@ -2,7 +2,7 @@ #define RECCALORIMETER_CELLPOSITIONSHCALBARRELNOSEGTOOL_H // GAUDI -#include "GaudiAlg/GaudiTool.h" +#include "GaudiKernel/AlgTool.h" #include "GaudiKernel/ServiceHandle.h" // FCCSW @@ -34,7 +34,7 @@ class Segmentation; * @author Coralie Neubueser */ -class CellPositionsHCalBarrelNoSegTool : public GaudiTool, virtual public ICellPositionsTool { +class CellPositionsHCalBarrelNoSegTool : public AlgTool, virtual public ICellPositionsTool { public: CellPositionsHCalBarrelNoSegTool(const std::string& type, const std::string& name, const IInterface* parent); ~CellPositionsHCalBarrelNoSegTool() = default; diff --git a/RecFCChhCalorimeter/src/components/CellPositionsHCalBarrelPhiSegTool.cpp b/RecFCChhCalorimeter/src/components/CellPositionsHCalBarrelPhiSegTool.cpp index 3fd4f259..99f13343 100644 --- a/RecFCChhCalorimeter/src/components/CellPositionsHCalBarrelPhiSegTool.cpp +++ b/RecFCChhCalorimeter/src/components/CellPositionsHCalBarrelPhiSegTool.cpp @@ -6,12 +6,12 @@ DECLARE_COMPONENT(CellPositionsHCalBarrelPhiSegTool) CellPositionsHCalBarrelPhiSegTool::CellPositionsHCalBarrelPhiSegTool(const std::string& type, const std::string& name, const IInterface* parent) - : GaudiTool(type, name, parent) { + : AlgTool(type, name, parent) { declareInterface(this); } StatusCode CellPositionsHCalBarrelPhiSegTool::initialize() { - StatusCode sc = GaudiTool::initialize(); + StatusCode sc = AlgTool::initialize(); if (sc.isFailure()) return sc; m_geoSvc = service("GeoSvc"); if (!m_geoSvc) { @@ -91,4 +91,4 @@ int CellPositionsHCalBarrelPhiSegTool::layerId(const uint64_t& aCellId) { return layer; } -StatusCode CellPositionsHCalBarrelPhiSegTool::finalize() { return GaudiTool::finalize(); } +StatusCode CellPositionsHCalBarrelPhiSegTool::finalize() { return AlgTool::finalize(); } diff --git a/RecFCChhCalorimeter/src/components/CellPositionsHCalBarrelPhiSegTool.h b/RecFCChhCalorimeter/src/components/CellPositionsHCalBarrelPhiSegTool.h index 7dcf8a97..f5fdfe95 100644 --- a/RecFCChhCalorimeter/src/components/CellPositionsHCalBarrelPhiSegTool.h +++ b/RecFCChhCalorimeter/src/components/CellPositionsHCalBarrelPhiSegTool.h @@ -2,7 +2,7 @@ #define RECCALORIMETER_CELLPOSITIONSHCALBARRELPHISEGTOOL_H // GAUDI -#include "GaudiAlg/GaudiTool.h" +#include "GaudiKernel/AlgTool.h" #include "GaudiKernel/ServiceHandle.h" // FCCSW @@ -34,7 +34,7 @@ class Segmentation; * @author Coralie Neubueser */ -class CellPositionsHCalBarrelPhiSegTool : public GaudiTool, virtual public ICellPositionsTool { +class CellPositionsHCalBarrelPhiSegTool : public AlgTool, virtual public ICellPositionsTool { public: CellPositionsHCalBarrelPhiSegTool(const std::string& type, const std::string& name, const IInterface* parent); ~CellPositionsHCalBarrelPhiSegTool() = default; diff --git a/RecFCChhCalorimeter/src/components/CellPositionsHCalBarrelTool.cpp b/RecFCChhCalorimeter/src/components/CellPositionsHCalBarrelTool.cpp index d5553144..6c05f3b0 100644 --- a/RecFCChhCalorimeter/src/components/CellPositionsHCalBarrelTool.cpp +++ b/RecFCChhCalorimeter/src/components/CellPositionsHCalBarrelTool.cpp @@ -6,12 +6,12 @@ DECLARE_COMPONENT(CellPositionsHCalBarrelTool) CellPositionsHCalBarrelTool::CellPositionsHCalBarrelTool(const std::string& type, const std::string& name, const IInterface* parent) - : GaudiTool(type, name, parent) { + : AlgTool(type, name, parent) { declareInterface(this); } StatusCode CellPositionsHCalBarrelTool::initialize() { - StatusCode sc = GaudiTool::initialize(); + StatusCode sc = AlgTool::initialize(); if (sc.isFailure()) return sc; m_geoSvc = service("GeoSvc"); if (!m_geoSvc) { @@ -85,4 +85,4 @@ int CellPositionsHCalBarrelTool::layerId(const uint64_t& aCellId) { return layer; } -StatusCode CellPositionsHCalBarrelTool::finalize() { return GaudiTool::finalize(); } +StatusCode CellPositionsHCalBarrelTool::finalize() { return AlgTool::finalize(); } diff --git a/RecFCChhCalorimeter/src/components/CellPositionsHCalBarrelTool.h b/RecFCChhCalorimeter/src/components/CellPositionsHCalBarrelTool.h index 4e7f94d3..9ef04acf 100644 --- a/RecFCChhCalorimeter/src/components/CellPositionsHCalBarrelTool.h +++ b/RecFCChhCalorimeter/src/components/CellPositionsHCalBarrelTool.h @@ -2,7 +2,7 @@ #define RECCALORIMETER_CELLPOSITIONSHCALBARRELTOOL_H // GAUDI -#include "GaudiAlg/GaudiTool.h" +#include "GaudiKernel/AlgTool.h" #include "GaudiKernel/ServiceHandle.h" // FCCSW @@ -29,7 +29,7 @@ class Segmentation; * */ -class CellPositionsHCalBarrelTool : public GaudiTool, virtual public ICellPositionsTool { +class CellPositionsHCalBarrelTool : public AlgTool, virtual public ICellPositionsTool { public: CellPositionsHCalBarrelTool(const std::string& type, const std::string& name, const IInterface* parent); ~CellPositionsHCalBarrelTool() = default; diff --git a/RecFCChhCalorimeter/src/components/CellPositionsTailCatcherTool.cpp b/RecFCChhCalorimeter/src/components/CellPositionsTailCatcherTool.cpp index 63f57ff0..74a04ba8 100644 --- a/RecFCChhCalorimeter/src/components/CellPositionsTailCatcherTool.cpp +++ b/RecFCChhCalorimeter/src/components/CellPositionsTailCatcherTool.cpp @@ -7,12 +7,12 @@ DECLARE_COMPONENT(CellPositionsTailCatcherTool) CellPositionsTailCatcherTool::CellPositionsTailCatcherTool(const std::string& type, const std::string& name, const IInterface* parent) - : GaudiTool(type, name, parent) { + : AlgTool(type, name, parent) { declareInterface(this); } StatusCode CellPositionsTailCatcherTool::initialize() { - StatusCode sc = GaudiTool::initialize(); + StatusCode sc = AlgTool::initialize(); if (sc.isFailure()) return sc; m_geoSvc = service("GeoSvc"); if (!m_geoSvc) { @@ -94,4 +94,4 @@ dd4hep::Position CellPositionsTailCatcherTool::xyzPosition(const uint64_t& aCell int CellPositionsTailCatcherTool::layerId(const uint64_t& /*aCellId*/) { return 0; } -StatusCode CellPositionsTailCatcherTool::finalize() { return GaudiTool::finalize(); } +StatusCode CellPositionsTailCatcherTool::finalize() { return AlgTool::finalize(); } diff --git a/RecFCChhCalorimeter/src/components/CellPositionsTailCatcherTool.h b/RecFCChhCalorimeter/src/components/CellPositionsTailCatcherTool.h index 595a0dd7..2d3e59a3 100644 --- a/RecFCChhCalorimeter/src/components/CellPositionsTailCatcherTool.h +++ b/RecFCChhCalorimeter/src/components/CellPositionsTailCatcherTool.h @@ -2,7 +2,7 @@ #define RECCALORIMETER_CELLPOSITIONSTAILCATCHERTOOL_H // GAUDI -#include "GaudiAlg/GaudiTool.h" +#include "GaudiKernel/AlgTool.h" #include "GaudiKernel/ServiceHandle.h" // FCCSW @@ -35,7 +35,7 @@ class Segmentation; * @author Coralie Neubueser */ -class CellPositionsTailCatcherTool : public GaudiTool, virtual public ICellPositionsTool { +class CellPositionsTailCatcherTool : public AlgTool, virtual public ICellPositionsTool { public: CellPositionsTailCatcherTool(const std::string& type, const std::string& name, const IInterface* parent); ~CellPositionsTailCatcherTool() = default; diff --git a/RecFCChhCalorimeter/src/components/CreateCellPositions.h b/RecFCChhCalorimeter/src/components/CreateCellPositions.h index 08952fec..fa378d60 100644 --- a/RecFCChhCalorimeter/src/components/CreateCellPositions.h +++ b/RecFCChhCalorimeter/src/components/CreateCellPositions.h @@ -44,7 +44,7 @@ class CreateCellPositions : public Gaudi::Algorithm { private: /// Handle for tool to get positions - ToolHandle m_cellPositionsTool; + mutable ToolHandle m_cellPositionsTool; /// Input collection mutable DataHandle m_hits{"hits/hits", Gaudi::DataHandle::Reader, this}; /// Output collection From 040de2cea851e93a40c31266e1be586334a078c4 Mon Sep 17 00:00:00 2001 From: jmcarcell Date: Mon, 29 Jul 2024 10:14:08 +0200 Subject: [PATCH 3/3] Bring back commented out lines related to ONNXRuntime --- RecFCCeeCalorimeter/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/RecFCCeeCalorimeter/CMakeLists.txt b/RecFCCeeCalorimeter/CMakeLists.txt index e833d974..356d57e4 100644 --- a/RecFCCeeCalorimeter/CMakeLists.txt +++ b/RecFCCeeCalorimeter/CMakeLists.txt @@ -4,9 +4,9 @@ # ONNX DEPENDENCIES # includes -# include_directories("${ONNXRUNTIME_INCLUDE_DIRS}") +include_directories("${ONNXRUNTIME_INCLUDE_DIRS}") # libs -# link_directories("${ONNXRUNTIME_LIBRARY_DIRS}") +link_directories("${ONNXRUNTIME_LIBRARY_DIRS}") # New versions of ONNXRuntime add directories to include # through the target onnxruntime::onnxruntime if(onnxruntime_FOUND)