Skip to content

Commit

Permalink
Merge branch 'main' into refactor/track-selector-require-ref-surface
Browse files Browse the repository at this point in the history
  • Loading branch information
kodiakhq[bot] authored Nov 1, 2024
2 parents b72a14e + 4893a20 commit 35af00c
Show file tree
Hide file tree
Showing 27 changed files with 441 additions and 300 deletions.
44 changes: 5 additions & 39 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,41 +1,7 @@
PLEASE FOLLOW THE CHECKLIST BELOW WHEN CREATING A NEW PULL REQUEST. THE
CHECKLIST IS FOR YOUR INFORMATION AND MUST BE REMOVED BEFORE SUBMITTING THE PULL
REQUEST.
PLEASE DESCRIBE YOUR CHANGES.
THIS MESSAGE ENDS UP AS THE COMMIT MESSAGE.
DO NOT USE @-MENTIONS HERE!

## Checklist
--- END COMMIT MESSAGE ---

- [ ] Does the PR title follow the `<prefix>: title` scheme?

The prefix must be one of:

- `fix`: for a bugfix
- `feat`: for a new feature
- `refactor`: for an improvement of an existing feature
- `perf`, `test`: for performance- or test-related changes
- `docs`: for documentation-related changes
- `build`, `ci`, `chore`: as appropriated for infrastructure changes

- [ ] Does this modify the public API as defined in `docs/versioning.rst`?

- [ ] Does the PR title contain a `!` to indicate a breaking change?
- [ ] Is there section starting with `BREAKING CHANGE:` in the PR body
that explains the breaking change?

- [ ] Is the PR ready to be merged?

- [ ] If not: is it marked as a draft PR?

- [ ] Does this PR close an existing issue?

- [ ] Is the issue correctly linked so it will be automatically closed
upon successful merge (See closing keywords link in the sidebar)?

- The CI will initially report a missing milestone. One of the maintainers will
handle assigning a milestone for book-keeping.

- An automated workflow will assign labels based on changed files, and whether
or not reference files were changed. These do not have to be set manually.

- If you push updates, and you know they will be superseded later on, consider adding
`[skip ci]` in the commit message. This will instruct the CI system not to run any
jobs on this commit.
Any further description goes here, @-mentions are ok here!
2 changes: 1 addition & 1 deletion .kodiak.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version = 1

merge.message.title = "pull_request_title"
merge.message.body = "pull_request_body"
merge.message.cut_body_before = "--- BEGIN COMMIT MESSAGE ---"
merge.message.cut_body_after = "--- END COMMIT MESSAGE ---"
merge.message.cut_body_and_text = true
merge.method = "squash"
merge.message.include_coauthors = true
Expand Down
13 changes: 11 additions & 2 deletions CI/physmon/workflows/physmon_simulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,14 @@
)
)

s.addWriter(
acts.examples.RootParticleWriter(
level=acts.logging.INFO,
inputParticles="particles_input",
filePath=tp / "particles.root",
)
)

