Skip to content

Commit

Permalink
Merge branch 'main' into feat-introduce-dd4hep-geometry-context
Browse files Browse the repository at this point in the history
  • Loading branch information
asalzburger authored Nov 19, 2024
2 parents 04c97f2 + 2cf38f7 commit 2d11970
Show file tree
Hide file tree
Showing 59 changed files with 1,081 additions and 643 deletions.
4 changes: 4 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,7 @@ DO NOT USE @-MENTIONS HERE!
--- END COMMIT MESSAGE ---

Any further description goes here, @-mentions are ok here!

- Use a *conventional commits* prefix: [quick summary](https://www.conventionalcommits.org/en/v1.0.0/#summary)
- We mostly use `feat`, `fix`, `refactor`, `docs`, `chore` and `build` types.
- A milestone will be assigned by one of the maintainers
2 changes: 1 addition & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ build_exatrkx:
# - git clone $CLONE_URL src
# - cd src
# - git checkout $HEAD_SHA
# - pip3 install -r Examples/Python/tests/requirements_ubuntu2004.txt
# - pip3 install -r Examples/Python/tests/requirements.txt
# - nvidia-smi
# - pytest -rFsv -k test_exatrkx

Expand Down
6 changes: 5 additions & 1 deletion .zenodo.json
Original file line number Diff line number Diff line change
Expand Up @@ -112,11 +112,15 @@
"affiliation": "CERN / University of Amsterdam",
"name": "Stephen Nicholas Swatman",
"orcid": "0000-0002-3747-3229"
}
},
{
"affiliation": "CERN / TU Wien",
"name": "Felix Russo",
"orcid": "0009-0005-8975-2245"
},
{
"affiliation": "UC Berkeley",
"name": "Carlo Varni"
}
],
"access_right": "open",
Expand Down
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@ The following people have contributed to the project (in alphabetical order):
- Andreas Stefl, CERN, TU Wien
- Stephen Nicholas Swatman, CERN, University of Amsterdam
- Roman Urmanov, Weizmann Institute of Science
- Carlo Varni, UC Berkeley
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
3 changes: 3 additions & 0 deletions CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,9 @@ authors:
family-names: Russo
affiliation: CERN / TU Wien
orcid: https://orcid.org/0009-0005-8975-2245
- given-names: Carlo
family-names: Varni
affiliation: UC Berkeley
version: 10.0.0
date-released: 2021-07-28
repository-code: https://github.com/acts-project/acts
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include "Acts/EventData/TrackContainer.hpp"
#include "Acts/EventData/TrackContainerFrontendConcept.hpp"
#include "Acts/EventData/TrackProxyConcept.hpp"
#include "Acts/EventData/TrackStateProxy.hpp"
#include "Acts/Utilities/Delegate.hpp"
#include "Acts/Utilities/Logger.hpp"

Expand Down Expand Up @@ -81,11 +82,17 @@ class ScoreBasedAmbiguityResolution {
std::size_t nSharedHits = 0;
};

