From a7a9e37f649f5dc894ec177fabf907a5753759d9 Mon Sep 17 00:00:00 2001 From: jmcarcell Date: Mon, 29 Jul 2024 10:08:34 +0200 Subject: [PATCH] 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