Skip to content

Commit

Permalink
GaudiAlgorithm -> Gaudi::Algorithm
Browse files Browse the repository at this point in the history
  • Loading branch information
giovannimarchiori committed Aug 13, 2024
1 parent de25ea2 commit 521a1c6
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
DECLARE_COMPONENT(CreatePositionedCaloCells)

CreatePositionedCaloCells::CreatePositionedCaloCells(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)");

Expand All @@ -29,7 +29,7 @@ GaudiAlgorithm(name, svcLoc), m_geoSvc("GeoSvc", name) {
}

StatusCode CreatePositionedCaloCells::initialize() {
StatusCode sc = GaudiAlgorithm::initialize();
StatusCode sc = Gaudi::Algorithm::initialize();
if (sc.isFailure()) return sc;

info() << "CreatePositionedCaloCells initialized" << endmsg;
Expand Down Expand Up @@ -89,7 +89,7 @@ StatusCode CreatePositionedCaloCells::initialize() {
return StatusCode::SUCCESS;
}

StatusCode CreatePositionedCaloCells::execute() {
StatusCode CreatePositionedCaloCells::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;
Expand Down Expand Up @@ -194,4 +194,4 @@ StatusCode CreatePositionedCaloCells::execute() {
return StatusCode::SUCCESS;
}

StatusCode CreatePositionedCaloCells::finalize() { return GaudiAlgorithm::finalize(); }
StatusCode CreatePositionedCaloCells::finalize() { return Gaudi::Algorithm::finalize(); }
22 changes: 11 additions & 11 deletions RecFCCeeCalorimeter/src/components/CreatePositionedCaloCells.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#include "k4Interface/ICaloReadCrosstalkMap.h"

// Gaudi
#include "GaudiAlg/GaudiAlgorithm.h"
#include "Gaudi/Algorithm.h"
#include "GaudiKernel/ToolHandle.h"

// edm4hep
Expand Down Expand Up @@ -53,26 +53,26 @@ class IGeoSvc;
*
*/

class CreatePositionedCaloCells : public GaudiAlgorithm {
class CreatePositionedCaloCells : public Gaudi::Algorithm {

public:
CreatePositionedCaloCells(const std::string& name, ISvcLocator* svcLoc);

StatusCode initialize();

StatusCode execute();
StatusCode execute(const EventContext&) const;

StatusCode finalize();

private:
/// Handle for tool to get cells positions
ToolHandle<ICellPositionsTool> m_cellPositionsTool{"CellPositionsTool", this};
/// Handle for the calorimeter cells crosstalk tool
ToolHandle<ICaloReadCrosstalkMap> m_crosstalkTool{"ReadCaloCrosstalkMap", this};
mutable ToolHandle<ICaloReadCrosstalkMap> m_crosstalkTool{"ReadCaloCrosstalkMap", this};
/// Handle for tool to calibrate Geant4 energy to EM scale tool
ToolHandle<ICalibrateCaloHitsTool> m_calibTool{"CalibrateCaloHitsTool", this};
mutable ToolHandle<ICalibrateCaloHitsTool> m_calibTool{"CalibrateCaloHitsTool", this};
/// Handle for the calorimeter cells noise tool
ToolHandle<INoiseCaloCellsTool> m_noiseTool{"NoiseCaloCellsFlatTool", this};
mutable ToolHandle<INoiseCaloCellsTool> m_noiseTool{"NoiseCaloCellsFlatTool", this};
/// Handle for the geometry tool
ToolHandle<ICalorimeterTool> m_geoTool{"TubeLayerPhiEtaCaloTool", this};

Expand All @@ -87,22 +87,22 @@ class CreatePositionedCaloCells : public GaudiAlgorithm {
"Save only cells with energy above threshold?"};

/// Handle for calo hits (input collection)
DataHandle<edm4hep::SimCalorimeterHitCollection> m_hits{"hits", Gaudi::DataHandle::Reader, this};
mutable DataHandle<edm4hep::SimCalorimeterHitCollection> m_hits{"hits", Gaudi::DataHandle::Reader, this};
/// Handle for the cellID encoding string of the input collection
MetaDataHandle<std::string> m_hitsCellIDEncoding{m_hits, edm4hep::labels::CellIDEncoding, Gaudi::DataHandle::Reader};
/// Handle for calo cells (output collection)
DataHandle<edm4hep::CalorimeterHitCollection> m_cells{"cells", Gaudi::DataHandle::Writer, this};
mutable DataHandle<edm4hep::CalorimeterHitCollection> m_cells{"cells", Gaudi::DataHandle::Writer, this};
MetaDataHandle<std::string> m_cellsCellIDEncoding{m_cells, edm4hep::labels::CellIDEncoding, Gaudi::DataHandle::Writer};
/// Pointer to the geometry service (is this needed?)
ServiceHandle<IGeoSvc> m_geoSvc;
/// dd4hep::VolumeManager m_volman; (not needed)
/// Maps of cell IDs (corresponding to DD4hep IDs) on final energies to be used for clustering
std::unordered_map<uint64_t, double> m_cellsMap;
mutable std::unordered_map<uint64_t, double> m_cellsMap;
/// Maps of cell IDs (corresponding to DD4hep IDs) on transfer of signals due to crosstalk
std::unordered_map<uint64_t, double> m_crosstalkCellsMap;
mutable std::unordered_map<uint64_t, double> m_crosstalkCellsMap;

/// Cache position vs cellID
std::unordered_map<dd4hep::DDSegmentation::CellID, edm4hep::Vector3f> m_positions_cache{};
mutable std::unordered_map<dd4hep::DDSegmentation::CellID, edm4hep::Vector3f> m_positions_cache{};
};

#endif /* RECFCCEECALORIMETER_CREATEPOSITIONEDCALOCELLS_H */

0 comments on commit 521a1c6

Please sign in to comment.