/// @brief MeasurementInfo : contains the measurement ID and the detector ID
struct MeasurementInfo {
std::size_t iMeasurement = 0;
std::size_t detectorId = 0;
bool isOutlier = false;
enum class TrackStateTypes : std::uint8_t {
// A measurement not yet used in any other track
UnsharedHit,
// A measurement shared with another track
SharedHit,
// A hit that needs to be removed from the track
RejectedHit,
// An outlier, to be copied in case
Outlier,
// Other trackstate types to be copied in case
OtherTrackStateType
};

/// @brief Configuration struct : contains the configuration for the ambiguity resolution.
Expand Down Expand Up @@ -125,11 +132,17 @@ class ScoreBasedAmbiguityResolution {

using OptionalScoreModifier =
std::function<void(const track_proxy_t&, double&)>;

using OptionalHitSelection = std::function<void(
const track_proxy_t&,
const typename track_proxy_t::ConstTrackStateProxy&, TrackStateTypes&)>;

std::vector<OptionalFilter> cuts = {};
std::vector<OptionalScoreModifier> weights = {};

/// applied only if useAmbiguityFunction is true
std::vector<OptionalScoreModifier> scores = {};
std::vector<OptionalHitSelection> hitSelections = {};
};

ScoreBasedAmbiguityResolution(
Expand All @@ -141,16 +154,10 @@ class ScoreBasedAmbiguityResolution {
/// Compute the initial state of the tracks.
///
/// @param tracks is the input track container
/// @param sourceLinkHash is the source links
/// @param sourceLinkEquality is the equality function for the source links
/// @param trackFeaturesVectors is the trackFeatures map from detector ID to trackFeatures
/// @return a vector of the initial state of the tracks
template <TrackContainerFrontend track_container_t,
typename source_link_hash_t, typename source_link_equality_t>
std::vector<std::vector<MeasurementInfo>> computeInitialState(
const track_container_t& tracks, source_link_hash_t sourceLinkHash,
source_link_equality_t sourceLinkEquality,
std::vector<std::vector<TrackFeatures>>& trackFeaturesVectors) const;
/// @return trackFeaturesVectors is the trackFeatures map from detector ID to trackFeatures
template <TrackContainerFrontend track_container_t>
std::vector<std::vector<TrackFeatures>> computeInitialState(
const track_container_t& tracks) const;

/// Compute the score of each track.
///
Expand Down Expand Up @@ -182,29 +189,35 @@ class ScoreBasedAmbiguityResolution {
/// that have a score below a certain threshold or not enough hits.
///
/// @brief Remove tracks that are not good enough based on cuts
/// @param track is the input track
/// @param trackScore is the score of each track
/// @param trackFeaturesVectors is the trackFeatures map for each track
/// @param measurementsPerTrack is the list of measurements for each track
/// @param nTracksPerMeasurement is the number of tracks per measurement
/// @param optionalHitSelections is the optional hit selections to be applied
/// @return a vector of IDs of the tracks we want to keep
std::vector<bool> getCleanedOutTracks(
const std::vector<double>& trackScore,
const std::vector<std::vector<TrackFeatures>>& trackFeaturesVectors,
const std::vector<std::vector<MeasurementInfo>>& measurementsPerTrack)
const;
template <TrackProxyConcept track_proxy_t>
bool getCleanedOutTracks(
const track_proxy_t& track, const double& trackScore,
const std::vector<std::size_t>& measurementsPerTrack,
const std::map<std::size_t, std::size_t>& nTracksPerMeasurement,
const std::vector<std::function<
void(const track_proxy_t&,
const typename track_proxy_t::ConstTrackStateProxy&,
TrackStateTypes&)>>& optionalHitSelections = {}) const;

/// Remove tracks that are bad based on cuts and weighted scores.
///
/// @brief Remove tracks that are not good enough
/// @param tracks is the input track container
/// @param measurementsPerTrack is the list of measurements for each track
/// @param trackFeaturesVectors is the map of detector id to trackFeatures for each track
/// @param sourceLinkHash is the source links
/// @param sourceLinkEquality is the equality function for the source links
/// @param optionalCuts is the optional cuts to be applied
/// @return a vector of IDs of the tracks we want to keep
template <TrackContainerFrontend track_container_t>
template <TrackContainerFrontend track_container_t,
typename source_link_hash_t, typename source_link_equality_t>
std::vector<int> solveAmbiguity(
const track_container_t& tracks,
const std::vector<std::vector<MeasurementInfo>>& measurementsPerTrack,
const std::vector<std::vector<TrackFeatures>>& trackFeaturesVectors,
const track_container_t& tracks, source_link_hash_t sourceLinkHash,
source_link_equality_t sourceLinkEquality,
const OptionalCuts<typename track_container_t::ConstTrackProxy>&
optionalCuts = {}) const;

Expand Down
Loading

0 comments on commit 2d11970

Please sign in to comment.