addFatras(
s,
setup.trackingGeometry,
Expand Down Expand Up @@ -100,6 +108,7 @@
s.run()

for file, name in [
(tp / "particles.root", "particles_gun.root"),
(tp / "fatras" / "particles_simulation.root", "particles_fatras.root"),
(tp / "geant4" / "particles_simulation.root", "particles_geant4.root"),
]:
Expand Down Expand Up @@ -135,8 +144,8 @@
s.run()

for file, name in [
(tp / "pythia8_particles.root", "particles_ttbar.root"),
(tp / "pythia8_vertices.root", "vertices_ttbar.root"),
(tp / "particles.root", "particles_ttbar.root"),
(tp / "vertices.root", "vertices_ttbar.root"),
]:
assert file.exists(), "file not found"
shutil.copy(file, setup.outdir / name)
1 change: 0 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ option(ACTS_BUILD_EXAMPLES_HEPMC3 "Build HepMC3-based code in the examples" OFF)
option(ACTS_BUILD_EXAMPLES_HASHING "Build Hashing-based code in the examples" OFF)
option(ACTS_BUILD_EXAMPLES_PYTHIA8 "Build Pythia8-based code in the examples" OFF)
option(ACTS_BUILD_EXAMPLES_PYTHON_BINDINGS "Build python bindings for the examples" OFF)
option(ACTS_USE_EXAMPLES_TBB "Use Threading Building Blocks library in the examples" ON)
option(ACTS_BUILD_ANALYSIS_APPS "Build Analysis applications in the examples" OFF)
# test related options
option(ACTS_BUILD_BENCHMARKS "Build benchmarks" OFF)
Expand Down
14 changes: 13 additions & 1 deletion Core/include/Acts/Seeding/SeedFilter.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include "Acts/Seeding/CandidatesForMiddleSp.hpp"
#include "Acts/Seeding/IExperimentCuts.hpp"
#include "Acts/Seeding/SeedFilterConfig.hpp"
#include "Acts/Utilities/Logger.hpp"

#include <memory>
#include <mutex>
Expand All @@ -37,8 +38,15 @@ struct SeedFilterState {
template <typename external_spacepoint_t>
class SeedFilter final {
public:
SeedFilter(SeedFilterConfig config,
SeedFilter(const SeedFilterConfig& config,
IExperimentCuts<external_spacepoint_t>* expCuts = nullptr);
SeedFilter(const SeedFilterConfig& config,
std::unique_ptr<const Acts::Logger> logger,
IExperimentCuts<external_spacepoint_t>* expCuts = nullptr);
SeedFilter(const SeedFilter<external_spacepoint_t>&) = delete;
SeedFilter& operator=(const SeedFilter<external_spacepoint_t>&) = delete;
SeedFilter(SeedFilter<external_spacepoint_t>&&) noexcept = default;
SeedFilter& operator=(SeedFilter<external_spacepoint_t>&&) noexcept = default;

SeedFilter() = delete;
~SeedFilter() = default;
Expand Down Expand Up @@ -95,7 +103,11 @@ class SeedFilter final {
}

private:
const Logger& logger() const { return *m_logger; }

const SeedFilterConfig m_cfg;
std::unique_ptr<const Acts::Logger> m_logger =
Acts::getDefaultLogger("SeedFilter", Logging::Level::INFO);
const IExperimentCuts<external_spacepoint_t>* m_experimentCuts;
};
} // namespace Acts
Expand Down
20 changes: 18 additions & 2 deletions Core/include/Acts/Seeding/SeedFilter.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,26 @@ namespace Acts {
// constructor
template <typename external_spacepoint_t>
SeedFilter<external_spacepoint_t>::SeedFilter(
SeedFilterConfig config,
const SeedFilterConfig& config,
IExperimentCuts<external_spacepoint_t>* expCuts /* = 0*/)
: m_cfg(config), m_experimentCuts(expCuts) {
if (!config.isInInternalUnits) {
throw std::runtime_error(
"SeedFilterConfig not in ACTS internal units in SeedFilter");
}
}

template <typename external_spacepoint_t>
SeedFilter<external_spacepoint_t>::SeedFilter(
const SeedFilterConfig& config, std::unique_ptr<const Acts::Logger> logger,
IExperimentCuts<external_spacepoint_t>* expCuts /* = 0*/)
: m_cfg(config), m_logger(std::move(logger)), m_experimentCuts(expCuts) {
if (!config.isInInternalUnits) {
throw std::runtime_error(
"SeedFilterConfig not in ACTS internal units in SeedFilter");
}
}

// function to filter seeds based on all seeds with same bottom- and
// middle-spacepoint.
// return vector must contain weight of each seed
Expand Down Expand Up @@ -295,10 +307,14 @@ void SeedFilter<external_spacepoint_t>::filterSeeds_1SpFixed(
seed.setVertexZ(zOrigin);
seed.setQuality(bestSeedQuality);

ACTS_VERBOSE("Adding seed: [b=" << bottom->index() << ", m="
<< medium->index() << ", t=" << top->index()
<< "], quality=" << bestSeedQuality
<< ", vertexZ=" << zOrigin);
Acts::detail::pushBackOrInsertAtEnd(outputCollection, std::move(seed));

++numTotalSeeds;
}
ACTS_VERBOSE("Identified " << numTotalSeeds << " seeds");
}

} // namespace Acts
25 changes: 18 additions & 7 deletions Core/include/Acts/Seeding/SeedFinder.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include "Acts/Seeding/SeedFinderUtils.hpp"
#include "Acts/Seeding/SpacePointGrid.hpp"
#include "Acts/Seeding/detail/UtilityFunctions.hpp"
#include "Acts/Utilities/Logger.hpp"

#include <array>
#include <limits>
Expand All @@ -37,11 +38,11 @@ concept GridBinCollection =
std::ranges::random_access_range<Coll> &&
std::same_as<typename Coll::value_type, std::size_t>;

template <typename Coll, typename external_t, std::size_t N = 3ul>
concept CollectionStoresSeedsTo = requires(Coll coll, external_t sp) {
Acts::detail::pushBackOrInsertAtEnd(coll,
Acts::Seed<external_t, N>(sp, sp, sp));
};
template <typename collection_t, typename external_t, std::size_t N = 3ul>
concept CollectionStoresSeedsTo =
requires(collection_t coll, Acts::Seed<external_t, N> seed) {
Acts::detail::pushBackOrInsertAtEnd(coll, seed);
};

enum class SpacePointCandidateType : short { eBottom, eTop };

Expand Down Expand Up @@ -87,15 +88,22 @@ class SeedFinder {

/// The only constructor. Requires a config object.
/// @param config the configuration for the SeedFinder
SeedFinder(const Acts::SeedFinderConfig<external_spacepoint_t>& config);
/// @param logger the ACTS logger
SeedFinder(const Acts::SeedFinderConfig<external_spacepoint_t>& config,
std::unique_ptr<const Acts::Logger> logger =
getDefaultLogger("SeedFinder", Logging::Level::INFO));
SeedFinder(SeedFinder<external_spacepoint_t, grid_t, platform_t>&&) noexcept =
default;
SeedFinder& operator=(SeedFinder<external_spacepoint_t, grid_t,
platform_t>&&) noexcept = default;
~SeedFinder() = default;
/** @name Disallow default instantiation, copy, assignment */
//@{
SeedFinder() = default;
SeedFinder(const SeedFinder<external_spacepoint_t, grid_t, platform_t>&) =
delete;
SeedFinder<external_spacepoint_t, grid_t, platform_t>& operator=(
const SeedFinder<external_spacepoint_t, grid_t, platform_t>&) = default;
const SeedFinder<external_spacepoint_t, grid_t, platform_t>&) = delete;
//@}

/// Create all seeds from the space points in the three iterators.
Expand Down Expand Up @@ -172,7 +180,10 @@ class SeedFinder {
SeedingState& state) const;

private:
const Logger& logger() const { return *m_logger; }

Acts::SeedFinderConfig<external_spacepoint_t> m_config;
std::unique_ptr<const Acts::Logger> m_logger{nullptr};
};

} // namespace Acts
Expand Down
21 changes: 19 additions & 2 deletions Core/include/Acts/Seeding/SeedFinder.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@ namespace Acts {

template <typename external_spacepoint_t, typename grid_t, typename platform_t>
SeedFinder<external_spacepoint_t, grid_t, platform_t>::SeedFinder(
const Acts::SeedFinderConfig<external_spacepoint_t>& config)
: m_config(config) {
const Acts::SeedFinderConfig<external_spacepoint_t>& config,
std::unique_ptr<const Acts::Logger> logger)
: m_config(config), m_logger(std::move(logger)) {
if (!config.isInInternalUnits) {
throw std::runtime_error(
"SeedFinderConfig not in ACTS internal units in SeedFinder");
Expand Down Expand Up @@ -110,6 +111,12 @@ void SeedFinder<external_spacepoint_t, grid_t, platform_t>::createSeedsForGroup(
// same z-bin
auto [minRadiusRangeForMiddle, maxRadiusRangeForMiddle] =
retrieveRadiusRangeForMiddle(*middleSPs.front(), rMiddleSPRange);
ACTS_VERBOSE("Current global bin: " << middleSPsIdx << ", z value of "
<< middleSPs.front()->z());
ACTS_VERBOSE("Validity range (radius) for the middle space point is ["
<< minRadiusRangeForMiddle << ", " << maxRadiusRangeForMiddle
<< "]");

for (const external_spacepoint_t* spM : middleSPs) {
const float rM = spM->radius();

Expand All @@ -136,6 +143,7 @@ void SeedFinder<external_spacepoint_t, grid_t, platform_t>::createSeedsForGroup(

// no top SP found -> try next spM
if (state.compatTopSP.empty()) {
ACTS_VERBOSE("No compatible Tops, moving to next middle candidate");
continue;
}

Expand All @@ -157,6 +165,10 @@ void SeedFinder<external_spacepoint_t, grid_t, platform_t>::createSeedsForGroup(
seedFilterState.rMaxSeedConf = seedConfRange.rMaxSeedConf;
// continue if number of top SPs is smaller than minimum
if (state.compatTopSP.size() < seedFilterState.nTopSeedConf) {
ACTS_VERBOSE(
"Number of top SPs is "
<< state.compatTopSP.size()
<< " and is smaller than minimum, moving to next middle candidate");
continue;
}
}
Expand All @@ -170,9 +182,14 @@ void SeedFinder<external_spacepoint_t, grid_t, platform_t>::createSeedsForGroup(

// no bottom SP found -> try next spM
if (state.compatBottomSP.empty()) {
ACTS_VERBOSE("No compatible Bottoms, moving to next middle candidate");
continue;
}

ACTS_VERBOSE("Candidates: " << state.compatBottomSP.size()
<< " bottoms and " << state.compatTopSP.size()
<< " tops for middle candidate indexed "
<< spM->index());
// filter candidates
if (m_config.useDetailedDoubleMeasurementInfo) {
filterCandidates<Acts::DetectorMeasurementInfo::eDetailed>(
Expand Down
10 changes: 7 additions & 3 deletions Core/include/Acts/Seeding/detail/CylindricalSpacePointGrid.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include "Acts/Seeding/BinnedGroup.hpp"
#include "Acts/Seeding/SeedFinderConfig.hpp"
#include "Acts/Utilities/Grid.hpp"
#include "Acts/Utilities/Logger.hpp"

#include <numbers>
#include <vector>
Expand Down Expand Up @@ -158,7 +159,8 @@ class CylindricalSpacePointGridCreator {
template <typename external_spacepoint_t>
static Acts::CylindricalSpacePointGrid<external_spacepoint_t> createGrid(
const Acts::CylindricalSpacePointGridConfig& _config,
const Acts::CylindricalSpacePointGridOptions& _options);
const Acts::CylindricalSpacePointGridOptions& _options,
const Acts::Logger& logger = Acts::getDummyLogger());

template <typename external_spacepoint_t,
typename external_spacepoint_iterator_t>
Expand All @@ -167,7 +169,8 @@ class CylindricalSpacePointGridCreator {
const Acts::SeedFinderOptions& options,
Acts::CylindricalSpacePointGrid<external_spacepoint_t>& grid,
external_spacepoint_iterator_t spBegin,
external_spacepoint_iterator_t spEnd);
external_spacepoint_iterator_t spEnd,
const Acts::Logger& logger = Acts::getDummyLogger());

template <typename external_spacepoint_t, typename external_collection_t>
requires std::ranges::range<external_collection_t> &&
Expand All @@ -177,7 +180,8 @@ class CylindricalSpacePointGridCreator {
const Acts::SeedFinderConfig<external_spacepoint_t>& config,
const Acts::SeedFinderOptions& options,
Acts::CylindricalSpacePointGrid<external_spacepoint_t>& grid,
const external_collection_t& collection);
const external_collection_t& collection,
const Acts::Logger& logger = Acts::getDummyLogger());
};

} // namespace Acts
Expand Down
Loading

0 comments on commit 35af00c

Please sign in to comment.