Skip to content

Commit

Permalink
refactor!: Rename Seedfinder to SeedFinder - classes and files (#1575)
Browse files Browse the repository at this point in the history
The Seedfinder and related classes somehow did not follow the usual naming convention for classes (CamelCase convention). This PR fixes this. 

It addresses part of the issue: #1522 but not closes it. I decided that is best addressed in two PRs. This one is strictly technical.

BREAKING CHANGE: Include file names are changed and so are the classes. Fix is trivial on client side, yet needs to be done in several places when migrating.
  • Loading branch information
tboldagh committed Oct 20, 2022
1 parent b7b3e77 commit f8e756e
Show file tree
Hide file tree
Showing 49 changed files with 340 additions and 340 deletions.
6 changes: 3 additions & 3 deletions CI/physmon/physmon.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
addSeeding,
TruthSeedRanges,
ParticleSmearingSigmas,
SeedfinderConfigArg,
SeedFinderConfigArg,
SeedingAlgorithm,
TrackParamsEstimationConfig,
addCKFTracks,
Expand Down Expand Up @@ -147,7 +147,7 @@
ParticleSmearingSigmas(
pRel=0.01
), # only used by SeedingAlgorithm.TruthSmeared
SeedfinderConfigArg(
SeedFinderConfigArg(
r=(None, 200 * u.mm), # rMin=default, 33mm
deltaR=(1 * u.mm, 60 * u.mm),
collisionRegion=(-250 * u.mm, 250 * u.mm),
Expand Down Expand Up @@ -274,7 +274,7 @@
ParticleSmearingSigmas(
pRel=0.01
), # only used by SeedingAlgorithm.TruthSmeared
SeedfinderConfigArg(
SeedFinderConfigArg(
r=(None, 200 * u.mm), # rMin=default, 33mm
deltaR=(1 * u.mm, 60 * u.mm),
collisionRegion=(-250 * u.mm, 250 * u.mm),
Expand Down
4 changes: 2 additions & 2 deletions Core/include/Acts/Seeding/BinnedSPGroup.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#include "Acts/Seeding/BinFinder.hpp"
#include "Acts/Seeding/InternalSeed.hpp"
#include "Acts/Seeding/Seed.hpp"
#include "Acts/Seeding/SeedfinderConfig.hpp"
#include "Acts/Seeding/SeedFinderConfig.hpp"
#include "Acts/Seeding/SpacePointGrid.hpp"

#include <memory>
Expand Down Expand Up @@ -274,7 +274,7 @@ class BinnedSPGroup {
std::shared_ptr<Acts::BinFinder<external_spacepoint_t>> tBinFinder,
std::unique_ptr<SpacePointGrid<external_spacepoint_t>> grid,
Acts::Extent rRangeSPExtent,
const SeedfinderConfig<external_spacepoint_t>& _config);
const SeedFinderConfig<external_spacepoint_t>& _config);

size_t size() { return m_binnedSP->size(); }

Expand Down
2 changes: 1 addition & 1 deletion Core/include/Acts/Seeding/BinnedSPGroup.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Acts::BinnedSPGroup<external_spacepoint_t>::BinnedSPGroup(
std::shared_ptr<Acts::BinFinder<external_spacepoint_t>> tBinFinder,
std::unique_ptr<SpacePointGrid<external_spacepoint_t>> grid,
Acts::Extent rRangeSPExtent,
const SeedfinderConfig<external_spacepoint_t>& _config) {
const SeedFinderConfig<external_spacepoint_t>& _config) {
auto config = _config.toInternalUnits();
static_assert(
std::is_same<
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
#include "Acts/Geometry/Extent.hpp"
#include "Acts/Seeding/InternalSeed.hpp"
#include "Acts/Seeding/InternalSpacePoint.hpp"
#include "Acts/Seeding/SeedFinderConfig.hpp"
#include "Acts/Seeding/SeedFinderUtils.hpp"
#include "Acts/Seeding/SeedfinderConfig.hpp"

#include <array>
#include <list>
Expand All @@ -26,7 +26,7 @@
namespace Acts {

template <typename external_spacepoint_t, typename platform_t = void*>
class Seedfinder {
class SeedFinder {
///////////////////////////////////////////////////////////////////
// Public methods:
///////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -55,15 +55,15 @@ class Seedfinder {
};

/// The only constructor. Requires a config object.
/// @param config the configuration for the Seedfinder
Seedfinder(Acts::SeedfinderConfig<external_spacepoint_t> config);
~Seedfinder() = default;
/// @param config the configuration for the SeedFinder
SeedFinder(Acts::SeedFinderConfig<external_spacepoint_t> config);
~SeedFinder() = default;
/** @name Disallow default instantiation, copy, assignment */
//@{
Seedfinder() = delete;
Seedfinder(const Seedfinder<external_spacepoint_t, platform_t>&) = delete;
Seedfinder<external_spacepoint_t, platform_t>& operator=(
const Seedfinder<external_spacepoint_t, platform_t>&) = delete;
SeedFinder() = delete;
SeedFinder(const SeedFinder<external_spacepoint_t, platform_t>&) = delete;
SeedFinder<external_spacepoint_t, platform_t>& operator=(
const SeedFinder<external_spacepoint_t, platform_t>&) = delete;
//@}

/// Create all seeds from the space points in the three iterators.
Expand Down Expand Up @@ -105,11 +105,11 @@ class Seedfinder {
sp_range_t bottomSPs, sp_range_t middleSPs, sp_range_t topSPs) const;

private:
Acts::SeedfinderConfig<external_spacepoint_t> m_config;
Acts::SeedFinderConfig<external_spacepoint_t> m_config;
};

} // namespace Acts

#ifndef DOXYGEN
#include "Acts/Seeding/Seedfinder.ipp"
#include "Acts/Seeding/SeedFinder.ipp"
#endif
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
namespace Acts {

template <typename external_spacepoint_t, typename platform_t>
Seedfinder<external_spacepoint_t, platform_t>::Seedfinder(
Acts::SeedfinderConfig<external_spacepoint_t> config)
SeedFinder<external_spacepoint_t, platform_t>::SeedFinder(
Acts::SeedFinderConfig<external_spacepoint_t> config)
: m_config(config.toInternalUnits()) {
// calculation of scattering using the highland formula
// convert pT to p once theta angle is known
Expand All @@ -38,7 +38,7 @@ Seedfinder<external_spacepoint_t, platform_t>::Seedfinder(

template <typename external_spacepoint_t, typename platform_t>
template <template <typename...> typename container_t, typename sp_range_t>
void Seedfinder<external_spacepoint_t, platform_t>::createSeedsForGroup(
void SeedFinder<external_spacepoint_t, platform_t>::createSeedsForGroup(
State& state,
std::back_insert_iterator<container_t<Seed<external_spacepoint_t>>> outIt,
sp_range_t bottomSPs, sp_range_t middleSPs, sp_range_t topSPs,
Expand Down Expand Up @@ -527,7 +527,7 @@ void Seedfinder<external_spacepoint_t, platform_t>::createSeedsForGroup(
template <typename external_spacepoint_t, typename platform_t>
template <typename sp_range_t>
std::vector<Seed<external_spacepoint_t>>
Seedfinder<external_spacepoint_t, platform_t>::createSeedsForGroup(
SeedFinder<external_spacepoint_t, platform_t>::createSeedsForGroup(
sp_range_t bottomSPs, sp_range_t middleSPs, sp_range_t topSPs) const {
State state;
Extent extent;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ template <typename T>
class SeedFilter;

template <typename SpacePoint>
struct SeedfinderConfig {
struct SeedFinderConfig {
std::shared_ptr<Acts::SeedFilter<SpacePoint>> seedFilter;

// Seed Cuts
Expand Down Expand Up @@ -141,7 +141,7 @@ struct SeedfinderConfig {
// find seeds within 5sigma error ellipse
float sigmaError = 5;

// derived values, set on Seedfinder construction
// derived values, set on SeedFinder construction
float highland = 0;
float maxScatteringAngle2 = 0;
float pTPerHelixRadius = 0;
Expand Down Expand Up @@ -173,9 +173,9 @@ struct SeedfinderConfig {
// Returns position of the center of the top strip.
Delegate<Acts::Vector3(const SpacePoint&)> getTopStripCenterPosition;

SeedfinderConfig toInternalUnits() const {
SeedFinderConfig toInternalUnits() const {
using namespace Acts::UnitLiterals;
SeedfinderConfig config = *this;
SeedFinderConfig config = *this;
config.minPt /= 1_MeV;
config.deltaRMin /= 1_mm;
config.deltaRMax /= 1_mm;
Expand Down
2 changes: 1 addition & 1 deletion Core/include/Acts/Seeding/SeedFinderOrthogonalConfig.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ struct SeedFinderOrthogonalConfig {
// TODO: necessary to make amount of material dependent on detector region?
float radLengthPerSeed = 0.05;

// derived values, set on Seedfinder construction
// derived values, set on SeedFinder construction
float highland = 0;
float maxScatteringAngle2 = 0;
float pTPerHelixRadius = 0;
Expand Down
6 changes: 3 additions & 3 deletions Core/include/Acts/Seeding/SeedFinderUtils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

#include "Acts/Seeding/InternalSeed.hpp"
#include "Acts/Seeding/InternalSpacePoint.hpp"
#include "Acts/Seeding/SeedfinderConfig.hpp"
#include "Acts/Seeding/SeedFinderConfig.hpp"

namespace Acts {
/// @brief A partial description of a circle in u-v space.
Expand Down Expand Up @@ -72,14 +72,14 @@ void transformCoordinates(std::vector<external_spacepoint_t*>& vec,
/// @tparam external_spacepoint_t The external spacepoint type.
/// @tparam sp_range_t Container type for the space point collections.
///
/// @param[in] config Seedfinder config containing the delegates to the strip measurement details.
/// @param[in] config SeedFinder config containing the delegates to the strip measurement details.
/// @param[in] sp Input space point used in the check.
/// @param[in] spacepointPosition Spacepoint coordinates in xyz plane.
/// @param[in] toleranceParam Parameter used to evaluate if spacepointPosition is inside the detector elements.
/// @param[out] outputCoordinates The output vector to write to.
/// @returns Boolean that says if spacepoint is compatible with being inside the detector element.
template <typename external_spacepoint_t, typename sp_range_t>
bool xyzCoordinateCheck(Acts::SeedfinderConfig<external_spacepoint_t> config,
bool xyzCoordinateCheck(Acts::SeedFinderConfig<external_spacepoint_t> config,
sp_range_t sp, const double* spacepointPosition,
const float toleranceParam, double* outputCoordinates);

Expand Down
2 changes: 1 addition & 1 deletion Core/include/Acts/Seeding/SeedFinderUtils.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ void transformCoordinates(std::vector<external_spacepoint_t*>& vec,
}

template <typename external_spacepoint_t, typename sp_range_t>
bool xyzCoordinateCheck(Acts::SeedfinderConfig<external_spacepoint_t> m_config,
bool xyzCoordinateCheck(Acts::SeedFinderConfig<external_spacepoint_t> m_config,
sp_range_t sp, const double* spacepointPosition,
const float toleranceParam, double* outputCoordinates) {
// check the compatibility of SPs coordinates in xyz assuming the
Expand Down
2 changes: 1 addition & 1 deletion Core/include/Acts/Seeding/SpacePointGrid.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ namespace Acts {
struct SpacePointGridConfig {
// magnetic field
float bFieldInZ;
// minimum pT to be found by seedfinder
// minimum pT to be found by seedFinder
float minPt;
// maximum extension of sensitive detector layer relevant for seeding as
// distance from x=y=0 (i.e. in r)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

#include "Acts/Seeding/BinFinder.hpp"
#include "Acts/Seeding/SeedFilterConfig.hpp"
#include "Acts/Seeding/SeedfinderConfig.hpp"
#include "Acts/Seeding/SeedFinderConfig.hpp"
#include "Acts/Seeding/SpacePointGrid.hpp"
#include "ActsExamples/EventData/SimSpacePoint.hpp"
#include "ActsExamples/Framework/BareAlgorithm.hpp"
Expand All @@ -37,7 +37,7 @@ class SeedingAlgorithm final : public BareAlgorithm {
std::string outputProtoTracks;

Acts::SeedFilterConfig seedFilterConfig;
Acts::SeedfinderConfig<SimSpacePoint> seedFinderConfig;
Acts::SeedFinderConfig<SimSpacePoint> seedFinderConfig;
Acts::SpacePointGridConfig gridConfig;

// allow for different values of rMax in gridConfig and seedFinderConfig
Expand Down
4 changes: 2 additions & 2 deletions Examples/Algorithms/TrackFinding/src/SeedingAlgorithm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#include "Acts/Seeding/BinnedSPGroup.hpp"
#include "Acts/Seeding/Seed.hpp"
#include "Acts/Seeding/SeedFilter.hpp"
#include "Acts/Seeding/Seedfinder.hpp"
#include "Acts/Seeding/SeedFinder.hpp"
#include "Acts/Surfaces/Surface.hpp"
#include "ActsExamples/EventData/ProtoTrack.hpp"
#include "ActsExamples/EventData/SimSeed.hpp"
Expand Down Expand Up @@ -219,7 +219,7 @@ ActsExamples::ProcessCode ActsExamples::SeedingAlgorithm::execute(
spacePointPtrs.begin(), spacePointPtrs.end(), extractGlobalQuantities,
bottomBinFinder, topBinFinder, std::move(grid), rRangeSPExtent,
m_cfg.seedFinderConfig);
auto finder = Acts::Seedfinder<SimSpacePoint>(m_cfg.seedFinderConfig);
auto finder = Acts::SeedFinder<SimSpacePoint>(m_cfg.seedFinderConfig);

// run the seeding
static thread_local SimSeedContainer seeds;
Expand Down
6 changes: 3 additions & 3 deletions Examples/Python/python/acts/examples/itk.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from acts.examples import TGeoDetector

from acts.examples.reconstruction import (
SeedfinderConfigArg,
SeedFinderConfigArg,
SeedFilterConfigArg,
SpacePointGridConfigArg,
SeedingAlgorithmConfigArg,
Expand Down Expand Up @@ -462,7 +462,7 @@ def itkSeedingAlgConfig(inputSpacePointsType):
useDeltaRorTopRadius = False

# fill namedtuples
seedfinderConfigArg = SeedfinderConfigArg(
seedFinderConfigArg = SeedFinderConfigArg(
maxSeedsPerSpM=maxSeedsPerSpM,
cotThetaMax=cotThetaMax,
sigmaScattering=sigmaScattering,
Expand Down Expand Up @@ -520,7 +520,7 @@ def itkSeedingAlgConfig(inputSpacePointsType):
)

return (
seedfinderConfigArg,
seedFinderConfigArg,
seedFilterConfigArg,
spacePointGridConfigArg,
seedingAlgorithmConfigArg,
Expand Down

0 comments on commit f8e756e

Please sign in to comment.