From 06194c42ac86144fa7ca3625323bbf4d75bc7614 Mon Sep 17 00:00:00 2001 From: AJPfleger Date: Wed, 9 Oct 2024 10:38:42 +0200 Subject: [PATCH 01/10] material --- Core/include/Acts/Material/AccumulatedSurfaceMaterial.hpp | 2 +- Core/include/Acts/Material/HomogeneousVolumeMaterial.hpp | 2 +- Core/include/Acts/Material/ISurfaceMaterial.hpp | 2 +- Core/include/Acts/Material/InterpolatedMaterialMap.hpp | 3 ++- Core/include/Acts/Material/MaterialInteraction.hpp | 4 ++-- Core/include/Acts/Material/PropagatorMaterialAssigner.hpp | 2 +- Core/include/Acts/Material/ProtoVolumeMaterial.hpp | 2 +- Core/src/Material/VolumeMaterialMapper.cpp | 2 +- 8 files changed, 10 insertions(+), 9 deletions(-) diff --git a/Core/include/Acts/Material/AccumulatedSurfaceMaterial.hpp b/Core/include/Acts/Material/AccumulatedSurfaceMaterial.hpp index 7107410bfec..12c233a37e2 100644 --- a/Core/include/Acts/Material/AccumulatedSurfaceMaterial.hpp +++ b/Core/include/Acts/Material/AccumulatedSurfaceMaterial.hpp @@ -37,7 +37,7 @@ class AccumulatedSurfaceMaterial { /// Default Constructor - for homogeneous material /// /// @param splitFactor is the pre/post splitting directive - AccumulatedSurfaceMaterial(double splitFactor = 0.); + explicit AccumulatedSurfaceMaterial(double splitFactor = 0.); /// Explicit constructor with only full MaterialSlab, /// for one-dimensional binning. diff --git a/Core/include/Acts/Material/HomogeneousVolumeMaterial.hpp b/Core/include/Acts/Material/HomogeneousVolumeMaterial.hpp index 91005dcae55..0bb49452cd3 100644 --- a/Core/include/Acts/Material/HomogeneousVolumeMaterial.hpp +++ b/Core/include/Acts/Material/HomogeneousVolumeMaterial.hpp @@ -25,7 +25,7 @@ class HomogeneousVolumeMaterial : public IVolumeMaterial { /// Explicit constructor /// /// @param material is the material held by this - HomogeneousVolumeMaterial(const Material& material); + explicit HomogeneousVolumeMaterial(const Material& material); /// Copy Constructor /// diff --git a/Core/include/Acts/Material/ISurfaceMaterial.hpp b/Core/include/Acts/Material/ISurfaceMaterial.hpp index a379e18e715..ebeb5ff45af 100644 --- a/Core/include/Acts/Material/ISurfaceMaterial.hpp +++ b/Core/include/Acts/Material/ISurfaceMaterial.hpp @@ -38,7 +38,7 @@ class ISurfaceMaterial { /// Constructor /// /// @param splitFactor is the splitting ratio between pre/post update - ISurfaceMaterial(double splitFactor) : m_splitFactor(splitFactor) {} + explicit ISurfaceMaterial(double splitFactor) : m_splitFactor(splitFactor) {} /// Constructor /// diff --git a/Core/include/Acts/Material/InterpolatedMaterialMap.hpp b/Core/include/Acts/Material/InterpolatedMaterialMap.hpp index eb792539871..5c0f1014fe9 100644 --- a/Core/include/Acts/Material/InterpolatedMaterialMap.hpp +++ b/Core/include/Acts/Material/InterpolatedMaterialMap.hpp @@ -247,7 +247,8 @@ class InterpolatedMaterialMap : public IVolumeMaterial { /// @brief Create interpolated map /// /// @param [in] mapper Material map - InterpolatedMaterialMap(Mapper_t&& mapper) : m_mapper(std::move(mapper)) {} + explicit InterpolatedMaterialMap(Mapper_t&& mapper) + : m_mapper(std::move(mapper)) {} /// @brief Create interpolated map /// diff --git a/Core/include/Acts/Material/MaterialInteraction.hpp b/Core/include/Acts/Material/MaterialInteraction.hpp index e3b078d310a..0a02bf1e398 100644 --- a/Core/include/Acts/Material/MaterialInteraction.hpp +++ b/Core/include/Acts/Material/MaterialInteraction.hpp @@ -32,11 +32,11 @@ struct InteractionVolume { /// Constructor from tracking volume /// @param tv The tracking volume - InteractionVolume(const TrackingVolume* tv) : trackingVolume(tv) {} + explicit InteractionVolume(const TrackingVolume* tv) : trackingVolume(tv) {} /// Constructor from detector volume /// @param dv The detector volume - InteractionVolume(const Experimental::DetectorVolume* dv) + explicit InteractionVolume(const Experimental::DetectorVolume* dv) : detectorVolume(dv) {} /// Forward the geometry identifier diff --git a/Core/include/Acts/Material/PropagatorMaterialAssigner.hpp b/Core/include/Acts/Material/PropagatorMaterialAssigner.hpp index 5c3c0fa0339..0f4d3275545 100644 --- a/Core/include/Acts/Material/PropagatorMaterialAssigner.hpp +++ b/Core/include/Acts/Material/PropagatorMaterialAssigner.hpp @@ -98,7 +98,7 @@ class PropagatorMaterialAssigner final : public IAssignmentFinder { public: /// @brief Construct with propagator /// @param propagator - PropagatorMaterialAssigner(propagator_t propagator) + explicit PropagatorMaterialAssigner(propagator_t propagator) : m_propagator(std::move(propagator)) {} /// @brief Method for generating assignment candidates for the diff --git a/Core/include/Acts/Material/ProtoVolumeMaterial.hpp b/Core/include/Acts/Material/ProtoVolumeMaterial.hpp index 38206e8f6dc..d26769c790a 100644 --- a/Core/include/Acts/Material/ProtoVolumeMaterial.hpp +++ b/Core/include/Acts/Material/ProtoVolumeMaterial.hpp @@ -35,7 +35,7 @@ class ProtoVolumeMaterial : public IVolumeMaterial { /// /// @param binUtility a BinUtility determining the granularity /// and binning of the material on the volume - ProtoVolumeMaterial(const BinUtility& binUtility); + explicit ProtoVolumeMaterial(const BinUtility& binUtility); /// Copy constructor /// diff --git a/Core/src/Material/VolumeMaterialMapper.cpp b/Core/src/Material/VolumeMaterialMapper.cpp index ca7c00b5730..8074ed52d04 100644 --- a/Core/src/Material/VolumeMaterialMapper.cpp +++ b/Core/src/Material/VolumeMaterialMapper.cpp @@ -498,7 +498,7 @@ void Acts::VolumeMaterialMapper::mapMaterialTrack( sfIter++; } } - rmIter->volume = volIter->volume; + rmIter->volume = InteractionVolume{volIter->volume}; rmIter->intersectionID = currentID; rmIter->intersection = rmIter->position; } From a8a23b4dceb211f66961a24f5b983219a6f59896 Mon Sep 17 00:00:00 2001 From: AJPfleger Date: Sat, 12 Oct 2024 13:42:37 +0200 Subject: [PATCH 02/10] Plugins --- .../include/Acts/Plugins/DD4hep/DD4hepDetectorStructure.hpp | 6 +++--- .../Acts/Plugins/DD4hep/DD4hepDetectorSurfaceFactory.hpp | 2 +- .../include/Acts/Plugins/DD4hep/DD4hepFieldAdapter.hpp | 2 +- .../Detray/include/Acts/Plugins/Detray/DetrayConverter.hpp | 5 +++-- .../Acts/Plugins/Geant4/Geant4PhysicalVolumeSelectors.hpp | 2 +- .../Acts/Plugins/Json/GeometryHierarchyMapJsonConverter.hpp | 2 +- .../include/Acts/Plugins/Podio/PodioDynamicColumns.hpp | 5 +++-- 7 files changed, 13 insertions(+), 11 deletions(-) diff --git a/Plugins/DD4hep/include/Acts/Plugins/DD4hep/DD4hepDetectorStructure.hpp b/Plugins/DD4hep/include/Acts/Plugins/DD4hep/DD4hepDetectorStructure.hpp index a11601b579b..eb69176aa19 100644 --- a/Plugins/DD4hep/include/Acts/Plugins/DD4hep/DD4hepDetectorStructure.hpp +++ b/Plugins/DD4hep/include/Acts/Plugins/DD4hep/DD4hepDetectorStructure.hpp @@ -55,9 +55,9 @@ class DD4hepDetectorStructure { /// @param logger is the screen output logger /// /// @note this needs to be provided - DD4hepDetectorStructure(std::unique_ptr logger = - getDefaultLogger("DD4hepLayerStructure", - Acts::Logging::INFO)); + explicit DD4hepDetectorStructure(std::unique_ptr logger = + getDefaultLogger("DD4hepLayerStructure", + Acts::Logging::INFO)); DD4hepDetectorStructure() = delete; diff --git a/Plugins/DD4hep/include/Acts/Plugins/DD4hep/DD4hepDetectorSurfaceFactory.hpp b/Plugins/DD4hep/include/Acts/Plugins/DD4hep/DD4hepDetectorSurfaceFactory.hpp index d6855443af2..b120358d537 100644 --- a/Plugins/DD4hep/include/Acts/Plugins/DD4hep/DD4hepDetectorSurfaceFactory.hpp +++ b/Plugins/DD4hep/include/Acts/Plugins/DD4hep/DD4hepDetectorSurfaceFactory.hpp @@ -90,7 +90,7 @@ class DD4hepDetectorSurfaceFactory { /// The DD4hep detector element factory /// /// @param mlogger a screen output logger - DD4hepDetectorSurfaceFactory( + explicit DD4hepDetectorSurfaceFactory( std::unique_ptr mlogger = getDefaultLogger( "DD4hepDetectorSurfaceFactory", Acts::Logging::INFO)); diff --git a/Plugins/DD4hep/include/Acts/Plugins/DD4hep/DD4hepFieldAdapter.hpp b/Plugins/DD4hep/include/Acts/Plugins/DD4hep/DD4hepFieldAdapter.hpp index 9d2007235e5..6f7b8077348 100644 --- a/Plugins/DD4hep/include/Acts/Plugins/DD4hep/DD4hepFieldAdapter.hpp +++ b/Plugins/DD4hep/include/Acts/Plugins/DD4hep/DD4hepFieldAdapter.hpp @@ -22,7 +22,7 @@ class DD4hepFieldAdapter : public Acts::MagneticFieldProvider { struct Cache {}; public: - DD4hepFieldAdapter(dd4hep::OverlayedField field); + explicit DD4hepFieldAdapter(dd4hep::OverlayedField field); MagneticFieldProvider::Cache makeCache( const Acts::MagneticFieldContext& mctx) const override; diff --git a/Plugins/Detray/include/Acts/Plugins/Detray/DetrayConverter.hpp b/Plugins/Detray/include/Acts/Plugins/Detray/DetrayConverter.hpp index 2c8ca2c7fac..78a5304ce40 100644 --- a/Plugins/Detray/include/Acts/Plugins/Detray/DetrayConverter.hpp +++ b/Plugins/Detray/include/Acts/Plugins/Detray/DetrayConverter.hpp @@ -38,8 +38,9 @@ class DetrayConverter { }; /// Constructor with logger - DetrayConverter(std::unique_ptr logger = - getDefaultLogger("DetrayConverter", Logging::INFO)); + explicit DetrayConverter( + std::unique_ptr logger = getDefaultLogger("DetrayConverter", + Logging::INFO)); /// Convert an Acts::Experimental::Detector to a detray::detector object /// diff --git a/Plugins/Geant4/include/Acts/Plugins/Geant4/Geant4PhysicalVolumeSelectors.hpp b/Plugins/Geant4/include/Acts/Plugins/Geant4/Geant4PhysicalVolumeSelectors.hpp index 1fab98ea834..fd05274a34d 100644 --- a/Plugins/Geant4/include/Acts/Plugins/Geant4/Geant4PhysicalVolumeSelectors.hpp +++ b/Plugins/Geant4/include/Acts/Plugins/Geant4/Geant4PhysicalVolumeSelectors.hpp @@ -70,7 +70,7 @@ struct PositionSelector : public IGeant4PhysicalVolumeSelector { /// Constructor with arguments /// @param ranges the provided map of axes of ranges - PositionSelector( + explicit PositionSelector( const std::map>& ranges) : m_ranges(ranges) {} diff --git a/Plugins/Json/include/Acts/Plugins/Json/GeometryHierarchyMapJsonConverter.hpp b/Plugins/Json/include/Acts/Plugins/Json/GeometryHierarchyMapJsonConverter.hpp index 70f070e9dd7..74ce7109975 100644 --- a/Plugins/Json/include/Acts/Plugins/Json/GeometryHierarchyMapJsonConverter.hpp +++ b/Plugins/Json/include/Acts/Plugins/Json/GeometryHierarchyMapJsonConverter.hpp @@ -42,7 +42,7 @@ class GeometryHierarchyMapJsonConverter { /// Construct the converter. /// /// @param valueIdentifier user-defined identifier for the stored value - GeometryHierarchyMapJsonConverter(std::string valueIdentifier) + explicit GeometryHierarchyMapJsonConverter(std::string valueIdentifier) : m_valueIdentifier(std::move(valueIdentifier)) { if (m_valueIdentifier.empty()) { throw std::invalid_argument("Value identifier must be non-empty"); diff --git a/Plugins/Podio/include/Acts/Plugins/Podio/PodioDynamicColumns.hpp b/Plugins/Podio/include/Acts/Plugins/Podio/PodioDynamicColumns.hpp index d72e78bd9f2..295937efe7e 100644 --- a/Plugins/Podio/include/Acts/Plugins/Podio/PodioDynamicColumns.hpp +++ b/Plugins/Podio/include/Acts/Plugins/Podio/PodioDynamicColumns.hpp @@ -18,7 +18,7 @@ namespace Acts::podio_detail { struct ConstDynamicColumnBase { - ConstDynamicColumnBase(std::string_view name) : m_name{name} {} + explicit ConstDynamicColumnBase(std::string_view name) : m_name{name} {} virtual ~ConstDynamicColumnBase() = default; @@ -45,7 +45,8 @@ struct ConstDynamicColumn : public ConstDynamicColumnBase { }; struct DynamicColumnBase : public ConstDynamicColumnBase { - DynamicColumnBase(std::string_view name) : ConstDynamicColumnBase{name} {} + explicit DynamicColumnBase(std::string_view name) + : ConstDynamicColumnBase{name} {} virtual std::any get(std::size_t i) = 0; std::any get(std::size_t i) const override = 0; From 4068e49588a8222b802ff4826168b3ac90d017e0 Mon Sep 17 00:00:00 2001 From: AJPfleger Date: Sat, 12 Oct 2024 14:04:36 +0200 Subject: [PATCH 03/10] Fatras --- Fatras/include/ActsFatras/Utilities/LandauDistribution.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Fatras/include/ActsFatras/Utilities/LandauDistribution.hpp b/Fatras/include/ActsFatras/Utilities/LandauDistribution.hpp index 5fe4f57280c..2b29bd89066 100644 --- a/Fatras/include/ActsFatras/Utilities/LandauDistribution.hpp +++ b/Fatras/include/ActsFatras/Utilities/LandauDistribution.hpp @@ -51,7 +51,7 @@ class LandauDistribution { /// Construct directly from the distribution parameters. LandauDistribution(double location, double scale) : m_cfg(location, scale) {} /// Construct from a parameter object. - LandauDistribution(const param_type &cfg) : m_cfg(cfg) {} + explicit LandauDistribution(const param_type &cfg) : m_cfg(cfg) {} // Explicitlely defaulted construction and assignment LandauDistribution() = default; LandauDistribution(const LandauDistribution &) = default; From 08e6558882ffefc23f7851ad73e22fdb75bde012 Mon Sep 17 00:00:00 2001 From: AJPfleger Date: Sat, 12 Oct 2024 14:51:41 +0200 Subject: [PATCH 04/10] Examples --- .../Algorithms/Alignment/src/AlignmentAlgorithmFunction.cpp | 2 +- .../ActsExamples/Digitization/DigitizationConfig.hpp | 2 +- .../Algorithms/Digitization/src/MeasurementCreation.cpp | 3 ++- .../include/ActsExamples/Geant4/MaterialPhysicsList.hpp | 6 +++--- .../include/ActsExamples/Geant4/PhysicsListFactory.hpp | 2 +- .../include/ActsExamples/Geant4/SteppingActionList.hpp | 2 +- Examples/Algorithms/Geant4HepMC/src/EventAction.hpp | 2 +- Examples/Algorithms/Geant4HepMC/src/SteppingAction.hpp | 2 +- .../ActsExamples/Generators/MultiplicityGenerators.hpp | 4 ++-- .../ActsExamples/Generators/ParametricParticleGenerator.cpp | 4 ++-- .../ActsExamples/Generators/ParametricParticleGenerator.hpp | 2 +- .../ActsExamples/Propagation/PropagatorInterface.hpp | 2 +- .../TrackFinding/src/TrackFindingAlgorithmFunction.cpp | 2 +- .../Vertexing/src/AdaptiveMultiVertexFinderAlgorithm.cpp | 3 ++- .../include/ActsExamples/DD4hepDetector/DD4hepDetector.hpp | 3 ++- .../ActsExamples/DD4hepDetector/DD4hepGeometryService.hpp | 2 +- .../include/ActsExamples/MagneticField/ScalableBField.hpp | 2 +- .../MuonSpectrometerMockupDetector/MockupSectorBuilder.hpp | 2 +- .../include/ActsExamples/TGeoDetector/TGeoDetector.hpp | 2 +- Examples/Framework/ML/src/NeuralCalibrator.cpp | 3 ++- .../include/ActsExamples/EventData/Measurement.hpp | 6 +++--- .../include/ActsExamples/EventData/ScalingCalibrator.hpp | 2 +- .../Framework/include/ActsExamples/EventData/SimVertex.hpp | 5 +++-- .../include/ActsExamples/EventData/SpacePointContainer.hpp | 6 ++++-- .../include/ActsExamples/Framework/RandomNumbers.hpp | 2 +- .../Framework/include/ActsExamples/Framework/Sequencer.hpp | 2 +- .../Framework/include/ActsExamples/Framework/WhiteBoard.hpp | 2 +- .../Framework/include/ActsExamples/Utilities/tbbWrap.hpp | 2 +- Examples/Framework/src/EventData/MeasurementCalibration.cpp | 3 ++- Examples/Framework/src/EventData/ScalingCalibrator.cpp | 3 ++- Examples/Framework/src/Framework/Sequencer.cpp | 2 +- Examples/HelloWorld/HelloLoggerAlgorithm.hpp | 2 +- .../Io/Csv/include/ActsExamples/Io/Csv/CsvInputOutput.hpp | 2 +- .../detail/NuclearInteractionParametrisation.hpp | 2 +- .../ActsExamples/Io/Performance/VertexPerformanceWriter.cpp | 5 +++-- Examples/Io/Root/src/RootVertexReader.cpp | 2 +- Examples/Scripts/TrackingPerformance/TreeReader.h | 2 +- 37 files changed, 56 insertions(+), 46 deletions(-) diff --git a/Examples/Algorithms/Alignment/src/AlignmentAlgorithmFunction.cpp b/Examples/Algorithms/Alignment/src/AlignmentAlgorithmFunction.cpp index d36a6df9b95..de6780d817b 100644 --- a/Examples/Algorithms/Alignment/src/AlignmentAlgorithmFunction.cpp +++ b/Examples/Algorithms/Alignment/src/AlignmentAlgorithmFunction.cpp @@ -31,7 +31,7 @@ struct AlignmentFunctionImpl : public ActsExamples::AlignmentAlgorithm::AlignmentFunction { Alignment align; - AlignmentFunctionImpl(Alignment&& a) : align(std::move(a)) {} + explicit AlignmentFunctionImpl(Alignment&& a) : align(std::move(a)) {} ActsExamples::AlignmentAlgorithm::AlignmentResult operator()( const std::vector>& diff --git a/Examples/Algorithms/Digitization/include/ActsExamples/Digitization/DigitizationConfig.hpp b/Examples/Algorithms/Digitization/include/ActsExamples/Digitization/DigitizationConfig.hpp index 941d01ae494..5fa97d8142c 100644 --- a/Examples/Algorithms/Digitization/include/ActsExamples/Digitization/DigitizationConfig.hpp +++ b/Examples/Algorithms/Digitization/include/ActsExamples/Digitization/DigitizationConfig.hpp @@ -130,7 +130,7 @@ class DigitizationConfig { bool doMerge, double mergeNsigma, bool mergeCommonCorner, Acts::GeometryHierarchyMap &&digiCfgs); - DigitizationConfig( + explicit DigitizationConfig( Acts::GeometryHierarchyMap &&digiCfgs); /// Input collection of simulated hits. diff --git a/Examples/Algorithms/Digitization/src/MeasurementCreation.cpp b/Examples/Algorithms/Digitization/src/MeasurementCreation.cpp index e7a9e6b379e..c91e95a2299 100644 --- a/Examples/Algorithms/Digitization/src/MeasurementCreation.cpp +++ b/Examples/Algorithms/Digitization/src/MeasurementCreation.cpp @@ -31,6 +31,7 @@ ActsExamples::VariableBoundMeasurementProxy ActsExamples::createMeasurement( return Acts::visit_measurement( dParams.indices.size(), [&](auto dim) -> VariableBoundMeasurementProxy { auto [indices, par, cov] = measurementConstituents(dParams); - return container.emplaceMeasurement(sl, indices, par, cov); + return VariableBoundMeasurementProxy{ + container.emplaceMeasurement(sl, indices, par, cov)}; }); } diff --git a/Examples/Algorithms/Geant4/include/ActsExamples/Geant4/MaterialPhysicsList.hpp b/Examples/Algorithms/Geant4/include/ActsExamples/Geant4/MaterialPhysicsList.hpp index b53567b77a0..9cfb45d0453 100644 --- a/Examples/Algorithms/Geant4/include/ActsExamples/Geant4/MaterialPhysicsList.hpp +++ b/Examples/Algorithms/Geant4/include/ActsExamples/Geant4/MaterialPhysicsList.hpp @@ -29,9 +29,9 @@ class MaterialPhysicsList final : public G4VUserPhysicsList { /// /// @param cfg the configuration struct for this Stepping action /// @param logger is an Acts::Logger for unique logging - MaterialPhysicsList(std::unique_ptr logger = - Acts::getDefaultLogger("MaterialPhysicsList", - Acts::Logging::INFO)); + explicit MaterialPhysicsList(std::unique_ptr logger = + Acts::getDefaultLogger("MaterialPhysicsList", + Acts::Logging::INFO)); ~MaterialPhysicsList() override = default; /// @brief Interface particle construction method diff --git a/Examples/Algorithms/Geant4/include/ActsExamples/Geant4/PhysicsListFactory.hpp b/Examples/Algorithms/Geant4/include/ActsExamples/Geant4/PhysicsListFactory.hpp index d3c4b9f33c2..6bbc39b4f04 100644 --- a/Examples/Algorithms/Geant4/include/ActsExamples/Geant4/PhysicsListFactory.hpp +++ b/Examples/Algorithms/Geant4/include/ActsExamples/Geant4/PhysicsListFactory.hpp @@ -28,7 +28,7 @@ class PhysicsListFactoryFunction final : public PhysicsListFactory { public: using Function = std::function()>; - PhysicsListFactoryFunction(Function function); + explicit PhysicsListFactoryFunction(Function function); std::unique_ptr factorize() const final; diff --git a/Examples/Algorithms/Geant4/include/ActsExamples/Geant4/SteppingActionList.hpp b/Examples/Algorithms/Geant4/include/ActsExamples/Geant4/SteppingActionList.hpp index 569914007d8..b4a6d7e5d68 100644 --- a/Examples/Algorithms/Geant4/include/ActsExamples/Geant4/SteppingActionList.hpp +++ b/Examples/Algorithms/Geant4/include/ActsExamples/Geant4/SteppingActionList.hpp @@ -28,7 +28,7 @@ class SteppingActionList : public G4UserSteppingAction { std::vector> actions; }; - SteppingActionList(const Config &cfg) : m_cfg(cfg) {} + explicit SteppingActionList(const Config &cfg) : m_cfg(cfg) {} void UserSteppingAction(const G4Step *step) override { for (const auto &action : m_cfg.actions) { diff --git a/Examples/Algorithms/Geant4HepMC/src/EventAction.hpp b/Examples/Algorithms/Geant4HepMC/src/EventAction.hpp index 5c078e21cf8..dcf82b9543f 100644 --- a/Examples/Algorithms/Geant4HepMC/src/EventAction.hpp +++ b/Examples/Algorithms/Geant4HepMC/src/EventAction.hpp @@ -28,7 +28,7 @@ class EventAction final : public G4UserEventAction { static EventAction* instance(); /// Construct the action and ensure singleton usage. - EventAction(std::vector processFilter); + explicit EventAction(std::vector processFilter); ~EventAction() override; /// Interface method for begin of the event diff --git a/Examples/Algorithms/Geant4HepMC/src/SteppingAction.hpp b/Examples/Algorithms/Geant4HepMC/src/SteppingAction.hpp index 51144f3e83c..c19ed0a8560 100644 --- a/Examples/Algorithms/Geant4HepMC/src/SteppingAction.hpp +++ b/Examples/Algorithms/Geant4HepMC/src/SteppingAction.hpp @@ -20,7 +20,7 @@ namespace ActsExamples::Geant4::HepMC3 { /// Collects the particles history. class SteppingAction : public G4UserSteppingAction { public: - SteppingAction(std::vector eventRejectionProcess); + explicit SteppingAction(std::vector eventRejectionProcess); ~SteppingAction() override; /// Static access method to the instance diff --git a/Examples/Algorithms/Generators/ActsExamples/Generators/MultiplicityGenerators.hpp b/Examples/Algorithms/Generators/ActsExamples/Generators/MultiplicityGenerators.hpp index 42290a5e471..32c6d708235 100644 --- a/Examples/Algorithms/Generators/ActsExamples/Generators/MultiplicityGenerators.hpp +++ b/Examples/Algorithms/Generators/ActsExamples/Generators/MultiplicityGenerators.hpp @@ -19,7 +19,7 @@ struct FixedMultiplicityGenerator : public EventGenerator::MultiplicityGenerator { std::size_t n = 1; - FixedMultiplicityGenerator(std::size_t _n) : n{_n} {} + explicit FixedMultiplicityGenerator(std::size_t _n) : n{_n} {} FixedMultiplicityGenerator() = default; std::size_t operator()(RandomEngine& /*rng*/) const override { return n; } @@ -28,7 +28,7 @@ struct FixedMultiplicityGenerator struct PoissonMultiplicityGenerator : public EventGenerator::MultiplicityGenerator { double mean = 1; - PoissonMultiplicityGenerator(double _mean) : mean{_mean} {} + explicit PoissonMultiplicityGenerator(double _mean) : mean{_mean} {} PoissonMultiplicityGenerator() = default; std::size_t operator()(RandomEngine& rng) const override { diff --git a/Examples/Algorithms/Generators/ActsExamples/Generators/ParametricParticleGenerator.cpp b/Examples/Algorithms/Generators/ActsExamples/Generators/ParametricParticleGenerator.cpp index 104c8c0f04d..1e4e227df09 100644 --- a/Examples/Algorithms/Generators/ActsExamples/Generators/ParametricParticleGenerator.cpp +++ b/Examples/Algorithms/Generators/ActsExamples/Generators/ParametricParticleGenerator.cpp @@ -64,8 +64,8 @@ ParametricParticleGenerator::operator()(RandomEngine& rng) { SimParticleContainer::sequence_type particles; // create the primary vertex - auto& primaryVertex = - vertices.emplace_back(0, SimVertex::Vector4(0., 0., 0., 0.)); + auto& primaryVertex = vertices.emplace_back( + SimVertexBarcode{0}, SimVertex::Vector4(0., 0., 0., 0.)); // counter will be reused as barcode particle number which must be non-zero. for (std::size_t ip = 1; ip <= m_cfg.numParticles; ++ip) { diff --git a/Examples/Algorithms/Generators/ActsExamples/Generators/ParametricParticleGenerator.hpp b/Examples/Algorithms/Generators/ActsExamples/Generators/ParametricParticleGenerator.hpp index 3bb8ff9d836..a7d9bfe3e08 100644 --- a/Examples/Algorithms/Generators/ActsExamples/Generators/ParametricParticleGenerator.hpp +++ b/Examples/Algorithms/Generators/ActsExamples/Generators/ParametricParticleGenerator.hpp @@ -64,7 +64,7 @@ class ParametricParticleGenerator : public EventGenerator::ParticlesGenerator { std::optional mass; }; - ParametricParticleGenerator(const Config& cfg); + explicit ParametricParticleGenerator(const Config& cfg); /// Generate a single primary vertex with the given number of particles. std::pair operator()( diff --git a/Examples/Algorithms/Propagation/include/ActsExamples/Propagation/PropagatorInterface.hpp b/Examples/Algorithms/Propagation/include/ActsExamples/Propagation/PropagatorInterface.hpp index c063a2a1a48..2aa3b2292ac 100644 --- a/Examples/Algorithms/Propagation/include/ActsExamples/Propagation/PropagatorInterface.hpp +++ b/Examples/Algorithms/Propagation/include/ActsExamples/Propagation/PropagatorInterface.hpp @@ -50,7 +50,7 @@ class PropagatorInterface { template class ConcretePropagator : public PropagatorInterface { public: - ConcretePropagator(propagator_t propagator) + explicit ConcretePropagator(propagator_t propagator) : m_propagator{std::move(propagator)} {} Acts::Result execute( diff --git a/Examples/Algorithms/TrackFinding/src/TrackFindingAlgorithmFunction.cpp b/Examples/Algorithms/TrackFinding/src/TrackFindingAlgorithmFunction.cpp index 65e0cf41970..e9f6ae315f3 100644 --- a/Examples/Algorithms/TrackFinding/src/TrackFindingAlgorithmFunction.cpp +++ b/Examples/Algorithms/TrackFinding/src/TrackFindingAlgorithmFunction.cpp @@ -35,7 +35,7 @@ struct TrackFinderFunctionImpl : public ActsExamples::TrackFindingAlgorithm::TrackFinderFunction { CKF trackFinder; - TrackFinderFunctionImpl(CKF&& f) : trackFinder(std::move(f)) {} + explicit TrackFinderFunctionImpl(CKF&& f) : trackFinder(std::move(f)) {} ActsExamples::TrackFindingAlgorithm::TrackFinderResult operator()( const ActsExamples::TrackParameters& initialParameters, diff --git a/Examples/Algorithms/Vertexing/src/AdaptiveMultiVertexFinderAlgorithm.cpp b/Examples/Algorithms/Vertexing/src/AdaptiveMultiVertexFinderAlgorithm.cpp index 9ef72913e37..5330e55c76c 100644 --- a/Examples/Algorithms/Vertexing/src/AdaptiveMultiVertexFinderAlgorithm.cpp +++ b/Examples/Algorithms/Vertexing/src/AdaptiveMultiVertexFinderAlgorithm.cpp @@ -249,7 +249,8 @@ ProcessCode AdaptiveMultiVertexFinderAlgorithm::execute( // Count the number of particles associated with each vertex std::size_t particleCount = 0; for (const auto& particle : truthParticles) { - if (particle.particleId().vertexId() == truthVertex.vertexId()) { + if (static_cast(particle.particleId().vertexId()) == + truthVertex.vertexId()) { ++particleCount; } } diff --git a/Examples/Detectors/DD4hepDetector/include/ActsExamples/DD4hepDetector/DD4hepDetector.hpp b/Examples/Detectors/DD4hepDetector/include/ActsExamples/DD4hepDetector/DD4hepDetector.hpp index fec8cfdd052..015b511825f 100644 --- a/Examples/Detectors/DD4hepDetector/include/ActsExamples/DD4hepDetector/DD4hepDetector.hpp +++ b/Examples/Detectors/DD4hepDetector/include/ActsExamples/DD4hepDetector/DD4hepDetector.hpp @@ -52,7 +52,8 @@ struct DD4hepDetector { DD4hepDetector() = default; /// @brief Constructor from geometry service /// @param _geometryService the geometry service - DD4hepDetector(std::shared_ptr _geometryService); + explicit DD4hepDetector( + std::shared_ptr _geometryService); /// @brief Default destructor ~DD4hepDetector() = default; diff --git a/Examples/Detectors/DD4hepDetector/include/ActsExamples/DD4hepDetector/DD4hepGeometryService.hpp b/Examples/Detectors/DD4hepDetector/include/ActsExamples/DD4hepDetector/DD4hepGeometryService.hpp index 6fb17141814..9ce1ca5f2e9 100644 --- a/Examples/Detectors/DD4hepDetector/include/ActsExamples/DD4hepDetector/DD4hepGeometryService.hpp +++ b/Examples/Detectors/DD4hepDetector/include/ActsExamples/DD4hepDetector/DD4hepGeometryService.hpp @@ -87,7 +87,7 @@ class DD4hepGeometryService { std::make_shared(); }; - DD4hepGeometryService(const Config& cfg); + explicit DD4hepGeometryService(const Config& cfg); DD4hepGeometryService(const DD4hepGeometryService&) = delete; DD4hepGeometryService(DD4hepGeometryService&&) = delete; ~DD4hepGeometryService(); diff --git a/Examples/Detectors/MagneticField/include/ActsExamples/MagneticField/ScalableBField.hpp b/Examples/Detectors/MagneticField/include/ActsExamples/MagneticField/ScalableBField.hpp index bd7f7af38df..5def5740fa4 100644 --- a/Examples/Detectors/MagneticField/include/ActsExamples/MagneticField/ScalableBField.hpp +++ b/Examples/Detectors/MagneticField/include/ActsExamples/MagneticField/ScalableBField.hpp @@ -26,7 +26,7 @@ class ScalableBField final : public Acts::MagneticFieldProvider { Acts::ActsScalar scalor = 1.; /// @brief constructor with context - Cache(const Acts::MagneticFieldContext& mctx) { + explicit Cache(const Acts::MagneticFieldContext& mctx) { scalor = mctx.get().scalor; } }; diff --git a/Examples/Detectors/MuonSpectrometerMockupDetector/include/ActsExamples/MuonSpectrometerMockupDetector/MockupSectorBuilder.hpp b/Examples/Detectors/MuonSpectrometerMockupDetector/include/ActsExamples/MuonSpectrometerMockupDetector/MockupSectorBuilder.hpp index 62ae610224e..5b349bec9af 100644 --- a/Examples/Detectors/MuonSpectrometerMockupDetector/include/ActsExamples/MuonSpectrometerMockupDetector/MockupSectorBuilder.hpp +++ b/Examples/Detectors/MuonSpectrometerMockupDetector/include/ActsExamples/MuonSpectrometerMockupDetector/MockupSectorBuilder.hpp @@ -55,7 +55,7 @@ class MockupSectorBuilder { /// Constructor ///@param config The configuration struct - MockupSectorBuilder(const Config& config); + explicit MockupSectorBuilder(const Config& config); /// Destructor ~MockupSectorBuilder() = default; diff --git a/Examples/Detectors/TGeoDetector/include/ActsExamples/TGeoDetector/TGeoDetector.hpp b/Examples/Detectors/TGeoDetector/include/ActsExamples/TGeoDetector/TGeoDetector.hpp index 8982e3dbfb9..0fae0df1c5a 100644 --- a/Examples/Detectors/TGeoDetector/include/ActsExamples/TGeoDetector/TGeoDetector.hpp +++ b/Examples/Detectors/TGeoDetector/include/ActsExamples/TGeoDetector/TGeoDetector.hpp @@ -75,7 +75,7 @@ struct TGeoDetector { struct LayerTriplet { LayerTriplet() = default; - LayerTriplet(T value) + explicit LayerTriplet(T value) : negative{value}, central{value}, positive{value} {} LayerTriplet(T _negative, T _central, T _positive) diff --git a/Examples/Framework/ML/src/NeuralCalibrator.cpp b/Examples/Framework/ML/src/NeuralCalibrator.cpp index 68d24d35468..67c6e76db57 100644 --- a/Examples/Framework/ML/src/NeuralCalibrator.cpp +++ b/Examples/Framework/ML/src/NeuralCalibrator.cpp @@ -176,7 +176,8 @@ void ActsExamples::NeuralCalibrator::calibrate( Acts::visit_measurement(measurement.size(), [&](auto N) -> void { constexpr std::size_t kMeasurementSize = decltype(N)::value; const ConstFixedBoundMeasurementProxy fixedMeasurement = - measurement; + static_cast>( + measurement); Acts::ActsVector calibratedParameters = fixedMeasurement.parameters(); diff --git a/Examples/Framework/include/ActsExamples/EventData/Measurement.hpp b/Examples/Framework/include/ActsExamples/EventData/Measurement.hpp index 8703806a164..6721740fbfa 100644 --- a/Examples/Framework/include/ActsExamples/EventData/Measurement.hpp +++ b/Examples/Framework/include/ActsExamples/EventData/Measurement.hpp @@ -191,7 +191,7 @@ class MeasurementProxyBase { MeasurementProxyBase(Container& container_, Index index_) : m_container(&container_), m_index(index_) {} template - MeasurementProxyBase( + explicit MeasurementProxyBase( const MeasurementProxyBase& other) requires(ReadOnly == OtherReadOnly || ReadOnly) : m_container(&other.container()), m_index(other.index()) {} @@ -354,7 +354,7 @@ class FixedMeasurementProxy assert(container().m_entries.at(index()).size == Size && "Size mismatch"); } template - FixedMeasurementProxy( + explicit FixedMeasurementProxy( const MeasurementProxyBase& other) requires(ReadOnly == OtherReadOnly || ReadOnly) : Base(other) { @@ -446,7 +446,7 @@ class VariableMeasurementProxy VariableMeasurementProxy(Container& container_, Index index_) : Base(container_, index_) {} template - VariableMeasurementProxy( + explicit VariableMeasurementProxy( const MeasurementProxyBase& other) requires(ReadOnly == OtherReadOnly || ReadOnly) : Base(other) {} diff --git a/Examples/Framework/include/ActsExamples/EventData/ScalingCalibrator.hpp b/Examples/Framework/include/ActsExamples/EventData/ScalingCalibrator.hpp index 706ef5291cd..a91b6d840cb 100644 --- a/Examples/Framework/include/ActsExamples/EventData/ScalingCalibrator.hpp +++ b/Examples/Framework/include/ActsExamples/EventData/ScalingCalibrator.hpp @@ -47,7 +47,7 @@ class ScalingCalibrator : public MeasurementCalibrator { } }; - ScalingCalibrator(const std::filesystem::path& path); + explicit ScalingCalibrator(const std::filesystem::path& path); void calibrate( const MeasurementContainer& measurements, diff --git a/Examples/Framework/include/ActsExamples/EventData/SimVertex.hpp b/Examples/Framework/include/ActsExamples/EventData/SimVertex.hpp index d012ac3eb80..0bdfbb4925c 100644 --- a/Examples/Framework/include/ActsExamples/EventData/SimVertex.hpp +++ b/Examples/Framework/include/ActsExamples/EventData/SimVertex.hpp @@ -21,8 +21,9 @@ class SimVertexBarcode { using Value = SimBarcode::Value; constexpr SimVertexBarcode() = default; - constexpr SimVertexBarcode(Value encoded) : m_id(SimBarcode(encoded)) {} - constexpr SimVertexBarcode(SimBarcode vertexId) + explicit constexpr SimVertexBarcode(Value encoded) + : m_id(SimBarcode(encoded)) {} + explicit constexpr SimVertexBarcode(SimBarcode vertexId) : m_id(vertexId.setParticle(0).setSubParticle(0)) { if (vertexId != vertexId.vertexId()) { throw std::invalid_argument("SimVertexBarcode: invalid vertexId"); diff --git a/Examples/Framework/include/ActsExamples/EventData/SpacePointContainer.hpp b/Examples/Framework/include/ActsExamples/EventData/SpacePointContainer.hpp index 14f50ff249a..dbf94345f0a 100644 --- a/Examples/Framework/include/ActsExamples/EventData/SpacePointContainer.hpp +++ b/Examples/Framework/include/ActsExamples/EventData/SpacePointContainer.hpp @@ -31,8 +31,10 @@ class SpacePointContainer { // the memory backend is independetly handled. This is only interfacing it to // ACTS SpacePointContainer(CollectionType&& container) = delete; - SpacePointContainer(CollectionType& container) : m_storage(container) {} - SpacePointContainer(CollectionType* container) : m_storage(container) {} + explicit SpacePointContainer(CollectionType& container) + : m_storage(container) {} + explicit SpacePointContainer(CollectionType* container) + : m_storage(container) {} // No copy constructor or copy operation allowed SpacePointContainer(const SpacePointContainer&) = delete; diff --git a/Examples/Framework/include/ActsExamples/Framework/RandomNumbers.hpp b/Examples/Framework/include/ActsExamples/Framework/RandomNumbers.hpp index 5389ae5a8b6..6f9f9abbcd6 100644 --- a/Examples/Framework/include/ActsExamples/Framework/RandomNumbers.hpp +++ b/Examples/Framework/include/ActsExamples/Framework/RandomNumbers.hpp @@ -44,7 +44,7 @@ class RandomNumbers { std::uint64_t seed = 1234567890u; ///< random seed }; - RandomNumbers(const Config& cfg); + explicit RandomNumbers(const Config& cfg); /// Spawn an algorithm-local random number generator. To avoid inefficiencies /// and multiple uses of a given RNG seed, this should only be done once per diff --git a/Examples/Framework/include/ActsExamples/Framework/Sequencer.hpp b/Examples/Framework/include/ActsExamples/Framework/Sequencer.hpp index fa1c53618a0..91f229a8c0b 100644 --- a/Examples/Framework/include/ActsExamples/Framework/Sequencer.hpp +++ b/Examples/Framework/include/ActsExamples/Framework/Sequencer.hpp @@ -89,7 +89,7 @@ class Sequencer { std::size_t fpeStackTraceLength = 8; }; - Sequencer(const Config &cfg); + explicit Sequencer(const Config &cfg); /// Add a context decorator to the set of context decorators. /// diff --git a/Examples/Framework/include/ActsExamples/Framework/WhiteBoard.hpp b/Examples/Framework/include/ActsExamples/Framework/WhiteBoard.hpp index ca5e1904879..777d27fe898 100644 --- a/Examples/Framework/include/ActsExamples/Framework/WhiteBoard.hpp +++ b/Examples/Framework/include/ActsExamples/Framework/WhiteBoard.hpp @@ -76,7 +76,7 @@ class WhiteBoard { struct HolderT : public IHolder { T value; - HolderT(T&& v) : value(std::move(v)) {} + explicit HolderT(T&& v) : value(std::move(v)) {} const std::type_info& type() const override { return typeid(T); } }; diff --git a/Examples/Framework/include/ActsExamples/Utilities/tbbWrap.hpp b/Examples/Framework/include/ActsExamples/Utilities/tbbWrap.hpp index 985cbb2180b..84784c55d31 100644 --- a/Examples/Framework/include/ActsExamples/Utilities/tbbWrap.hpp +++ b/Examples/Framework/include/ActsExamples/Utilities/tbbWrap.hpp @@ -161,7 +161,7 @@ class queuing_mutex { #endif } - scoped_lock(queuing_mutex& ACTS_EXAMPLES_WITH_TBB(m)) { + explicit scoped_lock(queuing_mutex& ACTS_EXAMPLES_WITH_TBB(m)) { #ifndef ACTS_EXAMPLES_NO_TBB if (enableTBB()) { tbb.emplace(*m.tbb); diff --git a/Examples/Framework/src/EventData/MeasurementCalibration.cpp b/Examples/Framework/src/EventData/MeasurementCalibration.cpp index 963ef57ea24..b4764844770 100644 --- a/Examples/Framework/src/EventData/MeasurementCalibration.cpp +++ b/Examples/Framework/src/EventData/MeasurementCalibration.cpp @@ -38,7 +38,8 @@ void ActsExamples::PassThroughCalibrator::calibrate( Acts::visit_measurement(measurement.size(), [&](auto N) -> void { constexpr std::size_t kMeasurementSize = decltype(N)::value; const ConstFixedBoundMeasurementProxy fixedMeasurement = - measurement; + static_cast>( + measurement); trackState.allocateCalibrated(kMeasurementSize); trackState.calibrated() = fixedMeasurement.parameters(); diff --git a/Examples/Framework/src/EventData/ScalingCalibrator.cpp b/Examples/Framework/src/EventData/ScalingCalibrator.cpp index 12da0078659..ae5c1eca4fe 100644 --- a/Examples/Framework/src/EventData/ScalingCalibrator.cpp +++ b/Examples/Framework/src/EventData/ScalingCalibrator.cpp @@ -165,7 +165,8 @@ void ActsExamples::ScalingCalibrator::calibrate( Acts::visit_measurement(measurement.size(), [&](auto N) -> void { constexpr std::size_t kMeasurementSize = decltype(N)::value; const ConstFixedBoundMeasurementProxy fixedMeasurement = - measurement; + static_cast>( + measurement); Acts::ActsVector calibratedParameters = fixedMeasurement.parameters(); diff --git a/Examples/Framework/src/Framework/Sequencer.cpp b/Examples/Framework/src/Framework/Sequencer.cpp index 100f55cf93c..4d734da7e85 100644 --- a/Examples/Framework/src/Framework/Sequencer.cpp +++ b/Examples/Framework/src/Framework/Sequencer.cpp @@ -360,7 +360,7 @@ struct StopWatch { Timepoint start; Duration& store; - StopWatch(Duration& s) : start(Clock::now()), store(s) {} + explicit StopWatch(Duration& s) : start(Clock::now()), store(s) {} ~StopWatch() { store += Clock::now() - start; } }; diff --git a/Examples/HelloWorld/HelloLoggerAlgorithm.hpp b/Examples/HelloWorld/HelloLoggerAlgorithm.hpp index 934c0b67f5c..3cafd2c4f55 100644 --- a/Examples/HelloWorld/HelloLoggerAlgorithm.hpp +++ b/Examples/HelloWorld/HelloLoggerAlgorithm.hpp @@ -17,7 +17,7 @@ namespace ActsExamples { /// A simple algorithm that just prints hello world. class HelloLoggerAlgorithm : public ActsExamples::IAlgorithm { public: - HelloLoggerAlgorithm(Acts::Logging::Level level); + explicit HelloLoggerAlgorithm(Acts::Logging::Level level); // Log a few messages. ActsExamples::ProcessCode execute(const AlgorithmContext& ctx) const override; diff --git a/Examples/Io/Csv/include/ActsExamples/Io/Csv/CsvInputOutput.hpp b/Examples/Io/Csv/include/ActsExamples/Io/Csv/CsvInputOutput.hpp index 7f4e7b894c3..e141f470988 100644 --- a/Examples/Io/Csv/include/ActsExamples/Io/Csv/CsvInputOutput.hpp +++ b/Examples/Io/Csv/include/ActsExamples/Io/Csv/CsvInputOutput.hpp @@ -236,7 +236,7 @@ class DsvReader { /// Open a file at the given path. /// /// \param path Path to the input file - DsvReader(const std::string& path); + explicit DsvReader(const std::string& path); /// Read the next line from the file. /// diff --git a/Examples/Io/NuclearInteractions/include/ActsExamples/Io/NuclearInteractions/detail/NuclearInteractionParametrisation.hpp b/Examples/Io/NuclearInteractions/include/ActsExamples/Io/NuclearInteractions/detail/NuclearInteractionParametrisation.hpp index b0a6174a0d6..e00fb79c63a 100644 --- a/Examples/Io/NuclearInteractions/include/ActsExamples/Io/NuclearInteractions/detail/NuclearInteractionParametrisation.hpp +++ b/Examples/Io/NuclearInteractions/include/ActsExamples/Io/NuclearInteractions/detail/NuclearInteractionParametrisation.hpp @@ -34,7 +34,7 @@ struct EventFraction { /// /// @param [in] event Tuple containing the initial particle, the particle /// before the interaction and all final state particles after the interaction - EventFraction(const ActsExamples::ExtractedSimulationProcess& event) + explicit EventFraction(const ActsExamples::ExtractedSimulationProcess& event) : initialParticle(event.initial), interactingParticle(event.before), finalParticles(event.after) {} diff --git a/Examples/Io/Performance/ActsExamples/Io/Performance/VertexPerformanceWriter.cpp b/Examples/Io/Performance/ActsExamples/Io/Performance/VertexPerformanceWriter.cpp index dfc790433f9..5e79d0803ae 100644 --- a/Examples/Io/Performance/ActsExamples/Io/Performance/VertexPerformanceWriter.cpp +++ b/Examples/Io/Performance/ActsExamples/Io/Performance/VertexPerformanceWriter.cpp @@ -497,7 +497,7 @@ ProcessCode VertexPerformanceWriter::writeT( fmap[vtxId].second += weight; } double truthMajorityVertexTrackWeights = 0; - SimVertexBarcode truthMajorityVertexId = 0; + SimVertexBarcode truthMajorityVertexId{0}; for (const auto& [vtxId, counter] : fmap) { if (counter.second > truthMajorityVertexTrackWeights) { truthMajorityVertexId = vtxId; @@ -629,7 +629,8 @@ ProcessCode VertexPerformanceWriter::writeT( // Count number of reconstructible tracks on truth vertex int nTracksOnTruthVertex = 0; for (const auto& particle : selectedParticles) { - if (particle.particleId().vertexId() == truthVertex.vertexId()) { + if (static_cast(particle.particleId().vertexId()) == + truthVertex.vertexId()) { ++nTracksOnTruthVertex; } } diff --git a/Examples/Io/Root/src/RootVertexReader.cpp b/Examples/Io/Root/src/RootVertexReader.cpp index 93a986a6c04..336e0364f9b 100644 --- a/Examples/Io/Root/src/RootVertexReader.cpp +++ b/Examples/Io/Root/src/RootVertexReader.cpp @@ -114,7 +114,7 @@ ProcessCode RootVertexReader::read(const AlgorithmContext& context) { for (unsigned int i = 0; i < nVertices; i++) { SimVertex v; - v.id = (*m_vertexId)[i]; + v.id = SimVertexBarcode{(*m_vertexId)[i]}; v.process = static_cast((*m_process)[i]); v.position4 = Acts::Vector4((*m_vx)[i] * Acts::UnitConstants::mm, (*m_vy)[i] * Acts::UnitConstants::mm, diff --git a/Examples/Scripts/TrackingPerformance/TreeReader.h b/Examples/Scripts/TrackingPerformance/TreeReader.h index 1346d5197ea..ffdf1308b02 100644 --- a/Examples/Scripts/TrackingPerformance/TreeReader.h +++ b/Examples/Scripts/TrackingPerformance/TreeReader.h @@ -36,7 +36,7 @@ struct ParticleInfo { /// struct TreeReader { // The constructor - TreeReader(TTree* tree_) : tree(tree_) {} + explicit TreeReader(TTree* tree_) : tree(tree_) {} // Get entry void getEntry(unsigned int i) const { From 3271411c0eda5c4e8720326593f3c0893a5a6dde Mon Sep 17 00:00:00 2001 From: AJPfleger Date: Sat, 12 Oct 2024 20:13:42 +0200 Subject: [PATCH 05/10] more SimVertexBarcode --- .../ActsExamples/Generators/Pythia8ProcessGenerator.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Examples/Algorithms/GeneratorsPythia8/ActsExamples/Generators/Pythia8ProcessGenerator.cpp b/Examples/Algorithms/GeneratorsPythia8/ActsExamples/Generators/Pythia8ProcessGenerator.cpp index e19e785ac5c..ae7c2b85403 100644 --- a/Examples/Algorithms/GeneratorsPythia8/ActsExamples/Generators/Pythia8ProcessGenerator.cpp +++ b/Examples/Algorithms/GeneratorsPythia8/ActsExamples/Generators/Pythia8ProcessGenerator.cpp @@ -121,7 +121,8 @@ Pythia8Generator::operator()(RandomEngine& rng) { } // create the primary vertex - vertices.emplace_back(0, SimVertex::Vector4(0., 0., 0., 0.)); + vertices.emplace_back(SimVertexBarcode{0}, + SimVertex::Vector4(0., 0., 0., 0.)); // convert generated final state particles into internal format for (int ip = 0; ip < m_pythia8->event.size(); ++ip) { @@ -166,7 +167,8 @@ Pythia8Generator::operator()(RandomEngine& rng) { } else { // no matching secondary vertex exists -> create new one particleId.setVertexSecondary(vertices.size()); - auto& vertex = vertices.emplace_back(particleId.vertexId(), pos4); + auto& vertex = vertices.emplace_back( + static_cast(particleId.vertexId()), pos4); vertex.outgoing.insert(particleId); ACTS_VERBOSE("created new secondary vertex " << pos4.transpose()); } From 672aa9c1c2d16b2adc66548ee859f2fcf791d6c5 Mon Sep 17 00:00:00 2001 From: AJPfleger Date: Fri, 18 Oct 2024 14:18:01 +0200 Subject: [PATCH 06/10] revert Core changes --- Core/include/Acts/Material/AccumulatedSurfaceMaterial.hpp | 2 +- Core/include/Acts/Material/HomogeneousVolumeMaterial.hpp | 2 +- Core/include/Acts/Material/ISurfaceMaterial.hpp | 2 +- Core/include/Acts/Material/InterpolatedMaterialMap.hpp | 3 +-- Core/include/Acts/Material/MaterialInteraction.hpp | 4 ++-- Core/include/Acts/Material/PropagatorMaterialAssigner.hpp | 2 +- Core/include/Acts/Material/ProtoVolumeMaterial.hpp | 2 +- Core/src/Material/VolumeMaterialMapper.cpp | 2 +- 8 files changed, 9 insertions(+), 10 deletions(-) diff --git a/Core/include/Acts/Material/AccumulatedSurfaceMaterial.hpp b/Core/include/Acts/Material/AccumulatedSurfaceMaterial.hpp index 12c233a37e2..7107410bfec 100644 --- a/Core/include/Acts/Material/AccumulatedSurfaceMaterial.hpp +++ b/Core/include/Acts/Material/AccumulatedSurfaceMaterial.hpp @@ -37,7 +37,7 @@ class AccumulatedSurfaceMaterial { /// Default Constructor - for homogeneous material /// /// @param splitFactor is the pre/post splitting directive - explicit AccumulatedSurfaceMaterial(double splitFactor = 0.); + AccumulatedSurfaceMaterial(double splitFactor = 0.); /// Explicit constructor with only full MaterialSlab, /// for one-dimensional binning. diff --git a/Core/include/Acts/Material/HomogeneousVolumeMaterial.hpp b/Core/include/Acts/Material/HomogeneousVolumeMaterial.hpp index 0bb49452cd3..91005dcae55 100644 --- a/Core/include/Acts/Material/HomogeneousVolumeMaterial.hpp +++ b/Core/include/Acts/Material/HomogeneousVolumeMaterial.hpp @@ -25,7 +25,7 @@ class HomogeneousVolumeMaterial : public IVolumeMaterial { /// Explicit constructor /// /// @param material is the material held by this - explicit HomogeneousVolumeMaterial(const Material& material); + HomogeneousVolumeMaterial(const Material& material); /// Copy Constructor /// diff --git a/Core/include/Acts/Material/ISurfaceMaterial.hpp b/Core/include/Acts/Material/ISurfaceMaterial.hpp index ebeb5ff45af..a379e18e715 100644 --- a/Core/include/Acts/Material/ISurfaceMaterial.hpp +++ b/Core/include/Acts/Material/ISurfaceMaterial.hpp @@ -38,7 +38,7 @@ class ISurfaceMaterial { /// Constructor /// /// @param splitFactor is the splitting ratio between pre/post update - explicit ISurfaceMaterial(double splitFactor) : m_splitFactor(splitFactor) {} + ISurfaceMaterial(double splitFactor) : m_splitFactor(splitFactor) {} /// Constructor /// diff --git a/Core/include/Acts/Material/InterpolatedMaterialMap.hpp b/Core/include/Acts/Material/InterpolatedMaterialMap.hpp index 5c0f1014fe9..eb792539871 100644 --- a/Core/include/Acts/Material/InterpolatedMaterialMap.hpp +++ b/Core/include/Acts/Material/InterpolatedMaterialMap.hpp @@ -247,8 +247,7 @@ class InterpolatedMaterialMap : public IVolumeMaterial { /// @brief Create interpolated map /// /// @param [in] mapper Material map - explicit InterpolatedMaterialMap(Mapper_t&& mapper) - : m_mapper(std::move(mapper)) {} + InterpolatedMaterialMap(Mapper_t&& mapper) : m_mapper(std::move(mapper)) {} /// @brief Create interpolated map /// diff --git a/Core/include/Acts/Material/MaterialInteraction.hpp b/Core/include/Acts/Material/MaterialInteraction.hpp index 0a02bf1e398..e3b078d310a 100644 --- a/Core/include/Acts/Material/MaterialInteraction.hpp +++ b/Core/include/Acts/Material/MaterialInteraction.hpp @@ -32,11 +32,11 @@ struct InteractionVolume { /// Constructor from tracking volume /// @param tv The tracking volume - explicit InteractionVolume(const TrackingVolume* tv) : trackingVolume(tv) {} + InteractionVolume(const TrackingVolume* tv) : trackingVolume(tv) {} /// Constructor from detector volume /// @param dv The detector volume - explicit InteractionVolume(const Experimental::DetectorVolume* dv) + InteractionVolume(const Experimental::DetectorVolume* dv) : detectorVolume(dv) {} /// Forward the geometry identifier diff --git a/Core/include/Acts/Material/PropagatorMaterialAssigner.hpp b/Core/include/Acts/Material/PropagatorMaterialAssigner.hpp index 0f4d3275545..5c3c0fa0339 100644 --- a/Core/include/Acts/Material/PropagatorMaterialAssigner.hpp +++ b/Core/include/Acts/Material/PropagatorMaterialAssigner.hpp @@ -98,7 +98,7 @@ class PropagatorMaterialAssigner final : public IAssignmentFinder { public: /// @brief Construct with propagator /// @param propagator - explicit PropagatorMaterialAssigner(propagator_t propagator) + PropagatorMaterialAssigner(propagator_t propagator) : m_propagator(std::move(propagator)) {} /// @brief Method for generating assignment candidates for the diff --git a/Core/include/Acts/Material/ProtoVolumeMaterial.hpp b/Core/include/Acts/Material/ProtoVolumeMaterial.hpp index d26769c790a..38206e8f6dc 100644 --- a/Core/include/Acts/Material/ProtoVolumeMaterial.hpp +++ b/Core/include/Acts/Material/ProtoVolumeMaterial.hpp @@ -35,7 +35,7 @@ class ProtoVolumeMaterial : public IVolumeMaterial { /// /// @param binUtility a BinUtility determining the granularity /// and binning of the material on the volume - explicit ProtoVolumeMaterial(const BinUtility& binUtility); + ProtoVolumeMaterial(const BinUtility& binUtility); /// Copy constructor /// diff --git a/Core/src/Material/VolumeMaterialMapper.cpp b/Core/src/Material/VolumeMaterialMapper.cpp index 8074ed52d04..ca7c00b5730 100644 --- a/Core/src/Material/VolumeMaterialMapper.cpp +++ b/Core/src/Material/VolumeMaterialMapper.cpp @@ -498,7 +498,7 @@ void Acts::VolumeMaterialMapper::mapMaterialTrack( sfIter++; } } - rmIter->volume = InteractionVolume{volIter->volume}; + rmIter->volume = volIter->volume; rmIter->intersectionID = currentID; rmIter->intersection = rmIter->position; } From 19a9919685bc297df388d2b5b98a028712955f1e Mon Sep 17 00:00:00 2001 From: AJPfleger Date: Sat, 19 Oct 2024 00:49:50 +0200 Subject: [PATCH 07/10] revert conflicting files --- .../detail/NuclearInteractionParametrisation.hpp | 2 +- .../ActsExamples/Io/Performance/VertexPerformanceWriter.cpp | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/Examples/Io/NuclearInteractions/include/ActsExamples/Io/NuclearInteractions/detail/NuclearInteractionParametrisation.hpp b/Examples/Io/NuclearInteractions/include/ActsExamples/Io/NuclearInteractions/detail/NuclearInteractionParametrisation.hpp index e00fb79c63a..b0a6174a0d6 100644 --- a/Examples/Io/NuclearInteractions/include/ActsExamples/Io/NuclearInteractions/detail/NuclearInteractionParametrisation.hpp +++ b/Examples/Io/NuclearInteractions/include/ActsExamples/Io/NuclearInteractions/detail/NuclearInteractionParametrisation.hpp @@ -34,7 +34,7 @@ struct EventFraction { /// /// @param [in] event Tuple containing the initial particle, the particle /// before the interaction and all final state particles after the interaction - explicit EventFraction(const ActsExamples::ExtractedSimulationProcess& event) + EventFraction(const ActsExamples::ExtractedSimulationProcess& event) : initialParticle(event.initial), interactingParticle(event.before), finalParticles(event.after) {} diff --git a/Examples/Io/Performance/ActsExamples/Io/Performance/VertexPerformanceWriter.cpp b/Examples/Io/Performance/ActsExamples/Io/Performance/VertexPerformanceWriter.cpp index 5e79d0803ae..dfc790433f9 100644 --- a/Examples/Io/Performance/ActsExamples/Io/Performance/VertexPerformanceWriter.cpp +++ b/Examples/Io/Performance/ActsExamples/Io/Performance/VertexPerformanceWriter.cpp @@ -497,7 +497,7 @@ ProcessCode VertexPerformanceWriter::writeT( fmap[vtxId].second += weight; } double truthMajorityVertexTrackWeights = 0; - SimVertexBarcode truthMajorityVertexId{0}; + SimVertexBarcode truthMajorityVertexId = 0; for (const auto& [vtxId, counter] : fmap) { if (counter.second > truthMajorityVertexTrackWeights) { truthMajorityVertexId = vtxId; @@ -629,8 +629,7 @@ ProcessCode VertexPerformanceWriter::writeT( // Count number of reconstructible tracks on truth vertex int nTracksOnTruthVertex = 0; for (const auto& particle : selectedParticles) { - if (static_cast(particle.particleId().vertexId()) == - truthVertex.vertexId()) { + if (particle.particleId().vertexId() == truthVertex.vertexId()) { ++nTracksOnTruthVertex; } } From 51d53044869cfe21dbdd4fb5ecb28d64dc886c07 Mon Sep 17 00:00:00 2001 From: AJPfleger Date: Sat, 19 Oct 2024 00:56:22 +0200 Subject: [PATCH 08/10] resolve conflicts --- .../Io/Root/detail/NuclearInteractionParametrisation.hpp | 2 +- Examples/Io/Root/src/VertexPerformanceWriter.cpp | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Examples/Io/Root/include/ActsExamples/Io/Root/detail/NuclearInteractionParametrisation.hpp b/Examples/Io/Root/include/ActsExamples/Io/Root/detail/NuclearInteractionParametrisation.hpp index b0a6174a0d6..e00fb79c63a 100644 --- a/Examples/Io/Root/include/ActsExamples/Io/Root/detail/NuclearInteractionParametrisation.hpp +++ b/Examples/Io/Root/include/ActsExamples/Io/Root/detail/NuclearInteractionParametrisation.hpp @@ -34,7 +34,7 @@ struct EventFraction { /// /// @param [in] event Tuple containing the initial particle, the particle /// before the interaction and all final state particles after the interaction - EventFraction(const ActsExamples::ExtractedSimulationProcess& event) + explicit EventFraction(const ActsExamples::ExtractedSimulationProcess& event) : initialParticle(event.initial), interactingParticle(event.before), finalParticles(event.after) {} diff --git a/Examples/Io/Root/src/VertexPerformanceWriter.cpp b/Examples/Io/Root/src/VertexPerformanceWriter.cpp index f032e39af35..ca04e9c80c1 100644 --- a/Examples/Io/Root/src/VertexPerformanceWriter.cpp +++ b/Examples/Io/Root/src/VertexPerformanceWriter.cpp @@ -497,7 +497,7 @@ ProcessCode VertexPerformanceWriter::writeT( fmap[vtxId].second += weight; } double truthMajorityVertexTrackWeights = 0; - SimVertexBarcode truthMajorityVertexId = 0; + SimVertexBarcode truthMajorityVertexId{0}; for (const auto& [vtxId, counter] : fmap) { if (counter.second > truthMajorityVertexTrackWeights) { truthMajorityVertexId = vtxId; @@ -629,7 +629,8 @@ ProcessCode VertexPerformanceWriter::writeT( // Count number of reconstructible tracks on truth vertex int nTracksOnTruthVertex = 0; for (const auto& particle : selectedParticles) { - if (particle.particleId().vertexId() == truthVertex.vertexId()) { + if (static_cast(particle.particleId().vertexId()) == + truthVertex.vertexId()) { ++nTracksOnTruthVertex; } } From c3609a0b5e84398b4f412ae93a059891459fea46 Mon Sep 17 00:00:00 2001 From: AJPfleger Date: Sat, 19 Oct 2024 16:46:05 +0200 Subject: [PATCH 09/10] revert vertex performance writer --- Examples/Io/Root/src/VertexPerformanceWriter.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Examples/Io/Root/src/VertexPerformanceWriter.cpp b/Examples/Io/Root/src/VertexPerformanceWriter.cpp index ca04e9c80c1..f032e39af35 100644 --- a/Examples/Io/Root/src/VertexPerformanceWriter.cpp +++ b/Examples/Io/Root/src/VertexPerformanceWriter.cpp @@ -497,7 +497,7 @@ ProcessCode VertexPerformanceWriter::writeT( fmap[vtxId].second += weight; } double truthMajorityVertexTrackWeights = 0; - SimVertexBarcode truthMajorityVertexId{0}; + SimVertexBarcode truthMajorityVertexId = 0; for (const auto& [vtxId, counter] : fmap) { if (counter.second > truthMajorityVertexTrackWeights) { truthMajorityVertexId = vtxId; @@ -629,8 +629,7 @@ ProcessCode VertexPerformanceWriter::writeT( // Count number of reconstructible tracks on truth vertex int nTracksOnTruthVertex = 0; for (const auto& particle : selectedParticles) { - if (static_cast(particle.particleId().vertexId()) == - truthVertex.vertexId()) { + if (particle.particleId().vertexId() == truthVertex.vertexId()) { ++nTracksOnTruthVertex; } } From dad1a66c48acdcb3ef3dc8be21739923e5c2e1c2 Mon Sep 17 00:00:00 2001 From: AJPfleger Date: Sat, 19 Oct 2024 16:47:47 +0200 Subject: [PATCH 10/10] resolve conflicts --- Examples/Io/Root/src/VertexNTupleWriter.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Examples/Io/Root/src/VertexNTupleWriter.cpp b/Examples/Io/Root/src/VertexNTupleWriter.cpp index 36c9b7bfb29..c5a800741d3 100644 --- a/Examples/Io/Root/src/VertexNTupleWriter.cpp +++ b/Examples/Io/Root/src/VertexNTupleWriter.cpp @@ -497,7 +497,7 @@ ProcessCode VertexNTupleWriter::writeT( fmap[vtxId].second += weight; } double truthMajorityVertexTrackWeights = 0; - SimVertexBarcode truthMajorityVertexId = 0; + SimVertexBarcode truthMajorityVertexId{0}; for (const auto& [vtxId, counter] : fmap) { if (counter.second > truthMajorityVertexTrackWeights) { truthMajorityVertexId = vtxId; @@ -629,7 +629,8 @@ ProcessCode VertexNTupleWriter::writeT( // Count number of reconstructible tracks on truth vertex int nTracksOnTruthVertex = 0; for (const auto& particle : selectedParticles) { - if (particle.particleId().vertexId() == truthVertex.vertexId()) { + if (static_cast(particle.particleId().vertexId()) == + truthVertex.vertexId()) { ++nTracksOnTruthVertex; } }