From bb2542fc530d6b40fee15821d3a08843a11d9ded Mon Sep 17 00:00:00 2001 From: Wouter Deconinck Date: Thu, 11 Aug 2022 16:59:42 -0500 Subject: [PATCH 01/16] New headers, renames, etc --- CMakeLists.txt | 8 +- JugBase/CMakeLists.txt | 19 ----- JugBase/Jug/Algorithm.h | 64 ++++++++++++++++ JugBase/Jug/Particle.h | 13 ++++ JugBase/{JugBase => Jug}/Property.h | 4 + JugBase/Jug/Service.h | 13 ++++ JugBase/JugAlg/JugAlgorithm.h | 2 + JugBase/JugAlg/JugTool.h | 1 + JugBase/JugAlg/Producer.h | 2 + JugBase/JugAlg/Transformer.h | 2 + JugBase/JugBase/Algorithm.h | 28 ------- JugBase/JugBase/IParticleSvc.h | 41 +--------- JugBase/JugKernel/PhysicalConstants.h | 8 ++ JugBase/JugKernel/RndmGenerators.h | 1 + JugBase/src/components/EICDataSvc.cpp | 2 - JugBase/src/components/GeoSvc.cpp | 6 +- JugBase/src/components/GeoSvc.h | 14 ++-- JugBase/src/components/InputCopier.cpp | 24 +++--- JugBase/src/components/ParticleSvc.cpp | 2 - JugBase/src/components/ParticleSvc.h | 2 +- JugBase/src/components/PodioInput.cpp | 8 +- JugBase/src/components/PodioInput.h | 6 +- JugBase/src/components/PodioOutput.cpp | 14 ++-- JugBase/src/components/PodioOutput.h | 10 +-- JugBase/src/components/ReadTestConsumer.cxx | 11 ++- JugDigi/CMakeLists.txt | 6 +- .../src/components/CalorimeterBirksCorr.cpp | 76 +++++-------------- JugDigi/src/components/CalorimeterHitDigi.cpp | 22 +++--- .../src/components/PhotoMultiplierDigi.cpp | 36 +++++---- JugDigi/src/components/SiliconTrackerDigi.cpp | 32 ++++---- .../components/SimTrackerHitsCollector.cpp | 24 +++--- JugFast/CMakeLists.txt | 8 +- JugFast/src/components/ClusterMerger.cpp | 30 ++++---- .../components/InclusiveKinematicsTruth.cpp | 24 +++--- JugFast/src/components/MC2SmearedParticle.cpp | 24 +++--- JugFast/src/components/MatchClusters.cpp | 36 +++++---- .../src/components/ParticlesWithTruthPID.cpp | 32 ++++---- .../components/SmearedFarForwardParticles.cpp | 58 +++++++------- JugFast/src/components/TruthClustering.cpp | 30 ++++---- .../TruthEnergyPositionClusterMerger.cpp | 34 ++++----- JugPID/CMakeLists.txt | 8 +- JugPID/src/components/PhotoRingClusters.cpp | 40 +++++----- JugReco/CMakeLists.txt | 8 +- JugReco/src/components/CalorimeterHitReco.cpp | 58 +++++++------- .../CalorimeterHitsEtaPhiProjector.cpp | 30 ++++---- .../src/components/CalorimeterHitsMerger.cpp | 36 +++++---- .../components/CalorimeterIslandCluster.cpp | 52 ++++++------- JugReco/src/components/ClusterRecoCoG.cpp | 48 ++++++------ .../EnergyPositionClusterMerger.cpp | 32 ++++---- .../src/components/FarForwardParticles.cpp | 48 ++++++------ .../src/components/FarForwardParticlesOMD.cpp | 34 ++++----- JugReco/src/components/ImagingClusterReco.cpp | 40 +++++----- .../components/ImagingPixelDataCombiner.cpp | 34 ++++----- .../src/components/ImagingPixelDataSorter.cpp | 32 ++++---- JugReco/src/components/ImagingPixelMerger.cpp | 32 ++++---- JugReco/src/components/ImagingPixelReco.cpp | 50 ++++++------ JugReco/src/components/ImagingTopoCluster.cpp | 44 +++++------ .../src/components/InclusiveKinematicsDA.cpp | 30 ++++---- .../InclusiveKinematicsElectron.cpp | 30 ++++---- .../src/components/InclusiveKinematicsJB.cpp | 30 ++++---- .../components/InclusiveKinematicsSigma.cpp | 30 ++++---- .../components/InclusiveKinematicseSigma.cpp | 30 ++++---- JugReco/src/components/ParticleCollector.cpp | 24 +++--- .../src/components/PhotoMultiplierReco.cpp | 38 +++++----- JugReco/src/components/SimpleClustering.cpp | 38 +++++----- .../components/TrackerHitReconstruction.cpp | 32 ++++---- .../src/components/TrackingHitsCollector.cpp | 28 ++++--- .../src/components/TrackingHitsCollector2.cpp | 24 +++--- JugTrack/CMakeLists.txt | 7 +- JugTrack/src/components/CKFTracking.cpp | 20 +++-- JugTrack/src/components/CKFTracking.h | 22 +++--- .../components/ConformalXYPeakProtoTracks.cpp | 28 ++++--- .../src/components/FinderAlgoTemplate.cpp | 24 +++--- JugTrack/src/components/GenFitTrackFitter.cpp | 20 +++-- JugTrack/src/components/GenFitTrackFitter.h | 20 ++--- .../components/HoughTransformProtoTracks.cpp | 24 +++--- .../src/components/ParticlesFromTrackFit.cpp | 30 ++++---- .../src/components/ProtoTrackMatching.cpp | 28 ++++--- .../components/SingleTrackSourceLinker.cpp | 32 ++++---- JugTrack/src/components/TestACTSLogger.cpp | 8 +- JugTrack/src/components/TestACTSLogger.h | 6 +- .../src/components/TrackFindingAlgorithm.cpp | 20 +++-- .../src/components/TrackFindingAlgorithm.h | 22 +++--- .../src/components/TrackFittingAlgorithm.cpp | 21 +++-- .../src/components/TrackFittingAlgorithm.h | 20 ++--- .../src/components/TrackParamACTSSeeding.cpp | 29 ++++--- .../src/components/TrackParamClusterInit.cpp | 26 +++---- .../TrackParamImagingClusterInit.cpp | 26 +++---- .../src/components/TrackParamTruthInit.cpp | 48 ++++++------ .../TrackParamVertexClusterInit.cpp | 34 ++++----- JugTrack/src/components/TrackProjector.cpp | 38 +++++----- .../src/components/TrackerSourceLinker.cpp | 30 ++++---- JugTrack/src/components/TruthTrackSeeding.cpp | 26 +++---- 93 files changed, 1098 insertions(+), 1248 deletions(-) create mode 100644 JugBase/Jug/Algorithm.h create mode 100644 JugBase/Jug/Particle.h rename JugBase/{JugBase => Jug}/Property.h (94%) create mode 100644 JugBase/Jug/Service.h create mode 100644 JugBase/JugAlg/JugAlgorithm.h create mode 100644 JugBase/JugAlg/JugTool.h create mode 100644 JugBase/JugAlg/Producer.h create mode 100644 JugBase/JugAlg/Transformer.h delete mode 100644 JugBase/JugBase/Algorithm.h create mode 100644 JugBase/JugKernel/PhysicalConstants.h create mode 100644 JugBase/JugKernel/RndmGenerators.h diff --git a/CMakeLists.txt b/CMakeLists.txt index e61ddee..9b8d164 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -78,7 +78,7 @@ find_path(genfit2_INCLUDE_DIR NAMES GFGbl.h PATHS /usr/local/include ${genfit2}/ #add_subdirectory(JugBase) add_subdirectory(JugDigi) -#add_subdirectory(JugFast) -#add_subdirectory(JugPID) -#add_subdirectory(JugReco) -#add_subdirectory(JugTrack) +add_subdirectory(JugFast) +add_subdirectory(JugPID) +add_subdirectory(JugReco) +add_subdirectory(JugTrack) diff --git a/JugBase/CMakeLists.txt b/JugBase/CMakeLists.txt index 97bdafb..c0a30da 100644 --- a/JugBase/CMakeLists.txt +++ b/JugBase/CMakeLists.txt @@ -58,22 +58,3 @@ install(TARGETS JugBase JugBasePlugins RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" COMPONENT bin LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" COMPONENT shlib COMPONENT dev) - -if(BUILD_TESTING) - enable_testing() -endif() - -#add_test(NAME ProduceForReadTest -# WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} -# COMMAND ${CMAKE_BINARY_DIR}/run ${PROJECT_SOURCE_DIR}/JugBase/scripts/gaudirun tests/options/simple_producer.py) -#add_test(NAME ReadTest -# WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} -# COMMAND ${CMAKE_BINARY_DIR}/run ${PROJECT_SOURCE_DIR}/JugBase/scripts/gaudirun tests/options/simple_reader.py) -#add_test(NAME ReadGeoTest -# WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} -# COMMAND ${CMAKE_BINARY_DIR}/run ${PROJECT_SOURCE_DIR}/JugBase/scripts/gaudirun tests/options/reader_with_geosvc.py) -#add_test(NAME CheckReadCollectionSize -# ENVIRONMENT PYTHONPATH+=${PODIO_PYTHON_DIR} -# WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} -# COMMAND python JugBase/tests/scripts/check_coll_after_read.py -# DEPENDS ReadTest) diff --git a/JugBase/Jug/Algorithm.h b/JugBase/Jug/Algorithm.h new file mode 100644 index 0000000..9812f99 --- /dev/null +++ b/JugBase/Jug/Algorithm.h @@ -0,0 +1,64 @@ +#pragma once + +#include + +namespace Jug { + + class ISvcLocator; + + class StatusCode { + public: + enum Value : uint { + SUCCESS, + FAILURE + }; + StatusCode() = default; + constexpr StatusCode(Value value): m_value(value) { }; + constexpr operator Value() const { return m_value; } + explicit operator bool() const = delete; + constexpr bool operator==(StatusCode a) const { return m_value == a.m_value; } + constexpr bool operator!=(StatusCode a) const { return m_value != a.m_value; } + constexpr bool isFailure() const { return m_value == FAILURE; } + private: + Value m_value; + }; + + class JugAlgorithm { + private: + std::string m_name; + ISvcLocator* m_svc; + + static std::function m_debug; + static std::function m_info; + static std::function m_warning; + static std::function m_error; + static std::function m_endmsg; + + static void SetLoggers( + std::function debug, + std::function info, + std::function warning, + std::function error + ) { + m_debug = debug; + m_info = info; + m_warning = warning; + m_error = error; + } + + + public: + JugAlgorithm(const std::string& name, ISvcLocator* svc) + : m_name(name),m_svc(svc) { + } + + protected: + static std::ostream& debug() { return m_debug(); }; + static std::ostream& info() { return m_info(); }; + static std::ostream& warning() { return m_warning(); }; + static std::ostream& error() { return m_error(); }; + static std::ostream& endmsg() { return m_endmsg(); }; + + }; + +} // namespace Jug diff --git a/JugBase/Jug/Particle.h b/JugBase/Jug/Particle.h new file mode 100644 index 0000000..c5ba026 --- /dev/null +++ b/JugBase/Jug/Particle.h @@ -0,0 +1,13 @@ +#pragma once + +namespace Jug::Base { + + /** Simple particle data. + * + */ + struct Particle { + int pdgCode; + int charge; + double mass; //std::string name; + }; +} // namespace Jug::Base diff --git a/JugBase/JugBase/Property.h b/JugBase/Jug/Property.h similarity index 94% rename from JugBase/JugBase/Property.h rename to JugBase/Jug/Property.h index 448dcfa..06bc6b2 100644 --- a/JugBase/JugBase/Property.h +++ b/JugBase/Jug/Property.h @@ -1,3 +1,7 @@ +#pragma once + +#include + namespace Jug { template diff --git a/JugBase/Jug/Service.h b/JugBase/Jug/Service.h new file mode 100644 index 0000000..858cd9c --- /dev/null +++ b/JugBase/Jug/Service.h @@ -0,0 +1,13 @@ +#pragma once + +#include + +namespace Jug { + + template + class Service: public std::function { + public: + Service() = default; + }; + +} // namespace Jug diff --git a/JugBase/JugAlg/JugAlgorithm.h b/JugBase/JugAlg/JugAlgorithm.h new file mode 100644 index 0000000..9f1288d --- /dev/null +++ b/JugBase/JugAlg/JugAlgorithm.h @@ -0,0 +1,2 @@ +#pragma once +#include "Jug/Algorithm.h" diff --git a/JugBase/JugAlg/JugTool.h b/JugBase/JugAlg/JugTool.h new file mode 100644 index 0000000..6f70f09 --- /dev/null +++ b/JugBase/JugAlg/JugTool.h @@ -0,0 +1 @@ +#pragma once diff --git a/JugBase/JugAlg/Producer.h b/JugBase/JugAlg/Producer.h new file mode 100644 index 0000000..9f1288d --- /dev/null +++ b/JugBase/JugAlg/Producer.h @@ -0,0 +1,2 @@ +#pragma once +#include "Jug/Algorithm.h" diff --git a/JugBase/JugAlg/Transformer.h b/JugBase/JugAlg/Transformer.h new file mode 100644 index 0000000..9f1288d --- /dev/null +++ b/JugBase/JugAlg/Transformer.h @@ -0,0 +1,2 @@ +#pragma once +#include "Jug/Algorithm.h" diff --git a/JugBase/JugBase/Algorithm.h b/JugBase/JugBase/Algorithm.h deleted file mode 100644 index 7dd3dee..0000000 --- a/JugBase/JugBase/Algorithm.h +++ /dev/null @@ -1,28 +0,0 @@ -namespace Jug { - - class Algorithm { - private: - std::string m_name; - - static std::function m_info; - static std::function m_error; - - static void SetInfo(std::function info) { - m_info = info; - } - static void SetError(std::function error) { - m_error = error; - } - - public: - Algorithm(const std::string& name) - : m_name ( name ) { - } - - protected: - static std::ostream& info() { return m_info(); }; - static std::ostream& error() { return m_error(); }; - - }; - -} // namespace Jug diff --git a/JugBase/JugBase/IParticleSvc.h b/JugBase/JugBase/IParticleSvc.h index 897cbcb..d5d7fd6 100644 --- a/JugBase/JugBase/IParticleSvc.h +++ b/JugBase/JugBase/IParticleSvc.h @@ -1,40 +1,3 @@ -// SPDX-License-Identifier: LGPL-3.0-or-later -// Copyright (C) 2022 Whitney Armstrong +#pragma once -#ifndef IParticleSvc_H -#define IParticleSvc_H - -#include -#include - -namespace Jug::Base { - - /** Simple particle data. - * - */ - struct ParticleData { - int pdgCode; - int charge; - double mass; //std::string name; - }; -} // namespace Jug::Base - -/** Particle interface. - * - * \ingroup base - */ -class GAUDI_API IParticleSvc : virtual public IService { -public: - using Particle = Jug::Base::ParticleData; - using ParticleMap = std::map; - -public: - /// InterfaceID - DeclareInterfaceID(IParticleSvc, 1, 0); - virtual ~IParticleSvc() {} - - virtual ParticleMap particleMap() const = 0; - virtual Particle particle(int pdg) const = 0; -}; - -#endif // IParticleSvc_H +#include "Jug/Particle.h" diff --git a/JugBase/JugKernel/PhysicalConstants.h b/JugBase/JugKernel/PhysicalConstants.h new file mode 100644 index 0000000..a56311e --- /dev/null +++ b/JugBase/JugKernel/PhysicalConstants.h @@ -0,0 +1,8 @@ +#pragma once + +#include "DD4hep/DD4hepUnits.h" + +using dd4hep::eV; +using dd4hep::MeV; +using dd4hep::GeV; +using dd4hep::mm; diff --git a/JugBase/JugKernel/RndmGenerators.h b/JugBase/JugKernel/RndmGenerators.h new file mode 100644 index 0000000..6f70f09 --- /dev/null +++ b/JugBase/JugKernel/RndmGenerators.h @@ -0,0 +1 @@ +#pragma once diff --git a/JugBase/src/components/EICDataSvc.cpp b/JugBase/src/components/EICDataSvc.cpp index f0b10e6..e7ab4a8 100644 --- a/JugBase/src/components/EICDataSvc.cpp +++ b/JugBase/src/components/EICDataSvc.cpp @@ -5,8 +5,6 @@ // Instantiation of a static factory class used by clients to create // instances of this service -// NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables) -DECLARE_COMPONENT(EICDataSvc) /// Standard Constructor EICDataSvc::EICDataSvc(const std::string& name, ISvcLocator* svc) : PodioDataSvc(name, svc) { diff --git a/JugBase/src/components/GeoSvc.cpp b/JugBase/src/components/GeoSvc.cpp index 2eddc4b..ab2fa31 100644 --- a/JugBase/src/components/GeoSvc.cpp +++ b/JugBase/src/components/GeoSvc.cpp @@ -2,7 +2,7 @@ // Copyright (C) 2022 Whitney Armstrong, Wouter Deconinck #include "GeoSvc.h" -#include "GaudiKernel/Service.h" +#include "JugKernel/Service.h" //#include "GeoConstruction.h" #include "TGeoManager.h" @@ -76,10 +76,8 @@ void draw_surfaces(std::shared_ptr trk_geo, const os.close(); } -using namespace Gaudi; +using namespace Jug; -// NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables) -DECLARE_COMPONENT(GeoSvc) GeoSvc::GeoSvc(const std::string& name, ISvcLocator* svc) : base_class(name, svc) diff --git a/JugBase/src/components/GeoSvc.h b/JugBase/src/components/GeoSvc.h index d8ea303..333be88 100644 --- a/JugBase/src/components/GeoSvc.h +++ b/JugBase/src/components/GeoSvc.h @@ -24,10 +24,10 @@ #include "Acts/Plugins/DD4hep/DD4hepDetectorElement.hpp" #include -// Gaudi -#include "GaudiKernel/MsgStream.h" -#include "GaudiKernel/Service.h" -#include "GaudiKernel/ServiceHandle.h" +// Jug +#include "JugKernel/MsgStream.h" +#include "JugKernel/Service.h" +#include "JugKernel/ServiceHandle.h" // DD4Hep #include "DD4hep/Detector.h" @@ -88,14 +88,14 @@ class GeoSvc : public extends { std::shared_ptr m_magneticField = nullptr; /// XML-files with the detector description - Gaudi::Property> m_xmlFileNames{ + Jug::Property> m_xmlFileNames{ this, "detectors", {}, "Detector descriptions XML-files"}; /// JSON-file with the material map - Gaudi::Property m_jsonFileName{ + Jug::Property m_jsonFileName{ this, "materials", "", "Material map JSON-file"}; - /// Gaudi logging output + /// Jug logging output MsgStream m_log; public: diff --git a/JugBase/src/components/InputCopier.cpp b/JugBase/src/components/InputCopier.cpp index 1b3e3e2..14d463b 100644 --- a/JugBase/src/components/InputCopier.cpp +++ b/JugBase/src/components/InputCopier.cpp @@ -4,10 +4,10 @@ // Deprecated algorithm, as we can now properly store input collections in our output #include -#include "GaudiAlg/Transformer.h" -#include "GaudiAlg/Producer.h" -#include "GaudiAlg/GaudiTool.h" -#include "Gaudi/Algorithm.h" +#include "JugAlg/Transformer.h" +#include "JugAlg/Producer.h" +#include "JugAlg/JugTool.h" +#include "Jug/Algorithm.h" // FCCSW #include "JugBase/DataHandle.h" @@ -26,16 +26,16 @@ namespace Jug::Base { * https://github.com/AIDASoft/podio/issues/103 */ template - class InputCopier : public GaudiAlgorithm { + class InputCopier : public JugAlgorithm { public: - InputCopier(const std::string& name, ISvcLocator* svcLoc) : GaudiAlgorithm(name, svcLoc) + InputCopier(const std::string& name, ISvcLocator* svcLoc) : JugAlgorithm(name, svcLoc) { declareProperty("inputCollection", m_inputHitCollection, "MCParticles"); declareProperty("outputCollection", m_outputHitCollection, "genparticles"); } StatusCode initialize() override { - if (GaudiAlgorithm::initialize().isFailure()) { + if (JugAlgorithm::initialize().isFailure()) { return StatusCode::FAILURE; } warning() << "DEPRECATED ALGORITHM, no need to use this anymore, we can do a proper straight passthrough from input to output." << endmsg; @@ -56,20 +56,14 @@ namespace Jug::Base { return StatusCode::SUCCESS; } - DataHandle m_inputHitCollection{"MCParticles", Gaudi::DataHandle::Reader, this}; - DataHandle m_outputHitCollection{"genparticles", Gaudi::DataHandle::Writer, this}; + DataHandle m_inputHitCollection{"MCParticles", Jug::DataHandle::Reader, this}; + DataHandle m_outputHitCollection{"genparticles", Jug::DataHandle::Writer, this}; }; using CalorimeterColCopier = InputCopier; - // NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables) - DECLARE_COMPONENT(CalorimeterColCopier) using TrackerColCopier = InputCopier; - // NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables) - DECLARE_COMPONENT(TrackerColCopier) using MCCopier = InputCopier; - // NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables) - DECLARE_COMPONENT(MCCopier) } // namespace Jug::Base diff --git a/JugBase/src/components/ParticleSvc.cpp b/JugBase/src/components/ParticleSvc.cpp index fb5aba5..edf7d74 100644 --- a/JugBase/src/components/ParticleSvc.cpp +++ b/JugBase/src/components/ParticleSvc.cpp @@ -3,8 +3,6 @@ #include "ParticleSvc.h" -// NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables) -DECLARE_COMPONENT(ParticleSvc) namespace { const IParticleSvc::ParticleMap kParticleMap = { diff --git a/JugBase/src/components/ParticleSvc.h b/JugBase/src/components/ParticleSvc.h index 2bc60b9..0c62a3a 100644 --- a/JugBase/src/components/ParticleSvc.h +++ b/JugBase/src/components/ParticleSvc.h @@ -6,7 +6,7 @@ #include -#include "GaudiKernel/Service.h" +#include "JugKernel/Service.h" #include "JugBase/IParticleSvc.h" diff --git a/JugBase/src/components/PodioInput.cpp b/JugBase/src/components/PodioInput.cpp index 03d49ba..86c1984 100644 --- a/JugBase/src/components/PodioInput.cpp +++ b/JugBase/src/components/PodioInput.cpp @@ -9,14 +9,12 @@ #include "JugBase/DataWrapper.h" #include "JugBase/PodioDataSvc.h" -// NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables) -DECLARE_COMPONENT(PodioInput) PodioInput::PodioInput(const std::string& name, ISvcLocator* svcLoc) -: GaudiAlgorithm(name, svcLoc), m_podioDataSvc(nullptr) {} +: JugAlgorithm(name, svcLoc), m_podioDataSvc(nullptr) {} StatusCode PodioInput::initialize() { - if (GaudiAlgorithm::initialize().isFailure()) { + if (JugAlgorithm::initialize().isFailure()) { return StatusCode::FAILURE; } @@ -54,7 +52,7 @@ StatusCode PodioInput::execute() { } StatusCode PodioInput::finalize() { - if (GaudiAlgorithm::finalize().isFailure()) { + if (JugAlgorithm::finalize().isFailure()) { return StatusCode::FAILURE; } return StatusCode::SUCCESS; diff --git a/JugBase/src/components/PodioInput.h b/JugBase/src/components/PodioInput.h index 18685ec..1c04ff7 100644 --- a/JugBase/src/components/PodioInput.h +++ b/JugBase/src/components/PodioInput.h @@ -4,7 +4,7 @@ #ifndef JUGBASE_PODIOINPUT_H #define JUGBASE_PODIOINPUT_H // Gaaudi -#include "GaudiAlg/GaudiAlgorithm.h" +#include "JugAlg/JugAlgorithm.h" // STL #include @@ -21,7 +21,7 @@ class PodioDataSvc; * @author J. Lingemann */ -class PodioInput : public GaudiAlgorithm { +class PodioInput : public JugAlgorithm { public: /// Constructor. @@ -35,7 +35,7 @@ class PodioInput : public GaudiAlgorithm { private: /// Name of collections to read. Set by option collections (this is temporary) - Gaudi::Property> m_collectionNames{this, "collections", {}, "Places of collections to read"}; + Jug::Property> m_collectionNames{this, "collections", {}, "Places of collections to read"}; /// Collection IDs (retrieved with CollectionIDTable from ROOT file, using collection names) std::vector m_collectionIDs; /// Data service: needed to register objects and get collection IDs. Just an observing pointer. diff --git a/JugBase/src/components/PodioOutput.cpp b/JugBase/src/components/PodioOutput.cpp index 2793878..b8f9f0b 100644 --- a/JugBase/src/components/PodioOutput.cpp +++ b/JugBase/src/components/PodioOutput.cpp @@ -3,21 +3,19 @@ #include "PodioOutput.h" #include "podio/podioVersion.h" -#include "GaudiKernel/ISvcLocator.h" +#include "JugKernel/ISvcLocator.h" #include "JugBase/PodioDataSvc.h" #include "TFile.h" #include "rootutils.h" -// NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables) -DECLARE_COMPONENT(PodioOutput) PodioOutput::PodioOutput(const std::string& name, ISvcLocator* svcLoc) - : GaudiAlgorithm(name, svcLoc), m_firstEvent(true), + : JugAlgorithm(name, svcLoc), m_firstEvent(true), m_podioDataSvc(nullptr), m_datatree(nullptr), m_metadatatree(nullptr), m_runMDtree(nullptr), m_evtMDtree(nullptr), m_colMDtree(nullptr) {} StatusCode PodioOutput::initialize() { - if (GaudiAlgorithm::initialize().isFailure()) { + if (JugAlgorithm::initialize().isFailure()) { return StatusCode::FAILURE; } @@ -153,7 +151,7 @@ StatusCode PodioOutput::execute() { */ StatusCode PodioOutput::finalize() { info() << "Finalizing output algorithm" << endmsg; - if (GaudiAlgorithm::finalize().isFailure()) { + if (JugAlgorithm::finalize().isFailure()) { return StatusCode::FAILURE; } //// prepare job options metadata /////////////////////// @@ -161,7 +159,7 @@ StatusCode PodioOutput::finalize() { // and write it to file as vector of strings debug() << "Preparing job options metadata" << endmsg; std::vector config_data; - const auto& jobOptionsSvc = Gaudi::svcLocator()->getOptsSvc(); + const auto& jobOptionsSvc = Jug::svcLocator()->getOptsSvc(); const auto& configured_properties = jobOptionsSvc.items(); for (const auto& per_property : configured_properties) { std::stringstream config_stream; @@ -174,7 +172,7 @@ StatusCode PodioOutput::finalize() { config_data.push_back(config_stream.str()); } // Some default components are not captured by the job option service - // and have to be traversed like this. Note that Gaudi!577 will improve this. + // and have to be traversed like this. Note that Jug!577 will improve this. debug() << "Appending default component metadata" << endmsg; for (const auto* name : {"ApplicationMgr", "MessageSvc", "NTupleSvc"}) { std::stringstream config_stream; diff --git a/JugBase/src/components/PodioOutput.h b/JugBase/src/components/PodioOutput.h index 5bb6408..ab04f01 100644 --- a/JugBase/src/components/PodioOutput.h +++ b/JugBase/src/components/PodioOutput.h @@ -5,7 +5,7 @@ #define JUGBASE_PODIOOUTPUT_H #include "JugBase/KeepDropSwitch.h" -#include "GaudiAlg/GaudiAlgorithm.h" +#include "JugAlg/JugAlgorithm.h" #include "podio/CollectionBase.h" #include "TTree.h" @@ -17,7 +17,7 @@ class TFile; class PodioDataSvc; -class PodioOutput : public GaudiAlgorithm { +class PodioOutput : public JugAlgorithm { public: /// Constructor. @@ -37,11 +37,11 @@ class PodioOutput : public GaudiAlgorithm { /// First event or not bool m_firstEvent; /// Root file name the output is written to - Gaudi::Property m_filename{this, "filename", "output.root", "Name of the file to create"}; + Jug::Property m_filename{this, "filename", "output.root", "Name of the file to create"}; /// Commands which output is to be kept - Gaudi::Property> m_outputCommands{ + Jug::Property> m_outputCommands{ this, "outputCommands", {"keep *"}, "A set of commands to declare which collections to keep or drop."}; - Gaudi::Property m_filenameRemote{ + Jug::Property m_filenameRemote{ this, "filenameRemote", "", "An optional file path to copy the outputfile to."}; /// Switch for keeping or dropping outputs KeepDropSwitch m_switch; diff --git a/JugBase/src/components/ReadTestConsumer.cxx b/JugBase/src/components/ReadTestConsumer.cxx index 019a052..6e09b32 100644 --- a/JugBase/src/components/ReadTestConsumer.cxx +++ b/JugBase/src/components/ReadTestConsumer.cxx @@ -1,14 +1,14 @@ -#include "GaudiAlg/GaudiAlgorithm.h" +#include "JugAlg/JugAlgorithm.h" #include "JugBase/DataHandle.h" #include "edm4hep/MCParticleCollection.h" -class ReadTestConsumer : public GaudiAlgorithm { +class ReadTestConsumer : public JugAlgorithm { public: ReadTestConsumer(const std::string& name, ISvcLocator* svcLoc) - : GaudiAlgorithm(name, svcLoc), m_genParticles("MCParticles", Gaudi::DataHandle::Reader, this) { + : JugAlgorithm(name, svcLoc), m_genParticles("MCParticles", Jug::DataHandle::Reader, this) { declareProperty("genParticles", m_genParticles, "mc particles to read"); } @@ -16,7 +16,7 @@ class ReadTestConsumer : public GaudiAlgorithm { StatusCode initialize() { warning() << "This is a deprecated test algorithm" << endmsg; - return GaudiAlgorithm::initialize(); } + return JugAlgorithm::initialize(); } StatusCode execute() { // Read the input @@ -36,10 +36,9 @@ class ReadTestConsumer : public GaudiAlgorithm { return StatusCode::SUCCESS; } - StatusCode finalize() { return GaudiAlgorithm::finalize(); } + StatusCode finalize() { return JugAlgorithm::finalize(); } private: /// Particles to read DataHandle m_genParticles; }; -DECLARE_COMPONENT(ReadTestConsumer) diff --git a/JugDigi/CMakeLists.txt b/JugDigi/CMakeLists.txt index 96206b3..ec86c15 100644 --- a/JugDigi/CMakeLists.txt +++ b/JugDigi/CMakeLists.txt @@ -5,11 +5,7 @@ # Package: JugDigi ################################################################################ -#file(GLOB JugDigiPlugins_sources CONFIGURE_DEPENDS src/components/*.cpp) -set(JugDigiPlugins_sources - src/components/CalorimeterHitDigi.cpp -) -message(STATUS "${JugDigiPlugins_sources}") +file(GLOB JugDigiPlugins_sources CONFIGURE_DEPENDS src/components/*.cpp) add_library(JugDigiPlugins ${JugDigiPlugins_sources}) target_link_libraries(JugDigiPlugins ROOT::Core ROOT::RIO ROOT::Tree diff --git a/JugDigi/src/components/CalorimeterBirksCorr.cpp b/JugDigi/src/components/CalorimeterBirksCorr.cpp index b42c1dd..a0ba432 100644 --- a/JugDigi/src/components/CalorimeterBirksCorr.cpp +++ b/JugDigi/src/components/CalorimeterBirksCorr.cpp @@ -10,23 +10,20 @@ #include #include -#include "GaudiAlg/GaudiTool.h" -#include "GaudiAlg/Transformer.h" -#include "GaudiKernel/PhysicalConstants.h" -#include "Gaudi/Property.h" -#include "GaudiKernel/RndmGenerators.h" +#include "JugAlg/JugTool.h" +#include "JugAlg/Transformer.h" +#include "JugKernel/PhysicalConstants.h" +#include "Jug/Property.h" +#include "Jug/Service.h" +#include "JugKernel/RndmGenerators.h" #include "JugBase/DataHandle.h" #include "JugBase/IParticleSvc.h" // Event Model related classes #include "edm4hep/SimCalorimeterHitCollection.h" -#include "eicd/RawCalorimeterHitCollection.h" -#include "eicd/RawCalorimeterHitData.h" -using namespace Gaudi::Units; - namespace Jug::Digi { /** Generic calorimeter hit digitiziation. @@ -34,73 +31,40 @@ namespace Jug::Digi { * \ingroup digi * \ingroup calorimetry */ - class CalorimeterBirksCorr : public GaudiAlgorithm { + class CalorimeterBirksCorr : public JugAlgorithm { public: - // digitization settings - Gaudi::Property m_birksConstant{this, "birksConstant", 0.126*mm/MeV}; - - DataHandle m_inputHitCollection{"inputHitCollection", Gaudi::DataHandle::Reader, - this}; - DataHandle m_outputHitCollection{"outputHitCollection", Gaudi::DataHandle::Writer, - this}; - - SmartIF m_pidSvc; - // unitless conterpart of arguments - double birksConstant{0}; - - // ill-formed: using GaudiAlgorithm::GaudiAlgorithm; - CalorimeterBirksCorr(const std::string& name, ISvcLocator* svcLoc) - : GaudiAlgorithm(name, svcLoc) - { - declareProperty("inputHitCollection", m_inputHitCollection, ""); - declareProperty("outputHitCollection", m_outputHitCollection, ""); - } - - StatusCode initialize() override - { - if (GaudiAlgorithm::initialize().isFailure()) { - return StatusCode::FAILURE; - } - - m_pidSvc = service("ParticleSvc"); - if (!m_pidSvc) { - error() << "Unable to locate Particle Service. " - << "Make sure you have ParticleSvc in the configuration." - << endmsg; - return StatusCode::FAILURE; - } + // Types + using InputCollection = edm4hep::SimCalorimeterHitCollection; + using OutputCollection = edm4hep::SimCalorimeterHitCollection; - // using juggler internal units (GeV, mm, radian, ns) - birksConstant = m_birksConstant.value() / mm * GeV; + // Properties + Jug::Property m_birksConstant{this, "birksConstant", 0.126*mm/MeV}; - return StatusCode::SUCCESS; - } + // Services + Jug::Service m_pidSvc; - StatusCode execute() override + OutputCollection operator()(const InputCollection& input) const { - auto& ohits = *m_outputHitCollection.createAndPut(); - for (const auto& hit : *m_inputHitCollection.get()) { + OutputCollection ohits; + for (const auto& hit : input) { auto ohit = ohits->create(hit.getCellID(), hit.getEnergy(), hit.getPosition()); double energy = 0.; for (const auto &c: hit.getContributions()) { ohit.addToContributions(c); - const double charge = m_pidSvc->particle(c.getPDG()).charge; + const double charge = m_pidSvc(c.getPDG()).charge; // some tolerance for precision if (std::abs(charge) > 1e-5) { // FIXME - //energy += c.getEnergy() / (1. + c.getEnergy() / c.length * birksConstant); + //energy += c.getEnergy() / (1. + c.getEnergy() / c.length * m_birksConstant); error() << "edm4hep::CaloHitContribution has no length field for Birks correction." << endmsg; - return StatusCode::FAILURE; } } // replace energy deposit with Birks Law corrected value ohit.setEnergy(energy); } - return StatusCode::SUCCESS; + return ohits; } }; - // NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables) - DECLARE_COMPONENT(CalorimeterBirksCorr) } // namespace Jug::Digi diff --git a/JugDigi/src/components/CalorimeterHitDigi.cpp b/JugDigi/src/components/CalorimeterHitDigi.cpp index 268869e..95366f3 100644 --- a/JugDigi/src/components/CalorimeterHitDigi.cpp +++ b/JugDigi/src/components/CalorimeterHitDigi.cpp @@ -14,13 +14,13 @@ #include #include +#include "DD4hep/DD4hepUnits.h" #include "DDRec/CellIDPositionConverter.h" #include "DDSegmentation/BitFieldCoder.h" -#include "JugBase/Algorithm.h" -#include "JugBase/Property.h" -#include "JugBase/IGeoSvc.h" -#include "JugBase/DataHandle.h" +#include "Jug/Algorithm.h" +#include "Jug/Property.h" +#include "Jug/Service.h" #include "fmt/format.h" #include "fmt/ranges.h" @@ -36,7 +36,7 @@ namespace Jug::Digi { * \ingroup digi * \ingroup calorimetry */ - class CalorimeterHitDigi : Jug::Algorithm { + class CalorimeterHitDigi : JugAlgorithm { public: // additional smearing resolutions Jug::Property> u_eRes{this, "energyResolutions", {}}; // a/sqrt(E/GeV) + b + c/(E/GeV) @@ -63,14 +63,16 @@ namespace Jug::Digi { Jug::Property> u_refs{this, "fieldRefNumbers", {}}; Jug::Property m_readout{this, "readoutClass", ""}; + // Geometry service + Jug::Service m_geoSvc; + // unitless counterparts of inputs double dyRangeADC{0}, stepTDC{0}, tRes{0}, eRes[3] = {0., 0., 0.}; uint64_t id_mask{0}, ref_mask{0}; - CalorimeterHitDigi(const std::string& name) - : Jug::Algorithm(name) { } + CalorimeterHitDigi() = default; - bool initialize(const dd4hep::Detector* detector) + bool initialize() { // set energy resolution numbers for (size_t i = 0; i < u_eRes.value().size() && i < 3; ++i) { @@ -85,7 +87,7 @@ namespace Jug::Digi { // need signal sum if (!u_fields.value().empty()) { // sanity checks - if (!detector) { + if (!m_geoSvc()) { error() << "Unable to locate Geometry Service. " << "Make sure you have GeoSvc and SimSvc in the right order in the configuration." << std::endl;; @@ -99,7 +101,7 @@ namespace Jug::Digi { // get decoders try { - auto id_desc = detector->readout(m_readout.value()).idSpec(); + auto id_desc = m_geoSvc()->readout(m_readout.value()).idSpec(); id_mask = 0; std::vector> ref_fields; for (size_t i = 0; i < u_fields.value().size(); ++i) { diff --git a/JugDigi/src/components/PhotoMultiplierDigi.cpp b/JugDigi/src/components/PhotoMultiplierDigi.cpp index c5a5480..386dd0e 100644 --- a/JugDigi/src/components/PhotoMultiplierDigi.cpp +++ b/JugDigi/src/components/PhotoMultiplierDigi.cpp @@ -15,10 +15,10 @@ #include #include -#include "GaudiAlg/Transformer.h" -#include "GaudiAlg/GaudiTool.h" -#include "GaudiKernel/RndmGenerators.h" -#include "GaudiKernel/PhysicalConstants.h" +#include "JugAlg/Transformer.h" +#include "JugAlg/JugTool.h" +#include "JugKernel/RndmGenerators.h" +#include "JugKernel/PhysicalConstants.h" #include "JugBase/DataHandle.h" @@ -28,7 +28,7 @@ #include "edm4hep/SimTrackerHitCollection.h" -using namespace Gaudi::Units; +using namespace Jug::Units; namespace Jug::Digi { @@ -36,26 +36,26 @@ namespace Jug::Digi { * * \ingroup digi */ -class PhotoMultiplierDigi : public GaudiAlgorithm +class PhotoMultiplierDigi : public JugAlgorithm { public: DataHandle - m_inputHitCollection{"inputHitCollection", Gaudi::DataHandle::Reader, this}; + m_inputHitCollection{"inputHitCollection", Jug::DataHandle::Reader, this}; DataHandle - m_outputHitCollection{"outputHitCollection", Gaudi::DataHandle::Writer, this}; - Gaudi::Property>> + m_outputHitCollection{"outputHitCollection", Jug::DataHandle::Writer, this}; + Jug::Property>> u_quantumEfficiency{this, "quantumEfficiency", {{2.6*eV, 0.3}, {7.0*eV, 0.3}}}; - Gaudi::Property m_hitTimeWindow{this, "hitTimeWindow", 20.0*ns}; - Gaudi::Property m_timeStep{this, "timeStep", 0.0625*ns}; - Gaudi::Property m_speMean{this, "speMean", 80.0}; - Gaudi::Property m_speError{this, "speError", 16.0}; - Gaudi::Property m_pedMean{this, "pedMean", 200.0}; - Gaudi::Property m_pedError{this, "pedError", 3.0}; + Jug::Property m_hitTimeWindow{this, "hitTimeWindow", 20.0*ns}; + Jug::Property m_timeStep{this, "timeStep", 0.0625*ns}; + Jug::Property m_speMean{this, "speMean", 80.0}; + Jug::Property m_speError{this, "speError", 16.0}; + Jug::Property m_pedMean{this, "pedMean", 200.0}; + Jug::Property m_pedError{this, "pedError", 3.0}; Rndm::Numbers m_rngUni, m_rngNorm; // constructor PhotoMultiplierDigi(const std::string& name, ISvcLocator* svcLoc) - : GaudiAlgorithm(name, svcLoc) + : JugAlgorithm(name, svcLoc) { declareProperty("inputHitCollection", m_inputHitCollection,""); declareProperty("outputHitCollection", m_outputHitCollection, ""); @@ -63,7 +63,7 @@ class PhotoMultiplierDigi : public GaudiAlgorithm StatusCode initialize() override { - if (GaudiAlgorithm::initialize().isFailure()) { + if (JugAlgorithm::initialize().isFailure()) { return StatusCode::FAILURE; } @@ -214,7 +214,5 @@ class PhotoMultiplierDigi : public GaudiAlgorithm } }; -// NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables) -DECLARE_COMPONENT(PhotoMultiplierDigi) } // namespace Jug::Digi diff --git a/JugDigi/src/components/SiliconTrackerDigi.cpp b/JugDigi/src/components/SiliconTrackerDigi.cpp index 4789ce2..a213748 100644 --- a/JugDigi/src/components/SiliconTrackerDigi.cpp +++ b/JugDigi/src/components/SiliconTrackerDigi.cpp @@ -4,11 +4,11 @@ #include #include -#include "Gaudi/Property.h" -#include "GaudiAlg/GaudiTool.h" -#include "GaudiAlg/Transformer.h" -#include "GaudiKernel/PhysicalConstants.h" -#include "GaudiKernel/RndmGenerators.h" +#include "Jug/Property.h" +#include "JugAlg/JugTool.h" +#include "JugAlg/Transformer.h" +#include "JugKernel/PhysicalConstants.h" +#include "JugKernel/RndmGenerators.h" #include "JugBase/DataHandle.h" @@ -25,24 +25,24 @@ namespace Jug::Digi { * * \ingroup digi */ -class SiliconTrackerDigi : public GaudiAlgorithm { +class SiliconTrackerDigi : public JugAlgorithm { private: - Gaudi::Property m_timeResolution{this, "timeResolution", 10}; // todo : add units - Gaudi::Property m_threshold{this, "threshold", 0. * Gaudi::Units::keV}; + Jug::Property m_timeResolution{this, "timeResolution", 10}; // todo : add units + Jug::Property m_threshold{this, "threshold", 0. * Jug::Units::keV}; Rndm::Numbers m_gaussDist; - DataHandle m_inputHitCollection{"inputHitCollection", Gaudi::DataHandle::Reader, + DataHandle m_inputHitCollection{"inputHitCollection", Jug::DataHandle::Reader, this}; - DataHandle m_outputHitCollection{"outputHitCollection", Gaudi::DataHandle::Writer, + DataHandle m_outputHitCollection{"outputHitCollection", Jug::DataHandle::Writer, this}; public: - // ill-formed: using GaudiAlgorithm::GaudiAlgorithm; - SiliconTrackerDigi(const std::string& name, ISvcLocator* svcLoc) : GaudiAlgorithm(name, svcLoc) { + // ill-formed: using JugAlgorithm::JugAlgorithm; + SiliconTrackerDigi(const std::string& name, ISvcLocator* svcLoc) : JugAlgorithm(name, svcLoc) { declareProperty("inputHitCollection", m_inputHitCollection, ""); declareProperty("outputHitCollection", m_outputHitCollection, ""); } StatusCode initialize() override { - if (GaudiAlgorithm::initialize().isFailure()) { + if (JugAlgorithm::initialize().isFailure()) { return StatusCode::FAILURE; } IRndmGenSvc* randSvc = svc("RndmGenSvc", true); @@ -69,9 +69,9 @@ class SiliconTrackerDigi : public GaudiAlgorithm { debug() << " momentum = (" << ahit.getMomentum().x << "," << ahit.getMomentum().y << "," << ahit.getMomentum().z << ")" << endmsg; } - if (ahit.getEDep() * Gaudi::Units::keV < m_threshold) { + if (ahit.getEDep() * Jug::Units::keV < m_threshold) { if (msgLevel(MSG::DEBUG)) { - debug() << " edep = " << ahit.getEDep() << " (below threshold of " << m_threshold / Gaudi::Units::keV + debug() << " edep = " << ahit.getEDep() << " (below threshold of " << m_threshold / Jug::Units::keV << " keV)" << endmsg; } continue; @@ -96,7 +96,5 @@ class SiliconTrackerDigi : public GaudiAlgorithm { return StatusCode::SUCCESS; } }; -// NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables) -DECLARE_COMPONENT(SiliconTrackerDigi) } // namespace Jug::Digi diff --git a/JugDigi/src/components/SimTrackerHitsCollector.cpp b/JugDigi/src/components/SimTrackerHitsCollector.cpp index ebd80c5..602a18c 100644 --- a/JugDigi/src/components/SimTrackerHitsCollector.cpp +++ b/JugDigi/src/components/SimTrackerHitsCollector.cpp @@ -1,11 +1,11 @@ // SPDX-License-Identifier: LGPL-3.0-or-later // Copyright (C) 2022 Wouter Deconinck, Whitney Armstrong, Chao Peng -// Gaudi -#include "GaudiAlg/GaudiAlgorithm.h" -#include "Gaudi/Property.h" -#include "GaudiAlg/GaudiTool.h" -#include "GaudiAlg/Transformer.h" +// Jug +#include "JugAlg/JugAlgorithm.h" +#include "Jug/Property.h" +#include "JugAlg/JugTool.h" +#include "JugAlg/Transformer.h" #include "JugBase/DataHandle.h" @@ -21,16 +21,16 @@ namespace Jug::Digi { * * \ingroup digi */ - class SimTrackerHitsCollector : public GaudiAlgorithm { + class SimTrackerHitsCollector : public JugAlgorithm { private: - Gaudi::Property> m_inputSimTrackerHits{this, "inputSimTrackerHits", {},"Tracker hits to be aggregated"}; - DataHandle m_outputSimTrackerHits{"outputSimTrackerHits", Gaudi::DataHandle::Writer, this}; + Jug::Property> m_inputSimTrackerHits{this, "inputSimTrackerHits", {},"Tracker hits to be aggregated"}; + DataHandle m_outputSimTrackerHits{"outputSimTrackerHits", Jug::DataHandle::Writer, this}; std::vector*> m_hitCollections; public: SimTrackerHitsCollector(const std::string& name, ISvcLocator* svcLoc) - : GaudiAlgorithm(name, svcLoc) + : JugAlgorithm(name, svcLoc) { declareProperty("outputSimTrackerHits", m_outputSimTrackerHits, "output hits combined into single collection"); } @@ -41,12 +41,12 @@ namespace Jug::Digi { } StatusCode initialize() override { - if (GaudiAlgorithm::initialize().isFailure()) { + if (JugAlgorithm::initialize().isFailure()) { return StatusCode::FAILURE; } for (auto colname : m_inputSimTrackerHits) { debug() << "initializing collection: " << colname << endmsg; - m_hitCollections.push_back(new DataHandle{colname, Gaudi::DataHandle::Reader, this}); + m_hitCollections.push_back(new DataHandle{colname, Jug::DataHandle::Reader, this}); } return StatusCode::SUCCESS; } @@ -69,7 +69,5 @@ namespace Jug::Digi { return StatusCode::SUCCESS; } }; - // NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables) - DECLARE_COMPONENT(SimTrackerHitsCollector) } // namespace Jug::Digi diff --git a/JugFast/CMakeLists.txt b/JugFast/CMakeLists.txt index 96d3ccf..b1d3c9c 100644 --- a/JugFast/CMakeLists.txt +++ b/JugFast/CMakeLists.txt @@ -6,11 +6,8 @@ ################################################################################ file(GLOB JugFastPlugins_sources CONFIGURE_DEPENDS src/components/*.cpp) -gaudi_add_module(JugFastPlugins - SOURCES - ${JugFastPlugins_sources} - LINK - Gaudi::GaudiAlgLib Gaudi::GaudiKernel +add_library(JugFastPlugins ${JugFastPlugins_sources}) +target_link_libraries(JugFastPlugins JugBase ROOT::Core ROOT::RIO ROOT::Tree EDM4HEP::edm4hep @@ -18,6 +15,7 @@ gaudi_add_module(JugFastPlugins ) target_include_directories(JugFastPlugins PUBLIC + $ $ $) diff --git a/JugFast/src/components/ClusterMerger.cpp b/JugFast/src/components/ClusterMerger.cpp index 30df222..700a8e9 100644 --- a/JugFast/src/components/ClusterMerger.cpp +++ b/JugFast/src/components/ClusterMerger.cpp @@ -5,12 +5,12 @@ #include #include -// Gaudi -#include "Gaudi/Property.h" -#include "GaudiAlg/GaudiAlgorithm.h" -#include "GaudiAlg/GaudiTool.h" -#include "GaudiAlg/Transformer.h" -#include "GaudiKernel/PhysicalConstants.h" +// Jug +#include "Jug/Property.h" +#include "JugAlg/JugAlgorithm.h" +#include "JugAlg/JugTool.h" +#include "JugAlg/Transformer.h" +#include "JugKernel/PhysicalConstants.h" #include "JugBase/DataHandle.h" @@ -19,7 +19,7 @@ #include "eicd/MCRecoClusterParticleAssociationCollection.h" #include "eicd/vector_utils.h" -using namespace Gaudi::Units; +using namespace Jug::Units; namespace Jug::Fast { @@ -28,17 +28,17 @@ namespace Jug::Fast { * * \ingroup fast */ -class ClusterMerger : public GaudiAlgorithm { +class ClusterMerger : public JugAlgorithm { private: // Input - DataHandle m_inputClusters{"InputClusters", Gaudi::DataHandle::Reader, this}; - DataHandle m_inputAssociations{"InputAssociations", Gaudi::DataHandle::Reader, this}; + DataHandle m_inputClusters{"InputClusters", Jug::DataHandle::Reader, this}; + DataHandle m_inputAssociations{"InputAssociations", Jug::DataHandle::Reader, this}; // Output - DataHandle m_outputClusters{"OutputClusters", Gaudi::DataHandle::Writer, this}; - DataHandle m_outputAssociations{"OutputAssociations", Gaudi::DataHandle::Writer, this}; + DataHandle m_outputClusters{"OutputClusters", Jug::DataHandle::Writer, this}; + DataHandle m_outputAssociations{"OutputAssociations", Jug::DataHandle::Writer, this}; public: ClusterMerger(const std::string& name, ISvcLocator* svcLoc) - : GaudiAlgorithm(name, svcLoc) { + : JugAlgorithm(name, svcLoc) { declareProperty("inputClusters", m_inputClusters, "Input cluster collection"); declareProperty("inputAssociations", m_inputAssociations, "Input cluster association"); declareProperty("outputClusters", m_outputClusters, "Cluster collection with good energy precision"); @@ -46,7 +46,7 @@ class ClusterMerger : public GaudiAlgorithm { } StatusCode initialize() override { - if (GaudiAlgorithm::initialize().isFailure()) { + if (JugAlgorithm::initialize().isFailure()) { return StatusCode::FAILURE; } @@ -183,7 +183,5 @@ class ClusterMerger : public GaudiAlgorithm { } }; -// NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables) -DECLARE_COMPONENT(ClusterMerger) } // namespace Jug::Fast diff --git a/JugFast/src/components/InclusiveKinematicsTruth.cpp b/JugFast/src/components/InclusiveKinematicsTruth.cpp index 0f35704..54586ee 100644 --- a/JugFast/src/components/InclusiveKinematicsTruth.cpp +++ b/JugFast/src/components/InclusiveKinematicsTruth.cpp @@ -1,12 +1,12 @@ // SPDX-License-Identifier: LGPL-3.0-or-later // Copyright (C) 2022 Wouter Deconinck -#include "Gaudi/Algorithm.h" -#include "GaudiAlg/GaudiTool.h" -#include "GaudiAlg/Producer.h" -#include "GaudiAlg/Transformer.h" -#include "GaudiKernel/RndmGenerators.h" -#include "GaudiKernel/PhysicalConstants.h" +#include "Jug/Algorithm.h" +#include "JugAlg/JugTool.h" +#include "JugAlg/Producer.h" +#include "JugAlg/Transformer.h" +#include "JugKernel/RndmGenerators.h" +#include "JugKernel/PhysicalConstants.h" #include #include @@ -26,15 +26,15 @@ using ROOT::Math::PxPyPzEVector; namespace Jug::Fast { -class InclusiveKinematicsTruth : public GaudiAlgorithm { +class InclusiveKinematicsTruth : public JugAlgorithm { private: DataHandle m_inputMCParticleCollection{ "inputMCParticles", - Gaudi::DataHandle::Reader, + Jug::DataHandle::Reader, this}; DataHandle m_outputInclusiveKinematicsCollection{ "outputInclusiveKinematics", - Gaudi::DataHandle::Writer, + Jug::DataHandle::Writer, this}; SmartIF m_pidSvc; @@ -44,13 +44,13 @@ class InclusiveKinematicsTruth : public GaudiAlgorithm { public: InclusiveKinematicsTruth(const std::string& name, ISvcLocator* svcLoc) - : GaudiAlgorithm(name, svcLoc) { + : JugAlgorithm(name, svcLoc) { declareProperty("inputMCParticles", m_inputMCParticleCollection, "MCParticles"); declareProperty("outputInclusiveKinematics", m_outputInclusiveKinematicsCollection, "InclusiveKinematicsTruth"); } StatusCode initialize() override { - if (GaudiAlgorithm::initialize().isFailure()) { + if (JugAlgorithm::initialize().isFailure()) { return StatusCode::FAILURE; } @@ -152,7 +152,5 @@ class InclusiveKinematicsTruth : public GaudiAlgorithm { } }; -// NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables) -DECLARE_COMPONENT(InclusiveKinematicsTruth) } // namespace Jug::Fast diff --git a/JugFast/src/components/MC2SmearedParticle.cpp b/JugFast/src/components/MC2SmearedParticle.cpp index b3e691d..e4ebed6 100644 --- a/JugFast/src/components/MC2SmearedParticle.cpp +++ b/JugFast/src/components/MC2SmearedParticle.cpp @@ -1,11 +1,11 @@ // SPDX-License-Identifier: LGPL-3.0-or-later // Copyright (C) 2022 Sylvester Joosten, Whitney Armstrong, Wouter Deconinck -#include "Gaudi/Algorithm.h" -#include "GaudiAlg/GaudiTool.h" -#include "GaudiAlg/Producer.h" -#include "GaudiAlg/Transformer.h" -#include "GaudiKernel/RndmGenerators.h" +#include "Jug/Algorithm.h" +#include "JugAlg/JugTool.h" +#include "JugAlg/Producer.h" +#include "JugAlg/Transformer.h" +#include "JugKernel/RndmGenerators.h" #include #include @@ -17,21 +17,21 @@ namespace Jug::Fast { -class MC2SmearedParticle : public GaudiAlgorithm { +class MC2SmearedParticle : public JugAlgorithm { private: - DataHandle m_inputMCParticles{"MCParticles", Gaudi::DataHandle::Reader, this}; + DataHandle m_inputMCParticles{"MCParticles", Jug::DataHandle::Reader, this}; DataHandle m_outputParticles{"SmearedReconstructedParticles", - Gaudi::DataHandle::Writer, this}; + Jug::DataHandle::Writer, this}; Rndm::Numbers m_gaussDist; - Gaudi::Property m_smearing{this, "smearing", 0.01 /* 1 percent*/}; + Jug::Property m_smearing{this, "smearing", 0.01 /* 1 percent*/}; public: - MC2SmearedParticle(const std::string& name, ISvcLocator* svcLoc) : GaudiAlgorithm(name, svcLoc) { + MC2SmearedParticle(const std::string& name, ISvcLocator* svcLoc) : JugAlgorithm(name, svcLoc) { declareProperty("inputParticles", m_inputMCParticles, "MCParticles"); declareProperty("outputParticles", m_outputParticles, "SmearedReconstructedParticles"); } StatusCode initialize() override { - if (GaudiAlgorithm::initialize().isFailure()) { + if (JugAlgorithm::initialize().isFailure()) { return StatusCode::FAILURE; } @@ -93,7 +93,5 @@ class MC2SmearedParticle : public GaudiAlgorithm { } }; -// NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables) -DECLARE_COMPONENT(MC2SmearedParticle) } // namespace Jug::Fast diff --git a/JugFast/src/components/MatchClusters.cpp b/JugFast/src/components/MatchClusters.cpp index 547d8af..7fd58e7 100644 --- a/JugFast/src/components/MatchClusters.cpp +++ b/JugFast/src/components/MatchClusters.cpp @@ -10,11 +10,11 @@ #include -#include "Gaudi/Algorithm.h" -#include "GaudiAlg/GaudiTool.h" -#include "GaudiAlg/Producer.h" -#include "GaudiAlg/Transformer.h" -#include "GaudiKernel/RndmGenerators.h" +#include "Jug/Algorithm.h" +#include "JugAlg/JugTool.h" +#include "JugAlg/Producer.h" +#include "JugAlg/Transformer.h" +#include "JugKernel/RndmGenerators.h" #include "JugBase/DataHandle.h" @@ -29,28 +29,28 @@ namespace Jug::Fast { -class MatchClusters : public GaudiAlgorithm { +class MatchClusters : public JugAlgorithm { private: // input data - DataHandle m_inputMCParticles{"MCParticles", Gaudi::DataHandle::Reader, this}; + DataHandle m_inputMCParticles{"MCParticles", Jug::DataHandle::Reader, this}; DataHandle m_inputParticles{"ReconstructedChargedParticles", - Gaudi::DataHandle::Reader, this}; + Jug::DataHandle::Reader, this}; DataHandle m_inputParticlesAssoc{"ReconstructedChargedParticlesAssoc", - Gaudi::DataHandle::Reader, this}; - Gaudi::Property> m_inputClusters{this, "inputClusters", {}, "Clusters to be aggregated"}; - Gaudi::Property> m_inputClustersAssoc{this, "inputClustersAssoc", {}, "Cluster associations to be aggregated"}; + Jug::DataHandle::Reader, this}; + Jug::Property> m_inputClusters{this, "inputClusters", {}, "Clusters to be aggregated"}; + Jug::Property> m_inputClustersAssoc{this, "inputClustersAssoc", {}, "Cluster associations to be aggregated"}; std::vector*> m_inputClustersCollections; std::vector*> m_inputClustersAssocCollections; // output data DataHandle m_outputParticles{"ReconstructedParticles", - Gaudi::DataHandle::Writer, this}; + Jug::DataHandle::Writer, this}; DataHandle m_outputParticlesAssoc{"ReconstructedParticlesAssoc", - Gaudi::DataHandle::Writer, this}; + Jug::DataHandle::Writer, this}; public: MatchClusters(const std::string& name, ISvcLocator* svcLoc) - : GaudiAlgorithm(name, svcLoc) { + : JugAlgorithm(name, svcLoc) { declareProperty("inputMCParticles", m_inputMCParticles, "MCParticles"); declareProperty("inputParticles", m_inputParticles, "ReconstructedChargedParticles"); declareProperty("inputParticlesAssoc", m_inputParticlesAssoc, "ReconstructedChargedParticlesAssoc"); @@ -59,7 +59,7 @@ class MatchClusters : public GaudiAlgorithm { } StatusCode initialize() override { - if (GaudiAlgorithm::initialize().isFailure()) { + if (JugAlgorithm::initialize().isFailure()) { return StatusCode::FAILURE; } m_inputClustersCollections = getClusterCollections(m_inputClusters); @@ -187,7 +187,7 @@ class MatchClusters : public GaudiAlgorithm { std::vector*> ret; for (const auto& colname : cols) { debug() << "initializing cluster collection: " << colname << endmsg; - ret.push_back(new DataHandle{colname, Gaudi::DataHandle::Reader, this}); + ret.push_back(new DataHandle{colname, Jug::DataHandle::Reader, this}); } return ret; } @@ -196,7 +196,7 @@ class MatchClusters : public GaudiAlgorithm { std::vector*> ret; for (const auto& colname : cols) { debug() << "initializing cluster association collection: " << colname << endmsg; - ret.push_back(new DataHandle{colname, Gaudi::DataHandle::Reader, this}); + ret.push_back(new DataHandle{colname, Jug::DataHandle::Reader, this}); } return ret; } @@ -283,7 +283,5 @@ class MatchClusters : public GaudiAlgorithm { } }; // namespace Jug::Fast -// NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables) -DECLARE_COMPONENT(MatchClusters) } // namespace Jug::Fast diff --git a/JugFast/src/components/ParticlesWithTruthPID.cpp b/JugFast/src/components/ParticlesWithTruthPID.cpp index c09a18e..f1162e5 100644 --- a/JugFast/src/components/ParticlesWithTruthPID.cpp +++ b/JugFast/src/components/ParticlesWithTruthPID.cpp @@ -6,11 +6,11 @@ #include -#include "Gaudi/Algorithm.h" -#include "GaudiAlg/GaudiTool.h" -#include "GaudiAlg/Producer.h" -#include "GaudiAlg/Transformer.h" -#include "GaudiKernel/RndmGenerators.h" +#include "Jug/Algorithm.h" +#include "JugAlg/JugTool.h" +#include "JugAlg/Producer.h" +#include "JugAlg/Transformer.h" +#include "JugKernel/RndmGenerators.h" #include "JugBase/DataHandle.h" @@ -23,32 +23,32 @@ namespace Jug::Fast { -class ParticlesWithTruthPID : public GaudiAlgorithm { +class ParticlesWithTruthPID : public JugAlgorithm { private: - DataHandle m_inputTruthCollection{"inputMCParticles", Gaudi::DataHandle::Reader, this}; - DataHandle m_inputTrackCollection{"inputTrackParameters", Gaudi::DataHandle::Reader, + DataHandle m_inputTruthCollection{"inputMCParticles", Jug::DataHandle::Reader, this}; + DataHandle m_inputTrackCollection{"inputTrackParameters", Jug::DataHandle::Reader, this}; DataHandle m_outputParticleCollection{"ReconstructedParticles", - Gaudi::DataHandle::Writer, this}; + Jug::DataHandle::Writer, this}; DataHandle m_outputAssocCollection{"MCRecoParticleAssociation", - Gaudi::DataHandle::Writer, this}; + Jug::DataHandle::Writer, this}; // Matching momentum tolerance requires 10% by default; - Gaudi::Property m_pRelativeTolerance{this, "pRelativeTolerance", {0.1}}; + Jug::Property m_pRelativeTolerance{this, "pRelativeTolerance", {0.1}}; // Matching phi tolerance of 10 mrad - Gaudi::Property m_phiTolerance{this, "phiTolerance", {0.030}}; + Jug::Property m_phiTolerance{this, "phiTolerance", {0.030}}; // Matchin eta tolerance of 0.1 - Gaudi::Property m_etaTolerance{this, "etaTolerance", {0.2}}; + Jug::Property m_etaTolerance{this, "etaTolerance", {0.2}}; public: - ParticlesWithTruthPID(const std::string& name, ISvcLocator* svcLoc) : GaudiAlgorithm(name, svcLoc) { + ParticlesWithTruthPID(const std::string& name, ISvcLocator* svcLoc) : JugAlgorithm(name, svcLoc) { declareProperty("inputMCParticles", m_inputTruthCollection, "MCParticles"); declareProperty("inputTrackParameters", m_inputTrackCollection, "outputTrackParameters"); declareProperty("outputParticles", m_outputParticleCollection, "ReconstructedParticles"); declareProperty("outputAssociations", m_outputAssocCollection, "MCRecoParticleAssociation"); } StatusCode initialize() override { - if (GaudiAlgorithm::initialize().isFailure()) { + if (JugAlgorithm::initialize().isFailure()) { return StatusCode::FAILURE; } return StatusCode::SUCCESS; @@ -156,8 +156,6 @@ class ParticlesWithTruthPID : public GaudiAlgorithm { } }; // namespace Jug::Fast -// NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables) -DECLARE_COMPONENT(ParticlesWithTruthPID) } // namespace Jug::Fast diff --git a/JugFast/src/components/SmearedFarForwardParticles.cpp b/JugFast/src/components/SmearedFarForwardParticles.cpp index 629c1d6..185ebea 100644 --- a/JugFast/src/components/SmearedFarForwardParticles.cpp +++ b/JugFast/src/components/SmearedFarForwardParticles.cpp @@ -5,11 +5,11 @@ #include #include -#include "Gaudi/Algorithm.h" -#include "GaudiAlg/GaudiTool.h" -#include "GaudiAlg/Producer.h" -#include "GaudiAlg/Transformer.h" -#include "GaudiKernel/RndmGenerators.h" +#include "Jug/Algorithm.h" +#include "JugAlg/JugTool.h" +#include "JugAlg/Producer.h" +#include "JugAlg/Transformer.h" +#include "JugKernel/RndmGenerators.h" #include "JugBase/DataHandle.h" @@ -25,43 +25,43 @@ enum DetectorTags { kTagB0 = 1, kTagRP = 2, kTagOMD = 3, kTagZDC = 4 }; namespace Jug::Fast { -class SmearedFarForwardParticles : public GaudiAlgorithm { +class SmearedFarForwardParticles : public JugAlgorithm { private: - DataHandle m_inputMCParticles{"inputMCParticles", Gaudi::DataHandle::Reader, this}; + DataHandle m_inputMCParticles{"inputMCParticles", Jug::DataHandle::Reader, this}; DataHandle m_outputParticles{"SmearedFarForwardParticles", - Gaudi::DataHandle::Writer, this}; + Jug::DataHandle::Writer, this}; DataHandle m_outputAssocCollection{"MCRecoParticleAssociation", - Gaudi::DataHandle::Writer, this}; + Jug::DataHandle::Writer, this}; - Gaudi::Property m_enableZDC{this, "enableZDC", true}; - Gaudi::Property m_enableB0{this, "enableB0", true}; - Gaudi::Property m_enableRP{this, "enableRP", true}; - Gaudi::Property m_enableOMD{this, "enableOMD", true}; + Jug::Property m_enableZDC{this, "enableZDC", true}; + Jug::Property m_enableB0{this, "enableB0", true}; + Jug::Property m_enableRP{this, "enableRP", true}; + Jug::Property m_enableOMD{this, "enableOMD", true}; // Beam energy, only used to determine the RP/OMD momentum ranges - Gaudi::Property m_ionBeamEnergy{this, "ionBeamEnergy", 0.}; + Jug::Property m_ionBeamEnergy{this, "ionBeamEnergy", 0.}; // RP default to 10-on-100 setting // Pz > 60% of beam energy (60% x 100GeV = 60GeV) // theta from 0.2mrad -> 5mrad - Gaudi::Property m_thetaMinRP{this, "thetaMinRP", 0.2e-3}; - Gaudi::Property m_thetaMaxRP{this, "thetaMaxRP", 5e-3}; - Gaudi::Property m_pMinRigidityRP{this, "pMinRigidityRP", 0.60}; + Jug::Property m_thetaMinRP{this, "thetaMinRP", 0.2e-3}; + Jug::Property m_thetaMaxRP{this, "thetaMaxRP", 5e-3}; + Jug::Property m_pMinRigidityRP{this, "pMinRigidityRP", 0.60}; // B0 - Gaudi::Property m_thetaMinB0{this, "thetaMinB0", 6.0e-3}; - Gaudi::Property m_thetaMaxB0{this, "thetaMaxB0", 20.0e-3}; + Jug::Property m_thetaMinB0{this, "thetaMinB0", 6.0e-3}; + Jug::Property m_thetaMaxB0{this, "thetaMaxB0", 20.0e-3}; // OMD default to 10-on-100 setting // 25% < P/Ebeam < 60% of beam energy (25% x 100GeV = 25GeV and 60% x 100GeV = 60GeV) // Angles both given for the small angle full-acceptance part, // and for the larger angle part where we only measure |phi| > rad - Gaudi::Property m_thetaMinFullOMD{this, "thetaMinFullOMD", 0.}; - Gaudi::Property m_thetaMaxFullOMD{this, "thetaMaxFullOMD", 2e-3}; - Gaudi::Property m_thetaMinPartialOMD{this, "thetaMinPartialOMD", 2.0e-3}; - Gaudi::Property m_thetaMaxPartialOMD{this, "thetaMaxPartialOMD", 5.0e-3}; - Gaudi::Property m_pMinRigidityOMD{this, "pMinRigidityOMD", 0.25}; - Gaudi::Property m_pMaxRigidityOMD{this, "pMaxRigidityOMD", 0.60}; + Jug::Property m_thetaMinFullOMD{this, "thetaMinFullOMD", 0.}; + Jug::Property m_thetaMaxFullOMD{this, "thetaMaxFullOMD", 2e-3}; + Jug::Property m_thetaMinPartialOMD{this, "thetaMinPartialOMD", 2.0e-3}; + Jug::Property m_thetaMaxPartialOMD{this, "thetaMaxPartialOMD", 5.0e-3}; + Jug::Property m_pMinRigidityOMD{this, "pMinRigidityOMD", 0.25}; + Jug::Property m_pMaxRigidityOMD{this, "pMaxRigidityOMD", 0.60}; // Crossing angle, set to -25mrad - Gaudi::Property m_crossingAngle{this, "crossingAngle", + Jug::Property m_crossingAngle{this, "crossingAngle", -0.025}; //-0.025}; -- causes double rotation with afterburner Rndm::Numbers m_gaussDist; @@ -71,13 +71,13 @@ class SmearedFarForwardParticles : public GaudiAlgorithm { using RecData = std::pair; public: - SmearedFarForwardParticles(const std::string& name, ISvcLocator* svcLoc) : GaudiAlgorithm(name, svcLoc) { + SmearedFarForwardParticles(const std::string& name, ISvcLocator* svcLoc) : JugAlgorithm(name, svcLoc) { declareProperty("inputMCParticles", m_inputMCParticles, "MCParticles"); declareProperty("outputParticles", m_outputParticles, "ReconstructedParticles"); declareProperty("outputAssociations", m_outputAssocCollection, "MCRecoParticleAssociation"); } StatusCode initialize() override { - if (GaudiAlgorithm::initialize().isFailure()) { + if (JugAlgorithm::initialize().isFailure()) { return StatusCode::FAILURE; } IRndmGenSvc* randSvc = svc("RndmGenSvc", true); @@ -414,7 +414,5 @@ class SmearedFarForwardParticles : public GaudiAlgorithm { } }; -// NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables) -DECLARE_COMPONENT(SmearedFarForwardParticles) } // namespace Jug::Fast diff --git a/JugFast/src/components/TruthClustering.cpp b/JugFast/src/components/TruthClustering.cpp index 35ce7ea..99ff3a8 100644 --- a/JugFast/src/components/TruthClustering.cpp +++ b/JugFast/src/components/TruthClustering.cpp @@ -3,13 +3,13 @@ #include -#include "Gaudi/Property.h" -#include "GaudiAlg/GaudiAlgorithm.h" -#include "GaudiAlg/GaudiTool.h" -#include "GaudiAlg/Transformer.h" -#include "GaudiKernel/PhysicalConstants.h" -#include "GaudiKernel/RndmGenerators.h" -#include "GaudiKernel/ToolHandle.h" +#include "Jug/Property.h" +#include "JugAlg/JugAlgorithm.h" +#include "JugAlg/JugTool.h" +#include "JugAlg/Transformer.h" +#include "JugKernel/PhysicalConstants.h" +#include "JugKernel/RndmGenerators.h" +#include "JugKernel/ToolHandle.h" #include "DDRec/CellIDPositionConverter.h" #include "DDRec/Surface.h" @@ -26,7 +26,7 @@ #include "eicd/ProtoClusterCollection.h" #include "eicd/RawCalorimeterHitCollection.h" -using namespace Gaudi::Units; +using namespace Jug::Units; namespace Jug::Fast { @@ -34,22 +34,22 @@ namespace Jug::Fast { * * \ingroup reco */ -class TruthClustering : public GaudiAlgorithm { +class TruthClustering : public JugAlgorithm { private: - DataHandle m_inputHits{"inputHits", Gaudi::DataHandle::Reader, this}; - DataHandle m_mcHits{"mcHits", Gaudi::DataHandle::Reader, this}; - DataHandle m_outputProtoClusters{"outputProtoClusters", Gaudi::DataHandle::Writer, this}; + DataHandle m_inputHits{"inputHits", Jug::DataHandle::Reader, this}; + DataHandle m_mcHits{"mcHits", Jug::DataHandle::Reader, this}; + DataHandle m_outputProtoClusters{"outputProtoClusters", Jug::DataHandle::Writer, this}; public: TruthClustering(const std::string& name, ISvcLocator* svcLoc) - : GaudiAlgorithm(name, svcLoc) { + : JugAlgorithm(name, svcLoc) { declareProperty("inputHits", m_inputHits, "Input calorimeter reco hits"); declareProperty("mcHits", m_mcHits, "Input truth hits"); declareProperty("outputProtoClusters", m_outputProtoClusters, "Output proto clusters"); } StatusCode initialize() override { - if (GaudiAlgorithm::initialize().isFailure()) { + if (JugAlgorithm::initialize().isFailure()) { return StatusCode::FAILURE; } return StatusCode::SUCCESS; @@ -82,7 +82,5 @@ class TruthClustering : public GaudiAlgorithm { } }; -// NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables) -DECLARE_COMPONENT(TruthClustering) } // namespace Jug::Fast diff --git a/JugFast/src/components/TruthEnergyPositionClusterMerger.cpp b/JugFast/src/components/TruthEnergyPositionClusterMerger.cpp index 091cdc2..2012d63 100644 --- a/JugFast/src/components/TruthEnergyPositionClusterMerger.cpp +++ b/JugFast/src/components/TruthEnergyPositionClusterMerger.cpp @@ -5,12 +5,12 @@ #include #include -// Gaudi -#include "Gaudi/Property.h" -#include "GaudiAlg/GaudiAlgorithm.h" -#include "GaudiAlg/GaudiTool.h" -#include "GaudiAlg/Transformer.h" -#include "GaudiKernel/PhysicalConstants.h" +// Jug +#include "Jug/Property.h" +#include "JugAlg/JugAlgorithm.h" +#include "JugAlg/JugTool.h" +#include "JugAlg/Transformer.h" +#include "JugKernel/PhysicalConstants.h" #include "JugBase/DataHandle.h" @@ -20,7 +20,7 @@ #include "eicd/MCRecoClusterParticleAssociationCollection.h" #include -using namespace Gaudi::Units; +using namespace Jug::Units; namespace Jug::Fast { @@ -32,21 +32,21 @@ namespace Jug::Fast { * * \ingroup reco */ -class TruthEnergyPositionClusterMerger : public GaudiAlgorithm { +class TruthEnergyPositionClusterMerger : public JugAlgorithm { private: // Input - DataHandle m_inputMCParticles{"MCParticles", Gaudi::DataHandle::Reader, this}; - DataHandle m_energyClusters{"EnergyClusters", Gaudi::DataHandle::Reader, this}; - DataHandle m_energyAssociations{"EnergyAssociations", Gaudi::DataHandle::Reader, this}; - DataHandle m_positionClusters{"PositionClusters", Gaudi::DataHandle::Reader, this}; - DataHandle m_positionAssociations{"PositionAssociations", Gaudi::DataHandle::Reader, this}; + DataHandle m_inputMCParticles{"MCParticles", Jug::DataHandle::Reader, this}; + DataHandle m_energyClusters{"EnergyClusters", Jug::DataHandle::Reader, this}; + DataHandle m_energyAssociations{"EnergyAssociations", Jug::DataHandle::Reader, this}; + DataHandle m_positionClusters{"PositionClusters", Jug::DataHandle::Reader, this}; + DataHandle m_positionAssociations{"PositionAssociations", Jug::DataHandle::Reader, this}; // Output - DataHandle m_outputClusters{"OutputClusters", Gaudi::DataHandle::Writer, this}; - DataHandle m_outputAssociations{"OutputAssociations", Gaudi::DataHandle::Writer, this}; + DataHandle m_outputClusters{"OutputClusters", Jug::DataHandle::Writer, this}; + DataHandle m_outputAssociations{"OutputAssociations", Jug::DataHandle::Writer, this}; public: TruthEnergyPositionClusterMerger(const std::string& name, ISvcLocator* svcLoc) - : GaudiAlgorithm(name, svcLoc) { + : JugAlgorithm(name, svcLoc) { declareProperty("inputMCParticles", m_inputMCParticles, "MCParticles"); declareProperty("inputEnergyClusters", m_energyClusters, "Cluster collection with good energy precision"); declareProperty("inputEnergyAssociations", m_energyAssociations, "Cluster association with good energy precision"); @@ -237,7 +237,5 @@ class TruthEnergyPositionClusterMerger : public GaudiAlgorithm { } }; -// NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables) -DECLARE_COMPONENT(TruthEnergyPositionClusterMerger) } // namespace Jug::Fast diff --git a/JugPID/CMakeLists.txt b/JugPID/CMakeLists.txt index 6669b90..8366df4 100644 --- a/JugPID/CMakeLists.txt +++ b/JugPID/CMakeLists.txt @@ -6,11 +6,8 @@ ################################################################################ file(GLOB JugPIDPlugins_sources CONFIGURE_DEPENDS src/components/*.cpp) -gaudi_add_module(JugPIDPlugins - SOURCES - ${JugPIDPlugins_sources} - LINK - Gaudi::GaudiAlgLib Gaudi::GaudiKernel +add_library(JugPIDPlugins ${JugPIDPlugins_sources}) +target_link_libraries(JugPIDPlugins JugBase ROOT::Core ROOT::RIO ROOT::Tree EDM4HEP::edm4hep @@ -18,6 +15,7 @@ gaudi_add_module(JugPIDPlugins ) target_include_directories(JugPIDPlugins PUBLIC + $ $ $) diff --git a/JugPID/src/components/PhotoRingClusters.cpp b/JugPID/src/components/PhotoRingClusters.cpp index 921c31b..d5e855e 100644 --- a/JugPID/src/components/PhotoRingClusters.cpp +++ b/JugPID/src/components/PhotoRingClusters.cpp @@ -10,13 +10,13 @@ #include -#include "Gaudi/Property.h" -#include "GaudiAlg/GaudiAlgorithm.h" -#include "GaudiAlg/GaudiTool.h" -#include "GaudiAlg/Transformer.h" -#include "GaudiKernel/PhysicalConstants.h" -#include "GaudiKernel/RndmGenerators.h" -#include "GaudiKernel/ToolHandle.h" +#include "Jug/Property.h" +#include "JugAlg/JugAlgorithm.h" +#include "JugAlg/JugTool.h" +#include "JugAlg/Transformer.h" +#include "JugKernel/PhysicalConstants.h" +#include "JugKernel/RndmGenerators.h" +#include "JugKernel/ToolHandle.h" #include "DDRec/CellIDPositionConverter.h" #include "DDRec/Surface.h" @@ -30,7 +30,7 @@ #include "eicd/PMTHitCollection.h" #include "eicd/RingImageCollection.h" -using namespace Gaudi::Units; +using namespace Jug::Units; using namespace Eigen; namespace Jug::Reco { @@ -39,30 +39,30 @@ namespace Jug::Reco { * * \ingroup reco */ -class PhotoRingClusters : public GaudiAlgorithm { +class PhotoRingClusters : public JugAlgorithm { private: - DataHandle m_inputHitCollection{"inputHitCollection", Gaudi::DataHandle::Reader, this}; - DataHandle m_outputClusterCollection{"outputClusterCollection", Gaudi::DataHandle::Writer, + DataHandle m_inputHitCollection{"inputHitCollection", Jug::DataHandle::Reader, this}; + DataHandle m_outputClusterCollection{"outputClusterCollection", Jug::DataHandle::Writer, this}; // @TODO // A more realistic way is to have tracker info as the input to determine how much clusters should be found - Gaudi::Property m_nRings{this, "nRings", 1}; - Gaudi::Property m_nIters{this, "nIters", 1000}; - Gaudi::Property m_q{this, "q", 2.0}; - Gaudi::Property m_eps{this, "epsilon", 1e-4}; - Gaudi::Property m_minNpe{this, "minNpe", 0.5}; + Jug::Property m_nRings{this, "nRings", 1}; + Jug::Property m_nIters{this, "nIters", 1000}; + Jug::Property m_q{this, "q", 2.0}; + Jug::Property m_eps{this, "epsilon", 1e-4}; + Jug::Property m_minNpe{this, "minNpe", 0.5}; // Pointer to the geometry service SmartIF m_geoSvc; public: - // ill-formed: using GaudiAlgorithm::GaudiAlgorithm; - PhotoRingClusters(const std::string& name, ISvcLocator* svcLoc) : GaudiAlgorithm(name, svcLoc) { + // ill-formed: using JugAlgorithm::JugAlgorithm; + PhotoRingClusters(const std::string& name, ISvcLocator* svcLoc) : JugAlgorithm(name, svcLoc) { declareProperty("inputHitCollection", m_inputHitCollection, ""); declareProperty("outputClusterCollection", m_outputClusterCollection, ""); } StatusCode initialize() override { - if (GaudiAlgorithm::initialize().isFailure()) { + if (JugAlgorithm::initialize().isFailure()) { return StatusCode::FAILURE; } m_geoSvc = service("GeoSvc"); @@ -111,7 +111,5 @@ class PhotoRingClusters : public GaudiAlgorithm { } }; -// NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables) -DECLARE_COMPONENT(PhotoRingClusters) } // namespace Jug::Reco diff --git a/JugReco/CMakeLists.txt b/JugReco/CMakeLists.txt index d342b85..e47696d 100644 --- a/JugReco/CMakeLists.txt +++ b/JugReco/CMakeLists.txt @@ -6,11 +6,8 @@ ################################################################################ file(GLOB JugRecoPlugins_sources CONFIGURE_DEPENDS src/components/*.cpp) -gaudi_add_module(JugRecoPlugins - SOURCES - ${JugRecoPlugins_sources} - LINK - Gaudi::GaudiAlgLib Gaudi::GaudiKernel +add_library(JugRecoPlugins ${JugRecoPlugins_sources}) +target_link_libraries(JugRecoPlugins JugBase ROOT::Core ROOT::RIO ROOT::Tree EDM4HEP::edm4hep @@ -19,6 +16,7 @@ gaudi_add_module(JugRecoPlugins ) target_include_directories(JugRecoPlugins PUBLIC + $ $ $) diff --git a/JugReco/src/components/CalorimeterHitReco.cpp b/JugReco/src/components/CalorimeterHitReco.cpp index 7bd08d7..6b2a5dc 100644 --- a/JugReco/src/components/CalorimeterHitReco.cpp +++ b/JugReco/src/components/CalorimeterHitReco.cpp @@ -10,13 +10,13 @@ #include #include -#include "Gaudi/Property.h" -#include "GaudiAlg/GaudiAlgorithm.h" -#include "GaudiAlg/GaudiTool.h" -#include "GaudiAlg/Transformer.h" -#include "GaudiKernel/PhysicalConstants.h" -#include "GaudiKernel/RndmGenerators.h" -#include "GaudiKernel/ToolHandle.h" +#include "Jug/Property.h" +#include "JugAlg/JugAlgorithm.h" +#include "JugAlg/JugTool.h" +#include "JugAlg/Transformer.h" +#include "JugKernel/PhysicalConstants.h" +#include "JugKernel/RndmGenerators.h" +#include "JugKernel/ToolHandle.h" #include "DDRec/CellIDPositionConverter.h" #include "DDRec/Surface.h" @@ -29,7 +29,7 @@ #include "eicd/CalorimeterHitCollection.h" #include "eicd/RawCalorimeterHitCollection.h" -using namespace Gaudi::Units; +using namespace Jug::Units; namespace Jug::Reco { @@ -38,59 +38,59 @@ namespace Jug::Reco { * Reconstruct digitized outputs, paired with Jug::Digi::CalorimeterHitDigi * \ingroup reco */ -class CalorimeterHitReco : public GaudiAlgorithm { +class CalorimeterHitReco : public JugAlgorithm { private: // length unit from dd4hep, should be fixed - Gaudi::Property m_lUnit{this, "lengthUnit", dd4hep::mm}; + Jug::Property m_lUnit{this, "lengthUnit", dd4hep::mm}; // digitization settings, must be consistent with digi class - Gaudi::Property m_capADC{this, "capacityADC", 8096}; - Gaudi::Property m_dyRangeADC{this, "dynamicRangeADC", 100. * MeV}; - Gaudi::Property m_pedMeanADC{this, "pedestalMean", 400}; - Gaudi::Property m_pedSigmaADC{this, "pedestalSigma", 3.2}; - Gaudi::Property m_resolutionTDC{this, "resolutionTDC", 10 * ps}; + Jug::Property m_capADC{this, "capacityADC", 8096}; + Jug::Property m_dyRangeADC{this, "dynamicRangeADC", 100. * MeV}; + Jug::Property m_pedMeanADC{this, "pedestalMean", 400}; + Jug::Property m_pedSigmaADC{this, "pedestalSigma", 3.2}; + Jug::Property m_resolutionTDC{this, "resolutionTDC", 10 * ps}; // zero suppression values - Gaudi::Property m_thresholdFactor{this, "thresholdFactor", 0.0}; - Gaudi::Property m_thresholdValue{this, "thresholdValue", 0.0}; + Jug::Property m_thresholdFactor{this, "thresholdFactor", 0.0}; + Jug::Property m_thresholdValue{this, "thresholdValue", 0.0}; // energy correction with sampling fraction - Gaudi::Property m_sampFrac{this, "samplingFraction", 1.0}; + Jug::Property m_sampFrac{this, "samplingFraction", 1.0}; // unitless counterparts of the input parameters double dyRangeADC{0}; double thresholdADC{0}; double stepTDC{0}; - DataHandle m_inputHitCollection{"inputHitCollection", Gaudi::DataHandle::Reader, + DataHandle m_inputHitCollection{"inputHitCollection", Jug::DataHandle::Reader, this}; - DataHandle m_outputHitCollection{"outputHitCollection", Gaudi::DataHandle::Writer, + DataHandle m_outputHitCollection{"outputHitCollection", Jug::DataHandle::Writer, this}; // geometry service to get ids, ignored if no names provided - Gaudi::Property m_geoSvcName{this, "geoServiceName", "GeoSvc"}; - Gaudi::Property m_readout{this, "readoutClass", ""}; - Gaudi::Property m_layerField{this, "layerField", ""}; - Gaudi::Property m_sectorField{this, "sectorField", ""}; + Jug::Property m_geoSvcName{this, "geoServiceName", "GeoSvc"}; + Jug::Property m_readout{this, "readoutClass", ""}; + Jug::Property m_layerField{this, "layerField", ""}; + Jug::Property m_sectorField{this, "sectorField", ""}; SmartIF m_geoSvc; dd4hep::BitFieldCoder* id_dec = nullptr; size_t sector_idx{0}, layer_idx{0}; // name of detelment or fields to find the local detector (for global->local transform) // if nothing is provided, the lowest level DetElement (from cellID) will be used - Gaudi::Property m_localDetElement{this, "localDetElement", ""}; - Gaudi::Property> u_localDetFields{this, "localDetFields", {}}; + Jug::Property m_localDetElement{this, "localDetElement", ""}; + Jug::Property> u_localDetFields{this, "localDetFields", {}}; dd4hep::DetElement local; size_t local_mask = ~0; public: - CalorimeterHitReco(const std::string& name, ISvcLocator* svcLoc) : GaudiAlgorithm(name, svcLoc) { + CalorimeterHitReco(const std::string& name, ISvcLocator* svcLoc) : JugAlgorithm(name, svcLoc) { declareProperty("inputHitCollection", m_inputHitCollection, ""); declareProperty("outputHitCollection", m_outputHitCollection, ""); } StatusCode initialize() override { - if (GaudiAlgorithm::initialize().isFailure()) { + if (JugAlgorithm::initialize().isFailure()) { return StatusCode::FAILURE; } @@ -238,7 +238,5 @@ class CalorimeterHitReco : public GaudiAlgorithm { }; // class CalorimeterHitReco -// NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables) -DECLARE_COMPONENT(CalorimeterHitReco) } // namespace Jug::Reco diff --git a/JugReco/src/components/CalorimeterHitsEtaPhiProjector.cpp b/JugReco/src/components/CalorimeterHitsEtaPhiProjector.cpp index fe92735..5210ea4 100644 --- a/JugReco/src/components/CalorimeterHitsEtaPhiProjector.cpp +++ b/JugReco/src/components/CalorimeterHitsEtaPhiProjector.cpp @@ -15,13 +15,13 @@ #include #include -#include "Gaudi/Property.h" -#include "GaudiAlg/GaudiAlgorithm.h" -#include "GaudiAlg/GaudiTool.h" -#include "GaudiAlg/Transformer.h" -#include "GaudiKernel/PhysicalConstants.h" -#include "GaudiKernel/RndmGenerators.h" -#include "GaudiKernel/ToolHandle.h" +#include "Jug/Property.h" +#include "JugAlg/JugAlgorithm.h" +#include "JugAlg/JugTool.h" +#include "JugAlg/Transformer.h" +#include "JugKernel/PhysicalConstants.h" +#include "JugKernel/RndmGenerators.h" +#include "JugKernel/ToolHandle.h" #include "DDRec/CellIDPositionConverter.h" #include "DDRec/Surface.h" @@ -35,7 +35,7 @@ #include "eicd/CalorimeterHitCollection.h" #include "eicd/vector_utils.h" -using namespace Gaudi::Units; +using namespace Jug::Units; using Point3D = ROOT::Math::XYZPoint; struct pair_hash { @@ -57,24 +57,24 @@ namespace Jug::Reco { * * \ingroup reco */ -class CalorimeterHitsEtaPhiProjector : public GaudiAlgorithm { +class CalorimeterHitsEtaPhiProjector : public JugAlgorithm { private: - Gaudi::Property> u_gridSizes{this, "gridSizes", {0.001, 0.001 * rad}}; - DataHandle m_inputHitCollection{"inputHitCollection", Gaudi::DataHandle::Reader, + Jug::Property> u_gridSizes{this, "gridSizes", {0.001, 0.001 * rad}}; + DataHandle m_inputHitCollection{"inputHitCollection", Jug::DataHandle::Reader, this}; - DataHandle m_outputHitCollection{"outputHitCollection", Gaudi::DataHandle::Writer, + DataHandle m_outputHitCollection{"outputHitCollection", Jug::DataHandle::Writer, this}; double gridSizes[2]{0.0, 0.0}; public: - CalorimeterHitsEtaPhiProjector(const std::string& name, ISvcLocator* svcLoc) : GaudiAlgorithm(name, svcLoc) { + CalorimeterHitsEtaPhiProjector(const std::string& name, ISvcLocator* svcLoc) : JugAlgorithm(name, svcLoc) { declareProperty("inputHitCollection", m_inputHitCollection, ""); declareProperty("outputHitCollection", m_outputHitCollection, ""); } StatusCode initialize() override { - if (GaudiAlgorithm::initialize().isFailure()) { + if (JugAlgorithm::initialize().isFailure()) { return StatusCode::FAILURE; } @@ -132,7 +132,5 @@ class CalorimeterHitsEtaPhiProjector : public GaudiAlgorithm { }; // class CalorimeterHitsEtaPhiProjector -// NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables) -DECLARE_COMPONENT(CalorimeterHitsEtaPhiProjector) } // namespace Jug::Reco diff --git a/JugReco/src/components/CalorimeterHitsMerger.cpp b/JugReco/src/components/CalorimeterHitsMerger.cpp index 3b7c0b6..bafcfb8 100644 --- a/JugReco/src/components/CalorimeterHitsMerger.cpp +++ b/JugReco/src/components/CalorimeterHitsMerger.cpp @@ -12,13 +12,13 @@ #include #include -#include "Gaudi/Property.h" -#include "GaudiAlg/GaudiAlgorithm.h" -#include "GaudiAlg/GaudiTool.h" -#include "GaudiAlg/Transformer.h" -#include "GaudiKernel/PhysicalConstants.h" -#include "GaudiKernel/RndmGenerators.h" -#include "GaudiKernel/ToolHandle.h" +#include "Jug/Property.h" +#include "JugAlg/JugAlgorithm.h" +#include "JugAlg/JugTool.h" +#include "JugAlg/Transformer.h" +#include "JugKernel/PhysicalConstants.h" +#include "JugKernel/RndmGenerators.h" +#include "JugKernel/ToolHandle.h" #include "DDRec/CellIDPositionConverter.h" #include "DDRec/Surface.h" @@ -34,7 +34,7 @@ // Event Model related classes #include "eicd/CalorimeterHitCollection.h" -using namespace Gaudi::Units; +using namespace Jug::Units; namespace Jug::Reco { @@ -45,29 +45,29 @@ namespace Jug::Reco { * * \ingroup reco */ -class CalorimeterHitsMerger : public GaudiAlgorithm { +class CalorimeterHitsMerger : public JugAlgorithm { private: - Gaudi::Property m_geoSvcName{this, "geoServiceName", "GeoSvc"}; - Gaudi::Property m_readout{this, "readoutClass", ""}; + Jug::Property m_geoSvcName{this, "geoServiceName", "GeoSvc"}; + Jug::Property m_readout{this, "readoutClass", ""}; // field names to generate id mask, the hits will be grouped by masking the field - Gaudi::Property> u_fields{this, "fields", {"layer"}}; + Jug::Property> u_fields{this, "fields", {"layer"}}; // reference field numbers to locate position for each merged hits group - Gaudi::Property> u_refs{this, "fieldRefNumbers", {}}; - DataHandle m_inputHitCollection{"inputHitCollection", Gaudi::DataHandle::Reader, this}; - DataHandle m_outputHitCollection{"outputHitCollection", Gaudi::DataHandle::Writer, + Jug::Property> u_refs{this, "fieldRefNumbers", {}}; + DataHandle m_inputHitCollection{"inputHitCollection", Jug::DataHandle::Reader, this}; + DataHandle m_outputHitCollection{"outputHitCollection", Jug::DataHandle::Writer, this}; SmartIF m_geoSvc; uint64_t id_mask{0}, ref_mask{0}; public: - CalorimeterHitsMerger(const std::string& name, ISvcLocator* svcLoc) : GaudiAlgorithm(name, svcLoc) { + CalorimeterHitsMerger(const std::string& name, ISvcLocator* svcLoc) : JugAlgorithm(name, svcLoc) { declareProperty("inputHitCollection", m_inputHitCollection, ""); declareProperty("outputHitCollection", m_outputHitCollection, ""); } StatusCode initialize() override { - if (GaudiAlgorithm::initialize().isFailure()) { + if (JugAlgorithm::initialize().isFailure()) { return StatusCode::FAILURE; } @@ -191,7 +191,5 @@ class CalorimeterHitsMerger : public GaudiAlgorithm { }; // class CalorimeterHitsMerger -// NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables) -DECLARE_COMPONENT(CalorimeterHitsMerger) } // namespace Jug::Reco diff --git a/JugReco/src/components/CalorimeterIslandCluster.cpp b/JugReco/src/components/CalorimeterIslandCluster.cpp index 194f647..81ec06c 100644 --- a/JugReco/src/components/CalorimeterIslandCluster.cpp +++ b/JugReco/src/components/CalorimeterIslandCluster.cpp @@ -17,13 +17,13 @@ #include "fmt/format.h" -#include "Gaudi/Property.h" -#include "GaudiAlg/GaudiAlgorithm.h" -#include "GaudiAlg/GaudiTool.h" -#include "GaudiAlg/Transformer.h" -#include "GaudiKernel/PhysicalConstants.h" -#include "GaudiKernel/RndmGenerators.h" -#include "GaudiKernel/ToolHandle.h" +#include "Jug/Property.h" +#include "JugAlg/JugAlgorithm.h" +#include "JugAlg/JugTool.h" +#include "JugAlg/Transformer.h" +#include "JugKernel/PhysicalConstants.h" +#include "JugKernel/RndmGenerators.h" +#include "JugKernel/ToolHandle.h" #include "DDRec/CellIDPositionConverter.h" #include "DDRec/Surface.h" @@ -40,7 +40,7 @@ #include "eicd/Vector3f.h" #include "eicd/vector_utils.h" -using namespace Gaudi::Units; +using namespace Jug::Units; namespace { @@ -112,23 +112,23 @@ namespace Jug::Reco { * * \ingroup reco */ -class CalorimeterIslandCluster : public GaudiAlgorithm { +class CalorimeterIslandCluster : public JugAlgorithm { private: - Gaudi::Property m_splitCluster{this, "splitCluster", true}; - Gaudi::Property m_minClusterHitEdep{this, "minClusterHitEdep", 0.}; - Gaudi::Property m_minClusterCenterEdep{this, "minClusterCenterEdep", 50.0 * MeV}; - DataHandle m_inputHitCollection{"inputHitCollection", Gaudi::DataHandle::Reader, this}; + Jug::Property m_splitCluster{this, "splitCluster", true}; + Jug::Property m_minClusterHitEdep{this, "minClusterHitEdep", 0.}; + Jug::Property m_minClusterCenterEdep{this, "minClusterCenterEdep", 50.0 * MeV}; + DataHandle m_inputHitCollection{"inputHitCollection", Jug::DataHandle::Reader, this}; DataHandle m_outputProtoCollection{"outputProtoClusterCollection", - Gaudi::DataHandle::Writer, this}; + Jug::DataHandle::Writer, this}; // neighbour checking distances - Gaudi::Property m_sectorDist{this, "sectorDist", 5.0 * cm}; - Gaudi::Property> u_localDistXY{this, "localDistXY", {}}; - Gaudi::Property> u_localDistXZ{this, "localDistXZ", {}}; - Gaudi::Property> u_localDistYZ{this, "localDistYZ", {}}; - Gaudi::Property> u_globalDistRPhi{this, "globalDistRPhi", {}}; - Gaudi::Property> u_globalDistEtaPhi{this, "globalDistEtaPhi", {}}; - Gaudi::Property> u_dimScaledLocalDistXY{this, "dimScaledLocalDistXY", {1.8, 1.8}}; + Jug::Property m_sectorDist{this, "sectorDist", 5.0 * cm}; + Jug::Property> u_localDistXY{this, "localDistXY", {}}; + Jug::Property> u_localDistXZ{this, "localDistXZ", {}}; + Jug::Property> u_localDistYZ{this, "localDistYZ", {}}; + Jug::Property> u_globalDistRPhi{this, "globalDistRPhi", {}}; + Jug::Property> u_globalDistEtaPhi{this, "globalDistEtaPhi", {}}; + Jug::Property> u_dimScaledLocalDistXY{this, "dimScaledLocalDistXY", {1.8, 1.8}}; // neighbor checking function std::function hitsDist; @@ -137,13 +137,13 @@ class CalorimeterIslandCluster : public GaudiAlgorithm { std::array neighbourDist = {0., 0.}; public: - CalorimeterIslandCluster(const std::string& name, ISvcLocator* svcLoc) : GaudiAlgorithm(name, svcLoc) { + CalorimeterIslandCluster(const std::string& name, ISvcLocator* svcLoc) : JugAlgorithm(name, svcLoc) { declareProperty("inputHitCollection", m_inputHitCollection, ""); declareProperty("outputProtoClusterCollection", m_outputProtoCollection, ""); } StatusCode initialize() override { - if (GaudiAlgorithm::initialize().isFailure()) { + if (JugAlgorithm::initialize().isFailure()) { return StatusCode::FAILURE; } @@ -153,7 +153,7 @@ class CalorimeterIslandCluster : public GaudiAlgorithm { sectorDist = m_sectorDist.value() / mm; // set coordinate system - auto set_dist_method = [this](const Gaudi::Property>& uprop) { + auto set_dist_method = [this](const Jug::Property>& uprop) { if (uprop.size() == 0) { return false; } @@ -175,7 +175,7 @@ class CalorimeterIslandCluster : public GaudiAlgorithm { return true; }; - std::vector>> uprops{ + std::vector>> uprops{ u_localDistXY, u_localDistXZ, u_localDistYZ, @@ -408,7 +408,5 @@ class CalorimeterIslandCluster : public GaudiAlgorithm { } }; -// NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables) -DECLARE_COMPONENT(CalorimeterIslandCluster) } // namespace Jug::Reco diff --git a/JugReco/src/components/ClusterRecoCoG.cpp b/JugReco/src/components/ClusterRecoCoG.cpp index 8b60f02..4598659 100644 --- a/JugReco/src/components/ClusterRecoCoG.cpp +++ b/JugReco/src/components/ClusterRecoCoG.cpp @@ -16,13 +16,13 @@ #include "fmt/format.h" #include -#include "Gaudi/Property.h" -#include "GaudiAlg/GaudiAlgorithm.h" -#include "GaudiAlg/GaudiTool.h" -#include "GaudiAlg/Transformer.h" -#include "GaudiKernel/PhysicalConstants.h" -#include "GaudiKernel/RndmGenerators.h" -#include "GaudiKernel/ToolHandle.h" +#include "Jug/Property.h" +#include "JugAlg/JugAlgorithm.h" +#include "JugAlg/JugTool.h" +#include "JugAlg/Transformer.h" +#include "JugKernel/PhysicalConstants.h" +#include "JugKernel/RndmGenerators.h" +#include "JugKernel/ToolHandle.h" #include "DDRec/CellIDPositionConverter.h" #include "DDRec/Surface.h" @@ -39,7 +39,7 @@ #include "eicd/ProtoClusterCollection.h" #include "eicd/vector_utils.h" -using namespace Gaudi::Units; +using namespace Jug::Units; namespace Jug::Reco { @@ -64,28 +64,28 @@ static const std::map m_sampFrac{this, "samplingFraction", 1.0}; - Gaudi::Property m_logWeightBase{this, "logWeightBase", 3.6}; - Gaudi::Property m_depthCorrection{this, "depthCorrection", 0.0}; - Gaudi::Property m_energyWeight{this, "energyWeight", "log"}; - Gaudi::Property m_moduleDimZName{this, "moduleDimZName", ""}; + Jug::Property m_sampFrac{this, "samplingFraction", 1.0}; + Jug::Property m_logWeightBase{this, "logWeightBase", 3.6}; + Jug::Property m_depthCorrection{this, "depthCorrection", 0.0}; + Jug::Property m_energyWeight{this, "energyWeight", "log"}; + Jug::Property m_moduleDimZName{this, "moduleDimZName", ""}; // Constrain the cluster position eta to be within // the eta of the contributing hits. This is useful to avoid edge effects // for endcaps. - Gaudi::Property m_enableEtaBounds{this, "enableEtaBounds", false}; + Jug::Property m_enableEtaBounds{this, "enableEtaBounds", false}; - DataHandle m_inputProto{"inputProtoClusterCollection", Gaudi::DataHandle::Reader, this}; - DataHandle m_outputClusters{"outputClusterCollection", Gaudi::DataHandle::Writer, this}; + DataHandle m_inputProto{"inputProtoClusterCollection", Jug::DataHandle::Reader, this}; + DataHandle m_outputClusters{"outputClusterCollection", Jug::DataHandle::Writer, this}; // Collection for MC hits when running on MC - Gaudi::Property m_mcHits{this, "mcHits", ""}; + Jug::Property m_mcHits{this, "mcHits", ""}; // Optional handle to MC hits std::unique_ptr> m_mcHits_ptr; // Collection for associations when running on MC - Gaudi::Property m_outputAssociations{this, "outputAssociations", ""}; + Jug::Property m_outputAssociations{this, "outputAssociations", ""}; // Optional handle to MC hits std::unique_ptr> m_outputAssociations_ptr; @@ -95,27 +95,27 @@ class ClusterRecoCoG : public GaudiAlgorithm { std::function weightFunc; public: - ClusterRecoCoG(const std::string& name, ISvcLocator* svcLoc) : GaudiAlgorithm(name, svcLoc) { + ClusterRecoCoG(const std::string& name, ISvcLocator* svcLoc) : JugAlgorithm(name, svcLoc) { declareProperty("inputProtoClusterCollection", m_inputProto, ""); declareProperty("outputClusterCollection", m_outputClusters, ""); } StatusCode initialize() override { - if (GaudiAlgorithm::initialize().isFailure()) { + if (JugAlgorithm::initialize().isFailure()) { return StatusCode::FAILURE; } // Initialize the optional MC input hit collection if requested if (m_mcHits != "") { m_mcHits_ptr = - std::make_unique>(m_mcHits, Gaudi::DataHandle::Reader, + std::make_unique>(m_mcHits, Jug::DataHandle::Reader, this); } // Initialize the optional association collection if requested if (m_outputAssociations != "") { m_outputAssociations_ptr = - std::make_unique>(m_outputAssociations, Gaudi::DataHandle::Writer, + std::make_unique>(m_outputAssociations, Jug::DataHandle::Writer, this); } @@ -350,7 +350,5 @@ class ClusterRecoCoG : public GaudiAlgorithm { } }; -// NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables) -DECLARE_COMPONENT(ClusterRecoCoG) } // namespace Jug::Reco diff --git a/JugReco/src/components/EnergyPositionClusterMerger.cpp b/JugReco/src/components/EnergyPositionClusterMerger.cpp index ff3aa38..cd33eb0 100644 --- a/JugReco/src/components/EnergyPositionClusterMerger.cpp +++ b/JugReco/src/components/EnergyPositionClusterMerger.cpp @@ -5,12 +5,12 @@ #include #include -// Gaudi -#include "Gaudi/Property.h" -#include "GaudiAlg/GaudiAlgorithm.h" -#include "GaudiAlg/GaudiTool.h" -#include "GaudiAlg/Transformer.h" -#include "GaudiKernel/PhysicalConstants.h" +// Jug +#include "Jug/Property.h" +#include "JugAlg/JugAlgorithm.h" +#include "JugAlg/JugTool.h" +#include "JugAlg/Transformer.h" +#include "JugKernel/PhysicalConstants.h" #include "JugBase/DataHandle.h" @@ -18,7 +18,7 @@ #include "eicd/ClusterCollection.h" #include "eicd/vector_utils.h" -using namespace Gaudi::Units; +using namespace Jug::Units; namespace Jug::Reco { @@ -34,23 +34,23 @@ namespace Jug::Reco { * * \ingroup reco */ -class EnergyPositionClusterMerger : public GaudiAlgorithm { +class EnergyPositionClusterMerger : public JugAlgorithm { private: // Input - DataHandle m_energyClusters{"energyClusters", Gaudi::DataHandle::Reader, this}; - DataHandle m_positionClusters{"positionClusters", Gaudi::DataHandle::Reader, this}; + DataHandle m_energyClusters{"energyClusters", Jug::DataHandle::Reader, this}; + DataHandle m_positionClusters{"positionClusters", Jug::DataHandle::Reader, this}; // Output - DataHandle m_outputClusters{"outputClusters", Gaudi::DataHandle::Writer, this}; + DataHandle m_outputClusters{"outputClusters", Jug::DataHandle::Writer, this}; // Negative values mean the tolerance check is disabled - Gaudi::Property m_zToleranceUnits{this, "zTolerance", -1 * cm}; - Gaudi::Property m_phiToleranceUnits{this, "phiTolerance", 20 * degree}; - Gaudi::Property m_energyRelTolerance{this, "energyRelTolerance", 0.3}; + Jug::Property m_zToleranceUnits{this, "zTolerance", -1 * cm}; + Jug::Property m_phiToleranceUnits{this, "phiTolerance", 20 * degree}; + Jug::Property m_energyRelTolerance{this, "energyRelTolerance", 0.3}; // Unitless (GeV/mm/ns/rad) versions of these tolerances double m_zTolerance{0}; double m_phiTolerance{0}; public: - EnergyPositionClusterMerger(const std::string& name, ISvcLocator* svcLoc) : GaudiAlgorithm(name, svcLoc) { + EnergyPositionClusterMerger(const std::string& name, ISvcLocator* svcLoc) : JugAlgorithm(name, svcLoc) { declareProperty("energyClusters", m_energyClusters, "Cluster collection with good energy precision"); declareProperty("positionClusters", m_positionClusters, "Cluster collection with good position precision"); declareProperty("outputClusters", m_outputClusters, ""); @@ -136,7 +136,5 @@ class EnergyPositionClusterMerger : public GaudiAlgorithm { return StatusCode::SUCCESS; } }; -// NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables) -DECLARE_COMPONENT(EnergyPositionClusterMerger) } // namespace Jug::Reco diff --git a/JugReco/src/components/FarForwardParticles.cpp b/JugReco/src/components/FarForwardParticles.cpp index 828ee36..f2de0c4 100644 --- a/JugReco/src/components/FarForwardParticles.cpp +++ b/JugReco/src/components/FarForwardParticles.cpp @@ -5,11 +5,11 @@ #include #include -#include "Gaudi/Algorithm.h" -#include "GaudiAlg/GaudiTool.h" -#include "GaudiAlg/Producer.h" -#include "GaudiAlg/Transformer.h" -#include "GaudiKernel/RndmGenerators.h" +#include "Jug/Algorithm.h" +#include "JugAlg/JugTool.h" +#include "JugAlg/Producer.h" +#include "JugAlg/Transformer.h" +#include "JugKernel/RndmGenerators.h" #include "DDRec/CellIDPositionConverter.h" #include "DDRec/Surface.h" @@ -25,31 +25,31 @@ namespace Jug::Reco { -class FarForwardParticles : public GaudiAlgorithm { +class FarForwardParticles : public JugAlgorithm { private: - DataHandle m_inputHitCollection{"FarForwardTrackerHits", Gaudi::DataHandle::Reader, this}; - DataHandle m_outputParticles{"outputParticles", Gaudi::DataHandle::Writer, + DataHandle m_inputHitCollection{"FarForwardTrackerHits", Jug::DataHandle::Reader, this}; + DataHandle m_outputParticles{"outputParticles", Jug::DataHandle::Writer, this}; //----- Define constants here ------ - Gaudi::Property local_x_offset_station_1{this, "localXOffsetSta1", -833.3878326}; - Gaudi::Property local_x_offset_station_2{this, "localXOffsetSta2", -924.342804}; - Gaudi::Property local_x_slope_offset{this, "localXSlopeOffset", -0.00622147}; - Gaudi::Property local_y_slope_offset{this, "localYSlopeOffset", -0.0451035}; - Gaudi::Property crossingAngle{this, "crossingAngle", -0.025}; - Gaudi::Property nomMomentum{this, "beamMomentum", 275.0}; - - Gaudi::Property m_geoSvcName{this, "geoServiceName", "GeoSvc"}; - Gaudi::Property m_readout{this, "readoutClass", ""}; - Gaudi::Property m_layerField{this, "layerField", ""}; - Gaudi::Property m_sectorField{this, "sectorField", ""}; + Jug::Property local_x_offset_station_1{this, "localXOffsetSta1", -833.3878326}; + Jug::Property local_x_offset_station_2{this, "localXOffsetSta2", -924.342804}; + Jug::Property local_x_slope_offset{this, "localXSlopeOffset", -0.00622147}; + Jug::Property local_y_slope_offset{this, "localYSlopeOffset", -0.0451035}; + Jug::Property crossingAngle{this, "crossingAngle", -0.025}; + Jug::Property nomMomentum{this, "beamMomentum", 275.0}; + + Jug::Property m_geoSvcName{this, "geoServiceName", "GeoSvc"}; + Jug::Property m_readout{this, "readoutClass", ""}; + Jug::Property m_layerField{this, "layerField", ""}; + Jug::Property m_sectorField{this, "sectorField", ""}; SmartIF m_geoSvc; dd4hep::BitFieldCoder* id_dec = nullptr; size_t sector_idx{0}, layer_idx{0}; - Gaudi::Property m_localDetElement{this, "localDetElement", ""}; - Gaudi::Property> u_localDetFields{this, "localDetFields", {}}; + Jug::Property m_localDetElement{this, "localDetElement", ""}; + Jug::Property> u_localDetFields{this, "localDetFields", {}}; dd4hep::DetElement local; size_t local_mask = ~0; @@ -60,7 +60,7 @@ class FarForwardParticles : public GaudiAlgorithm { double aYRPinv[2][2] = {{0.0, 0.0}, {0.0, 0.0}}; public: - FarForwardParticles(const std::string& name, ISvcLocator* svcLoc) : GaudiAlgorithm(name, svcLoc) { + FarForwardParticles(const std::string& name, ISvcLocator* svcLoc) : JugAlgorithm(name, svcLoc) { declareProperty("inputCollection", m_inputHitCollection, "FarForwardTrackerHits"); declareProperty("outputCollection", m_outputParticles, "ReconstructedParticles"); } @@ -73,7 +73,7 @@ class FarForwardParticles : public GaudiAlgorithm { // include the Eigen libraries, used in ACTS, for the linear algebra. StatusCode initialize() override { - if (GaudiAlgorithm::initialize().isFailure()) { + if (JugAlgorithm::initialize().isFailure()) { return StatusCode::FAILURE; } m_geoSvc = service(m_geoSvcName); @@ -273,7 +273,5 @@ class FarForwardParticles : public GaudiAlgorithm { } }; -// NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables) -DECLARE_COMPONENT(FarForwardParticles) } // namespace Jug::Reco diff --git a/JugReco/src/components/FarForwardParticlesOMD.cpp b/JugReco/src/components/FarForwardParticlesOMD.cpp index 3a14f8c..72ef98b 100644 --- a/JugReco/src/components/FarForwardParticlesOMD.cpp +++ b/JugReco/src/components/FarForwardParticlesOMD.cpp @@ -5,11 +5,11 @@ #include #include -#include "Gaudi/Algorithm.h" -#include "GaudiAlg/GaudiTool.h" -#include "GaudiAlg/Producer.h" -#include "GaudiAlg/Transformer.h" -#include "GaudiKernel/RndmGenerators.h" +#include "Jug/Algorithm.h" +#include "JugAlg/JugTool.h" +#include "JugAlg/Producer.h" +#include "JugAlg/Transformer.h" +#include "JugKernel/RndmGenerators.h" #include "JugBase/DataHandle.h" @@ -20,20 +20,20 @@ namespace Jug::Reco { -class FarForwardParticlesOMD : public GaudiAlgorithm { +class FarForwardParticlesOMD : public JugAlgorithm { private: - DataHandle m_inputHitCollection{"FarForwardTrackerHits", Gaudi::DataHandle::Reader, this}; - DataHandle m_outputParticles{"outputParticles", Gaudi::DataHandle::Writer, + DataHandle m_inputHitCollection{"FarForwardTrackerHits", Jug::DataHandle::Reader, this}; + DataHandle m_outputParticles{"outputParticles", Jug::DataHandle::Writer, this}; //----- Define constants here ------ - Gaudi::Property local_x_offset_station_1{this, "localXOffsetSta1", -762.5006104}; - Gaudi::Property local_x_offset_station_2{this, "localXOffsetSta2", -881.9621277}; - Gaudi::Property local_x_slope_offset{this, "localXSlopeOffset", -59.73075865}; - Gaudi::Property local_y_slope_offset{this, "localYSlopeOffset", 0.0012755}; - Gaudi::Property crossingAngle{this, "crossingAngle", -0.025}; - Gaudi::Property nomMomentum{this, "beamMomentum", 137.5}; // This number is set to 50% maximum beam momentum + Jug::Property local_x_offset_station_1{this, "localXOffsetSta1", -762.5006104}; + Jug::Property local_x_offset_station_2{this, "localXOffsetSta2", -881.9621277}; + Jug::Property local_x_slope_offset{this, "localXSlopeOffset", -59.73075865}; + Jug::Property local_y_slope_offset{this, "localYSlopeOffset", 0.0012755}; + Jug::Property crossingAngle{this, "crossingAngle", -0.025}; + Jug::Property nomMomentum{this, "beamMomentum", 137.5}; // This number is set to 50% maximum beam momentum const double aXOMD[2][2] = {{1.6229248, 12.9519653}, {-2.86056525, 0.1830292}}; const double aYOMD[2][2] = {{0.0000185, -28.599739}, {0.00000925, -2.8795791}}; @@ -43,13 +43,13 @@ class FarForwardParticlesOMD : public GaudiAlgorithm { public: FarForwardParticlesOMD(const std::string& name, ISvcLocator* svcLoc) - : GaudiAlgorithm(name, svcLoc) { + : JugAlgorithm(name, svcLoc) { declareProperty("inputCollection", m_inputHitCollection, "FarForwardTrackerHits"); declareProperty("outputCollection", m_outputParticles, "ReconstructedParticles"); } StatusCode initialize() override { - if (GaudiAlgorithm::initialize().isFailure()) { + if (JugAlgorithm::initialize().isFailure()) { return StatusCode::FAILURE; } double det = aXOMD[0][0] * aXOMD[1][1] - aXOMD[0][1] * aXOMD[1][0]; @@ -182,7 +182,5 @@ class FarForwardParticlesOMD : public GaudiAlgorithm { } }; -// NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables) -DECLARE_COMPONENT(FarForwardParticlesOMD) } // namespace Jug::Reco diff --git a/JugReco/src/components/ImagingClusterReco.cpp b/JugReco/src/components/ImagingClusterReco.cpp index 5d78e7d..ec4675b 100644 --- a/JugReco/src/components/ImagingClusterReco.cpp +++ b/JugReco/src/components/ImagingClusterReco.cpp @@ -11,13 +11,13 @@ #include #include -#include "Gaudi/Property.h" -#include "GaudiAlg/GaudiAlgorithm.h" -#include "GaudiAlg/GaudiTool.h" -#include "GaudiAlg/Transformer.h" -#include "GaudiKernel/PhysicalConstants.h" -#include "GaudiKernel/RndmGenerators.h" -#include "GaudiKernel/ToolHandle.h" +#include "Jug/Property.h" +#include "JugAlg/JugAlgorithm.h" +#include "JugAlg/JugTool.h" +#include "JugAlg/Transformer.h" +#include "JugKernel/PhysicalConstants.h" +#include "JugKernel/RndmGenerators.h" +#include "JugKernel/ToolHandle.h" #include "DDRec/CellIDPositionConverter.h" #include "DDRec/Surface.h" @@ -37,7 +37,7 @@ #include "eicd/ProtoClusterCollection.h" #include "eicd/vector_utils.h" -using namespace Gaudi::Units; +using namespace Jug::Units; using namespace Eigen; namespace Jug::Reco { @@ -49,47 +49,47 @@ namespace Jug::Reco { * * \ingroup reco */ -class ImagingClusterReco : public GaudiAlgorithm { +class ImagingClusterReco : public JugAlgorithm { private: - Gaudi::Property m_trackStopLayer{this, "trackStopLayer", 9}; + Jug::Property m_trackStopLayer{this, "trackStopLayer", 9}; - DataHandle m_inputProtoClusters{"inputProtoClusters", Gaudi::DataHandle::Reader, this}; - DataHandle m_outputLayers{"outputLayers", Gaudi::DataHandle::Writer, this}; - DataHandle m_outputClusters{"outputClusters", Gaudi::DataHandle::Reader, this}; + DataHandle m_inputProtoClusters{"inputProtoClusters", Jug::DataHandle::Reader, this}; + DataHandle m_outputLayers{"outputLayers", Jug::DataHandle::Writer, this}; + DataHandle m_outputClusters{"outputClusters", Jug::DataHandle::Reader, this}; // Collection for MC hits when running on MC - Gaudi::Property m_mcHits{this, "mcHits", ""}; + Jug::Property m_mcHits{this, "mcHits", ""}; // Optional handle to MC hits std::unique_ptr> m_mcHits_ptr; // Collection for associations when running on MC - Gaudi::Property m_outputAssociations{this, "outputAssociations", ""}; + Jug::Property m_outputAssociations{this, "outputAssociations", ""}; // Optional handle to MC hits std::unique_ptr> m_outputAssociations_ptr; public: - ImagingClusterReco(const std::string& name, ISvcLocator* svcLoc) : GaudiAlgorithm(name, svcLoc) { + ImagingClusterReco(const std::string& name, ISvcLocator* svcLoc) : JugAlgorithm(name, svcLoc) { declareProperty("inputProtoClusters", m_inputProtoClusters, ""); declareProperty("outputLayers", m_outputLayers, ""); declareProperty("outputClusters", m_outputClusters, ""); } StatusCode initialize() override { - if (GaudiAlgorithm::initialize().isFailure()) { + if (JugAlgorithm::initialize().isFailure()) { return StatusCode::FAILURE; } // Initialize the optional MC input hit collection if requested if (m_mcHits != "") { m_mcHits_ptr = - std::make_unique>(m_mcHits, Gaudi::DataHandle::Reader, + std::make_unique>(m_mcHits, Jug::DataHandle::Reader, this); } // Initialize the optional association collection if requested if (m_outputAssociations != "") { m_outputAssociations_ptr = - std::make_unique>(m_outputAssociations, Gaudi::DataHandle::Writer, + std::make_unique>(m_outputAssociations, Jug::DataHandle::Writer, this); } @@ -348,7 +348,5 @@ class ImagingClusterReco : public GaudiAlgorithm { } }; -// NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables) -DECLARE_COMPONENT(ImagingClusterReco) } // namespace Jug::Reco diff --git a/JugReco/src/components/ImagingPixelDataCombiner.cpp b/JugReco/src/components/ImagingPixelDataCombiner.cpp index dc1c139..5f849b9 100644 --- a/JugReco/src/components/ImagingPixelDataCombiner.cpp +++ b/JugReco/src/components/ImagingPixelDataCombiner.cpp @@ -11,13 +11,13 @@ #include #include -#include "Gaudi/Property.h" -#include "GaudiAlg/GaudiAlgorithm.h" -#include "GaudiAlg/GaudiTool.h" -#include "GaudiAlg/Transformer.h" -#include "GaudiKernel/PhysicalConstants.h" -#include "GaudiKernel/RndmGenerators.h" -#include "GaudiKernel/ToolHandle.h" +#include "Jug/Property.h" +#include "JugAlg/JugAlgorithm.h" +#include "JugAlg/JugTool.h" +#include "JugAlg/Transformer.h" +#include "JugKernel/PhysicalConstants.h" +#include "JugKernel/RndmGenerators.h" +#include "JugKernel/ToolHandle.h" #include "DDRec/CellIDPositionConverter.h" #include "DDRec/Surface.h" @@ -31,7 +31,7 @@ #include "eicd/CalorimeterHitCollection.h" #include "eicd/vector_utils.h" -using namespace Gaudi::Units; +using namespace Jug::Units; namespace Jug::Reco { @@ -44,25 +44,25 @@ namespace Jug::Reco { * * \ingroup reco */ -class ImagingPixelDataCombiner : public GaudiAlgorithm { +class ImagingPixelDataCombiner : public JugAlgorithm { private: - Gaudi::Property m_layerIncrement{this, "layerIncrement", 0}; - Gaudi::Property m_rule{this, "rule", "concatenate"}; - DataHandle m_inputHits1{"inputHits1", Gaudi::DataHandle::Reader, this}; - DataHandle m_inputHits2{"inputHits2", Gaudi::DataHandle::Reader, this}; - DataHandle m_outputHits{"outputHits", Gaudi::DataHandle::Writer, this}; + Jug::Property m_layerIncrement{this, "layerIncrement", 0}; + Jug::Property m_rule{this, "rule", "concatenate"}; + DataHandle m_inputHits1{"inputHits1", Jug::DataHandle::Reader, this}; + DataHandle m_inputHits2{"inputHits2", Jug::DataHandle::Reader, this}; + DataHandle m_outputHits{"outputHits", Jug::DataHandle::Writer, this}; std::vector supported_rules{"concatenate", "interlayer"}; public: ImagingPixelDataCombiner(const std::string& name, ISvcLocator* svcLoc) - : GaudiAlgorithm(name, svcLoc) { + : JugAlgorithm(name, svcLoc) { declareProperty("inputHits1", m_inputHits1, ""); declareProperty("inputHits2", m_inputHits2, ""); declareProperty("outputHits", m_outputHits, ""); } StatusCode initialize() override { - if (GaudiAlgorithm::initialize().isFailure()) { + if (JugAlgorithm::initialize().isFailure()) { return StatusCode::FAILURE; } @@ -156,7 +156,5 @@ class ImagingPixelDataCombiner : public GaudiAlgorithm { }; // class ImagingPixelDataCombiner -// NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables) -DECLARE_COMPONENT(ImagingPixelDataCombiner) } // namespace Jug::Reco diff --git a/JugReco/src/components/ImagingPixelDataSorter.cpp b/JugReco/src/components/ImagingPixelDataSorter.cpp index 84cea6c..f47225f 100644 --- a/JugReco/src/components/ImagingPixelDataSorter.cpp +++ b/JugReco/src/components/ImagingPixelDataSorter.cpp @@ -10,13 +10,13 @@ #include #include -#include "Gaudi/Property.h" -#include "GaudiAlg/GaudiAlgorithm.h" -#include "GaudiAlg/GaudiTool.h" -#include "GaudiAlg/Transformer.h" -#include "GaudiKernel/PhysicalConstants.h" -#include "GaudiKernel/RndmGenerators.h" -#include "GaudiKernel/ToolHandle.h" +#include "Jug/Property.h" +#include "JugAlg/JugAlgorithm.h" +#include "JugAlg/JugTool.h" +#include "JugAlg/Transformer.h" +#include "JugKernel/PhysicalConstants.h" +#include "JugKernel/RndmGenerators.h" +#include "JugKernel/ToolHandle.h" #include "DDRec/CellIDPositionConverter.h" #include "DDRec/Surface.h" @@ -31,7 +31,7 @@ #include "eicd/CalorimeterHit.h" #include "eicd/CalorimeterHitCollection.h" -using namespace Gaudi::Units; +using namespace Jug::Units; namespace Jug::Reco { @@ -44,18 +44,18 @@ namespace Jug::Reco { * * \ingroup reco */ - class ImagingPixelDataSorter : public GaudiAlgorithm { + class ImagingPixelDataSorter : public JugAlgorithm { private: - Gaudi::Property m_nLayers{this, "numberOfLayers", 9}; - Gaudi::Property m_nHits{this, "numberOfHits", 50}; + Jug::Property m_nLayers{this, "numberOfLayers", 9}; + Jug::Property m_nHits{this, "numberOfHits", 50}; DataHandle m_inputHitCollection{"inputHitCollection", - Gaudi::DataHandle::Reader, this}; + Jug::DataHandle::Reader, this}; DataHandle m_outputHitCollection{"outputHitCollection", - Gaudi::DataHandle::Writer, this}; + Jug::DataHandle::Writer, this}; public: ImagingPixelDataSorter(const std::string& name, ISvcLocator* svcLoc) - : GaudiAlgorithm(name, svcLoc) + : JugAlgorithm(name, svcLoc) { declareProperty("inputHitCollection", m_inputHitCollection, ""); declareProperty("outputHitCollection", m_outputHitCollection, ""); @@ -63,7 +63,7 @@ namespace Jug::Reco { StatusCode initialize() override { - if (GaudiAlgorithm::initialize().isFailure()) { + if (JugAlgorithm::initialize().isFailure()) { return StatusCode::FAILURE; } @@ -116,7 +116,5 @@ namespace Jug::Reco { }; // class ImagingPixelDataSorter - // NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables) - DECLARE_COMPONENT(ImagingPixelDataSorter) } // namespace Jug::Reco diff --git a/JugReco/src/components/ImagingPixelMerger.cpp b/JugReco/src/components/ImagingPixelMerger.cpp index f641a94..7b8248c 100644 --- a/JugReco/src/components/ImagingPixelMerger.cpp +++ b/JugReco/src/components/ImagingPixelMerger.cpp @@ -14,13 +14,13 @@ #include #include -#include "Gaudi/Property.h" -#include "GaudiAlg/GaudiAlgorithm.h" -#include "GaudiAlg/GaudiTool.h" -#include "GaudiAlg/Transformer.h" -#include "GaudiKernel/PhysicalConstants.h" -#include "GaudiKernel/RndmGenerators.h" -#include "GaudiKernel/ToolHandle.h" +#include "Jug/Property.h" +#include "JugAlg/JugAlgorithm.h" +#include "JugAlg/JugTool.h" +#include "JugAlg/Transformer.h" +#include "JugKernel/PhysicalConstants.h" +#include "JugKernel/RndmGenerators.h" +#include "JugKernel/ToolHandle.h" #include "DDRec/CellIDPositionConverter.h" #include "DDRec/Surface.h" @@ -34,7 +34,7 @@ #include "eicd/CalorimeterHitCollection.h" #include -using namespace Gaudi::Units; +using namespace Jug::Units; struct PairHashFunction { template std::size_t operator()(const std::pair& pair) const { @@ -52,21 +52,21 @@ namespace Jug::Reco { * * \ingroup reco */ -class ImagingPixelMerger : public GaudiAlgorithm { +class ImagingPixelMerger : public JugAlgorithm { private: - Gaudi::Property m_etaSize{this, "etaSize", 0.001}; - Gaudi::Property m_phiSize{this, "phiSize", 0.001}; - DataHandle m_inputHits{"inputHits", Gaudi::DataHandle::Reader, this}; - DataHandle m_outputHits{"outputHits", Gaudi::DataHandle::Writer, this}; + Jug::Property m_etaSize{this, "etaSize", 0.001}; + Jug::Property m_phiSize{this, "phiSize", 0.001}; + DataHandle m_inputHits{"inputHits", Jug::DataHandle::Reader, this}; + DataHandle m_outputHits{"outputHits", Jug::DataHandle::Writer, this}; public: - ImagingPixelMerger(const std::string& name, ISvcLocator* svcLoc) : GaudiAlgorithm(name, svcLoc) { + ImagingPixelMerger(const std::string& name, ISvcLocator* svcLoc) : JugAlgorithm(name, svcLoc) { declareProperty("inputHits", m_inputHits, ""); declareProperty("outputHits", m_outputHits, ""); } StatusCode initialize() override { - if (GaudiAlgorithm::initialize().isFailure()) { + if (JugAlgorithm::initialize().isFailure()) { return StatusCode::FAILURE; } @@ -165,7 +165,5 @@ class ImagingPixelMerger : public GaudiAlgorithm { } }; // class ImagingPixelMerger -// NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables) -DECLARE_COMPONENT(ImagingPixelMerger) } // namespace Jug::Reco diff --git a/JugReco/src/components/ImagingPixelReco.cpp b/JugReco/src/components/ImagingPixelReco.cpp index 5ab8318..40e2011 100644 --- a/JugReco/src/components/ImagingPixelReco.cpp +++ b/JugReco/src/components/ImagingPixelReco.cpp @@ -8,13 +8,13 @@ #include #include -#include "Gaudi/Property.h" -#include "GaudiAlg/GaudiAlgorithm.h" -#include "GaudiAlg/GaudiTool.h" -#include "GaudiAlg/Transformer.h" -#include "GaudiKernel/PhysicalConstants.h" -#include "GaudiKernel/RndmGenerators.h" -#include "GaudiKernel/ToolHandle.h" +#include "Jug/Property.h" +#include "JugAlg/JugAlgorithm.h" +#include "JugAlg/JugTool.h" +#include "JugAlg/Transformer.h" +#include "JugKernel/PhysicalConstants.h" +#include "JugKernel/RndmGenerators.h" +#include "JugKernel/ToolHandle.h" #include "DDRec/CellIDPositionConverter.h" #include "DDRec/Surface.h" @@ -27,7 +27,7 @@ #include "eicd/CalorimeterHitCollection.h" #include "eicd/RawCalorimeterHitCollection.h" -using namespace Gaudi::Units; +using namespace Jug::Units; namespace Jug::Reco { @@ -38,31 +38,31 @@ namespace Jug::Reco { * * \ingroup reco */ -class ImagingPixelReco : public GaudiAlgorithm { +class ImagingPixelReco : public JugAlgorithm { private: // geometry service - Gaudi::Property m_geoSvcName{this, "geoServiceName", "GeoSvc"}; - Gaudi::Property m_readout{this, "readoutClass", ""}; - Gaudi::Property m_layerField{this, "layerField", "layer"}; - Gaudi::Property m_sectorField{this, "sectorField", "sector"}; + Jug::Property m_geoSvcName{this, "geoServiceName", "GeoSvc"}; + Jug::Property m_readout{this, "readoutClass", ""}; + Jug::Property m_layerField{this, "layerField", "layer"}; + Jug::Property m_sectorField{this, "sectorField", "sector"}; // length unit (from dd4hep geometry service) - Gaudi::Property m_lUnit{this, "lengthUnit", dd4hep::mm}; + Jug::Property m_lUnit{this, "lengthUnit", dd4hep::mm}; // digitization parameters - Gaudi::Property m_capADC{this, "capacityADC", 8096}; - Gaudi::Property m_pedMeanADC{this, "pedestalMean", 400}; - Gaudi::Property m_dyRangeADC{this, "dynamicRangeADC", 100 * MeV}; - Gaudi::Property m_pedSigmaADC{this, "pedestalSigma", 3.2}; - Gaudi::Property m_thresholdADC{this, "thresholdFactor", 3.0}; + Jug::Property m_capADC{this, "capacityADC", 8096}; + Jug::Property m_pedMeanADC{this, "pedestalMean", 400}; + Jug::Property m_dyRangeADC{this, "dynamicRangeADC", 100 * MeV}; + Jug::Property m_pedSigmaADC{this, "pedestalSigma", 3.2}; + Jug::Property m_thresholdADC{this, "thresholdFactor", 3.0}; // Calibration! - Gaudi::Property m_sampFrac{this, "samplingFraction", 1.0}; + Jug::Property m_sampFrac{this, "samplingFraction", 1.0}; // unitless counterparts for the input parameters double dyRangeADC{0}; // hits containers - DataHandle m_inputHitCollection{"inputHitCollection", Gaudi::DataHandle::Reader, + DataHandle m_inputHitCollection{"inputHitCollection", Jug::DataHandle::Reader, this}; - DataHandle m_outputHitCollection{"outputHitCollection", Gaudi::DataHandle::Writer, + DataHandle m_outputHitCollection{"outputHitCollection", Jug::DataHandle::Writer, this}; // Pointer to the geometry service @@ -72,13 +72,13 @@ class ImagingPixelReco : public GaudiAlgorithm { size_t sector_idx{0}, layer_idx{0}; public: - ImagingPixelReco(const std::string& name, ISvcLocator* svcLoc) : GaudiAlgorithm(name, svcLoc) { + ImagingPixelReco(const std::string& name, ISvcLocator* svcLoc) : JugAlgorithm(name, svcLoc) { declareProperty("inputHitCollection", m_inputHitCollection, ""); declareProperty("outputHitCollection", m_outputHitCollection, ""); } StatusCode initialize() override { - if (GaudiAlgorithm::initialize().isFailure()) { + if (JugAlgorithm::initialize().isFailure()) { return StatusCode::FAILURE; } m_geoSvc = service(m_geoSvcName); @@ -166,7 +166,5 @@ class ImagingPixelReco : public GaudiAlgorithm { } }; -// NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables) -DECLARE_COMPONENT(ImagingPixelReco) } // namespace Jug::Reco diff --git a/JugReco/src/components/ImagingTopoCluster.cpp b/JugReco/src/components/ImagingTopoCluster.cpp index 39cd0f7..6ad0a16 100644 --- a/JugReco/src/components/ImagingTopoCluster.cpp +++ b/JugReco/src/components/ImagingTopoCluster.cpp @@ -12,13 +12,13 @@ #include "fmt/format.h" #include -#include "Gaudi/Property.h" -#include "GaudiAlg/GaudiAlgorithm.h" -#include "GaudiAlg/GaudiTool.h" -#include "GaudiAlg/Transformer.h" -#include "GaudiKernel/PhysicalConstants.h" -#include "GaudiKernel/RndmGenerators.h" -#include "GaudiKernel/ToolHandle.h" +#include "Jug/Property.h" +#include "JugAlg/JugAlgorithm.h" +#include "JugAlg/JugTool.h" +#include "JugAlg/Transformer.h" +#include "JugKernel/PhysicalConstants.h" +#include "JugKernel/RndmGenerators.h" +#include "JugKernel/ToolHandle.h" #include "DD4hep/BitFieldCoder.h" #include "DDRec/CellIDPositionConverter.h" @@ -34,7 +34,7 @@ #include "eicd/ProtoClusterCollection.h" #include "eicd/vector_utils.h" -using namespace Gaudi::Units; +using namespace Jug::Units; namespace Jug::Reco { @@ -48,44 +48,44 @@ namespace Jug::Reco { * * \ingroup reco */ -class ImagingTopoCluster : public GaudiAlgorithm { +class ImagingTopoCluster : public JugAlgorithm { private: // maximum difference in layer numbers that can be considered as neighbours - Gaudi::Property m_neighbourLayersRange{this, "neighbourLayersRange", 1}; + Jug::Property m_neighbourLayersRange{this, "neighbourLayersRange", 1}; // maximum distance of local (x, y) to be considered as neighbors at the same layer - Gaudi::Property> u_localDistXY{this, "localDistXY", {1.0 * mm, 1.0 * mm}}; + Jug::Property> u_localDistXY{this, "localDistXY", {1.0 * mm, 1.0 * mm}}; // maximum distance of global (eta, phi) to be considered as neighbors at different layers - Gaudi::Property> u_layerDistEtaPhi{this, "layerDistEtaPhi", {0.01, 0.01}}; + Jug::Property> u_layerDistEtaPhi{this, "layerDistEtaPhi", {0.01, 0.01}}; // maximum global distance to be considered as neighbors in different sectors - Gaudi::Property m_sectorDist{this, "sectorDist", 1.0 * cm}; + Jug::Property m_sectorDist{this, "sectorDist", 1.0 * cm}; // minimum hit energy to participate clustering - Gaudi::Property m_minClusterHitEdep{this, "minClusterHitEdep", 0.}; + Jug::Property m_minClusterHitEdep{this, "minClusterHitEdep", 0.}; // minimum cluster center energy (to be considered as a seed for cluster) - Gaudi::Property m_minClusterCenterEdep{this, "minClusterCenterEdep", 0.}; + Jug::Property m_minClusterCenterEdep{this, "minClusterCenterEdep", 0.}; // minimum cluster energy (to save this cluster) - Gaudi::Property m_minClusterEdep{this, "minClusterEdep", 0.5 * MeV}; + Jug::Property m_minClusterEdep{this, "minClusterEdep", 0.5 * MeV}; // minimum number of hits (to save this cluster) - Gaudi::Property m_minClusterNhits{this, "minClusterNhits", 10}; + Jug::Property m_minClusterNhits{this, "minClusterNhits", 10}; // input hits collection - DataHandle m_inputHitCollection{"inputHitCollection", Gaudi::DataHandle::Reader, + DataHandle m_inputHitCollection{"inputHitCollection", Jug::DataHandle::Reader, this}; // output clustered hits DataHandle m_outputProtoClusterCollection{"outputProtoClusterCollection", - Gaudi::DataHandle::Writer, this}; + Jug::DataHandle::Writer, this}; // unitless counterparts of the input parameters double localDistXY[2]{0,0}, layerDistEtaPhi[2]{0,0}, sectorDist{0}; double minClusterHitEdep{0}, minClusterCenterEdep{0}, minClusterEdep{0}, minClusterNhits{0}; public: - ImagingTopoCluster(const std::string& name, ISvcLocator* svcLoc) : GaudiAlgorithm(name, svcLoc) { + ImagingTopoCluster(const std::string& name, ISvcLocator* svcLoc) : JugAlgorithm(name, svcLoc) { declareProperty("inputHitCollection", m_inputHitCollection, ""); declareProperty("outputProtoClusterCollection", m_outputProtoClusterCollection, ""); } StatusCode initialize() override { - if (GaudiAlgorithm::initialize().isFailure()) { + if (JugAlgorithm::initialize().isFailure()) { return StatusCode::FAILURE; } @@ -228,7 +228,5 @@ class ImagingTopoCluster : public GaudiAlgorithm { } }; // namespace Jug::Reco -// NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables) -DECLARE_COMPONENT(ImagingTopoCluster) } // namespace Jug::Reco diff --git a/JugReco/src/components/InclusiveKinematicsDA.cpp b/JugReco/src/components/InclusiveKinematicsDA.cpp index fb165d6..952f559 100644 --- a/JugReco/src/components/InclusiveKinematicsDA.cpp +++ b/JugReco/src/components/InclusiveKinematicsDA.cpp @@ -1,12 +1,12 @@ // SPDX-License-Identifier: LGPL-3.0-or-later // Copyright (C) 2022 Wouter Deconinck -#include "Gaudi/Algorithm.h" -#include "GaudiAlg/GaudiTool.h" -#include "GaudiAlg/Producer.h" -#include "GaudiAlg/Transformer.h" -#include "GaudiKernel/RndmGenerators.h" -#include "GaudiKernel/PhysicalConstants.h" +#include "Jug/Algorithm.h" +#include "JugAlg/JugTool.h" +#include "JugAlg/Producer.h" +#include "JugAlg/Transformer.h" +#include "JugKernel/RndmGenerators.h" +#include "JugKernel/PhysicalConstants.h" #include #include @@ -27,33 +27,33 @@ using ROOT::Math::PxPyPzEVector; namespace Jug::Reco { -class InclusiveKinematicsDA : public GaudiAlgorithm { +class InclusiveKinematicsDA : public JugAlgorithm { private: DataHandle m_inputMCParticleCollection{ "inputMCParticles", - Gaudi::DataHandle::Reader, + Jug::DataHandle::Reader, this}; DataHandle m_inputParticleCollection{ "inputReconstructedParticles", - Gaudi::DataHandle::Reader, + Jug::DataHandle::Reader, this}; DataHandle m_inputParticleAssociation{ "inputParticleAssociations", - Gaudi::DataHandle::Reader, + Jug::DataHandle::Reader, this}; DataHandle m_outputInclusiveKinematicsCollection{ "outputInclusiveKinematics", - Gaudi::DataHandle::Writer, + Jug::DataHandle::Writer, this}; - Gaudi::Property m_crossingAngle{this, "crossingAngle", -0.025 * Gaudi::Units::radian}; + Jug::Property m_crossingAngle{this, "crossingAngle", -0.025 * Jug::Units::radian}; SmartIF m_pidSvc; double m_proton{0}, m_neutron{0}, m_electron{0}; public: InclusiveKinematicsDA(const std::string& name, ISvcLocator* svcLoc) - : GaudiAlgorithm(name, svcLoc) { + : JugAlgorithm(name, svcLoc) { declareProperty("inputMCParticles", m_inputMCParticleCollection, "MCParticles"); declareProperty("inputReconstructedParticles", m_inputParticleCollection, "ReconstructedParticles"); declareProperty("inputParticleAssociations", m_inputParticleAssociation, "MCRecoParticleAssociation"); @@ -61,7 +61,7 @@ class InclusiveKinematicsDA : public GaudiAlgorithm { } StatusCode initialize() override { - if (GaudiAlgorithm::initialize().isFailure()) + if (JugAlgorithm::initialize().isFailure()) return StatusCode::FAILURE; m_pidSvc = service("ParticleSvc"); @@ -232,7 +232,5 @@ class InclusiveKinematicsDA : public GaudiAlgorithm { } }; -// NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables) -DECLARE_COMPONENT(InclusiveKinematicsDA) } // namespace Jug::Reco diff --git a/JugReco/src/components/InclusiveKinematicsElectron.cpp b/JugReco/src/components/InclusiveKinematicsElectron.cpp index e16ad98..62513e1 100644 --- a/JugReco/src/components/InclusiveKinematicsElectron.cpp +++ b/JugReco/src/components/InclusiveKinematicsElectron.cpp @@ -1,12 +1,12 @@ // SPDX-License-Identifier: LGPL-3.0-or-later // Copyright (C) 2022 Wouter Deconinck -#include "Gaudi/Algorithm.h" -#include "GaudiAlg/GaudiTool.h" -#include "GaudiAlg/Producer.h" -#include "GaudiAlg/Transformer.h" -#include "GaudiKernel/RndmGenerators.h" -#include "GaudiKernel/PhysicalConstants.h" +#include "Jug/Algorithm.h" +#include "JugAlg/JugTool.h" +#include "JugAlg/Producer.h" +#include "JugAlg/Transformer.h" +#include "JugKernel/RndmGenerators.h" +#include "JugKernel/PhysicalConstants.h" #include #include @@ -27,33 +27,33 @@ using ROOT::Math::PxPyPzEVector; namespace Jug::Reco { -class InclusiveKinematicsElectron : public GaudiAlgorithm { +class InclusiveKinematicsElectron : public JugAlgorithm { private: DataHandle m_inputMCParticleCollection{ "inputMCParticles", - Gaudi::DataHandle::Reader, + Jug::DataHandle::Reader, this}; DataHandle m_inputParticleCollection{ "inputReconstructedParticles", - Gaudi::DataHandle::Reader, + Jug::DataHandle::Reader, this}; DataHandle m_inputParticleAssociation{ "inputParticleAssociations", - Gaudi::DataHandle::Reader, + Jug::DataHandle::Reader, this}; DataHandle m_outputInclusiveKinematicsCollection{ "outputInclusiveKinematics", - Gaudi::DataHandle::Writer, + Jug::DataHandle::Writer, this}; - Gaudi::Property m_crossingAngle{this, "crossingAngle", -0.025 * Gaudi::Units::radian}; + Jug::Property m_crossingAngle{this, "crossingAngle", -0.025 * Jug::Units::radian}; SmartIF m_pidSvc; double m_proton{0}, m_neutron{0}, m_electron{0}; public: InclusiveKinematicsElectron(const std::string& name, ISvcLocator* svcLoc) - : GaudiAlgorithm(name, svcLoc) { + : JugAlgorithm(name, svcLoc) { declareProperty("inputMCParticles", m_inputMCParticleCollection, "MCParticles"); declareProperty("inputReconstructedParticles", m_inputParticleCollection, "ReconstructedParticles"); declareProperty("inputParticleAssociations", m_inputParticleAssociation, "MCRecoParticleAssociation"); @@ -61,7 +61,7 @@ class InclusiveKinematicsElectron : public GaudiAlgorithm { } StatusCode initialize() override { - if (GaudiAlgorithm::initialize().isFailure()) + if (JugAlgorithm::initialize().isFailure()) return StatusCode::FAILURE; m_pidSvc = service("ParticleSvc"); @@ -243,7 +243,5 @@ class InclusiveKinematicsElectron : public GaudiAlgorithm { } }; -// NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables) -DECLARE_COMPONENT(InclusiveKinematicsElectron) } // namespace Jug::Reco diff --git a/JugReco/src/components/InclusiveKinematicsJB.cpp b/JugReco/src/components/InclusiveKinematicsJB.cpp index 3eb9af3..3e6bb59 100644 --- a/JugReco/src/components/InclusiveKinematicsJB.cpp +++ b/JugReco/src/components/InclusiveKinematicsJB.cpp @@ -1,12 +1,12 @@ // SPDX-License-Identifier: LGPL-3.0-or-later // Copyright (C) 2022 Wouter Deconinck -#include "Gaudi/Algorithm.h" -#include "GaudiAlg/GaudiTool.h" -#include "GaudiAlg/Producer.h" -#include "GaudiAlg/Transformer.h" -#include "GaudiKernel/PhysicalConstants.h" -#include "GaudiKernel/RndmGenerators.h" +#include "Jug/Algorithm.h" +#include "JugAlg/JugTool.h" +#include "JugAlg/Producer.h" +#include "JugAlg/Transformer.h" +#include "JugKernel/PhysicalConstants.h" +#include "JugKernel/RndmGenerators.h" #include #include @@ -27,33 +27,33 @@ using ROOT::Math::PxPyPzEVector; namespace Jug::Reco { -class InclusiveKinematicsJB : public GaudiAlgorithm { +class InclusiveKinematicsJB : public JugAlgorithm { private: DataHandle m_inputMCParticleCollection{ "inputMCParticles", - Gaudi::DataHandle::Reader, + Jug::DataHandle::Reader, this}; DataHandle m_inputParticleCollection{ "inputReconstructedParticles", - Gaudi::DataHandle::Reader, + Jug::DataHandle::Reader, this}; DataHandle m_inputParticleAssociation{ "inputParticleAssociations", - Gaudi::DataHandle::Reader, + Jug::DataHandle::Reader, this}; DataHandle m_outputInclusiveKinematicsCollection{ "outputInclusiveKinematics", - Gaudi::DataHandle::Writer, + Jug::DataHandle::Writer, this}; - Gaudi::Property m_crossingAngle{this, "crossingAngle", -0.025 * Gaudi::Units::radian}; + Jug::Property m_crossingAngle{this, "crossingAngle", -0.025 * Jug::Units::radian}; SmartIF m_pidSvc; double m_proton{0}, m_neutron{0}, m_electron{0}; public: InclusiveKinematicsJB(const std::string& name, ISvcLocator* svcLoc) - : GaudiAlgorithm(name, svcLoc) { + : JugAlgorithm(name, svcLoc) { declareProperty("inputMCParticles", m_inputMCParticleCollection, "MCParticles"); declareProperty("inputReconstructedParticles", m_inputParticleCollection, "ReconstructedParticles"); declareProperty("inputParticleAssociations", m_inputParticleAssociation, "MCRecoParticleAssociation"); @@ -61,7 +61,7 @@ class InclusiveKinematicsJB : public GaudiAlgorithm { } StatusCode initialize() override { - if (GaudiAlgorithm::initialize().isFailure()) + if (JugAlgorithm::initialize().isFailure()) return StatusCode::FAILURE; m_pidSvc = service("ParticleSvc"); @@ -225,7 +225,5 @@ class InclusiveKinematicsJB : public GaudiAlgorithm { } }; -// NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables) -DECLARE_COMPONENT(InclusiveKinematicsJB) } // namespace Jug::Reco diff --git a/JugReco/src/components/InclusiveKinematicsSigma.cpp b/JugReco/src/components/InclusiveKinematicsSigma.cpp index 8070171..30fff2d 100644 --- a/JugReco/src/components/InclusiveKinematicsSigma.cpp +++ b/JugReco/src/components/InclusiveKinematicsSigma.cpp @@ -1,12 +1,12 @@ // SPDX-License-Identifier: LGPL-3.0-or-later // Copyright (C) 2022 Wouter Deconinck, Barak Schmookler -#include "Gaudi/Algorithm.h" -#include "GaudiAlg/GaudiTool.h" -#include "GaudiAlg/Producer.h" -#include "GaudiAlg/Transformer.h" -#include "GaudiKernel/RndmGenerators.h" -#include "GaudiKernel/PhysicalConstants.h" +#include "Jug/Algorithm.h" +#include "JugAlg/JugTool.h" +#include "JugAlg/Producer.h" +#include "JugAlg/Transformer.h" +#include "JugKernel/RndmGenerators.h" +#include "JugKernel/PhysicalConstants.h" #include #include @@ -27,33 +27,33 @@ using ROOT::Math::PxPyPzEVector; namespace Jug::Reco { -class InclusiveKinematicsSigma : public GaudiAlgorithm { +class InclusiveKinematicsSigma : public JugAlgorithm { private: DataHandle m_inputMCParticleCollection{ "inputMCParticles", - Gaudi::DataHandle::Reader, + Jug::DataHandle::Reader, this}; DataHandle m_inputParticleCollection{ "inputReconstructedParticles", - Gaudi::DataHandle::Reader, + Jug::DataHandle::Reader, this}; DataHandle m_inputParticleAssociation{ "inputParticleAssociations", - Gaudi::DataHandle::Reader, + Jug::DataHandle::Reader, this}; DataHandle m_outputInclusiveKinematicsCollection{ "outputInclusiveKinematics", - Gaudi::DataHandle::Writer, + Jug::DataHandle::Writer, this}; - Gaudi::Property m_crossingAngle{this, "crossingAngle", -0.025 * Gaudi::Units::radian}; + Jug::Property m_crossingAngle{this, "crossingAngle", -0.025 * Jug::Units::radian}; SmartIF m_pidSvc; double m_proton{0}, m_neutron{0}, m_electron{0}; public: InclusiveKinematicsSigma(const std::string& name, ISvcLocator* svcLoc) - : GaudiAlgorithm(name, svcLoc) { + : JugAlgorithm(name, svcLoc) { declareProperty("inputMCParticles", m_inputMCParticleCollection, "MCParticles"); declareProperty("inputReconstructedParticles", m_inputParticleCollection, "ReconstructedParticles"); declareProperty("inputParticleAssociations", m_inputParticleAssociation, "MCRecoParticleAssociation"); @@ -61,7 +61,7 @@ class InclusiveKinematicsSigma : public GaudiAlgorithm { } StatusCode initialize() override { - if (GaudiAlgorithm::initialize().isFailure()) + if (JugAlgorithm::initialize().isFailure()) return StatusCode::FAILURE; m_pidSvc = service("ParticleSvc"); @@ -232,7 +232,5 @@ class InclusiveKinematicsSigma : public GaudiAlgorithm { } }; -// NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables) -DECLARE_COMPONENT(InclusiveKinematicsSigma) } // namespace Jug::Reco diff --git a/JugReco/src/components/InclusiveKinematicseSigma.cpp b/JugReco/src/components/InclusiveKinematicseSigma.cpp index 1fca536..0182261 100644 --- a/JugReco/src/components/InclusiveKinematicseSigma.cpp +++ b/JugReco/src/components/InclusiveKinematicseSigma.cpp @@ -1,12 +1,12 @@ // SPDX-License-Identifier: LGPL-3.0-or-later // Copyright (C) 2022 Wouter Deconinck, Barak Schmookler -#include "Gaudi/Algorithm.h" -#include "GaudiAlg/GaudiTool.h" -#include "GaudiAlg/Producer.h" -#include "GaudiAlg/Transformer.h" -#include "GaudiKernel/RndmGenerators.h" -#include "GaudiKernel/PhysicalConstants.h" +#include "Jug/Algorithm.h" +#include "JugAlg/JugTool.h" +#include "JugAlg/Producer.h" +#include "JugAlg/Transformer.h" +#include "JugKernel/RndmGenerators.h" +#include "JugKernel/PhysicalConstants.h" #include #include @@ -27,33 +27,33 @@ using ROOT::Math::PxPyPzEVector; namespace Jug::Reco { -class InclusiveKinematicseSigma : public GaudiAlgorithm { +class InclusiveKinematicseSigma : public JugAlgorithm { private: DataHandle m_inputMCParticleCollection{ "inputMCParticles", - Gaudi::DataHandle::Reader, + Jug::DataHandle::Reader, this}; DataHandle m_inputParticleCollection{ "inputReconstructedParticles", - Gaudi::DataHandle::Reader, + Jug::DataHandle::Reader, this}; DataHandle m_inputParticleAssociation{ "inputParticleAssociations", - Gaudi::DataHandle::Reader, + Jug::DataHandle::Reader, this}; DataHandle m_outputInclusiveKinematicsCollection{ "outputInclusiveKinematics", - Gaudi::DataHandle::Writer, + Jug::DataHandle::Writer, this}; - Gaudi::Property m_crossingAngle{this, "crossingAngle", -0.025 * Gaudi::Units::radian}; + Jug::Property m_crossingAngle{this, "crossingAngle", -0.025 * Jug::Units::radian}; SmartIF m_pidSvc; double m_proton{0}, m_neutron{0}, m_electron{0}; public: InclusiveKinematicseSigma(const std::string& name, ISvcLocator* svcLoc) - : GaudiAlgorithm(name, svcLoc) { + : JugAlgorithm(name, svcLoc) { declareProperty("inputMCParticles", m_inputMCParticleCollection, "MCParticles"); declareProperty("inputReconstructedParticles", m_inputParticleCollection, "ReconstructedParticles"); declareProperty("inputParticleAssociations", m_inputParticleAssociation, "MCRecoParticleAssociation"); @@ -61,7 +61,7 @@ class InclusiveKinematicseSigma : public GaudiAlgorithm { } StatusCode initialize() override { - if (GaudiAlgorithm::initialize().isFailure()) + if (JugAlgorithm::initialize().isFailure()) return StatusCode::FAILURE; m_pidSvc = service("ParticleSvc"); @@ -241,7 +241,5 @@ class InclusiveKinematicseSigma : public GaudiAlgorithm { } }; -// NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables) -DECLARE_COMPONENT(InclusiveKinematicseSigma) } // namespace Jug::Reco diff --git a/JugReco/src/components/ParticleCollector.cpp b/JugReco/src/components/ParticleCollector.cpp index 24e28b5..e7cf356 100644 --- a/JugReco/src/components/ParticleCollector.cpp +++ b/JugReco/src/components/ParticleCollector.cpp @@ -1,11 +1,11 @@ // SPDX-License-Identifier: LGPL-3.0-or-later // Copyright (C) 2022 Sylvester Joosten, Whitney Armstrong -// Gaudi -#include "Gaudi/Property.h" -#include "GaudiAlg/GaudiAlgorithm.h" -#include "GaudiAlg/GaudiTool.h" -#include "GaudiAlg/Transformer.h" +// Jug +#include "Jug/Property.h" +#include "JugAlg/JugAlgorithm.h" +#include "JugAlg/JugTool.h" +#include "JugAlg/Transformer.h" #include "JugBase/DataHandle.h" @@ -21,16 +21,16 @@ namespace Jug::Reco { * * \ingroup reco */ -class ParticleCollector : public GaudiAlgorithm { +class ParticleCollector : public JugAlgorithm { private: - Gaudi::Property> m_inputParticles{this, "inputParticles", {}, "Particles to be aggregated"}; - DataHandle m_outputParticles{"outputParticles", Gaudi::DataHandle::Writer, + Jug::Property> m_inputParticles{this, "inputParticles", {}, "Particles to be aggregated"}; + DataHandle m_outputParticles{"outputParticles", Jug::DataHandle::Writer, this}; std::vector*> m_particleCollections; public: - ParticleCollector(const std::string& name, ISvcLocator* svcLoc) : GaudiAlgorithm(name, svcLoc) { + ParticleCollector(const std::string& name, ISvcLocator* svcLoc) : JugAlgorithm(name, svcLoc) { declareProperty("outputParticles", m_outputParticles, "output particles combined into single collection"); } ~ParticleCollector() { @@ -40,13 +40,13 @@ class ParticleCollector : public GaudiAlgorithm { } StatusCode initialize() override { - if (GaudiAlgorithm::initialize().isFailure()) { + if (JugAlgorithm::initialize().isFailure()) { return StatusCode::FAILURE; } for (auto colname : m_inputParticles) { debug() << "initializing collection: " << colname << endmsg; m_particleCollections.push_back( - new DataHandle{colname, Gaudi::DataHandle::Reader, this}); + new DataHandle{colname, Jug::DataHandle::Reader, this}); } return StatusCode::SUCCESS; } @@ -69,7 +69,5 @@ class ParticleCollector : public GaudiAlgorithm { return StatusCode::SUCCESS; } }; -// NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables) -DECLARE_COMPONENT(ParticleCollector) } // namespace Jug::Reco diff --git a/JugReco/src/components/PhotoMultiplierReco.cpp b/JugReco/src/components/PhotoMultiplierReco.cpp index 141446b..60da683 100644 --- a/JugReco/src/components/PhotoMultiplierReco.cpp +++ b/JugReco/src/components/PhotoMultiplierReco.cpp @@ -12,13 +12,13 @@ #include -#include "Gaudi/Property.h" -#include "GaudiAlg/GaudiAlgorithm.h" -#include "GaudiAlg/GaudiTool.h" -#include "GaudiAlg/Transformer.h" -#include "GaudiKernel/PhysicalConstants.h" -#include "GaudiKernel/RndmGenerators.h" -#include "GaudiKernel/ToolHandle.h" +#include "Jug/Property.h" +#include "JugAlg/JugAlgorithm.h" +#include "JugAlg/JugTool.h" +#include "JugAlg/Transformer.h" +#include "JugKernel/PhysicalConstants.h" +#include "JugKernel/RndmGenerators.h" +#include "JugKernel/ToolHandle.h" #include "DDRec/CellIDPositionConverter.h" #include "DDRec/Surface.h" @@ -31,7 +31,7 @@ #include "eicd/PMTHitCollection.h" #include "eicd/RawPMTHitCollection.h" -using namespace Gaudi::Units; +using namespace Jug::Units; namespace Jug::Reco { @@ -42,26 +42,26 @@ namespace Jug::Reco { * * \ingroup reco */ -class PhotoMultiplierReco : public GaudiAlgorithm { +class PhotoMultiplierReco : public JugAlgorithm { private: - DataHandle m_inputHitCollection{"inputHitCollection", Gaudi::DataHandle::Reader, this}; - DataHandle m_outputHitCollection{"outputHitCollection", Gaudi::DataHandle::Writer, this}; - Gaudi::Property m_timeStep{this, "timeStep", 0.0625 * ns}; - Gaudi::Property m_minNpe{this, "minNpe", 0.0}; - Gaudi::Property m_speMean{this, "speMean", 80.0}; - Gaudi::Property m_pedMean{this, "pedMean", 200.0}; + DataHandle m_inputHitCollection{"inputHitCollection", Jug::DataHandle::Reader, this}; + DataHandle m_outputHitCollection{"outputHitCollection", Jug::DataHandle::Writer, this}; + Jug::Property m_timeStep{this, "timeStep", 0.0625 * ns}; + Jug::Property m_minNpe{this, "minNpe", 0.0}; + Jug::Property m_speMean{this, "speMean", 80.0}; + Jug::Property m_pedMean{this, "pedMean", 200.0}; /// Pointer to the geometry service SmartIF m_geoSvc; public: - // ill-formed: using GaudiAlgorithm::GaudiAlgorithm; - PhotoMultiplierReco(const std::string& name, ISvcLocator* svcLoc) : GaudiAlgorithm(name, svcLoc) { + // ill-formed: using JugAlgorithm::JugAlgorithm; + PhotoMultiplierReco(const std::string& name, ISvcLocator* svcLoc) : JugAlgorithm(name, svcLoc) { declareProperty("inputHitCollection", m_inputHitCollection, ""); declareProperty("outputHitCollection", m_outputHitCollection, ""); } StatusCode initialize() override { - if (GaudiAlgorithm::initialize().isFailure()) { + if (JugAlgorithm::initialize().isFailure()) { return StatusCode::FAILURE; } m_geoSvc = service("GeoSvc"); @@ -107,7 +107,5 @@ class PhotoMultiplierReco : public GaudiAlgorithm { } }; -// NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables) -DECLARE_COMPONENT(PhotoMultiplierReco) } // namespace Jug::Reco diff --git a/JugReco/src/components/SimpleClustering.cpp b/JugReco/src/components/SimpleClustering.cpp index 446a736..4bc8bda 100644 --- a/JugReco/src/components/SimpleClustering.cpp +++ b/JugReco/src/components/SimpleClustering.cpp @@ -3,13 +3,13 @@ #include -#include "Gaudi/Property.h" -#include "GaudiAlg/GaudiAlgorithm.h" -#include "GaudiAlg/GaudiTool.h" -#include "GaudiAlg/Transformer.h" -#include "GaudiKernel/PhysicalConstants.h" -#include "GaudiKernel/RndmGenerators.h" -#include "GaudiKernel/ToolHandle.h" +#include "Jug/Property.h" +#include "JugAlg/JugAlgorithm.h" +#include "JugAlg/JugTool.h" +#include "JugAlg/Transformer.h" +#include "JugKernel/PhysicalConstants.h" +#include "JugKernel/RndmGenerators.h" +#include "JugKernel/ToolHandle.h" #include "DDRec/CellIDPositionConverter.h" #include "DDRec/Surface.h" @@ -26,7 +26,7 @@ #include "eicd/RawCalorimeterHitCollection.h" #include "eicd/vector_utils.h" -using namespace Gaudi::Units; +using namespace Jug::Units; namespace Jug::Reco { @@ -34,20 +34,20 @@ namespace Jug::Reco { * * \ingroup reco */ - class SimpleClustering : public GaudiAlgorithm { + class SimpleClustering : public JugAlgorithm { private: using RecHits = eicd::CalorimeterHitCollection; using ProtoClusters = eicd::ProtoClusterCollection; using Clusters = eicd::ClusterCollection; - DataHandle m_inputHitCollection{"inputHitCollection", Gaudi::DataHandle::Reader, this}; - DataHandle m_outputProtoClusters{"outputProtoCluster", Gaudi::DataHandle::Writer, this}; - DataHandle m_outputClusters{"outputClusterCollection", Gaudi::DataHandle::Writer, this}; + DataHandle m_inputHitCollection{"inputHitCollection", Jug::DataHandle::Reader, this}; + DataHandle m_outputProtoClusters{"outputProtoCluster", Jug::DataHandle::Writer, this}; + DataHandle m_outputClusters{"outputClusterCollection", Jug::DataHandle::Writer, this}; - Gaudi::Property m_mcHits{this, "mcHits", ""}; + Jug::Property m_mcHits{this, "mcHits", ""}; - Gaudi::Property m_minModuleEdep{this, "minModuleEdep", 5.0 * MeV}; - Gaudi::Property m_maxDistance{this, "maxDistance", 20.0 * cm}; + Jug::Property m_minModuleEdep{this, "minModuleEdep", 5.0 * MeV}; + Jug::Property m_maxDistance{this, "maxDistance", 20.0 * cm}; /// Pointer to the geometry service SmartIF m_geoSvc; @@ -57,7 +57,7 @@ namespace Jug::Reco { public: SimpleClustering(const std::string& name, ISvcLocator* svcLoc) - : GaudiAlgorithm(name, svcLoc) { + : JugAlgorithm(name, svcLoc) { declareProperty("inputHitCollection", m_inputHitCollection, ""); declareProperty("outputProtoClusterCollection", m_outputClusters, "Output proto clusters"); declareProperty("outputClusterCollection", m_outputClusters, "Output clusters"); @@ -65,13 +65,13 @@ namespace Jug::Reco { StatusCode initialize() override { - if (GaudiAlgorithm::initialize().isFailure()) { + if (JugAlgorithm::initialize().isFailure()) { return StatusCode::FAILURE; } // Initialize the MC input hit collection if requested if (m_mcHits != "") { m_inputMC = - std::make_unique>(m_mcHits, Gaudi::DataHandle::Reader, this); + std::make_unique>(m_mcHits, Jug::DataHandle::Reader, this); } m_geoSvc = service("GeoSvc"); if (!m_geoSvc) { @@ -179,7 +179,5 @@ namespace Jug::Reco { } }; - // NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables) - DECLARE_COMPONENT(SimpleClustering) } // namespace Jug::Reco diff --git a/JugReco/src/components/TrackerHitReconstruction.cpp b/JugReco/src/components/TrackerHitReconstruction.cpp index b669208..20e9657 100644 --- a/JugReco/src/components/TrackerHitReconstruction.cpp +++ b/JugReco/src/components/TrackerHitReconstruction.cpp @@ -3,13 +3,13 @@ #include -// Gaudi -#include "GaudiAlg/GaudiAlgorithm.h" -//#include "GaudiKernel/ToolHandle.h" -#include "Gaudi/Property.h" -#include "GaudiAlg/GaudiTool.h" -#include "GaudiAlg/Transformer.h" -#include "GaudiKernel/RndmGenerators.h" +// Jug +#include "JugAlg/JugAlgorithm.h" +//#include "JugKernel/ToolHandle.h" +#include "Jug/Property.h" +#include "JugAlg/JugTool.h" +#include "JugAlg/Transformer.h" +#include "JugKernel/RndmGenerators.h" #include "DD4hep/DD4hepUnits.h" #include "DDRec/CellIDPositionConverter.h" @@ -20,7 +20,7 @@ #include "JugBase/IGeoSvc.h" // Event Model related classes -//#include "GaudiExamples/MyTrack.h" +//#include "JugExamples/MyTrack.h" #include "eicd/RawTrackerHitCollection.h" #include "eicd/TrackerHitCollection.h" @@ -43,26 +43,26 @@ namespace Jug::Reco { * * \ingroup reco */ - class TrackerHitReconstruction : public GaudiAlgorithm { + class TrackerHitReconstruction : public JugAlgorithm { private: - Gaudi::Property m_timeResolution{this, "timeResolution", 10}; // in ns - DataHandle m_inputHitCollection{"inputHitCollection", Gaudi::DataHandle::Reader, + Jug::Property m_timeResolution{this, "timeResolution", 10}; // in ns + DataHandle m_inputHitCollection{"inputHitCollection", Jug::DataHandle::Reader, this}; - DataHandle m_outputHitCollection{"outputHitCollection", Gaudi::DataHandle::Writer, + DataHandle m_outputHitCollection{"outputHitCollection", Jug::DataHandle::Writer, this}; /// Pointer to the geometry service SmartIF m_geoSvc; public: - // ill-formed: using GaudiAlgorithm::GaudiAlgorithm; - TrackerHitReconstruction(const std::string& name, ISvcLocator* svcLoc) : GaudiAlgorithm(name, svcLoc) { + // ill-formed: using JugAlgorithm::JugAlgorithm; + TrackerHitReconstruction(const std::string& name, ISvcLocator* svcLoc) : JugAlgorithm(name, svcLoc) { declareProperty("inputHitCollection", m_inputHitCollection, ""); declareProperty("outputHitCollection", m_outputHitCollection, ""); } StatusCode initialize() override { - if (GaudiAlgorithm::initialize().isFailure()) { + if (JugAlgorithm::initialize().isFailure()) { return StatusCode::FAILURE; } m_geoSvc = service("GeoSvc"); @@ -120,7 +120,5 @@ namespace Jug::Reco { return StatusCode::SUCCESS; } }; - // NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables) - DECLARE_COMPONENT(TrackerHitReconstruction) } // namespace Jug::Reco diff --git a/JugReco/src/components/TrackingHitsCollector.cpp b/JugReco/src/components/TrackingHitsCollector.cpp index 2172314..2a84a71 100644 --- a/JugReco/src/components/TrackingHitsCollector.cpp +++ b/JugReco/src/components/TrackingHitsCollector.cpp @@ -1,11 +1,11 @@ // SPDX-License-Identifier: LGPL-3.0-or-later // Copyright (C) 2022 Whitney Armstrong, Sylvester Joosten, Chao Peng -// Gaudi -#include "GaudiAlg/GaudiAlgorithm.h" -#include "Gaudi/Property.h" -#include "GaudiAlg/GaudiTool.h" -#include "GaudiAlg/Transformer.h" +// Jug +#include "JugAlg/JugAlgorithm.h" +#include "Jug/Property.h" +#include "JugAlg/JugTool.h" +#include "JugAlg/Transformer.h" #include "JugBase/DataHandle.h" @@ -18,18 +18,18 @@ namespace Jug::Reco { * * \ingroup reco */ - class TrackingHitsCollector : public GaudiAlgorithm { + class TrackingHitsCollector : public JugAlgorithm { private: - DataHandle m_trackerBarrelHits{"trackerBarrelHits", Gaudi::DataHandle::Reader, this}; - DataHandle m_trackerEndcapHits{"trackerEndcapHits", Gaudi::DataHandle::Reader, this}; - DataHandle m_vertexBarrelHits {"vertexBarrelHits" , Gaudi::DataHandle::Reader, this}; - DataHandle m_vertexEndcapHits {"vertexEndcapHits" , Gaudi::DataHandle::Reader, this}; - DataHandle m_gemEndcapHits {"gemEndcapHits" , Gaudi::DataHandle::Reader, this}; - DataHandle m_outputHitCollection{"outputHitCollection", Gaudi::DataHandle::Writer, this}; + DataHandle m_trackerBarrelHits{"trackerBarrelHits", Jug::DataHandle::Reader, this}; + DataHandle m_trackerEndcapHits{"trackerEndcapHits", Jug::DataHandle::Reader, this}; + DataHandle m_vertexBarrelHits {"vertexBarrelHits" , Jug::DataHandle::Reader, this}; + DataHandle m_vertexEndcapHits {"vertexEndcapHits" , Jug::DataHandle::Reader, this}; + DataHandle m_gemEndcapHits {"gemEndcapHits" , Jug::DataHandle::Reader, this}; + DataHandle m_outputHitCollection{"outputHitCollection", Jug::DataHandle::Writer, this}; public: TrackingHitsCollector(const std::string& name, ISvcLocator* svcLoc) - : GaudiAlgorithm(name, svcLoc) + : JugAlgorithm(name, svcLoc) { declareProperty("trackerBarrelHits", m_trackerBarrelHits, ""); declareProperty("trackerEndcapHits", m_trackerEndcapHits, ""); @@ -66,7 +66,5 @@ namespace Jug::Reco { return StatusCode::SUCCESS; } }; - // NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables) - DECLARE_COMPONENT(TrackingHitsCollector) } // namespace Jug::Reco diff --git a/JugReco/src/components/TrackingHitsCollector2.cpp b/JugReco/src/components/TrackingHitsCollector2.cpp index da51534..fd86bb8 100644 --- a/JugReco/src/components/TrackingHitsCollector2.cpp +++ b/JugReco/src/components/TrackingHitsCollector2.cpp @@ -1,11 +1,11 @@ // SPDX-License-Identifier: LGPL-3.0-or-later // Copyright (C) 2022 Whitney Armstrong, Sylvester Joosten, Wouter Deconinck -// Gaudi -#include "GaudiAlg/GaudiAlgorithm.h" -#include "Gaudi/Property.h" -#include "GaudiAlg/GaudiTool.h" -#include "GaudiAlg/Transformer.h" +// Jug +#include "JugAlg/JugAlgorithm.h" +#include "Jug/Property.h" +#include "JugAlg/JugTool.h" +#include "JugAlg/Transformer.h" #include "JugBase/DataHandle.h" @@ -21,16 +21,16 @@ namespace Jug::Reco { * * \ingroup reco */ - class TrackingHitsCollector2 : public GaudiAlgorithm { + class TrackingHitsCollector2 : public JugAlgorithm { private: - Gaudi::Property> m_inputTrackingHits{this, "inputTrackingHits", {},"Tracker hits to be aggregated"}; - DataHandle m_trackingHits{"trackingHits", Gaudi::DataHandle::Writer, this}; + Jug::Property> m_inputTrackingHits{this, "inputTrackingHits", {},"Tracker hits to be aggregated"}; + DataHandle m_trackingHits{"trackingHits", Jug::DataHandle::Writer, this}; std::vector*> m_hitCollections; public: TrackingHitsCollector2(const std::string& name, ISvcLocator* svcLoc) - : GaudiAlgorithm(name, svcLoc) + : JugAlgorithm(name, svcLoc) { declareProperty("trackingHits", m_trackingHits, "output hits combined into single collection"); } @@ -41,12 +41,12 @@ namespace Jug::Reco { } StatusCode initialize() override { - if (GaudiAlgorithm::initialize().isFailure()) { + if (JugAlgorithm::initialize().isFailure()) { return StatusCode::FAILURE; } for (auto colname : m_inputTrackingHits) { debug() << "initializing collection: " << colname << endmsg; - m_hitCollections.push_back(new DataHandle{colname, Gaudi::DataHandle::Reader, this}); + m_hitCollections.push_back(new DataHandle{colname, Jug::DataHandle::Reader, this}); } return StatusCode::SUCCESS; } @@ -70,7 +70,5 @@ namespace Jug::Reco { return StatusCode::SUCCESS; } }; - // NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables) - DECLARE_COMPONENT(TrackingHitsCollector2) } // namespace Jug::Reco diff --git a/JugTrack/CMakeLists.txt b/JugTrack/CMakeLists.txt index fc6bf33..e045196 100644 --- a/JugTrack/CMakeLists.txt +++ b/JugTrack/CMakeLists.txt @@ -6,11 +6,8 @@ ################################################################################ file(GLOB JugTrackPlugins_sources CONFIGURE_DEPENDS src/components/*.cpp) -gaudi_add_module(JugTrackPlugins - SOURCES - ${JugTrackPlugins_sources} - LINK - Gaudi::GaudiAlgLib Gaudi::GaudiKernel +add_library(JugTrackPlugins ${JugTrackPlugins_sources}) +target_link_libraries(JugTrackPlugins JugBase ROOT::Core ROOT::RIO ROOT::Tree EDM4HEP::edm4hep diff --git a/JugTrack/src/components/CKFTracking.cpp b/JugTrack/src/components/CKFTracking.cpp index adabc3d..9c4c0ff 100644 --- a/JugTrack/src/components/CKFTracking.cpp +++ b/JugTrack/src/components/CKFTracking.cpp @@ -3,13 +3,13 @@ #include "CKFTracking.h" -// Gaudi -#include "GaudiAlg/GaudiAlgorithm.h" -#include "GaudiKernel/ToolHandle.h" -#include "GaudiAlg/Transformer.h" -#include "GaudiAlg/GaudiTool.h" -#include "GaudiKernel/RndmGenerators.h" -#include "Gaudi/Property.h" +// Jug +#include "JugAlg/JugAlgorithm.h" +#include "JugKernel/ToolHandle.h" +#include "JugAlg/Transformer.h" +#include "JugAlg/JugTool.h" +#include "JugKernel/RndmGenerators.h" +#include "Jug/Property.h" #include "DDRec/CellIDPositionConverter.h" #include "DDRec/SurfaceManager.h" @@ -63,7 +63,7 @@ namespace Jug::Reco { using namespace Acts::UnitLiterals; CKFTracking::CKFTracking(const std::string& name, ISvcLocator* svcLoc) - : GaudiAlgorithm(name, svcLoc) + : JugAlgorithm(name, svcLoc) { declareProperty("inputSourceLinks", m_inputSourceLinks, ""); declareProperty("inputMeasurements", m_inputMeasurements, ""); @@ -73,7 +73,7 @@ namespace Jug::Reco { StatusCode CKFTracking::initialize() { - if (GaudiAlgorithm::initialize().isFailure()) { + if (JugAlgorithm::initialize().isFailure()) { return StatusCode::FAILURE; } m_geoSvc = service("GeoSvc"); @@ -169,6 +169,4 @@ namespace Jug::Reco { return StatusCode::SUCCESS; } - // NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables) - DECLARE_COMPONENT(CKFTracking) } // namespace Jug::Reco diff --git a/JugTrack/src/components/CKFTracking.h b/JugTrack/src/components/CKFTracking.h index ead37d2..5cd20cb 100644 --- a/JugTrack/src/components/CKFTracking.h +++ b/JugTrack/src/components/CKFTracking.h @@ -9,9 +9,9 @@ #include #include -#include "Gaudi/Property.h" -#include "GaudiAlg/GaudiAlgorithm.h" -#include "GaudiKernel/ToolHandle.h" +#include "Jug/Property.h" +#include "JugAlg/JugAlgorithm.h" +#include "JugKernel/ToolHandle.h" #include "JugBase/DataHandle.h" #include "JugBase/IGeoSvc.h" @@ -36,7 +36,7 @@ namespace Jug::Reco { * * \ingroup tracking */ -class CKFTracking : public GaudiAlgorithm { +class CKFTracking : public JugAlgorithm { public: /// Track finder function that takes input measurements, initial trackstate /// and track finder options and returns some track-finder-specific result. @@ -61,15 +61,15 @@ class CKFTracking : public GaudiAlgorithm { std::shared_ptr magneticField); public: - DataHandle m_inputSourceLinks{"inputSourceLinks", Gaudi::DataHandle::Reader, this}; - DataHandle m_inputMeasurements{"inputMeasurements", Gaudi::DataHandle::Reader, this}; + DataHandle m_inputSourceLinks{"inputSourceLinks", Jug::DataHandle::Reader, this}; + DataHandle m_inputMeasurements{"inputMeasurements", Jug::DataHandle::Reader, this}; DataHandle m_inputInitialTrackParameters{"inputInitialTrackParameters", - Gaudi::DataHandle::Reader, this}; - DataHandle m_outputTrajectories{"outputTrajectories", Gaudi::DataHandle::Writer, this}; + Jug::DataHandle::Reader, this}; + DataHandle m_outputTrajectories{"outputTrajectories", Jug::DataHandle::Writer, this}; - Gaudi::Property> m_etaBins{this, "etaBins", {}}; - Gaudi::Property> m_chi2CutOff{this, "chi2CutOff", {15.}}; - Gaudi::Property> m_numMeasurementsCutOff{this, "numMeasurementsCutOff", {10}}; + Jug::Property> m_etaBins{this, "etaBins", {}}; + Jug::Property> m_chi2CutOff{this, "chi2CutOff", {15.}}; + Jug::Property> m_numMeasurementsCutOff{this, "numMeasurementsCutOff", {10}}; std::shared_ptr m_trackFinderFunc; SmartIF m_geoSvc; diff --git a/JugTrack/src/components/ConformalXYPeakProtoTracks.cpp b/JugTrack/src/components/ConformalXYPeakProtoTracks.cpp index 5ee7719..33c2d21 100644 --- a/JugTrack/src/components/ConformalXYPeakProtoTracks.cpp +++ b/JugTrack/src/components/ConformalXYPeakProtoTracks.cpp @@ -2,12 +2,12 @@ // Copyright (C) 2022 Whitney Armstrong, Sylvester Joosten #include -// Gaudi -#include "Gaudi/Property.h" -#include "GaudiAlg/GaudiAlgorithm.h" -#include "GaudiAlg/GaudiTool.h" -#include "GaudiAlg/Transformer.h" -#include "GaudiKernel/ToolHandle.h" +// Jug +#include "Jug/Property.h" +#include "JugAlg/JugAlgorithm.h" +#include "JugAlg/JugTool.h" +#include "JugAlg/Transformer.h" +#include "JugKernel/ToolHandle.h" #include "JugBase/DataHandle.h" #include "JugBase/IGeoSvc.h" @@ -28,25 +28,25 @@ namespace Jug::Reco { * * \ingroup tracking */ -class ConformalXYPeakProtoTracks : public GaudiAlgorithm { +class ConformalXYPeakProtoTracks : public JugAlgorithm { private: - DataHandle m_inputTrackerHits{"inputTrackerHits", Gaudi::DataHandle::Reader, this}; - DataHandle m_outputProtoTracks{"outputProtoTracks", Gaudi::DataHandle::Writer, this}; - DataHandle m_nProtoTracks{"nProtoTracks", Gaudi::DataHandle::Writer, this}; + DataHandle m_inputTrackerHits{"inputTrackerHits", Jug::DataHandle::Reader, this}; + DataHandle m_outputProtoTracks{"outputProtoTracks", Jug::DataHandle::Writer, this}; + DataHandle m_nProtoTracks{"nProtoTracks", Jug::DataHandle::Writer, this}; - Gaudi::Property m_nPhiBins{this, "nPhiBins", 100}; + Jug::Property m_nPhiBins{this, "nPhiBins", 100}; using ConformalHit = ROOT::Math::XYVector; public: - ConformalXYPeakProtoTracks(const std::string& name, ISvcLocator* svcLoc) : GaudiAlgorithm(name, svcLoc) { + ConformalXYPeakProtoTracks(const std::string& name, ISvcLocator* svcLoc) : JugAlgorithm(name, svcLoc) { declareProperty("inputTrackerHits", m_inputTrackerHits, "tracker hits whose indices are used in proto-tracks"); declareProperty("outputProtoTracks", m_outputProtoTracks, "grouped hit indicies"); declareProperty("nProtoTracks", m_nProtoTracks, "number of proto tracks"); } StatusCode initialize() override { - if (GaudiAlgorithm::initialize().isFailure()) { + if (JugAlgorithm::initialize().isFailure()) { return StatusCode::FAILURE; } return StatusCode::SUCCESS; @@ -110,7 +110,5 @@ class ConformalXYPeakProtoTracks : public GaudiAlgorithm { return StatusCode::SUCCESS; } }; -// NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables) -DECLARE_COMPONENT(ConformalXYPeakProtoTracks) } // namespace Jug::Reco diff --git a/JugTrack/src/components/FinderAlgoTemplate.cpp b/JugTrack/src/components/FinderAlgoTemplate.cpp index 0425abd..9eae465 100644 --- a/JugTrack/src/components/FinderAlgoTemplate.cpp +++ b/JugTrack/src/components/FinderAlgoTemplate.cpp @@ -2,12 +2,12 @@ // Copyright (C) 2022 Whitney Armstrong #include -// Gaudi -#include "Gaudi/Property.h" -#include "GaudiAlg/GaudiAlgorithm.h" -#include "GaudiAlg/GaudiTool.h" -#include "GaudiAlg/Transformer.h" -#include "GaudiKernel/ToolHandle.h" +// Jug +#include "Jug/Property.h" +#include "JugAlg/JugAlgorithm.h" +#include "JugAlg/JugTool.h" +#include "JugAlg/Transformer.h" +#include "JugKernel/ToolHandle.h" #include "JugBase/DataHandle.h" #include "JugBase/IGeoSvc.h" @@ -24,19 +24,19 @@ namespace Jug::Reco { * * \ingroup tracking */ -class FinderAlgoTemplate : public GaudiAlgorithm { +class FinderAlgoTemplate : public JugAlgorithm { private: - DataHandle m_inputTrackerHits{"inputTrackerHits", Gaudi::DataHandle::Reader, this}; - DataHandle m_outputProtoTracks{"outputProtoTracks", Gaudi::DataHandle::Writer, this}; + DataHandle m_inputTrackerHits{"inputTrackerHits", Jug::DataHandle::Reader, this}; + DataHandle m_outputProtoTracks{"outputProtoTracks", Jug::DataHandle::Writer, this}; public: - FinderAlgoTemplate(const std::string& name, ISvcLocator* svcLoc) : GaudiAlgorithm(name, svcLoc) { + FinderAlgoTemplate(const std::string& name, ISvcLocator* svcLoc) : JugAlgorithm(name, svcLoc) { declareProperty("inputTrackerHits", m_inputTrackerHits, "tracker hits whose indices are used in proto-tracks"); declareProperty("outputProtoTracks", m_outputProtoTracks, "grouped hit indicies"); } StatusCode initialize() override { - if (GaudiAlgorithm::initialize().isFailure()) { + if (JugAlgorithm::initialize().isFailure()) { return StatusCode::FAILURE; } return StatusCode::SUCCESS; @@ -51,7 +51,5 @@ class FinderAlgoTemplate : public GaudiAlgorithm { return StatusCode::SUCCESS; } }; -// NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables) -DECLARE_COMPONENT(FinderAlgoTemplate) } // namespace Jug::Reco diff --git a/JugTrack/src/components/GenFitTrackFitter.cpp b/JugTrack/src/components/GenFitTrackFitter.cpp index f8c52aa..5a68529 100644 --- a/JugTrack/src/components/GenFitTrackFitter.cpp +++ b/JugTrack/src/components/GenFitTrackFitter.cpp @@ -2,13 +2,13 @@ // Copyright (C) 2022 Whitney Armstrong, Sylvester Joosten #include "GenFitTrackFitter.h" -// Gaudi -#include "Gaudi/Property.h" -#include "GaudiAlg/GaudiAlgorithm.h" -#include "GaudiAlg/GaudiTool.h" -#include "GaudiAlg/Transformer.h" -#include "GaudiKernel/RndmGenerators.h" -#include "GaudiKernel/ToolHandle.h" +// Jug +#include "Jug/Property.h" +#include "JugAlg/JugAlgorithm.h" +#include "JugAlg/JugTool.h" +#include "JugAlg/Transformer.h" +#include "JugKernel/RndmGenerators.h" +#include "JugKernel/ToolHandle.h" #include "DDRec/CellIDPositionConverter.h" #include "DDRec/Surface.h" @@ -57,7 +57,7 @@ namespace Jug::Reco { -GenFitTrackFitter::GenFitTrackFitter(const std::string& name, ISvcLocator* svcLoc) : GaudiAlgorithm(name, svcLoc) { +GenFitTrackFitter::GenFitTrackFitter(const std::string& name, ISvcLocator* svcLoc) : JugAlgorithm(name, svcLoc) { declareProperty("inputHitCollection", m_inputHitCollection, ""); declareProperty("initialTrackParameters", m_initialTrackParameters, ""); declareProperty("inputProtoTracks", m_inputProtoTracks, ""); @@ -66,7 +66,7 @@ GenFitTrackFitter::GenFitTrackFitter(const std::string& name, ISvcLocator* svcLo } StatusCode GenFitTrackFitter::initialize() { - if (GaudiAlgorithm::initialize().isFailure()) { + if (JugAlgorithm::initialize().isFailure()) { return StatusCode::FAILURE; } m_geoSvc = service("GeoSvc"); @@ -303,6 +303,4 @@ StatusCode GenFitTrackFitter::execute() { return StatusCode::SUCCESS; } -// NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables) -DECLARE_COMPONENT(GenFitTrackFitter) } // namespace Jug::Reco diff --git a/JugTrack/src/components/GenFitTrackFitter.h b/JugTrack/src/components/GenFitTrackFitter.h index 8f2e254..ff3ffb6 100644 --- a/JugTrack/src/components/GenFitTrackFitter.h +++ b/JugTrack/src/components/GenFitTrackFitter.h @@ -8,10 +8,10 @@ #include #include -// Gaudi -#include "GaudiAlg/GaudiAlgorithm.h" -#include "GaudiKernel/ToolHandle.h" -#include "Gaudi/Property.h" +// Jug +#include "JugAlg/JugAlgorithm.h" +#include "JugKernel/ToolHandle.h" +#include "Jug/Property.h" #include "JugBase/DataHandle.h" #include "JugBase/IGeoSvc.h" @@ -40,7 +40,7 @@ namespace Jug::Reco { * * \ingroup tracking */ - class GenFitTrackFitter : public GaudiAlgorithm { + class GenFitTrackFitter : public JugAlgorithm { public: class FieldImp : public genfit::AbsBField { @@ -77,11 +77,11 @@ namespace Jug::Reco { }; public: - DataHandle m_inputHitCollection{"inputHitCollection", Gaudi::DataHandle::Reader, this}; - DataHandle m_initialTrackParameters{"initialTrackParameters", Gaudi::DataHandle::Reader, this}; - DataHandle m_inputProtoTracks{"inputProtoTracks", Gaudi::DataHandle::Reader, this}; - DataHandle m_foundTracks{"trackParameters", Gaudi::DataHandle::Reader, this}; - DataHandle m_outputTrajectories{"outputTrajectories", Gaudi::DataHandle::Writer, this}; + DataHandle m_inputHitCollection{"inputHitCollection", Jug::DataHandle::Reader, this}; + DataHandle m_initialTrackParameters{"initialTrackParameters", Jug::DataHandle::Reader, this}; + DataHandle m_inputProtoTracks{"inputProtoTracks", Jug::DataHandle::Reader, this}; + DataHandle m_foundTracks{"trackParameters", Jug::DataHandle::Reader, this}; + DataHandle m_outputTrajectories{"outputTrajectories", Jug::DataHandle::Writer, this}; SmartIF m_geoSvc; // Acts::GeometryContext m_geoctx; diff --git a/JugTrack/src/components/HoughTransformProtoTracks.cpp b/JugTrack/src/components/HoughTransformProtoTracks.cpp index 1816b73..b4bfa45 100644 --- a/JugTrack/src/components/HoughTransformProtoTracks.cpp +++ b/JugTrack/src/components/HoughTransformProtoTracks.cpp @@ -2,12 +2,12 @@ // Copyright (C) 2022 Whitney Armstrong #include -// Gaudi -#include "Gaudi/Property.h" -#include "GaudiAlg/GaudiAlgorithm.h" -#include "GaudiAlg/GaudiTool.h" -#include "GaudiAlg/Transformer.h" -#include "GaudiKernel/ToolHandle.h" +// Jug +#include "Jug/Property.h" +#include "JugAlg/JugAlgorithm.h" +#include "JugAlg/JugTool.h" +#include "JugAlg/Transformer.h" +#include "JugKernel/ToolHandle.h" #include "JugBase/DataHandle.h" #include "JugBase/IGeoSvc.h" @@ -24,19 +24,19 @@ namespace Jug::Reco { * * \ingroup tracking */ -class HoughTransformProtoTracks : public GaudiAlgorithm { +class HoughTransformProtoTracks : public JugAlgorithm { private: - DataHandle m_inputTrackerHits{"inputTrackerHits", Gaudi::DataHandle::Reader, this}; - DataHandle m_outputProtoTracks{"outputProtoTracks", Gaudi::DataHandle::Writer, this}; + DataHandle m_inputTrackerHits{"inputTrackerHits", Jug::DataHandle::Reader, this}; + DataHandle m_outputProtoTracks{"outputProtoTracks", Jug::DataHandle::Writer, this}; public: - HoughTransformProtoTracks(const std::string& name, ISvcLocator* svcLoc) : GaudiAlgorithm(name, svcLoc) { + HoughTransformProtoTracks(const std::string& name, ISvcLocator* svcLoc) : JugAlgorithm(name, svcLoc) { declareProperty("inputTrackerHits", m_inputTrackerHits, "tracker hits whose indices are used in proto-tracks"); declareProperty("outputProtoTracks", m_outputProtoTracks, "grouped hit indicies"); } StatusCode initialize() override { - if (GaudiAlgorithm::initialize().isFailure()) + if (JugAlgorithm::initialize().isFailure()) return StatusCode::FAILURE; return StatusCode::SUCCESS; } @@ -50,7 +50,5 @@ class HoughTransformProtoTracks : public GaudiAlgorithm { return StatusCode::SUCCESS; } }; -// NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables) -DECLARE_COMPONENT(HoughTransformProtoTracks) } // namespace Jug::Reco diff --git a/JugTrack/src/components/ParticlesFromTrackFit.cpp b/JugTrack/src/components/ParticlesFromTrackFit.cpp index 46af359..d44d573 100644 --- a/JugTrack/src/components/ParticlesFromTrackFit.cpp +++ b/JugTrack/src/components/ParticlesFromTrackFit.cpp @@ -3,13 +3,13 @@ #include -// Gaudi -#include "GaudiAlg/GaudiAlgorithm.h" -#include "GaudiKernel/ToolHandle.h" -#include "GaudiAlg/Transformer.h" -#include "GaudiAlg/GaudiTool.h" -#include "GaudiKernel/RndmGenerators.h" -#include "Gaudi/Property.h" +// Jug +#include "JugAlg/JugAlgorithm.h" +#include "JugKernel/ToolHandle.h" +#include "JugAlg/Transformer.h" +#include "JugAlg/JugTool.h" +#include "JugKernel/RndmGenerators.h" +#include "Jug/Property.h" #include "DDRec/CellIDPositionConverter.h" #include "DDRec/SurfaceManager.h" @@ -41,23 +41,23 @@ namespace Jug::Reco { * * \ingroup tracking */ - class ParticlesFromTrackFit : public GaudiAlgorithm { + class ParticlesFromTrackFit : public JugAlgorithm { private: - DataHandle m_inputTrajectories{"inputTrajectories", Gaudi::DataHandle::Reader, this}; - DataHandle m_outputParticles{"outputParticles", Gaudi::DataHandle::Writer, this}; - DataHandle m_outputTrackParameters{"outputTrackParameters", Gaudi::DataHandle::Writer, this}; + DataHandle m_inputTrajectories{"inputTrajectories", Jug::DataHandle::Reader, this}; + DataHandle m_outputParticles{"outputParticles", Jug::DataHandle::Writer, this}; + DataHandle m_outputTrackParameters{"outputTrackParameters", Jug::DataHandle::Writer, this}; public: - // ill-formed: using GaudiAlgorithm::GaudiAlgorithm; + // ill-formed: using JugAlgorithm::JugAlgorithm; ParticlesFromTrackFit(const std::string& name, ISvcLocator* svcLoc) - : GaudiAlgorithm(name, svcLoc) { + : JugAlgorithm(name, svcLoc) { declareProperty("inputTrajectories", m_inputTrajectories,""); declareProperty("outputParticles", m_outputParticles, ""); declareProperty("outputTrackParameters", m_outputTrackParameters, "Acts Track Parameters"); } StatusCode initialize() override { - if (GaudiAlgorithm::initialize().isFailure()) { + if (JugAlgorithm::initialize().isFailure()) { return StatusCode::FAILURE; } return StatusCode::SUCCESS; @@ -186,7 +186,5 @@ namespace Jug::Reco { } }; - // NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables) - DECLARE_COMPONENT(ParticlesFromTrackFit) } // namespace Jug::Reco diff --git a/JugTrack/src/components/ProtoTrackMatching.cpp b/JugTrack/src/components/ProtoTrackMatching.cpp index 5065a54..e97832d 100644 --- a/JugTrack/src/components/ProtoTrackMatching.cpp +++ b/JugTrack/src/components/ProtoTrackMatching.cpp @@ -2,12 +2,12 @@ // Copyright (C) 2022 Whitney Armstrong #include -// Gaudi -#include "Gaudi/Property.h" -#include "GaudiAlg/GaudiAlgorithm.h" -#include "GaudiAlg/GaudiTool.h" -#include "GaudiAlg/Transformer.h" -#include "GaudiKernel/ToolHandle.h" +// Jug +#include "Jug/Property.h" +#include "JugAlg/JugAlgorithm.h" +#include "JugAlg/JugTool.h" +#include "JugAlg/Transformer.h" +#include "JugKernel/ToolHandle.h" #include "JugBase/DataHandle.h" #include "JugBase/IGeoSvc.h" @@ -24,15 +24,15 @@ namespace Jug::Reco { * * \ingroup tracking */ -class ProtoTrackMatching : public GaudiAlgorithm { +class ProtoTrackMatching : public JugAlgorithm { private: - DataHandle m_inputTrackerHits{"inputTrackerHits", Gaudi::DataHandle::Reader, this}; - DataHandle m_initialTrackParameters{"initialTrackParameters", Gaudi::DataHandle::Reader, this}; - DataHandle m_inputProtoTracks{"inputProtoTracks", Gaudi::DataHandle::Reader, this}; - DataHandle m_outputProtoTracks{"matchedProtoTracks", Gaudi::DataHandle::Writer, this}; + DataHandle m_inputTrackerHits{"inputTrackerHits", Jug::DataHandle::Reader, this}; + DataHandle m_initialTrackParameters{"initialTrackParameters", Jug::DataHandle::Reader, this}; + DataHandle m_inputProtoTracks{"inputProtoTracks", Jug::DataHandle::Reader, this}; + DataHandle m_outputProtoTracks{"matchedProtoTracks", Jug::DataHandle::Writer, this}; public: - ProtoTrackMatching(const std::string& name, ISvcLocator* svcLoc) : GaudiAlgorithm(name, svcLoc) { + ProtoTrackMatching(const std::string& name, ISvcLocator* svcLoc) : JugAlgorithm(name, svcLoc) { declareProperty("inputTrackerHits", m_inputTrackerHits, ""); declareProperty("initialTrackParameters", m_initialTrackParameters, ""); declareProperty("inputProtoTracks", m_inputProtoTracks, ""); @@ -40,7 +40,7 @@ class ProtoTrackMatching : public GaudiAlgorithm { } StatusCode initialize() override { - if (GaudiAlgorithm::initialize().isFailure()) { + if (JugAlgorithm::initialize().isFailure()) { return StatusCode::FAILURE; } return StatusCode::SUCCESS; @@ -99,7 +99,5 @@ class ProtoTrackMatching : public GaudiAlgorithm { return StatusCode::SUCCESS; } }; -// NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables) -DECLARE_COMPONENT(ProtoTrackMatching) } // namespace Jug::Reco diff --git a/JugTrack/src/components/SingleTrackSourceLinker.cpp b/JugTrack/src/components/SingleTrackSourceLinker.cpp index 27306f2..1d3796d 100644 --- a/JugTrack/src/components/SingleTrackSourceLinker.cpp +++ b/JugTrack/src/components/SingleTrackSourceLinker.cpp @@ -1,13 +1,13 @@ // SPDX-License-Identifier: LGPL-3.0-or-later // Copyright (C) 2022 Whitney Armstrong, Sylvester Joosten, Wouter Deconinck -// Gaudi -#include "Gaudi/Property.h" -#include "GaudiAlg/GaudiAlgorithm.h" -#include "GaudiAlg/GaudiTool.h" -#include "GaudiAlg/Transformer.h" -#include "GaudiKernel/RndmGenerators.h" -#include "GaudiKernel/ToolHandle.h" +// Jug +#include "Jug/Property.h" +#include "JugAlg/JugAlgorithm.h" +#include "JugAlg/JugTool.h" +#include "JugAlg/Transformer.h" +#include "JugKernel/RndmGenerators.h" +#include "JugKernel/ToolHandle.h" #include "JugBase/DataHandle.h" #include "JugBase/IGeoSvc.h" @@ -40,18 +40,18 @@ namespace Jug::Reco { * * \ingroup tracking */ -class SingleTrackSourceLinker : public GaudiAlgorithm { +class SingleTrackSourceLinker : public JugAlgorithm { private: - DataHandle m_inputHitCollection{"inputHitCollection", Gaudi::DataHandle::Reader, this}; - DataHandle> m_sourceLinkStorage{"sourceLinkStorage", Gaudi::DataHandle::Writer, this}; - DataHandle m_outputSourceLinks{"outputSourceLinks", Gaudi::DataHandle::Writer, this}; - DataHandle m_outputMeasurements{"outputMeasurements", Gaudi::DataHandle::Writer, this}; - DataHandle m_outputProtoTracks{"outputProtoTracks", Gaudi::DataHandle::Writer, this}; + DataHandle m_inputHitCollection{"inputHitCollection", Jug::DataHandle::Reader, this}; + DataHandle> m_sourceLinkStorage{"sourceLinkStorage", Jug::DataHandle::Writer, this}; + DataHandle m_outputSourceLinks{"outputSourceLinks", Jug::DataHandle::Writer, this}; + DataHandle m_outputMeasurements{"outputMeasurements", Jug::DataHandle::Writer, this}; + DataHandle m_outputProtoTracks{"outputProtoTracks", Jug::DataHandle::Writer, this}; /// Pointer to the geometry service SmartIF m_geoSvc; public: - SingleTrackSourceLinker(const std::string& name, ISvcLocator* svcLoc) : GaudiAlgorithm(name, svcLoc) { + SingleTrackSourceLinker(const std::string& name, ISvcLocator* svcLoc) : JugAlgorithm(name, svcLoc) { declareProperty("inputHitCollection", m_inputHitCollection, ""); declareProperty("sourceLinkStorage", m_sourceLinkStorage, ""); declareProperty("outputSourceLinks", m_outputSourceLinks, ""); @@ -60,7 +60,7 @@ class SingleTrackSourceLinker : public GaudiAlgorithm { } StatusCode initialize() override { - if (GaudiAlgorithm::initialize().isFailure()) { + if (JugAlgorithm::initialize().isFailure()) { return StatusCode::FAILURE; } m_geoSvc = service("GeoSvc"); @@ -165,7 +165,5 @@ class SingleTrackSourceLinker : public GaudiAlgorithm { return StatusCode::SUCCESS; } }; -// NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables) -DECLARE_COMPONENT(SingleTrackSourceLinker) } // namespace Jug::Reco diff --git a/JugTrack/src/components/TestACTSLogger.cpp b/JugTrack/src/components/TestACTSLogger.cpp index c706b7d..6d51434 100644 --- a/JugTrack/src/components/TestACTSLogger.cpp +++ b/JugTrack/src/components/TestACTSLogger.cpp @@ -11,16 +11,14 @@ using namespace Acts; -// NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables) -DECLARE_COMPONENT(TestACTSLogger) TestACTSLogger::TestACTSLogger(const std::string& aName, ISvcLocator* aSvcLoc) - : GaudiAlgorithm(aName, aSvcLoc) {} + : JugAlgorithm(aName, aSvcLoc) {} TestACTSLogger::~TestACTSLogger() = default; StatusCode TestACTSLogger::initialize() { - if (GaudiAlgorithm::initialize().isFailure()) { + if (JugAlgorithm::initialize().isFailure()) { return StatusCode::FAILURE; } { @@ -49,4 +47,4 @@ StatusCode TestACTSLogger::initialize() { StatusCode TestACTSLogger::execute() { return StatusCode::SUCCESS; } -StatusCode TestACTSLogger::finalize() { return GaudiAlgorithm::finalize(); } +StatusCode TestACTSLogger::finalize() { return JugAlgorithm::finalize(); } diff --git a/JugTrack/src/components/TestACTSLogger.h b/JugTrack/src/components/TestACTSLogger.h index 31af7eb..3273e6d 100644 --- a/JugTrack/src/components/TestACTSLogger.h +++ b/JugTrack/src/components/TestACTSLogger.h @@ -5,8 +5,8 @@ #define TESTRECONSTRUCTION_TESTACTSLOGGER_H // GAUDI -#include "GaudiAlg/GaudiAlgorithm.h" -#include "Gaudi/Property.h" +#include "JugAlg/JugAlgorithm.h" +#include "Jug/Property.h" // FCCSW #include "JugBase/DataHandle.h" @@ -15,7 +15,7 @@ * * \ingroup tracking */ -class TestACTSLogger : public GaudiAlgorithm { +class TestACTSLogger : public JugAlgorithm { public: explicit TestACTSLogger(const std::string&, ISvcLocator*); virtual ~TestACTSLogger(); diff --git a/JugTrack/src/components/TrackFindingAlgorithm.cpp b/JugTrack/src/components/TrackFindingAlgorithm.cpp index acdb678..41d0ef0 100644 --- a/JugTrack/src/components/TrackFindingAlgorithm.cpp +++ b/JugTrack/src/components/TrackFindingAlgorithm.cpp @@ -3,13 +3,13 @@ #include "TrackFindingAlgorithm.h" -// Gaudi -#include "GaudiAlg/GaudiAlgorithm.h" -#include "GaudiKernel/ToolHandle.h" -#include "GaudiAlg/Transformer.h" -#include "GaudiAlg/GaudiTool.h" -#include "GaudiKernel/RndmGenerators.h" -#include "Gaudi/Property.h" +// Jug +#include "JugAlg/JugAlgorithm.h" +#include "JugKernel/ToolHandle.h" +#include "JugAlg/Transformer.h" +#include "JugAlg/JugTool.h" +#include "JugKernel/RndmGenerators.h" +#include "Jug/Property.h" #include "DDRec/CellIDPositionConverter.h" #include "DDRec/SurfaceManager.h" @@ -63,7 +63,7 @@ namespace Jug::Reco { using namespace Acts::UnitLiterals; TrackFindingAlgorithm::TrackFindingAlgorithm(const std::string& name, ISvcLocator* svcLoc) - : GaudiAlgorithm(name, svcLoc) + : JugAlgorithm(name, svcLoc) { declareProperty("inputSourceLinks", m_inputSourceLinks, ""); declareProperty("inputMeasurements", m_inputMeasurements, ""); @@ -74,7 +74,7 @@ namespace Jug::Reco { StatusCode TrackFindingAlgorithm::initialize() { warning() << "Deprecated algorithm, use CKFTracking instead" << endmsg; - if (GaudiAlgorithm::initialize().isFailure()) { + if (JugAlgorithm::initialize().isFailure()) { return StatusCode::FAILURE; } m_geoSvc = service("GeoSvc"); @@ -171,6 +171,4 @@ namespace Jug::Reco { return StatusCode::SUCCESS; } - // NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables) - DECLARE_COMPONENT(TrackFindingAlgorithm) } // namespace Jug::Reco diff --git a/JugTrack/src/components/TrackFindingAlgorithm.h b/JugTrack/src/components/TrackFindingAlgorithm.h index dca6bce..72e9c3d 100644 --- a/JugTrack/src/components/TrackFindingAlgorithm.h +++ b/JugTrack/src/components/TrackFindingAlgorithm.h @@ -9,9 +9,9 @@ #include #include -#include "Gaudi/Property.h" -#include "GaudiAlg/GaudiAlgorithm.h" -#include "GaudiKernel/ToolHandle.h" +#include "Jug/Property.h" +#include "JugAlg/JugAlgorithm.h" +#include "JugKernel/ToolHandle.h" #include "JugBase/DataHandle.h" #include "JugBase/IGeoSvc.h" @@ -36,7 +36,7 @@ namespace Jug::Reco { * * \ingroup tracking */ -class TrackFindingAlgorithm : public GaudiAlgorithm { +class TrackFindingAlgorithm : public JugAlgorithm { public: /// Track finder function that takes input measurements, initial trackstate /// and track finder options and returns some track-finder-specific result. @@ -61,15 +61,15 @@ class TrackFindingAlgorithm : public GaudiAlgorithm { std::shared_ptr magneticField); public: - DataHandle m_inputSourceLinks{"inputSourceLinks", Gaudi::DataHandle::Reader, this}; - DataHandle m_inputMeasurements{"inputMeasurements", Gaudi::DataHandle::Reader, this}; + DataHandle m_inputSourceLinks{"inputSourceLinks", Jug::DataHandle::Reader, this}; + DataHandle m_inputMeasurements{"inputMeasurements", Jug::DataHandle::Reader, this}; DataHandle m_inputInitialTrackParameters{"inputInitialTrackParameters", - Gaudi::DataHandle::Reader, this}; - DataHandle m_outputTrajectories{"outputTrajectories", Gaudi::DataHandle::Writer, this}; + Jug::DataHandle::Reader, this}; + DataHandle m_outputTrajectories{"outputTrajectories", Jug::DataHandle::Writer, this}; - Gaudi::Property> m_etaBins{this, "etaBins", {}}; - Gaudi::Property> m_chi2CutOff{this, "chi2CutOff", {15.}}; - Gaudi::Property> m_numMeasurementsCutOff{this, "numMeasurementsCutOff", {10}}; + Jug::Property> m_etaBins{this, "etaBins", {}}; + Jug::Property> m_chi2CutOff{this, "chi2CutOff", {15.}}; + Jug::Property> m_numMeasurementsCutOff{this, "numMeasurementsCutOff", {10}}; std::shared_ptr m_trackFinderFunc; SmartIF m_geoSvc; diff --git a/JugTrack/src/components/TrackFittingAlgorithm.cpp b/JugTrack/src/components/TrackFittingAlgorithm.cpp index 6fa1344..03b48a8 100644 --- a/JugTrack/src/components/TrackFittingAlgorithm.cpp +++ b/JugTrack/src/components/TrackFittingAlgorithm.cpp @@ -4,13 +4,13 @@ // #include "TrackFittingAlgorithm.h" -// Gaudi -#include "GaudiAlg/GaudiAlgorithm.h" -#include "GaudiKernel/ToolHandle.h" -#include "GaudiAlg/Transformer.h" -#include "GaudiAlg/GaudiTool.h" -#include "GaudiKernel/RndmGenerators.h" -#include "Gaudi/Property.h" +// Jug +#include "JugAlg/JugAlgorithm.h" +#include "JugKernel/ToolHandle.h" +#include "JugAlg/Transformer.h" +#include "JugAlg/JugTool.h" +#include "JugKernel/RndmGenerators.h" +#include "Jug/Property.h" #include "DDRec/CellIDPositionConverter.h" #include "DDRec/SurfaceManager.h" @@ -49,7 +49,7 @@ namespace Jug::Reco { using namespace Acts::UnitLiterals; TrackFittingAlgorithm::TrackFittingAlgorithm(const std::string& name, ISvcLocator* svcLoc) - : GaudiAlgorithm(name, svcLoc) + : JugAlgorithm(name, svcLoc) { declareProperty("inputSourceLinks", m_inputSourceLinks, ""); declareProperty("initialTrackParameters", m_initialTrackParameters, ""); @@ -61,7 +61,7 @@ namespace Jug::Reco { StatusCode TrackFittingAlgorithm::initialize() { - if (GaudiAlgorithm::initialize().isFailure()) { + if (JugAlgorithm::initialize().isFailure()) { return StatusCode::FAILURE; } m_geoSvc = service("GeoSvc"); @@ -286,8 +286,5 @@ namespace Jug::Reco { return StatusCode::SUCCESS; } - // NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables) - // NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables) - DECLARE_COMPONENT(TrackFittingAlgorithm) } // namespace Jug::Reco diff --git a/JugTrack/src/components/TrackFittingAlgorithm.h b/JugTrack/src/components/TrackFittingAlgorithm.h index 6f193da..f34ecb1 100644 --- a/JugTrack/src/components/TrackFittingAlgorithm.h +++ b/JugTrack/src/components/TrackFittingAlgorithm.h @@ -10,9 +10,9 @@ #include #include -#include "GaudiAlg/GaudiAlgorithm.h" -#include "GaudiKernel/ToolHandle.h" -#include "Gaudi/Property.h" +#include "JugAlg/JugAlgorithm.h" +#include "JugKernel/ToolHandle.h" +#include "Jug/Property.h" #include "JugBase/DataHandle.h" #include "JugBase/IGeoSvc.h" @@ -42,7 +42,7 @@ namespace Jug::Reco { * * \ingroup tracking */ - class TrackFittingAlgorithm : public GaudiAlgorithm { + class TrackFittingAlgorithm : public JugAlgorithm { public: /// Track fitter function that takes input measurements, initial trackstate /// and fitter options and returns some track-fitter-specific result. @@ -57,12 +57,12 @@ namespace Jug::Reco { const std::vector&, const TrackParameters&, const TrackFitterOptions&)>; public: - DataHandle m_inputSourceLinks{"inputSourceLinks", Gaudi::DataHandle::Reader, this}; - DataHandle m_initialTrackParameters{"initialTrackParameters", Gaudi::DataHandle::Reader, this}; - DataHandle m_inputMeasurements{"inputMeasurements", Gaudi::DataHandle::Reader, this}; - DataHandle m_inputProtoTracks{"inputProtoTracks", Gaudi::DataHandle::Reader, this}; - DataHandle m_foundTracks{"foundTracks", Gaudi::DataHandle::Reader, this}; - DataHandle m_outputTrajectories{"outputTrajectories", Gaudi::DataHandle::Writer, this}; + DataHandle m_inputSourceLinks{"inputSourceLinks", Jug::DataHandle::Reader, this}; + DataHandle m_initialTrackParameters{"initialTrackParameters", Jug::DataHandle::Reader, this}; + DataHandle m_inputMeasurements{"inputMeasurements", Jug::DataHandle::Reader, this}; + DataHandle m_inputProtoTracks{"inputProtoTracks", Jug::DataHandle::Reader, this}; + DataHandle m_foundTracks{"foundTracks", Jug::DataHandle::Reader, this}; + DataHandle m_outputTrajectories{"outputTrajectories", Jug::DataHandle::Writer, this}; FitterFunction m_trackFittingFunc; SmartIF m_geoSvc; diff --git a/JugTrack/src/components/TrackParamACTSSeeding.cpp b/JugTrack/src/components/TrackParamACTSSeeding.cpp index 6a664e6..31e9a3a 100644 --- a/JugTrack/src/components/TrackParamACTSSeeding.cpp +++ b/JugTrack/src/components/TrackParamACTSSeeding.cpp @@ -16,13 +16,13 @@ #include "Acts/Seeding/EstimateTrackParamsFromSeed.hpp" #include "Acts/Surfaces/PerigeeSurface.hpp" -// Gaudi -#include "GaudiAlg/GaudiAlgorithm.h" -#include "GaudiKernel/ToolHandle.h" -#include "GaudiAlg/Transformer.h" -#include "GaudiAlg/GaudiTool.h" -#include "GaudiKernel/RndmGenerators.h" -#include "Gaudi/Property.h" +// Jug +#include "JugAlg/JugAlgorithm.h" +#include "JugKernel/ToolHandle.h" +#include "JugAlg/Transformer.h" +#include "JugAlg/JugTool.h" +#include "JugKernel/RndmGenerators.h" +#include "Jug/Property.h" #include "JugBase/DataHandle.h" #include "JugBase/IGeoSvc.h" @@ -55,21 +55,21 @@ namespace Jug::Reco { * TrackParmetersContainer * \ingroup tracking */ - class TrackParamACTSSeeding : public GaudiAlgorithm { + class TrackParamACTSSeeding : public JugAlgorithm { public: DataHandle m_inputSourceLinks { "inputSourceLinks", - Gaudi::DataHandle::Reader, this }; + Jug::DataHandle::Reader, this }; DataHandle m_inputMeasurements { "inputMeasurements", - Gaudi::DataHandle::Reader, this}; + Jug::DataHandle::Reader, this}; DataHandle m_inputHitCollection { "inputHitCollection", - Gaudi::DataHandle::Reader, this }; + Jug::DataHandle::Reader, this }; DataHandle m_outputInitialTrackParameters { "outputInitialTrackParameters", - Gaudi::DataHandle::Writer, this }; + Jug::DataHandle::Writer, this }; SmartIF m_geoSvc; Acts::GeometryContext m_geoContext; @@ -197,7 +197,7 @@ namespace Jug::Reco { public: TrackParamACTSSeeding(const std::string &name, ISvcLocator* svcLoc) - : GaudiAlgorithm(name, svcLoc) { + : JugAlgorithm(name, svcLoc) { declareProperty("inputSourceLinks", m_inputSourceLinks, ""); declareProperty("inputMeasurements", @@ -223,7 +223,7 @@ namespace Jug::Reco { StatusCode TrackParamACTSSeeding::initialize() { - if (GaudiAlgorithm::initialize().isFailure()) { + if (JugAlgorithm::initialize().isFailure()) { return StatusCode::FAILURE; } @@ -552,5 +552,4 @@ namespace Jug::Reco { return StatusCode::SUCCESS; } - DECLARE_COMPONENT(TrackParamACTSSeeding) } // namespace Jug::reco diff --git a/JugTrack/src/components/TrackParamClusterInit.cpp b/JugTrack/src/components/TrackParamClusterInit.cpp index 538bcc8..a051b2d 100644 --- a/JugTrack/src/components/TrackParamClusterInit.cpp +++ b/JugTrack/src/components/TrackParamClusterInit.cpp @@ -2,13 +2,13 @@ // Copyright (C) 2022 Whitney Armstrong, Sylvester Joosten #include -// Gaudi -#include "Gaudi/Property.h" -#include "GaudiAlg/GaudiAlgorithm.h" -#include "GaudiAlg/GaudiTool.h" -#include "GaudiAlg/Transformer.h" -#include "GaudiKernel/RndmGenerators.h" -#include "GaudiKernel/ToolHandle.h" +// Jug +#include "Jug/Property.h" +#include "JugAlg/JugAlgorithm.h" +#include "JugAlg/JugTool.h" +#include "JugAlg/Transformer.h" +#include "JugKernel/RndmGenerators.h" +#include "JugKernel/ToolHandle.h" #include "Acts/Definitions/Common.hpp" #include "Acts/Definitions/Units.hpp" @@ -42,22 +42,22 @@ namespace Jug::Reco { * * \ingroup tracking */ -class TrackParamClusterInit : public GaudiAlgorithm { +class TrackParamClusterInit : public JugAlgorithm { private: using Clusters = eicd::ClusterCollection; - DataHandle m_inputClusters{"inputClusters", Gaudi::DataHandle::Reader, this}; + DataHandle m_inputClusters{"inputClusters", Jug::DataHandle::Reader, this}; DataHandle m_outputInitialTrackParameters{"outputInitialTrackParameters", - Gaudi::DataHandle::Writer, this}; + Jug::DataHandle::Writer, this}; public: - TrackParamClusterInit(const std::string& name, ISvcLocator* svcLoc) : GaudiAlgorithm(name, svcLoc) { + TrackParamClusterInit(const std::string& name, ISvcLocator* svcLoc) : JugAlgorithm(name, svcLoc) { declareProperty("inputClusters", m_inputClusters, "Input clusters"); declareProperty("outputInitialTrackParameters", m_outputInitialTrackParameters, ""); } StatusCode initialize() override { - if (GaudiAlgorithm::initialize().isFailure()) { + if (JugAlgorithm::initialize().isFailure()) { return StatusCode::FAILURE; } IRndmGenSvc* randSvc = svc("RndmGenSvc", true); @@ -129,7 +129,5 @@ class TrackParamClusterInit : public GaudiAlgorithm { return StatusCode::SUCCESS; } }; -// NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables) -DECLARE_COMPONENT(TrackParamClusterInit) } // namespace Jug::Reco diff --git a/JugTrack/src/components/TrackParamImagingClusterInit.cpp b/JugTrack/src/components/TrackParamImagingClusterInit.cpp index 7260951..112dc0c 100644 --- a/JugTrack/src/components/TrackParamImagingClusterInit.cpp +++ b/JugTrack/src/components/TrackParamImagingClusterInit.cpp @@ -2,13 +2,13 @@ // Copyright (C) 2022 Whitney Armstrong, Wouter Deconinck, Sylvester Joosten #include -// Gaudi -#include "GaudiAlg/GaudiAlgorithm.h" -#include "GaudiKernel/ToolHandle.h" -#include "GaudiAlg/Transformer.h" -#include "GaudiAlg/GaudiTool.h" -#include "GaudiKernel/RndmGenerators.h" -#include "Gaudi/Property.h" +// Jug +#include "JugAlg/JugAlgorithm.h" +#include "JugKernel/ToolHandle.h" +#include "JugAlg/Transformer.h" +#include "JugAlg/JugTool.h" +#include "JugKernel/RndmGenerators.h" +#include "Jug/Property.h" #include "JugBase/DataHandle.h" #include "JugBase/IGeoSvc.h" @@ -42,23 +42,23 @@ namespace Jug::Reco { * * \ingroup tracking */ - class TrackParamImagingClusterInit : public GaudiAlgorithm { + class TrackParamImagingClusterInit : public JugAlgorithm { private: using ImagingClusters = eicd::ClusterCollection; - DataHandle m_inputClusters{"inputClusters", Gaudi::DataHandle::Reader, this}; + DataHandle m_inputClusters{"inputClusters", Jug::DataHandle::Reader, this}; DataHandle m_outputInitialTrackParameters{"outputInitialTrackParameters", - Gaudi::DataHandle::Writer, this}; + Jug::DataHandle::Writer, this}; public: TrackParamImagingClusterInit(const std::string& name, ISvcLocator* svcLoc) - : GaudiAlgorithm(name, svcLoc) { + : JugAlgorithm(name, svcLoc) { declareProperty("inputClusters", m_inputClusters, "Input clusters"); declareProperty("outputInitialTrackParameters", m_outputInitialTrackParameters, ""); } StatusCode initialize() override { - if (GaudiAlgorithm::initialize().isFailure()) { + if (JugAlgorithm::initialize().isFailure()) { return StatusCode::FAILURE; } IRndmGenSvc* randSvc = svc("RndmGenSvc", true); @@ -117,7 +117,5 @@ namespace Jug::Reco { return StatusCode::SUCCESS; } }; - // NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables) - DECLARE_COMPONENT(TrackParamImagingClusterInit) } // namespace Jug::reco diff --git a/JugTrack/src/components/TrackParamTruthInit.cpp b/JugTrack/src/components/TrackParamTruthInit.cpp index 07b58b0..755924b 100644 --- a/JugTrack/src/components/TrackParamTruthInit.cpp +++ b/JugTrack/src/components/TrackParamTruthInit.cpp @@ -2,14 +2,14 @@ // Copyright (C) 2022 Whitney Armstrong, Wouter Deconinck, Sylvester Joosten #include -// Gaudi -#include "Gaudi/Property.h" -#include "GaudiAlg/GaudiAlgorithm.h" -#include "GaudiAlg/Transformer.h" -#include "GaudiAlg/GaudiTool.h" -#include "GaudiKernel/PhysicalConstants.h" -#include "GaudiKernel/RndmGenerators.h" -#include "GaudiKernel/ToolHandle.h" +// Jug +#include "Jug/Property.h" +#include "JugAlg/JugAlgorithm.h" +#include "JugAlg/Transformer.h" +#include "JugAlg/JugTool.h" +#include "JugKernel/PhysicalConstants.h" +#include "JugKernel/RndmGenerators.h" +#include "JugKernel/ToolHandle.h" #include "JugBase/DataHandle.h" #include "JugBase/IGeoSvc.h" @@ -43,32 +43,32 @@ namespace Jug::Reco { * TrackParmetersContainer * \ingroup tracking */ - class TrackParamTruthInit : public GaudiAlgorithm { + class TrackParamTruthInit : public JugAlgorithm { private: - DataHandle m_inputMCParticles{"inputMCParticles", Gaudi::DataHandle::Reader, + DataHandle m_inputMCParticles{"inputMCParticles", Jug::DataHandle::Reader, this}; DataHandle m_outputInitialTrackParameters{"outputInitialTrackParameters", - Gaudi::DataHandle::Writer, this}; + Jug::DataHandle::Writer, this}; // selection settings - Gaudi::Property m_maxVertexX{this, "maxVertexX", 80. * Gaudi::Units::mm}; - Gaudi::Property m_maxVertexY{this, "maxVertexY", 80. * Gaudi::Units::mm}; - Gaudi::Property m_maxVertexZ{this, "maxVertexZ", 200. * Gaudi::Units::mm}; - Gaudi::Property m_minMomentum{this, "minMomentum", 100. * Gaudi::Units::MeV}; - Gaudi::Property m_maxEtaForward{this, "maxEtaForward", 4.0}; - Gaudi::Property m_maxEtaBackward{this, "maxEtaBackward", 4.1}; + Jug::Property m_maxVertexX{this, "maxVertexX", 80. * Jug::Units::mm}; + Jug::Property m_maxVertexY{this, "maxVertexY", 80. * Jug::Units::mm}; + Jug::Property m_maxVertexZ{this, "maxVertexZ", 200. * Jug::Units::mm}; + Jug::Property m_minMomentum{this, "minMomentum", 100. * Jug::Units::MeV}; + Jug::Property m_maxEtaForward{this, "maxEtaForward", 4.0}; + Jug::Property m_maxEtaBackward{this, "maxEtaBackward", 4.1}; SmartIF m_pidSvc; public: TrackParamTruthInit(const std::string& name, ISvcLocator* svcLoc) - : GaudiAlgorithm(name, svcLoc) { + : JugAlgorithm(name, svcLoc) { declareProperty("inputMCParticles", m_inputMCParticles, ""); declareProperty("outputInitialTrackParameters", m_outputInitialTrackParameters, ""); } StatusCode initialize() override { - if (GaudiAlgorithm::initialize().isFailure()) { + if (JugAlgorithm::initialize().isFailure()) { return StatusCode::FAILURE; } IRndmGenSvc* randSvc = svc("RndmGenSvc", true); @@ -102,9 +102,9 @@ namespace Jug::Reco { } // require close to interaction vertex - if (abs(part.getVertex().x) * Gaudi::Units::mm > m_maxVertexX - || abs(part.getVertex().y) * Gaudi::Units::mm > m_maxVertexY - || abs(part.getVertex().z) * Gaudi::Units::mm > m_maxVertexZ) { + if (abs(part.getVertex().x) * Jug::Units::mm > m_maxVertexX + || abs(part.getVertex().y) * Jug::Units::mm > m_maxVertexY + || abs(part.getVertex().z) * Jug::Units::mm > m_maxVertexZ) { if (msgLevel(MSG::DEBUG)) { debug() << "ignoring particle with vs = " << part.getVertex() << " mm" << endmsg; } @@ -114,7 +114,7 @@ namespace Jug::Reco { // require minimum momentum const auto& p = part.getMomentum(); const auto pmag = std::hypot(p.x, p.y, p.z); - if (pmag * Gaudi::Units::GeV < m_minMomentum) { + if (pmag * Jug::Units::GeV < m_minMomentum) { if (msgLevel(MSG::DEBUG)) { debug() << "ignoring particle with p = " << pmag << " GeV" << endmsg; } @@ -186,7 +186,5 @@ namespace Jug::Reco { return StatusCode::SUCCESS; } }; - // NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables) - DECLARE_COMPONENT(TrackParamTruthInit) } // namespace Jug::reco diff --git a/JugTrack/src/components/TrackParamVertexClusterInit.cpp b/JugTrack/src/components/TrackParamVertexClusterInit.cpp index 1e12819..80c353f 100644 --- a/JugTrack/src/components/TrackParamVertexClusterInit.cpp +++ b/JugTrack/src/components/TrackParamVertexClusterInit.cpp @@ -3,14 +3,14 @@ #include -// Gaudi -#include "Gaudi/Property.h" -#include "GaudiAlg/GaudiAlgorithm.h" -#include "GaudiAlg/GaudiTool.h" -#include "GaudiAlg/Transformer.h" -#include "GaudiKernel/PhysicalConstants.h" -#include "GaudiKernel/RndmGenerators.h" -#include "GaudiKernel/ToolHandle.h" +// Jug +#include "Jug/Property.h" +#include "JugAlg/JugAlgorithm.h" +#include "JugAlg/JugTool.h" +#include "JugAlg/Transformer.h" +#include "JugKernel/PhysicalConstants.h" +#include "JugKernel/RndmGenerators.h" +#include "JugKernel/ToolHandle.h" #include "Acts/Definitions/Common.hpp" #include "Acts/Definitions/Units.hpp" @@ -23,7 +23,7 @@ #include "eicd/TrackerHitCollection.h" #include "eicd/vector_utils.h" -using namespace Gaudi::Units; +using namespace Jug::Units; namespace Jug::Reco { @@ -35,26 +35,26 @@ namespace Jug::Reco { * * \ingroup tracking */ -class TrackParamVertexClusterInit : public GaudiAlgorithm { +class TrackParamVertexClusterInit : public JugAlgorithm { private: using Clusters = eicd::ClusterCollection; using VertexHits = eicd::TrackerHitCollection; - DataHandle m_inputVertexHits{"inputVertexHits", Gaudi::DataHandle::Reader, this}; - DataHandle m_inputClusters{"inputClusters", Gaudi::DataHandle::Reader, this}; + DataHandle m_inputVertexHits{"inputVertexHits", Jug::DataHandle::Reader, this}; + DataHandle m_inputClusters{"inputClusters", Jug::DataHandle::Reader, this}; DataHandle m_outputInitialTrackParameters{"outputInitialTrackParameters", - Gaudi::DataHandle::Writer, this}; - Gaudi::Property m_maxHitRadius{this, "maxHitRadius", 40.0 * mm}; + Jug::DataHandle::Writer, this}; + Jug::Property m_maxHitRadius{this, "maxHitRadius", 40.0 * mm}; public: - TrackParamVertexClusterInit(const std::string& name, ISvcLocator* svcLoc) : GaudiAlgorithm(name, svcLoc) { + TrackParamVertexClusterInit(const std::string& name, ISvcLocator* svcLoc) : JugAlgorithm(name, svcLoc) { declareProperty("inputVertexHits", m_inputVertexHits, "Vertex tracker hits"); declareProperty("inputClusters", m_inputClusters, "Input clusters"); declareProperty("outputInitialTrackParameters", m_outputInitialTrackParameters, ""); } StatusCode initialize() override { - if (GaudiAlgorithm::initialize().isFailure()) { + if (JugAlgorithm::initialize().isFailure()) { return StatusCode::FAILURE; } IRndmGenSvc* randSvc = svc("RndmGenSvc", true); @@ -131,7 +131,5 @@ class TrackParamVertexClusterInit : public GaudiAlgorithm { return StatusCode::SUCCESS; } }; -// NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables) -DECLARE_COMPONENT(TrackParamVertexClusterInit) } // namespace Jug::Reco diff --git a/JugTrack/src/components/TrackProjector.cpp b/JugTrack/src/components/TrackProjector.cpp index 0a55fbf..5c412b2 100644 --- a/JugTrack/src/components/TrackProjector.cpp +++ b/JugTrack/src/components/TrackProjector.cpp @@ -3,13 +3,13 @@ #include -// Gaudi -#include "GaudiAlg/GaudiAlgorithm.h" -#include "GaudiKernel/ToolHandle.h" -#include "GaudiAlg/Transformer.h" -#include "GaudiAlg/GaudiTool.h" -#include "GaudiKernel/RndmGenerators.h" -#include "Gaudi/Property.h" +// Jug +#include "JugAlg/JugAlgorithm.h" +#include "JugKernel/ToolHandle.h" +#include "JugAlg/Transformer.h" +#include "JugAlg/JugTool.h" +#include "JugKernel/RndmGenerators.h" +#include "Jug/Property.h" #include "DDRec/CellIDPositionConverter.h" #include "DDRec/SurfaceManager.h" @@ -48,29 +48,29 @@ namespace Jug::Reco { * * \ingroup tracking */ - class TrackProjector : public GaudiAlgorithm { + class TrackProjector : public JugAlgorithm { private: - DataHandle m_inputTrajectories{"inputTrajectories", Gaudi::DataHandle::Reader, this}; - DataHandle m_outputTrackSegments{"outputTrackSegments", Gaudi::DataHandle::Writer, this}; + DataHandle m_inputTrajectories{"inputTrajectories", Jug::DataHandle::Reader, this}; + DataHandle m_outputTrackSegments{"outputTrackSegments", Jug::DataHandle::Writer, this}; - Gaudi::Property m_firstInVolumeID{this, "firstInVolumeID", 0}; - Gaudi::Property m_firstInVolumeName{this, "firstInVolumeName", ""}; - Gaudi::Property m_firstSmallerThanZ{this, "firstSmallerThanZ", 0}; - Gaudi::Property m_firstGreaterThanZ{this, "firstGreaterThanZ", 0}; - Gaudi::Property m_firstGreaterThanR{this, "firstGreaterThanR", -1}; + Jug::Property m_firstInVolumeID{this, "firstInVolumeID", 0}; + Jug::Property m_firstInVolumeName{this, "firstInVolumeName", ""}; + Jug::Property m_firstSmallerThanZ{this, "firstSmallerThanZ", 0}; + Jug::Property m_firstGreaterThanZ{this, "firstGreaterThanZ", 0}; + Jug::Property m_firstGreaterThanR{this, "firstGreaterThanR", -1}; Acts::GeometryContext m_geoContext; public: - // ill-formed: using GaudiAlgorithm::GaudiAlgorithm; + // ill-formed: using JugAlgorithm::JugAlgorithm; TrackProjector(const std::string& name, ISvcLocator* svcLoc) - : GaudiAlgorithm(name, svcLoc) { + : JugAlgorithm(name, svcLoc) { declareProperty("inputTrajectories", m_inputTrajectories,""); declareProperty("outputTrackSegments", m_outputTrackSegments, ""); } StatusCode initialize() override { - if (GaudiAlgorithm::initialize().isFailure()) + if (JugAlgorithm::initialize().isFailure()) return StatusCode::FAILURE; return StatusCode::SUCCESS; } @@ -218,7 +218,5 @@ namespace Jug::Reco { } }; - // NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables) - DECLARE_COMPONENT(TrackProjector) } // namespace Jug::Reco diff --git a/JugTrack/src/components/TrackerSourceLinker.cpp b/JugTrack/src/components/TrackerSourceLinker.cpp index 4fd9cd8..d4520a2 100644 --- a/JugTrack/src/components/TrackerSourceLinker.cpp +++ b/JugTrack/src/components/TrackerSourceLinker.cpp @@ -3,13 +3,13 @@ #include "JugTrack/GeometryContainers.hpp" -// Gaudi -#include "Gaudi/Property.h" -#include "GaudiAlg/GaudiAlgorithm.h" -#include "GaudiAlg/GaudiTool.h" -#include "GaudiAlg/Transformer.h" -#include "GaudiKernel/RndmGenerators.h" -#include "GaudiKernel/ToolHandle.h" +// Jug +#include "Jug/Property.h" +#include "JugAlg/JugAlgorithm.h" +#include "JugAlg/JugTool.h" +#include "JugAlg/Transformer.h" +#include "JugKernel/RndmGenerators.h" +#include "JugKernel/ToolHandle.h" #include "JugBase/DataHandle.h" #include "JugBase/IGeoSvc.h" @@ -42,17 +42,17 @@ namespace Jug::Reco { * * \ingroup tracking */ -class TrackerSourceLinker : public GaudiAlgorithm { +class TrackerSourceLinker : public JugAlgorithm { private: - DataHandle m_inputHitCollection{"inputHitCollection", Gaudi::DataHandle::Reader, this}; - DataHandle> m_sourceLinkStorage{"sourceLinkStorage", Gaudi::DataHandle::Writer, this}; - DataHandle m_outputSourceLinks{"outputSourceLinks", Gaudi::DataHandle::Writer, this}; - DataHandle m_outputMeasurements{"outputMeasurements", Gaudi::DataHandle::Writer, this}; + DataHandle m_inputHitCollection{"inputHitCollection", Jug::DataHandle::Reader, this}; + DataHandle> m_sourceLinkStorage{"sourceLinkStorage", Jug::DataHandle::Writer, this}; + DataHandle m_outputSourceLinks{"outputSourceLinks", Jug::DataHandle::Writer, this}; + DataHandle m_outputMeasurements{"outputMeasurements", Jug::DataHandle::Writer, this}; /// Pointer to the geometry service SmartIF m_geoSvc; public: - TrackerSourceLinker(const std::string& name, ISvcLocator* svcLoc) : GaudiAlgorithm(name, svcLoc) { + TrackerSourceLinker(const std::string& name, ISvcLocator* svcLoc) : JugAlgorithm(name, svcLoc) { declareProperty("inputHitCollection", m_inputHitCollection, ""); declareProperty("sourceLinkStorage", m_sourceLinkStorage, ""); declareProperty("outputSourceLinks", m_outputSourceLinks, ""); @@ -60,7 +60,7 @@ class TrackerSourceLinker : public GaudiAlgorithm { } StatusCode initialize() override { - if (GaudiAlgorithm::initialize().isFailure()) { + if (JugAlgorithm::initialize().isFailure()) { return StatusCode::FAILURE; } m_geoSvc = service("GeoSvc"); @@ -157,7 +157,5 @@ class TrackerSourceLinker : public GaudiAlgorithm { return StatusCode::SUCCESS; } }; -// NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables) -DECLARE_COMPONENT(TrackerSourceLinker) } // namespace Jug::Reco diff --git a/JugTrack/src/components/TruthTrackSeeding.cpp b/JugTrack/src/components/TruthTrackSeeding.cpp index d650551..6ee849c 100644 --- a/JugTrack/src/components/TruthTrackSeeding.cpp +++ b/JugTrack/src/components/TruthTrackSeeding.cpp @@ -2,13 +2,13 @@ // Copyright (C) 2022 Whitney Armstrong, Wouter Deconinck, Sylvester Joosten #include -// Gaudi -#include "GaudiAlg/GaudiAlgorithm.h" -#include "GaudiKernel/ToolHandle.h" -#include "GaudiAlg/Transformer.h" -#include "GaudiAlg/GaudiTool.h" -#include "GaudiKernel/RndmGenerators.h" -#include "Gaudi/Property.h" +// Jug +#include "JugAlg/JugAlgorithm.h" +#include "JugKernel/ToolHandle.h" +#include "JugAlg/Transformer.h" +#include "JugAlg/JugTool.h" +#include "JugKernel/RndmGenerators.h" +#include "Jug/Property.h" #include "JugBase/DataHandle.h" #include "JugBase/IGeoSvc.h" @@ -33,22 +33,22 @@ namespace Jug::Reco { * * \ingroup tracking */ - class TruthTrackSeeding : public GaudiAlgorithm { + class TruthTrackSeeding : public JugAlgorithm { private: - DataHandle m_inputMCParticles{"inputMCParticles", Gaudi::DataHandle::Reader, + DataHandle m_inputMCParticles{"inputMCParticles", Jug::DataHandle::Reader, this}; DataHandle m_outputTrackParameters{"outputTrackParameters", - Gaudi::DataHandle::Writer, this}; + Jug::DataHandle::Writer, this}; SmartIF m_pidSvc; public: - TruthTrackSeeding(const std::string& name, ISvcLocator* svcLoc) : GaudiAlgorithm(name, svcLoc) { + TruthTrackSeeding(const std::string& name, ISvcLocator* svcLoc) : JugAlgorithm(name, svcLoc) { declareProperty("inputMCParticles", m_inputMCParticles, "mcparticle truth data from npsim"); declareProperty("outputTrackParameters", m_outputTrackParameters, "Output initial track parameters"); } StatusCode initialize() override { - if (GaudiAlgorithm::initialize().isFailure()) { + if (JugAlgorithm::initialize().isFailure()) { return StatusCode::FAILURE; } IRndmGenSvc* randSvc = svc("RndmGenSvc", true); @@ -119,7 +119,5 @@ namespace Jug::Reco { return StatusCode::SUCCESS; } }; - // NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables) - DECLARE_COMPONENT(TruthTrackSeeding) } // namespace Jug::reco From 6bd69fc97d334ad2111a972f93660c147dd63085 Mon Sep 17 00:00:00 2001 From: Wouter Deconinck Date: Tue, 16 Aug 2022 12:46:14 -0500 Subject: [PATCH 02/16] fix: rename project, not more CMP overrides --- CMakeLists.txt | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9b8d164..2f1395f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,10 +3,7 @@ cmake_minimum_required(VERSION 3.19) -# CMP0074: find_package() uses _ROOT variables -cmake_policy(SET CMP0074 NEW) - -project(Juggler VERSION 4.3.0) +project(algorithms VERSION 0.0.1) set(CMAKE_CXX_STANDARD 17 CACHE STRING "") if(NOT CMAKE_CXX_STANDARD MATCHES "17|20") From b466f13c742d92b52d1b4d989f02731872aeb87c Mon Sep 17 00:00:00 2001 From: Wouter Deconinck Date: Tue, 16 Aug 2022 12:46:26 -0500 Subject: [PATCH 03/16] feat: include GNUInstallDirs --- CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2f1395f..7713b56 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -46,6 +46,9 @@ if(NOT CMAKE_BUILD_TYPE MATCHES Release) add_compile_options(-Wall -Wextra -Werror) endif() +# Use GNU install dirs +include(GNUInstallDirs) + find_package(Microsoft.GSL CONFIG) find_package(EICD REQUIRED) From 5ec150eb8430e6921c66c7a6ef6a2c4aec3553cf Mon Sep 17 00:00:00 2001 From: Wouter Deconinck Date: Tue, 16 Aug 2022 12:46:54 -0500 Subject: [PATCH 04/16] feat: add cmake config files for downstream projects --- CMakeLists.txt | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7713b56..62de421 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -82,3 +82,35 @@ add_subdirectory(JugFast) add_subdirectory(JugPID) add_subdirectory(JugReco) add_subdirectory(JugTrack) + + +# ------------------------- +# install library config +include(CMakePackageConfigHelpers) + +# Install and export targets +install(EXPORT ${PROJECT_NAME}Targets + FILE ${PROJECT_NAME}Targets.cmake + NAMESPACE ${PROJECT_NAME}:: + DESTINATION lib/${PROJECT_NAME} + ) + +set(TARGETS_INSTALL_PATH lib/${PROJECT_NAME}/${PROJECT_NAME}Targets.cmake) + +configure_package_config_file( + cmake/${PROJECT_NAME}Config.cmake.in + ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake + INSTALL_DESTINATION lib/${PROJECT_NAME} + PATH_VARS TARGETS_INSTALL_PATH + ) + +write_basic_package_version_file("${PROJECT_NAME}ConfigVersion.cmake" + VERSION ${VERSION} + COMPATIBILITY SameMajorVersion + ) + +install(FILES + ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake + ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake + DESTINATION lib/${PROJECT_NAME} +) From 0abf95955926530384aae0e75ec8c8b39174ea4e Mon Sep 17 00:00:00 2001 From: Wouter Deconinck Date: Tue, 16 Aug 2022 12:47:16 -0500 Subject: [PATCH 05/16] fix: install JugDigiPlugins --- JugDigi/CMakeLists.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/JugDigi/CMakeLists.txt b/JugDigi/CMakeLists.txt index ec86c15..e225e84 100644 --- a/JugDigi/CMakeLists.txt +++ b/JugDigi/CMakeLists.txt @@ -19,3 +19,10 @@ target_include_directories(JugDigiPlugins PUBLIC $) target_compile_options(JugDigiPlugins PRIVATE -Wno-suggest-override) + +install(TARGETS JugDigiPlugins + EXPORT ${PROJECT_NAME}Targets + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/JugDigi +) From 84f43f05e000c016cd91afa12767adaa6cc9f65a Mon Sep 17 00:00:00 2001 From: Wouter Deconinck Date: Tue, 16 Aug 2022 12:48:08 -0500 Subject: [PATCH 06/16] fix: create two empty headers, build shared library --- JugDigi/CMakeLists.txt | 12 +++++++++++- JugDigi/JugDigi/CalorimeterBirksCorr.h | 0 JugDigi/JugDigi/CalorimeterHitDigi.h | 0 cmake/algorithmsConfig.cmake.in | 5 +++++ 4 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 JugDigi/JugDigi/CalorimeterBirksCorr.h create mode 100644 JugDigi/JugDigi/CalorimeterHitDigi.h create mode 100644 cmake/algorithmsConfig.cmake.in diff --git a/JugDigi/CMakeLists.txt b/JugDigi/CMakeLists.txt index e225e84..f175025 100644 --- a/JugDigi/CMakeLists.txt +++ b/JugDigi/CMakeLists.txt @@ -6,7 +6,17 @@ ################################################################################ file(GLOB JugDigiPlugins_sources CONFIGURE_DEPENDS src/components/*.cpp) -add_library(JugDigiPlugins ${JugDigiPlugins_sources}) +set(JugDigiPlugins_sources + src/components/CalorimeterHitDigi.cpp + src/components/CalorimeterBirksCorr.cpp +) +set(JugDigiPlugins_headers + JugDigi/CalorimeterHitDigi.h + JugDigi/CalorimeterBirksCorr.h +) +add_library(JugDigiPlugins SHARED "${JugDigiPlugins_sources}") +set_target_properties(JugDigiPlugins + PROPERTIES PUBLIC_HEADER "${JugDigiPlugins_headers}") target_link_libraries(JugDigiPlugins ROOT::Core ROOT::RIO ROOT::Tree EDM4HEP::edm4hep diff --git a/JugDigi/JugDigi/CalorimeterBirksCorr.h b/JugDigi/JugDigi/CalorimeterBirksCorr.h new file mode 100644 index 0000000..e69de29 diff --git a/JugDigi/JugDigi/CalorimeterHitDigi.h b/JugDigi/JugDigi/CalorimeterHitDigi.h new file mode 100644 index 0000000..e69de29 diff --git a/cmake/algorithmsConfig.cmake.in b/cmake/algorithmsConfig.cmake.in new file mode 100644 index 0000000..6f8ee66 --- /dev/null +++ b/cmake/algorithmsConfig.cmake.in @@ -0,0 +1,5 @@ +@PACKAGE_INIT@ + +include("@PACKAGE_TARGETS_INSTALL_PATH@") + +check_required_components(algorithms) From 668c5152fbc47e6fe87a9ad800d6cd4a95e4710b Mon Sep 17 00:00:00 2001 From: Wouter Deconinck Date: Tue, 16 Aug 2022 12:48:18 -0500 Subject: [PATCH 07/16] fix: back to only JugDigi --- CMakeLists.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 62de421..e300ee2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -78,10 +78,10 @@ find_path(genfit2_INCLUDE_DIR NAMES GFGbl.h PATHS /usr/local/include ${genfit2}/ #add_subdirectory(JugBase) add_subdirectory(JugDigi) -add_subdirectory(JugFast) -add_subdirectory(JugPID) -add_subdirectory(JugReco) -add_subdirectory(JugTrack) +#add_subdirectory(JugFast) +#add_subdirectory(JugPID) +#add_subdirectory(JugReco) +#add_subdirectory(JugTrack) # ------------------------- From 2a409635f7dec3f76766d4111fac1488f7d6dfd3 Mon Sep 17 00:00:00 2001 From: Wouter Deconinck Date: Tue, 16 Aug 2022 12:49:15 -0500 Subject: [PATCH 08/16] fix: ignore files if installed in prefix --- .gitignore | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.gitignore b/.gitignore index ed8e28d..a6c3e64 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,8 @@ +# Installed in source as prefix +/include/ +/lib/ +/bin/ + # Compiled Object files *.slo *.lo From 60cf3ea1c80ebfed16cfe79375992d7d72510519 Mon Sep 17 00:00:00 2001 From: Wouter Deconinck Date: Tue, 16 Aug 2022 13:54:38 -0500 Subject: [PATCH 09/16] fix: return m_value for use of value() in const functions --- JugBase/Jug/Property.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/JugBase/Jug/Property.h b/JugBase/Jug/Property.h index 06bc6b2..76ee37a 100644 --- a/JugBase/Jug/Property.h +++ b/JugBase/Jug/Property.h @@ -19,7 +19,7 @@ namespace Jug { : m_value( std::forward( value ) ) { } - const ValueType& value() const { return *this; } + const ValueType& value() const { return this->m_value; } ValueType& value() { return const_cast( (const ValueType&)*this ); } }; From f33b89ce515306c798a528cdf601af8ce3a7468e Mon Sep 17 00:00:00 2001 From: Wouter Deconinck Date: Tue, 16 Aug 2022 13:55:02 -0500 Subject: [PATCH 10/16] fix: split CalorimeterHitDigi in header and source --- JugDigi/JugDigi/CalorimeterHitDigi.h | 80 +++++ JugDigi/src/components/CalorimeterHitDigi.cpp | 331 +++++++----------- 2 files changed, 215 insertions(+), 196 deletions(-) diff --git a/JugDigi/JugDigi/CalorimeterHitDigi.h b/JugDigi/JugDigi/CalorimeterHitDigi.h index e69de29..d328fd9 100644 --- a/JugDigi/JugDigi/CalorimeterHitDigi.h +++ b/JugDigi/JugDigi/CalorimeterHitDigi.h @@ -0,0 +1,80 @@ +#pragma once + +#include + +// Algorithm base classes +#include "Jug/Algorithm.h" +#include "Jug/Property.h" +#include "Jug/Service.h" + +// DD4hep +#include "DD4hep/DD4hepUnits.h" +#include "DDRec/CellIDPositionConverter.h" +#include "DDSegmentation/BitFieldCoder.h" + +// EDM4hep +#include "edm4hep/RawCalorimeterHitCollection.h" +#include "edm4hep/SimCalorimeterHitCollection.h" + +namespace Jug::Digi { + +/** Generic calorimeter hit digitization. + * + * \ingroup digi + * \ingroup calorimetry + */ +// FIXME should be using JugAlgorithm template +// class CalorimeterHitDigi : JugAlgorithm +class CalorimeterHitDigi : JugAlgorithm { + +public: + // additional smearing resolutions + Jug::Property> u_eRes{this, "energyResolutions", {}}; // a/sqrt(E/GeV) + b + c/(E/GeV) + Jug::Property m_tRes{this, "timeResolution", 0.0 * dd4hep::ns}; + + // digitization settings + Jug::Property m_capADC{this, "capacityADC", 8096}; + Jug::Property m_dyRangeADC{this, "dynamicRangeADC", 100 * dd4hep::MeV}; + Jug::Property m_pedMeanADC{this, "pedestalMean", 400}; + Jug::Property m_pedSigmaADC{this, "pedestalSigma", 3.2}; + Jug::Property m_resolutionTDC{this, "resolutionTDC", 0.010 * dd4hep::ns}; + + Jug::Property m_corrMeanScale{this, "scaleResponse", 1.0}; + // These are better variable names for the "energyResolutions" array which is a bit + // magic @FIXME + // Jug::Property m_corrSigmaCoeffE{this, "responseCorrectionSigmaCoeffE", 0.0}; + // Jug::Property m_corrSigmaCoeffSqrtE{this, "responseCorrectionSigmaCoeffSqrtE", 0.0}; + + // signal sums + // @TODO: implement signal sums with timing + // field names to generate id mask, the hits will be grouped by masking the field + Jug::Property> u_fields{this, "signalSumFields", {}}; + // ref field ids are used for the merged hits, 0 is used if nothing provided + Jug::Property> u_refs{this, "fieldRefNumbers", {}}; + Jug::Property m_readout{this, "readoutClass", ""}; + + // Geometry service + Jug::Service m_geoSvc; + + // unitless counterparts of inputs FIXME remove + double dyRangeADC{0}, stepTDC{0}, tRes{0}, eRes[3] = {0., 0., 0.}; + uint64_t id_mask{0}, ref_mask{0}; + + CalorimeterHitDigi() = default; + + bool initialize(); + + edm4hep::RawCalorimeterHitCollection operator()(const edm4hep::SimCalorimeterHitCollection& input, + const std::function normdist) const; + + bool finalize(); + +private: + edm4hep::RawCalorimeterHitCollection single_hits_digi(const edm4hep::SimCalorimeterHitCollection& simhits, + const std::function normdist) const; + + edm4hep::RawCalorimeterHitCollection signal_sum_digi(const edm4hep::SimCalorimeterHitCollection& simhits, + const std::function normdist) const; +}; + +} // namespace Jug::Digi diff --git a/JugDigi/src/components/CalorimeterHitDigi.cpp b/JugDigi/src/components/CalorimeterHitDigi.cpp index 95366f3..db915f9 100644 --- a/JugDigi/src/components/CalorimeterHitDigi.cpp +++ b/JugDigi/src/components/CalorimeterHitDigi.cpp @@ -10,6 +10,8 @@ // Author: Chao Peng // Date: 06/02/2021 +#include "JugDigi/CalorimeterHitDigi.h" + #include #include #include @@ -18,223 +20,160 @@ #include "DDRec/CellIDPositionConverter.h" #include "DDSegmentation/BitFieldCoder.h" -#include "Jug/Algorithm.h" -#include "Jug/Property.h" -#include "Jug/Service.h" - #include "fmt/format.h" #include "fmt/ranges.h" // Event Model related classes -#include "edm4hep/SimCalorimeterHitCollection.h" #include "edm4hep/RawCalorimeterHitCollection.h" +#include "edm4hep/SimCalorimeterHitCollection.h" namespace Jug::Digi { - /** Generic calorimeter hit digitiziation. - * - * \ingroup digi - * \ingroup calorimetry - */ - class CalorimeterHitDigi : JugAlgorithm { - public: - // additional smearing resolutions - Jug::Property> u_eRes{this, "energyResolutions", {}}; // a/sqrt(E/GeV) + b + c/(E/GeV) - Jug::Property m_tRes{this, "timeResolution", 0.0 * dd4hep::ns}; - - // digitization settings - Jug::Property m_capADC{this, "capacityADC", 8096}; - Jug::Property m_dyRangeADC{this, "dynamicRangeADC", 100 * dd4hep::MeV}; - Jug::Property m_pedMeanADC{this, "pedestalMean", 400}; - Jug::Property m_pedSigmaADC{this, "pedestalSigma", 3.2}; - Jug::Property m_resolutionTDC{this, "resolutionTDC", 0.010 * dd4hep::ns}; - - Jug::Property m_corrMeanScale{this, "scaleResponse", 1.0}; - // These are better variable names for the "energyResolutions" array which is a bit - // magic @FIXME - //Jug::Property m_corrSigmaCoeffE{this, "responseCorrectionSigmaCoeffE", 0.0}; - //Jug::Property m_corrSigmaCoeffSqrtE{this, "responseCorrectionSigmaCoeffSqrtE", 0.0}; - - // signal sums - // @TODO: implement signal sums with timing - // field names to generate id mask, the hits will be grouped by masking the field - Jug::Property> u_fields{this, "signalSumFields", {}}; - // ref field ids are used for the merged hits, 0 is used if nothing provided - Jug::Property> u_refs{this, "fieldRefNumbers", {}}; - Jug::Property m_readout{this, "readoutClass", ""}; - - // Geometry service - Jug::Service m_geoSvc; - - // unitless counterparts of inputs - double dyRangeADC{0}, stepTDC{0}, tRes{0}, eRes[3] = {0., 0., 0.}; - uint64_t id_mask{0}, ref_mask{0}; - - CalorimeterHitDigi() = default; - - bool initialize() - { - // set energy resolution numbers - for (size_t i = 0; i < u_eRes.value().size() && i < 3; ++i) { - eRes[i] = u_eRes.value()[i]; - } - - // using juggler internal units (GeV, mm, radian, ns) - dyRangeADC = m_dyRangeADC.value() / dd4hep::GeV; - tRes = m_tRes.value() / dd4hep::ns; - stepTDC = dd4hep::ns / m_resolutionTDC.value(); - - // need signal sum - if (!u_fields.value().empty()) { - // sanity checks - if (!m_geoSvc()) { - error() << "Unable to locate Geometry Service. " - << "Make sure you have GeoSvc and SimSvc in the right order in the configuration." - << std::endl;; - return false; - } - if (m_readout.value().empty()) { - error() << "readoutClass is not provided, it is needed to know the fields in readout ids" - << std::endl;; - return false; - } +bool CalorimeterHitDigi::initialize() { + // set energy resolution numbers + for (size_t i = 0; i < u_eRes.value().size() && i < 3; ++i) { + eRes[i] = u_eRes.value()[i]; + } + + // using juggler internal units (GeV, mm, radian, ns) + dyRangeADC = m_dyRangeADC.value() / dd4hep::GeV; + tRes = m_tRes.value() / dd4hep::ns; + stepTDC = dd4hep::ns / m_resolutionTDC.value(); + + // need signal sum + if (!u_fields.value().empty()) { + // sanity checks + if (!m_geoSvc()) { + error() << "Unable to locate Geometry Service. " + << "Make sure you have GeoSvc and SimSvc in the right order in the configuration." << std::endl; + ; + return false; + } + if (m_readout.value().empty()) { + error() << "readoutClass is not provided, it is needed to know the fields in readout ids" << std::endl; + ; + return false; + } - // get decoders - try { - auto id_desc = m_geoSvc()->readout(m_readout.value()).idSpec(); - id_mask = 0; - std::vector> ref_fields; - for (size_t i = 0; i < u_fields.value().size(); ++i) { - id_mask |= id_desc.field(u_fields.value()[i])->mask(); - // use the provided id number to find ref cell, or use 0 - int ref = i < u_refs.value().size() ? u_refs.value()[i] : 0; - ref_fields.emplace_back(u_fields.value()[i], ref); - } - ref_mask = id_desc.encode(ref_fields); - // debug() << fmt::format("Referece id mask for the fields {:#064b}", ref_mask) << std::endl;; - } catch (...) { - error() << "Failed to load ID decoder for " << m_readout.value() << std::endl;; - return false; - } - id_mask = ~id_mask; - info() << fmt::format("ID mask in {:s}: {:#064b}", m_readout.value(), id_mask) << std::endl;; - return true; + // get decoders + try { + auto id_desc = m_geoSvc()->readout(m_readout.value()).idSpec(); + id_mask = 0; + std::vector> ref_fields; + for (size_t i = 0; i < u_fields.value().size(); ++i) { + id_mask |= id_desc.field(u_fields.value()[i])->mask(); + // use the provided id number to find ref cell, or use 0 + int ref = i < u_refs.value().size() ? u_refs.value()[i] : 0; + ref_fields.emplace_back(u_fields.value()[i], ref); } - - return true; + ref_mask = id_desc.encode(ref_fields); + // debug() << fmt::format("Referece id mask for the fields {:#064b}", ref_mask) << std::endl;; + } catch (...) { + error() << "Failed to load ID decoder for " << m_readout.value() << std::endl; + ; + return false; } - - edm4hep::RawCalorimeterHitCollection - execute( - const edm4hep::SimCalorimeterHitCollection& input, - const std::function normdist - ) { - if (!u_fields.value().empty()) { - return signal_sum_digi(input, normdist); - } else { - return single_hits_digi(input, normdist); + id_mask = ~id_mask; + info() << fmt::format("ID mask in {:s}: {:#064b}", m_readout.value(), id_mask) << std::endl; + ; + return true; + } + + return true; +} + +edm4hep::RawCalorimeterHitCollection CalorimeterHitDigi::operator()(const edm4hep::SimCalorimeterHitCollection& input, + const std::function normdist) const { + if (!u_fields.value().empty()) { + return signal_sum_digi(input, normdist); + } else { + return single_hits_digi(input, normdist); + } +} + +edm4hep::RawCalorimeterHitCollection +CalorimeterHitDigi::single_hits_digi(const edm4hep::SimCalorimeterHitCollection& simhits, + const std::function normdist) const { + edm4hep::RawCalorimeterHitCollection rawhits; + + for (const auto& ahit : simhits) { + // Note: juggler internal unit of energy is GeV + const double eDep = ahit.getEnergy(); + + // apply additional calorimeter noise to corrected energy deposit + const double eResRel = (eDep > 1e-6) ? normdist() * std::sqrt(std::pow(eRes[0] / std::sqrt(eDep), 2) + + std::pow(eRes[1], 2) + std::pow(eRes[2] / (eDep), 2)) + : 0; + + const double ped = m_pedMeanADC.value() + normdist() * m_pedSigmaADC.value(); + const long long adc = + std::llround(ped + m_corrMeanScale.value() * eDep * (1. + eResRel) / dyRangeADC * m_capADC.value()); + + double time = std::numeric_limits::max(); + for (const auto& c : ahit.getContributions()) { + if (c.getTime() <= time) { + time = c.getTime(); } } - - private: - edm4hep::RawCalorimeterHitCollection - single_hits_digi( - const edm4hep::SimCalorimeterHitCollection& simhits, - const std::function normdist - ) { - edm4hep::RawCalorimeterHitCollection rawhits; - - for (const auto& ahit : simhits) { - // Note: juggler internal unit of energy is GeV - const double eDep = ahit.getEnergy(); - - // apply additional calorimeter noise to corrected energy deposit - const double eResRel = (eDep > 1e-6) - ? normdist() * std::sqrt(std::pow(eRes[0] / std::sqrt(eDep), 2) + - std::pow(eRes[1], 2) + std::pow(eRes[2] / (eDep), 2)) - : 0; - - const double ped = m_pedMeanADC.value() + normdist() * m_pedSigmaADC.value(); - const long long adc = std::llround(ped + m_corrMeanScale.value() * eDep * (1. + eResRel) / dyRangeADC * m_capADC.value()); - - double time = std::numeric_limits::max(); - for (const auto& c : ahit.getContributions()) { + const long long tdc = std::llround((time + normdist() * tRes) * stepTDC); + + edm4hep::RawCalorimeterHit rawhit(ahit.getCellID(), (adc > m_capADC.value() ? m_capADC.value() : adc), tdc); + rawhits->push_back(rawhit); + } + + return rawhits; +} + +edm4hep::RawCalorimeterHitCollection +CalorimeterHitDigi::signal_sum_digi(const edm4hep::SimCalorimeterHitCollection& simhits, + const std::function normdist) const { + edm4hep::RawCalorimeterHitCollection rawhits; + + // find the hits that belong to the same group (for merging) + std::unordered_map> merge_map; + for (const auto& ahit : simhits) { + int64_t hid = (ahit.getCellID() & id_mask) | ref_mask; + auto it = merge_map.find(hid); + + if (it == merge_map.end()) { + merge_map[hid] = {ahit}; + } else { + it->second.push_back(ahit); + } + } + + // signal sum + for (auto& [id, hits] : merge_map) { + double edep = hits[0].getEnergy(); + double time = hits[0].getContributions(0).getTime(); + double max_edep = hits[0].getEnergy(); + // sum energy, take time from the most energetic hit + for (size_t i = 1; i < hits.size(); ++i) { + edep += hits[i].getEnergy(); + if (hits[i].getEnergy() > max_edep) { + max_edep = hits[i].getEnergy(); + for (const auto& c : hits[i].getContributions()) { if (c.getTime() <= time) { time = c.getTime(); } } - const long long tdc = std::llround((time + normdist() * tRes) * stepTDC); - - edm4hep::RawCalorimeterHit rawhit( - ahit.getCellID(), - (adc > m_capADC.value() ? m_capADC.value() : adc), - tdc - ); - rawhits->push_back(rawhit); } - - return rawhits; } - edm4hep::RawCalorimeterHitCollection - signal_sum_digi( - const edm4hep::SimCalorimeterHitCollection& simhits, - const std::function normdist - ) { - edm4hep::RawCalorimeterHitCollection rawhits; - - // find the hits that belong to the same group (for merging) - std::unordered_map> merge_map; - for (const auto &ahit : simhits) { - int64_t hid = (ahit.getCellID() & id_mask) | ref_mask; - auto it = merge_map.find(hid); - - if (it == merge_map.end()) { - merge_map[hid] = {ahit}; - } else { - it->second.push_back(ahit); - } - } - - // signal sum - for (auto &[id, hits] : merge_map) { - double edep = hits[0].getEnergy(); - double time = hits[0].getContributions(0).getTime(); - double max_edep = hits[0].getEnergy(); - // sum energy, take time from the most energetic hit - for (size_t i = 1; i < hits.size(); ++i) { - edep += hits[i].getEnergy(); - if (hits[i].getEnergy() > max_edep) { - max_edep = hits[i].getEnergy(); - for (const auto& c : hits[i].getContributions()) { - if (c.getTime() <= time) { - time = c.getTime(); - } - } - } - } + double eResRel = 0.; + // safety check + if (edep > 1e-6) { + eResRel = normdist() * eRes[0] / std::sqrt(edep) + normdist() * eRes[1] + normdist() * eRes[2] / edep; + } + double ped = m_pedMeanADC.value() + normdist() * m_pedSigmaADC.value(); + unsigned long long adc = std::llround(ped + edep * (1. + eResRel) / dyRangeADC * m_capADC.value()); + unsigned long long tdc = std::llround((time + normdist() * tRes) * stepTDC); - double eResRel = 0.; - // safety check - if (edep > 1e-6) { - eResRel = normdist() * eRes[0] / std::sqrt(edep) + - normdist() * eRes[1] + - normdist() * eRes[2] / edep; - } - double ped = m_pedMeanADC.value() + normdist() * m_pedSigmaADC.value(); - unsigned long long adc = std::llround(ped + edep * (1. + eResRel) / dyRangeADC * m_capADC.value()); - unsigned long long tdc = std::llround((time + normdist() * tRes) * stepTDC); - - edm4hep::RawCalorimeterHit rawhit( - id, - (adc > m_capADC.value() ? m_capADC.value() : adc), - tdc - ); - rawhits.push_back(rawhit); - } + edm4hep::RawCalorimeterHit rawhit(id, (adc > m_capADC.value() ? m_capADC.value() : adc), tdc); + rawhits.push_back(rawhit); + } - return rawhits; - } - }; + return rawhits; +} } // namespace Jug::Digi From a329b841c89d14dfd2cc2779ae0fdf239a80b7e3 Mon Sep 17 00:00:00 2001 From: Wouter Deconinck Date: Tue, 16 Aug 2022 14:15:32 -0500 Subject: [PATCH 11/16] fix: enable JugBase again to install base headers --- CMakeLists.txt | 2 +- JugBase/CMakeLists.txt | 60 +++++++++------------------- JugBase/Jug/Algorithm.h | 1 + JugBase/src/components/Algorithm.cpp | 1 + 4 files changed, 21 insertions(+), 43 deletions(-) create mode 100644 JugBase/src/components/Algorithm.cpp diff --git a/CMakeLists.txt b/CMakeLists.txt index e300ee2..fe9d194 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -76,7 +76,7 @@ add_definitions("-DActs_VERSION_PATCH=${Acts_VERSION_PATCH}") find_library(genfit2 genfit2 /usr/local/lib REQUIRED) find_path(genfit2_INCLUDE_DIR NAMES GFGbl.h PATHS /usr/local/include ${genfit2}/../include REQUIRED) -#add_subdirectory(JugBase) +add_subdirectory(JugBase) add_subdirectory(JugDigi) #add_subdirectory(JugFast) #add_subdirectory(JugPID) diff --git a/JugBase/CMakeLists.txt b/JugBase/CMakeLists.txt index c0a30da..932e27a 100644 --- a/JugBase/CMakeLists.txt +++ b/JugBase/CMakeLists.txt @@ -5,56 +5,32 @@ # Package: JugBase ################################################################################ -file(GLOB JugBase_sources CONFIGURE_DEPENDS src/*.cpp) -file(GLOB JugBase_plugins CONFIGURE_DEPENDS src/Plugins/*.cpp) -file(GLOB JugBase_utilities CONFIGURE_DEPENDS src/Utilities/*.cpp) -gaudi_add_library(JugBase - SOURCES - ${JugBase_sources} - ${JugBase_plugins} - ${JugBase_utilities} - LINK - Gaudi::GaudiKernel Gaudi::GaudiAlgLib - podio::podioRootIO - ROOT::Core ROOT::RIO ROOT::Tree - DD4hep::DDG4IO DD4hep::DDRec - ActsCore ActsPluginDD4hep - ${genfit2} +file(GLOB JugBasePlugins_sources CONFIGURE_DEPENDS src/components/*.cpp) +set(JugBasePlugins_sources + src/components/Algorithm.cpp ) - -target_include_directories(JugBase PUBLIC - $ - $ - ${genfit2_INCLUDE_DIR} +set(JugBasePlugins_headers + Jug/Algorithm.h + Jug/Property.h ) - -target_compile_options(JugBase PRIVATE -Wno-suggest-override) - -file(GLOB JugBasePlugins_sources CONFIGURE_DEPENDS src/components/*.cpp) -gaudi_add_module(JugBasePlugins - SOURCES - ${JugBasePlugins_sources} - LINK - Gaudi::GaudiKernel Gaudi::GaudiAlgLib - ROOT::Core ROOT::RIO ROOT::Tree - JugBase +add_library(JugBasePlugins SHARED "${JugBasePlugins_sources}") +set_target_properties(JugBasePlugins + PROPERTIES PUBLIC_HEADER "${JugBasePlugins_headers}") +target_link_libraries(JugBasePlugins EDM4HEP::edm4hep - DD4hep::DDRec - ActsCore ActsPluginDD4hep ActsPluginJson EICD::eicd - ${genfit2} ) target_include_directories(JugBasePlugins PUBLIC + $ $ - $ - ${genfit2_INCLUDE_DIR} -) + $) target_compile_options(JugBasePlugins PRIVATE -Wno-suggest-override) -install(TARGETS JugBase JugBasePlugins - EXPORT JugBaseTargets - RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" COMPONENT bin - LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" COMPONENT shlib - COMPONENT dev) +install(TARGETS JugBasePlugins + EXPORT ${PROJECT_NAME}Targets + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/JugBase +) diff --git a/JugBase/Jug/Algorithm.h b/JugBase/Jug/Algorithm.h index 9812f99..1bee4be 100644 --- a/JugBase/Jug/Algorithm.h +++ b/JugBase/Jug/Algorithm.h @@ -1,5 +1,6 @@ #pragma once +#include #include namespace Jug { diff --git a/JugBase/src/components/Algorithm.cpp b/JugBase/src/components/Algorithm.cpp new file mode 100644 index 0000000..2e1ab55 --- /dev/null +++ b/JugBase/src/components/Algorithm.cpp @@ -0,0 +1 @@ +#include "Jug/Algorithm.h" From 5aa4892fdf530cf92fba519be29c4c13d4b3192a Mon Sep 17 00:00:00 2001 From: Wouter Deconinck Date: Tue, 16 Aug 2022 15:58:45 -0500 Subject: [PATCH 12/16] move Jug into JugBase for public distribution, change namespace --- JugBase/CMakeLists.txt | 5 +---- JugBase/{Jug => JugBase}/Algorithm.h | 6 +++--- JugBase/{Jug => JugBase}/Particle.h | 4 ++-- JugBase/{Jug => JugBase}/Property.h | 4 ++-- JugBase/{Jug => JugBase}/Service.h | 4 ++-- 5 files changed, 10 insertions(+), 13 deletions(-) rename JugBase/{Jug => JugBase}/Algorithm.h (93%) rename JugBase/{Jug => JugBase}/Particle.h (73%) rename JugBase/{Jug => JugBase}/Property.h (91%) rename JugBase/{Jug => JugBase}/Service.h (76%) diff --git a/JugBase/CMakeLists.txt b/JugBase/CMakeLists.txt index 932e27a..67243b1 100644 --- a/JugBase/CMakeLists.txt +++ b/JugBase/CMakeLists.txt @@ -9,10 +9,7 @@ file(GLOB JugBasePlugins_sources CONFIGURE_DEPENDS src/components/*.cpp) set(JugBasePlugins_sources src/components/Algorithm.cpp ) -set(JugBasePlugins_headers - Jug/Algorithm.h - Jug/Property.h -) +file(GLOB JugBasePlugins_headers CONFIGURE_DEPENDS JugBase/*.h) add_library(JugBasePlugins SHARED "${JugBasePlugins_sources}") set_target_properties(JugBasePlugins PROPERTIES PUBLIC_HEADER "${JugBasePlugins_headers}") diff --git a/JugBase/Jug/Algorithm.h b/JugBase/JugBase/Algorithm.h similarity index 93% rename from JugBase/Jug/Algorithm.h rename to JugBase/JugBase/Algorithm.h index 1bee4be..aae7891 100644 --- a/JugBase/Jug/Algorithm.h +++ b/JugBase/JugBase/Algorithm.h @@ -3,7 +3,7 @@ #include #include -namespace Jug { +namespace algorithms { class ISvcLocator; @@ -49,7 +49,7 @@ namespace Jug { public: - JugAlgorithm(const std::string& name, ISvcLocator* svc) + JugAlgorithm(const std::string& name = "", ISvcLocator* svc = nullptr) : m_name(name),m_svc(svc) { } @@ -62,4 +62,4 @@ namespace Jug { }; -} // namespace Jug +} // namespace algorithms diff --git a/JugBase/Jug/Particle.h b/JugBase/JugBase/Particle.h similarity index 73% rename from JugBase/Jug/Particle.h rename to JugBase/JugBase/Particle.h index c5ba026..b9aa9e8 100644 --- a/JugBase/Jug/Particle.h +++ b/JugBase/JugBase/Particle.h @@ -1,6 +1,6 @@ #pragma once -namespace Jug::Base { +namespace algorithms::base { /** Simple particle data. * @@ -10,4 +10,4 @@ namespace Jug::Base { int charge; double mass; //std::string name; }; -} // namespace Jug::Base +} // namespace algorithms::base diff --git a/JugBase/Jug/Property.h b/JugBase/JugBase/Property.h similarity index 91% rename from JugBase/Jug/Property.h rename to JugBase/JugBase/Property.h index 76ee37a..5d8d10c 100644 --- a/JugBase/Jug/Property.h +++ b/JugBase/JugBase/Property.h @@ -2,7 +2,7 @@ #include -namespace Jug { +namespace algorithms { template class Property { @@ -24,4 +24,4 @@ namespace Jug { }; -} // namespace Jug +} // namespace algorithms diff --git a/JugBase/Jug/Service.h b/JugBase/JugBase/Service.h similarity index 76% rename from JugBase/Jug/Service.h rename to JugBase/JugBase/Service.h index 858cd9c..616d4c3 100644 --- a/JugBase/Jug/Service.h +++ b/JugBase/JugBase/Service.h @@ -2,7 +2,7 @@ #include -namespace Jug { +namespace algorithms { template class Service: public std::function { @@ -10,4 +10,4 @@ namespace Jug { Service() = default; }; -} // namespace Jug +} // namespace algorithms From 44a183b8049d97b5a050f338fb3cd52abd2f35d1 Mon Sep 17 00:00:00 2001 From: Wouter Deconinck Date: Tue, 16 Aug 2022 15:59:04 -0500 Subject: [PATCH 13/16] include JugBase, not Jug/Algorithm --- JugBase/src/components/Algorithm.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/JugBase/src/components/Algorithm.cpp b/JugBase/src/components/Algorithm.cpp index 2e1ab55..84f6b7b 100644 --- a/JugBase/src/components/Algorithm.cpp +++ b/JugBase/src/components/Algorithm.cpp @@ -1 +1 @@ -#include "Jug/Algorithm.h" +#include "JugBase/Algorithm.h" From 5cbd4a13b4e8c87a47919349279977a2b7adde8e Mon Sep 17 00:00:00 2001 From: Wouter Deconinck Date: Tue, 16 Aug 2022 15:59:28 -0500 Subject: [PATCH 14/16] full implementation of digi calorimeter algorithms --- JugDigi/JugDigi/CalorimeterBirksCorr.h | 34 ++++++++ JugDigi/JugDigi/CalorimeterHitDigi.h | 55 +++++++------ .../src/components/CalorimeterBirksCorr.cpp | 81 ++++++------------- JugDigi/src/components/CalorimeterHitDigi.cpp | 45 +++++------ 4 files changed, 105 insertions(+), 110 deletions(-) diff --git a/JugDigi/JugDigi/CalorimeterBirksCorr.h b/JugDigi/JugDigi/CalorimeterBirksCorr.h index e69de29..098633e 100644 --- a/JugDigi/JugDigi/CalorimeterBirksCorr.h +++ b/JugDigi/JugDigi/CalorimeterBirksCorr.h @@ -0,0 +1,34 @@ +// Algorithm base classes +#include "JugBase/Algorithm.h" +#include "JugBase/Property.h" +#include "JugBase/Service.h" +#include "JugBase/Particle.h" + +// DD4hep +#include "DD4hep/DD4hepUnits.h" + +// EDM4hep +#include "edm4hep/SimCalorimeterHitCollection.h" + +namespace algorithms::digi { + +/** Generic calorimeter hit digitiziation. + * + * \ingroup digi + * \ingroup calorimetry + */ +class CalorimeterBirksCorr : public JugAlgorithm { +public: + CalorimeterBirksCorr() = default; + + // Properties + algorithms::Property m_birksConstant{this, "birksConstant", 0.126 * dd4hep::mm / dd4hep::MeV}; + + // Services + algorithms::Service m_pidSvc; + + // Operator + edm4hep::SimCalorimeterHitCollection operator()(const edm4hep::SimCalorimeterHitCollection& input) const; +}; + +} // namespace algorithms::digi diff --git a/JugDigi/JugDigi/CalorimeterHitDigi.h b/JugDigi/JugDigi/CalorimeterHitDigi.h index d328fd9..46a261d 100644 --- a/JugDigi/JugDigi/CalorimeterHitDigi.h +++ b/JugDigi/JugDigi/CalorimeterHitDigi.h @@ -3,9 +3,9 @@ #include // Algorithm base classes -#include "Jug/Algorithm.h" -#include "Jug/Property.h" -#include "Jug/Service.h" +#include "JugBase/Algorithm.h" +#include "JugBase/Property.h" +#include "JugBase/Service.h" // DD4hep #include "DD4hep/DD4hepUnits.h" @@ -13,10 +13,10 @@ #include "DDSegmentation/BitFieldCoder.h" // EDM4hep -#include "edm4hep/RawCalorimeterHitCollection.h" +#include "eicd/RawCalorimeterHitCollection.h" #include "edm4hep/SimCalorimeterHitCollection.h" -namespace Jug::Digi { +namespace algorithms::digi { /** Generic calorimeter hit digitization. * @@ -24,37 +24,40 @@ namespace Jug::Digi { * \ingroup calorimetry */ // FIXME should be using JugAlgorithm template -// class CalorimeterHitDigi : JugAlgorithm +// class CalorimeterHitDigi : JugAlgorithm class CalorimeterHitDigi : JugAlgorithm { public: // additional smearing resolutions - Jug::Property> u_eRes{this, "energyResolutions", {}}; // a/sqrt(E/GeV) + b + c/(E/GeV) - Jug::Property m_tRes{this, "timeResolution", 0.0 * dd4hep::ns}; + algorithms::Property> u_eRes{this, "energyResolutions", {}}; // a/sqrt(E/GeV) + b + c/(E/GeV) + algorithms::Property m_tRes{this, "timeResolution", 0.0 * dd4hep::ns}; // digitization settings - Jug::Property m_capADC{this, "capacityADC", 8096}; - Jug::Property m_dyRangeADC{this, "dynamicRangeADC", 100 * dd4hep::MeV}; - Jug::Property m_pedMeanADC{this, "pedestalMean", 400}; - Jug::Property m_pedSigmaADC{this, "pedestalSigma", 3.2}; - Jug::Property m_resolutionTDC{this, "resolutionTDC", 0.010 * dd4hep::ns}; + algorithms::Property m_capADC{this, "capacityADC", 8096}; + algorithms::Property m_dyRangeADC{this, "dynamicRangeADC", 100 * dd4hep::MeV}; + algorithms::Property m_pedMeanADC{this, "pedestalMean", 400}; + algorithms::Property m_pedSigmaADC{this, "pedestalSigma", 3.2}; + algorithms::Property m_resolutionTDC{this, "resolutionTDC", 0.010 * dd4hep::ns}; - Jug::Property m_corrMeanScale{this, "scaleResponse", 1.0}; + algorithms::Property m_corrMeanScale{this, "scaleResponse", 1.0}; // These are better variable names for the "energyResolutions" array which is a bit // magic @FIXME - // Jug::Property m_corrSigmaCoeffE{this, "responseCorrectionSigmaCoeffE", 0.0}; - // Jug::Property m_corrSigmaCoeffSqrtE{this, "responseCorrectionSigmaCoeffSqrtE", 0.0}; + // algorithms::Property m_corrSigmaCoeffE{this, "responseCorrectionSigmaCoeffE", 0.0}; + // algorithms::Property m_corrSigmaCoeffSqrtE{this, "responseCorrectionSigmaCoeffSqrtE", 0.0}; // signal sums // @TODO: implement signal sums with timing // field names to generate id mask, the hits will be grouped by masking the field - Jug::Property> u_fields{this, "signalSumFields", {}}; + algorithms::Property> u_fields{this, "signalSumFields", {}}; // ref field ids are used for the merged hits, 0 is used if nothing provided - Jug::Property> u_refs{this, "fieldRefNumbers", {}}; - Jug::Property m_readout{this, "readoutClass", ""}; + algorithms::Property> u_refs{this, "fieldRefNumbers", {}}; + algorithms::Property m_readout{this, "readoutClass", ""}; // Geometry service - Jug::Service m_geoSvc; + algorithms::Service m_geoSvc; + + // Random service + algorithms::Service m_normDist; // unitless counterparts of inputs FIXME remove double dyRangeADC{0}, stepTDC{0}, tRes{0}, eRes[3] = {0., 0., 0.}; @@ -64,17 +67,13 @@ class CalorimeterHitDigi : JugAlgorithm { bool initialize(); - edm4hep::RawCalorimeterHitCollection operator()(const edm4hep::SimCalorimeterHitCollection& input, - const std::function normdist) const; + eicd::RawCalorimeterHitCollection operator()(const edm4hep::SimCalorimeterHitCollection& input) const; bool finalize(); private: - edm4hep::RawCalorimeterHitCollection single_hits_digi(const edm4hep::SimCalorimeterHitCollection& simhits, - const std::function normdist) const; - - edm4hep::RawCalorimeterHitCollection signal_sum_digi(const edm4hep::SimCalorimeterHitCollection& simhits, - const std::function normdist) const; + eicd::RawCalorimeterHitCollection single_hits_digi(const edm4hep::SimCalorimeterHitCollection& simhits) const; + eicd::RawCalorimeterHitCollection signal_sum_digi(const edm4hep::SimCalorimeterHitCollection& simhits) const; }; -} // namespace Jug::Digi +} // namespace algorithms::digi diff --git a/JugDigi/src/components/CalorimeterBirksCorr.cpp b/JugDigi/src/components/CalorimeterBirksCorr.cpp index a0ba432..d2afa70 100644 --- a/JugDigi/src/components/CalorimeterBirksCorr.cpp +++ b/JugDigi/src/components/CalorimeterBirksCorr.cpp @@ -7,64 +7,29 @@ // Author: Chao Peng // Date: 09/29/2021 -#include -#include - -#include "JugAlg/JugTool.h" -#include "JugAlg/Transformer.h" -#include "JugKernel/PhysicalConstants.h" -#include "Jug/Property.h" -#include "Jug/Service.h" -#include "JugKernel/RndmGenerators.h" - -#include "JugBase/DataHandle.h" -#include "JugBase/IParticleSvc.h" - -// Event Model related classes -#include "edm4hep/SimCalorimeterHitCollection.h" - - -namespace Jug::Digi { - - /** Generic calorimeter hit digitiziation. - * - * \ingroup digi - * \ingroup calorimetry - */ - class CalorimeterBirksCorr : public JugAlgorithm { - public: - - // Types - using InputCollection = edm4hep::SimCalorimeterHitCollection; - using OutputCollection = edm4hep::SimCalorimeterHitCollection; - - // Properties - Jug::Property m_birksConstant{this, "birksConstant", 0.126*mm/MeV}; - - // Services - Jug::Service m_pidSvc; - - OutputCollection operator()(const InputCollection& input) const - { - OutputCollection ohits; - for (const auto& hit : input) { - auto ohit = ohits->create(hit.getCellID(), hit.getEnergy(), hit.getPosition()); - double energy = 0.; - for (const auto &c: hit.getContributions()) { - ohit.addToContributions(c); - const double charge = m_pidSvc(c.getPDG()).charge; - // some tolerance for precision - if (std::abs(charge) > 1e-5) { - // FIXME - //energy += c.getEnergy() / (1. + c.getEnergy() / c.length * m_birksConstant); - error() << "edm4hep::CaloHitContribution has no length field for Birks correction." << endmsg; - } - } - // replace energy deposit with Birks Law corrected value - ohit.setEnergy(energy); +#include "JugDigi/CalorimeterBirksCorr.h" + +namespace algorithms::digi { + +edm4hep::SimCalorimeterHitCollection CalorimeterBirksCorr::operator()(const edm4hep::SimCalorimeterHitCollection& input) const { + edm4hep::SimCalorimeterHitCollection ohits; + for (const auto& hit : input) { + auto ohit = ohits.create(hit.getCellID(), hit.getEnergy(), hit.getPosition()); + double energy = 0.; + for (const auto& c : hit.getContributions()) { + ohit.addToContributions(c); + const double charge = m_pidSvc(c.getPDG()).charge; + // some tolerance for precision + if (std::abs(charge) > 1e-5) { + // FIXME + // energy += c.getEnergy() / (1. + c.getEnergy() / c.length * m_birksConstant); + error() << "edm4hep::CaloHitContribution has no length field for Birks correction." << endmsg; } - return ohits; } - }; + // replace energy deposit with Birks Law corrected value + ohit.setEnergy(energy); + } + return ohits; +} -} // namespace Jug::Digi +} // namespace algorithms::digi diff --git a/JugDigi/src/components/CalorimeterHitDigi.cpp b/JugDigi/src/components/CalorimeterHitDigi.cpp index db915f9..932545c 100644 --- a/JugDigi/src/components/CalorimeterHitDigi.cpp +++ b/JugDigi/src/components/CalorimeterHitDigi.cpp @@ -24,10 +24,10 @@ #include "fmt/ranges.h" // Event Model related classes -#include "edm4hep/RawCalorimeterHitCollection.h" +#include "eicd/RawCalorimeterHitCollection.h" #include "edm4hep/SimCalorimeterHitCollection.h" -namespace Jug::Digi { +namespace algorithms::digi { bool CalorimeterHitDigi::initialize() { // set energy resolution numbers @@ -82,30 +82,28 @@ bool CalorimeterHitDigi::initialize() { return true; } -edm4hep::RawCalorimeterHitCollection CalorimeterHitDigi::operator()(const edm4hep::SimCalorimeterHitCollection& input, - const std::function normdist) const { +eicd::RawCalorimeterHitCollection CalorimeterHitDigi::operator()(const edm4hep::SimCalorimeterHitCollection& input) const { if (!u_fields.value().empty()) { - return signal_sum_digi(input, normdist); + return signal_sum_digi(input); } else { - return single_hits_digi(input, normdist); + return single_hits_digi(input); } } -edm4hep::RawCalorimeterHitCollection -CalorimeterHitDigi::single_hits_digi(const edm4hep::SimCalorimeterHitCollection& simhits, - const std::function normdist) const { - edm4hep::RawCalorimeterHitCollection rawhits; +eicd::RawCalorimeterHitCollection +CalorimeterHitDigi::single_hits_digi(const edm4hep::SimCalorimeterHitCollection& simhits) const { + eicd::RawCalorimeterHitCollection rawhits; for (const auto& ahit : simhits) { // Note: juggler internal unit of energy is GeV const double eDep = ahit.getEnergy(); // apply additional calorimeter noise to corrected energy deposit - const double eResRel = (eDep > 1e-6) ? normdist() * std::sqrt(std::pow(eRes[0] / std::sqrt(eDep), 2) + - std::pow(eRes[1], 2) + std::pow(eRes[2] / (eDep), 2)) + const double eResRel = (eDep > 1e-6) ? m_normDist() * std::sqrt(std::pow(eRes[0] / std::sqrt(eDep), 2) + + std::pow(eRes[1], 2) + std::pow(eRes[2] / (eDep), 2)) : 0; - const double ped = m_pedMeanADC.value() + normdist() * m_pedSigmaADC.value(); + const double ped = m_pedMeanADC.value() + m_normDist() * m_pedSigmaADC.value(); const long long adc = std::llround(ped + m_corrMeanScale.value() * eDep * (1. + eResRel) / dyRangeADC * m_capADC.value()); @@ -115,19 +113,18 @@ CalorimeterHitDigi::single_hits_digi(const edm4hep::SimCalorimeterHitCollection& time = c.getTime(); } } - const long long tdc = std::llround((time + normdist() * tRes) * stepTDC); + const long long tdc = std::llround((time + m_normDist() * tRes) * stepTDC); - edm4hep::RawCalorimeterHit rawhit(ahit.getCellID(), (adc > m_capADC.value() ? m_capADC.value() : adc), tdc); + eicd::RawCalorimeterHit rawhit(ahit.getCellID(), (adc > m_capADC.value() ? m_capADC.value() : adc), tdc); rawhits->push_back(rawhit); } return rawhits; } -edm4hep::RawCalorimeterHitCollection -CalorimeterHitDigi::signal_sum_digi(const edm4hep::SimCalorimeterHitCollection& simhits, - const std::function normdist) const { - edm4hep::RawCalorimeterHitCollection rawhits; +eicd::RawCalorimeterHitCollection +CalorimeterHitDigi::signal_sum_digi(const edm4hep::SimCalorimeterHitCollection& simhits) const { + eicd::RawCalorimeterHitCollection rawhits; // find the hits that belong to the same group (for merging) std::unordered_map> merge_map; @@ -163,17 +160,17 @@ CalorimeterHitDigi::signal_sum_digi(const edm4hep::SimCalorimeterHitCollection& double eResRel = 0.; // safety check if (edep > 1e-6) { - eResRel = normdist() * eRes[0] / std::sqrt(edep) + normdist() * eRes[1] + normdist() * eRes[2] / edep; + eResRel = m_normDist() * eRes[0] / std::sqrt(edep) + m_normDist() * eRes[1] + m_normDist() * eRes[2] / edep; } - double ped = m_pedMeanADC.value() + normdist() * m_pedSigmaADC.value(); + double ped = m_pedMeanADC.value() + m_normDist() * m_pedSigmaADC.value(); unsigned long long adc = std::llround(ped + edep * (1. + eResRel) / dyRangeADC * m_capADC.value()); - unsigned long long tdc = std::llround((time + normdist() * tRes) * stepTDC); + unsigned long long tdc = std::llround((time + m_normDist() * tRes) * stepTDC); - edm4hep::RawCalorimeterHit rawhit(id, (adc > m_capADC.value() ? m_capADC.value() : adc), tdc); + eicd::RawCalorimeterHit rawhit(id, (adc > m_capADC.value() ? m_capADC.value() : adc), tdc); rawhits.push_back(rawhit); } return rawhits; } -} // namespace Jug::Digi +} // namespace algorithms::digi From 42dfa2c0b79934b2442a20e302cfa6ab9840e601 Mon Sep 17 00:00:00 2001 From: Wouter Deconinck Date: Tue, 16 Aug 2022 21:05:28 -0500 Subject: [PATCH 15/16] property and service registration --- JugBase/JugBase/Algorithm.h | 29 +++++++++++++++++++++------ JugBase/JugBase/Property.h | 40 +++++++++++++++++++++---------------- JugBase/JugBase/Service.h | 19 +++++++++++++----- 3 files changed, 60 insertions(+), 28 deletions(-) diff --git a/JugBase/JugBase/Algorithm.h b/JugBase/JugBase/Algorithm.h index aae7891..6e29dbb 100644 --- a/JugBase/JugBase/Algorithm.h +++ b/JugBase/JugBase/Algorithm.h @@ -5,7 +5,8 @@ namespace algorithms { - class ISvcLocator; + class PropertyBase; + class ServiceBase; class StatusCode { public: @@ -24,10 +25,25 @@ namespace algorithms { Value m_value; }; - class JugAlgorithm { + class AlgorithmBase { + private: + std::vector> m_properties; + std::vector> m_services; + public: + AlgorithmBase() = default; + void registerProperty(PropertyBase* property, const std::string& name) { + m_properties.push_back(std::make_pair(name, property)); + } + void registerService(ServiceBase* service, const std::string& name) { + m_services.push_back(std::make_pair(name, service)); + } + + }; + + template + class JugAlgorithm : public AlgorithmBase { private: std::string m_name; - ISvcLocator* m_svc; static std::function m_debug; static std::function m_info; @@ -47,12 +63,13 @@ namespace algorithms { m_error = error; } - public: - JugAlgorithm(const std::string& name = "", ISvcLocator* svc = nullptr) - : m_name(name),m_svc(svc) { + JugAlgorithm(const std::string& name = "") + : m_name(name) { } + virtual Out operator()(const In&) const = 0; + protected: static std::ostream& debug() { return m_debug(); }; static std::ostream& info() { return m_info(); }; diff --git a/JugBase/JugBase/Property.h b/JugBase/JugBase/Property.h index 5d8d10c..0cfdd1c 100644 --- a/JugBase/JugBase/Property.h +++ b/JugBase/JugBase/Property.h @@ -4,24 +4,30 @@ namespace algorithms { - template - class Property { - public: - using StorageType = TYPE; - using ValueType = typename std::remove_reference::type; - - private: - StorageType m_value; - - public: - template - Property(OWNER* /* owner */, std::string /* name */, TYPE&& value) - : m_value( std::forward( value ) ) { +class PropertyBase { +public: + PropertyBase() = default; +}; + +template class Property : public PropertyBase { +public: + using StorageType = TYPE; + using ValueType = typename std::remove_reference::type; + +private: + std::string m_name; + StorageType m_value; + +public: + template + Property(OWNER* owner, const std::string& name, TYPE&& value) : m_name(name), m_value(std::forward(value)) { + if (owner != nullptr) { + owner->registerProperty(this, m_name); } + } - const ValueType& value() const { return this->m_value; } - ValueType& value() { return const_cast( (const ValueType&)*this ); } - - }; + const ValueType& value() const { return this->m_value; } + ValueType& value() { return const_cast((const ValueType&)*this); } +}; } // namespace algorithms diff --git a/JugBase/JugBase/Service.h b/JugBase/JugBase/Service.h index 616d4c3..7b15615 100644 --- a/JugBase/JugBase/Service.h +++ b/JugBase/JugBase/Service.h @@ -1,13 +1,22 @@ #pragma once +#include #include +#include "JugBase/Algorithm.h" + namespace algorithms { - template - class Service: public std::function { - public: - Service() = default; - }; +template class Service : public std::function { +private: + std::string m_name; + +public: + template Service(OWNER* /*owner*/, const std::string& name) : m_name(name) { + if (this != nullptr) { + //owner->registerService(this, name); + } + } +}; } // namespace algorithms From 3e5a2e3e8df1e3a59ca80b215d081486192ab3ce Mon Sep 17 00:00:00 2001 From: Wouter Deconinck Date: Tue, 16 Aug 2022 21:05:46 -0500 Subject: [PATCH 16/16] full functional algorithms --- JugDigi/JugDigi/CalorimeterBirksCorr.h | 2 +- JugDigi/JugDigi/CalorimeterHitDigi.h | 10 ++++------ 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/JugDigi/JugDigi/CalorimeterBirksCorr.h b/JugDigi/JugDigi/CalorimeterBirksCorr.h index 098633e..926e493 100644 --- a/JugDigi/JugDigi/CalorimeterBirksCorr.h +++ b/JugDigi/JugDigi/CalorimeterBirksCorr.h @@ -17,7 +17,7 @@ namespace algorithms::digi { * \ingroup digi * \ingroup calorimetry */ -class CalorimeterBirksCorr : public JugAlgorithm { +class CalorimeterBirksCorr final : public JugAlgorithm { public: CalorimeterBirksCorr() = default; diff --git a/JugDigi/JugDigi/CalorimeterHitDigi.h b/JugDigi/JugDigi/CalorimeterHitDigi.h index 46a261d..3b08409 100644 --- a/JugDigi/JugDigi/CalorimeterHitDigi.h +++ b/JugDigi/JugDigi/CalorimeterHitDigi.h @@ -13,8 +13,8 @@ #include "DDSegmentation/BitFieldCoder.h" // EDM4hep -#include "eicd/RawCalorimeterHitCollection.h" #include "edm4hep/SimCalorimeterHitCollection.h" +#include "eicd/RawCalorimeterHitCollection.h" namespace algorithms::digi { @@ -23,9 +23,7 @@ namespace algorithms::digi { * \ingroup digi * \ingroup calorimetry */ -// FIXME should be using JugAlgorithm template -// class CalorimeterHitDigi : JugAlgorithm -class CalorimeterHitDigi : JugAlgorithm { +class CalorimeterHitDigi final : public JugAlgorithm { public: // additional smearing resolutions @@ -54,10 +52,10 @@ class CalorimeterHitDigi : JugAlgorithm { algorithms::Property m_readout{this, "readoutClass", ""}; // Geometry service - algorithms::Service m_geoSvc; + algorithms::Service m_geoSvc{this, "geoSvc"}; // Random service - algorithms::Service m_normDist; + algorithms::Service m_normDist{this, "normDist"}; // unitless counterparts of inputs FIXME remove double dyRangeADC{0}, stepTDC{0}, tRes{0}, eRes[3] = {0., 0., 0.};