Skip to content

Commit

Permalink
Merge branch 'main' into geomodel-muons
Browse files Browse the repository at this point in the history
  • Loading branch information
dimitra97 authored Jul 24, 2024
2 parents daccdac + 5a2f6a4 commit 9ba3f7d
Show file tree
Hide file tree
Showing 103 changed files with 2,078 additions and 1,484 deletions.
4 changes: 2 additions & 2 deletions CI/setup_cvmfs_lcg.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# setup lowest, supported LCG release via cvmfs
# setup latest, supported LCG release via cvmfs

if test -n "$BASH_SOURCE"; then
this_script=$BASH_SOURCE
Expand All @@ -11,4 +11,4 @@ else
fi

dir="$( cd "$( dirname "${this_script}" )" && pwd )"
source $dir/setup_cvmfs_lcg101.sh
source $dir/setup_cvmfs_lcg105.sh
19 changes: 0 additions & 19 deletions CI/setup_cvmfs_lcg100.sh

This file was deleted.

19 changes: 0 additions & 19 deletions CI/setup_cvmfs_lcg101.sh

This file was deleted.

5 changes: 2 additions & 3 deletions CI/setup_cvmfs_lcg105.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,10 @@ else
fi

lcg_release=LCG_105
lcg_compiler=gcc11-opt
lcg_platform=x86_64-${lcg_os}-${lcg_compiler}
lcg_compiler=gcc13
lcg_platform=x86_64-${lcg_os}-${lcg_compiler}-opt
lcg_view=/cvmfs/sft.cern.ch/lcg/views/${lcg_release}/${lcg_platform}

source ${lcg_view}/setup.sh
# extra variables required to build acts
export DD4hep_DIR=${lcg_view}

9 changes: 8 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -222,10 +222,17 @@ set(_acts_boost_recommended_version 1.78.0)
# Include the sources for the external dependencies.
include(ActsExternSources)

# Controls behavior of DOWNLOAD_EXTRACT_TIMESTAMP
if(POLICY CMP0135)
cmake_policy(SET CMP0135 NEW)
endif()

# required packages
if (ACTS_SETUP_BOOST)
if (ACTS_USE_SYSTEM_BOOST)
# NOTE FindBoost.cmake looks for BoostConfig.cmake first, before running it's own logic.
if(POLICY CMP0167)
cmake_policy(SET CMP0167 NEW)
endif()

# Enable both program_options and unit_test_framework to reduce complexity
# Also Cuda tests seem to use program_options
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ class ScoreBasedAmbiguityResolution {
/// good enough, based on some criteria. Users are free to add their own cuts
/// with the help of this struct.
template <typename track_container_t, typename traj_t,
template <typename> class holder_t, bool ReadOnly>
template <typename> class holder_t, bool ReadOnly = true>
struct OptionalCuts {
using OptionalFilter =
std::function<bool(const Acts::TrackProxy<track_container_t, traj_t,
Expand Down Expand Up @@ -162,7 +162,7 @@ class ScoreBasedAmbiguityResolution {
/// @param optionalCuts is the user defined optional cuts to be applied.
/// @return a vector of scores for each track
template <typename track_container_t, typename traj_t,
template <typename> class holder_t, bool ReadOnly>
template <typename> class holder_t, bool ReadOnly = true>
std::vector<double> simpleScore(
const TrackContainer<track_container_t, traj_t, holder_t>& tracks,
const std::vector<std::vector<TrackFeatures>>& trackFeaturesVectors,
Expand All @@ -176,7 +176,7 @@ class ScoreBasedAmbiguityResolution {
/// @param optionalCuts is the user defined optional cuts to be applied.
/// @return a vector of scores for each track
template <typename track_container_t, typename traj_t,
template <typename> class holder_t, bool ReadOnly>
template <typename> class holder_t, bool ReadOnly = true>
std::vector<double> ambiguityScore(
const TrackContainer<track_container_t, traj_t, holder_t>& tracks,
const std::vector<std::vector<TrackFeatures>>& trackFeaturesVectors,
Expand Down Expand Up @@ -206,7 +206,7 @@ class ScoreBasedAmbiguityResolution {
/// @param optionalCuts is the optional cuts to be applied
/// @return a vector of IDs of the tracks we want to keep
template <typename track_container_t, typename traj_t,
template <typename> class holder_t, bool ReadOnly>
template <typename> class holder_t, bool ReadOnly = true>
std::vector<int> solveAmbiguity(
const TrackContainer<track_container_t, traj_t, holder_t>& tracks,
const std::vector<std::vector<MeasurementInfo>>& measurementsPerTrack,
Expand Down
90 changes: 38 additions & 52 deletions Core/include/Acts/EventData/MultiTrajectory.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -226,8 +226,7 @@ class MultiTrajectory {
/// @note Only available if the MultiTrajectory is not read-only
/// @param istate The index to access
/// @return Read-write proxy to the stored track state
template <bool RO = ReadOnly, typename = std::enable_if_t<!RO>>
TrackStateProxy getTrackState(IndexType istate) {
TrackStateProxy getTrackState(IndexType istate) requires(!ReadOnly) {
return {*this, istate};
}

Expand All @@ -238,20 +237,18 @@ class MultiTrajectory {
/// which to leave invalid
/// @param iprevious index of the previous state, kInvalid if first
/// @return Index of the newly added track state
template <bool RO = ReadOnly, typename = std::enable_if_t<!RO>>
IndexType addTrackState(TrackStatePropMask mask = TrackStatePropMask::All,
IndexType iprevious = kInvalid) {
IndexType iprevious = kInvalid) requires(!ReadOnly) {
return self().addTrackState_impl(mask, iprevious);
}

/// Add a track state to the container and return a track state proxy to it
/// This effectively calls @c addTrackState and @c getTrackState
/// @note Only available if the track state container is not read-only
/// @return a track state proxy to the newly added track state
template <bool RO = ReadOnly, typename = std::enable_if_t<!RO>>
TrackStateProxy makeTrackState(
TrackStatePropMask mask = TrackStatePropMask::All,
IndexType iprevious = kInvalid) {
IndexType iprevious = kInvalid) requires(!ReadOnly) {
return getTrackState(addTrackState(mask, iprevious));
}

Expand All @@ -276,8 +273,8 @@ class MultiTrajectory {
/// @warning If the trajectory contains multiple components with common
/// points, this can have an impact on the other components.
/// @note Only available if the MultiTrajectory is not read-only
template <typename F, bool RO = ReadOnly, typename = std::enable_if_t<!RO>>
void applyBackwards(IndexType iendpoint, F&& callable) {
template <typename F>
void applyBackwards(IndexType iendpoint, F&& callable) requires(!ReadOnly) {
static_assert(detail_lt::VisitorConcept<F, TrackStateProxy>,
"Callable needs to satisfy VisitorConcept");

Expand Down Expand Up @@ -327,8 +324,7 @@ class MultiTrajectory {
/// @param iendpoint Trajectory entry point to start from
/// @return Iterator pair to iterate over
/// @note Mutable version
template <bool RO = ReadOnly, typename = std::enable_if_t<!RO>>
auto reverseTrackStateRange(IndexType iendpoint) {
auto reverseTrackStateRange(IndexType iendpoint) requires(!ReadOnly) {
using range_t =
detail_lt::TrackStateRange<true, Derived, MeasurementSizeMax, false>;
if (iendpoint == kInvalid) {
Expand Down Expand Up @@ -360,8 +356,7 @@ class MultiTrajectory {
/// @param istartpoint Trajectory state index for the innermost track
/// state to start from
/// @return Iterator pair to iterate over
template <bool RO = ReadOnly, typename = std::enable_if_t<!RO>>
auto forwardTrackStateRange(IndexType istartpoint) {
auto forwardTrackStateRange(IndexType istartpoint) requires(!ReadOnly) {
using range_t =
detail_lt::TrackStateRange<false, Derived, MeasurementSizeMax, false>;
if (istartpoint == kInvalid) {
Expand All @@ -386,8 +381,8 @@ class MultiTrajectory {
/// @note This takes a string argument rather than a hashed string to maintain
/// compatibility with backends.
/// @note Only available if the MultiTrajectory is not read-only
template <typename T, bool RO = ReadOnly, typename = std::enable_if_t<!RO>>
void addColumn(std::string_view key) {
template <typename T>
void addColumn(std::string_view key) requires(!ReadOnly) {
self().template addColumn_impl<T>(key);
}

Expand All @@ -400,10 +395,7 @@ class MultiTrajectory {

/// Clear the @c MultiTrajectory. Leaves the underlying storage untouched
/// @note Only available if the MultiTrajectory is not read-only
template <bool RO = ReadOnly, typename = std::enable_if_t<!RO>>
void clear() {
self().clear_impl();
}
void clear() requires(!ReadOnly) { self().clear_impl(); }

/// Returns the number of track states contained
/// @return The number of track states
Expand Down Expand Up @@ -432,8 +424,8 @@ class MultiTrajectory {
/// Retrieve a parameter proxy instance for parameters at a given index
/// @param parIdx Index into the parameter column
/// @return Mutable proxy
template <bool RO = ReadOnly, typename = std::enable_if_t<!RO>>
typename TrackStateProxy::Parameters parameters(IndexType parIdx) {
typename TrackStateProxy::Parameters parameters(IndexType parIdx) requires(
!ReadOnly) {
return self().parameters_impl(parIdx);
}

Expand All @@ -447,8 +439,8 @@ class MultiTrajectory {
/// Retrieve a covariance proxy instance for a covariance at a given index
/// @param covIdx Index into the covariance column
/// @return Mutable proxy
template <bool RO = ReadOnly, typename = std::enable_if_t<!RO>>
typename TrackStateProxy::Covariance covariance(IndexType covIdx) {
typename TrackStateProxy::Covariance covariance(IndexType covIdx) requires(
!ReadOnly) {
return self().covariance_impl(covIdx);
}

Expand All @@ -462,8 +454,8 @@ class MultiTrajectory {
/// Retrieve a jacobian proxy instance for a jacobian at a given index
/// @param istate The track state
/// @return Mutable proxy
template <bool RO = ReadOnly, typename = std::enable_if_t<!RO>>
typename TrackStateProxy::Covariance jacobian(IndexType istate) {
typename TrackStateProxy::Covariance jacobian(IndexType istate) requires(
!ReadOnly) {
return self().jacobian_impl(istate);
}

Expand All @@ -479,10 +471,9 @@ class MultiTrajectory {
/// @tparam measdim the measurement dimension
/// @param istate The track state
/// @return Mutable proxy
template <std::size_t measdim, bool RO = ReadOnly,
typename = std::enable_if_t<!RO>>
template <std::size_t measdim>
typename TrackStateProxy::template Calibrated<measdim> calibrated(
IndexType istate) {
IndexType istate) requires(!ReadOnly) {
return self().template calibrated_impl<measdim>(istate);
}

Expand All @@ -502,16 +493,14 @@ class MultiTrajectory {
/// @tparam measdim the measurement dimension
/// @param istate The track state
/// @return Mutable proxy
template <std::size_t measdim, bool RO = ReadOnly,
typename = std::enable_if_t<!RO>>
template <std::size_t measdim>
typename TrackStateProxy::template CalibratedCovariance<measdim>
calibratedCovariance(IndexType istate) {
calibratedCovariance(IndexType istate) requires(!ReadOnly) {
return self().template calibratedCovariance_impl<measdim>(istate);
}

template <bool RO = ReadOnly, typename = std::enable_if_t<!RO>>
typename TrackStateProxy::EffectiveCalibrated effectiveCalibrated(
IndexType istate) {
IndexType istate) requires(!ReadOnly) {
// This abuses an incorrectly sized vector / matrix to access the
// data pointer! This works (don't use the matrix as is!), but be
// careful!
Expand All @@ -528,9 +517,8 @@ class MultiTrajectory {
calibrated<eBoundSize>(istate).data(), calibratedSize(istate)};
}

template <bool RO = ReadOnly, typename = std::enable_if_t<!RO>>
typename TrackStateProxy::EffectiveCalibratedCovariance
effectiveCalibratedCovariance(IndexType istate) {
effectiveCalibratedCovariance(IndexType istate) requires(!ReadOnly) {
// This abuses an incorrectly sized vector / matrix to access the
// data pointer! This works (don't use the matrix as is!), but be
// careful!
Expand Down Expand Up @@ -576,27 +564,25 @@ class MultiTrajectory {
/// or projector. See @c TrackStatePropMask.
/// @note The track states both need to be stored in the
/// same @c MultiTrajectory instance
template <bool RO = ReadOnly, typename = std::enable_if_t<!RO>>
void shareFrom(IndexType iself, IndexType iother,
TrackStatePropMask shareSource,
TrackStatePropMask shareTarget) {
TrackStatePropMask shareTarget) requires(!ReadOnly) {
self().shareFrom_impl(iself, iother, shareSource, shareTarget);
}

/// Unset an optional track state component
/// @param target The component to unset
/// @param istate The track state index to operate on
template <bool RO = ReadOnly, typename = std::enable_if_t<!RO>>
void unset(TrackStatePropMask target, IndexType istate) {
void unset(TrackStatePropMask target, IndexType istate) requires(!ReadOnly) {
self().unset_impl(target, istate);
}

/// Add additional components to an existing track state
/// @note Only available if the track state container is not read-only
/// @param istate The track state index to alter
/// @param mask The bitmask that instructs which components to allocate
template <bool RO = ReadOnly, typename = std::enable_if_t<!RO>>
void addTrackStateComponents(IndexType istate, TrackStatePropMask mask) {
void addTrackStateComponents(IndexType istate,
TrackStatePropMask mask) requires(!ReadOnly) {
self().addTrackStateComponents_impl(istate, mask);
}

Expand All @@ -605,9 +591,8 @@ class MultiTrajectory {
/// @tparam key String key for the component to access
/// @param istate The track state index to operate on
/// @return Mutable reference to the component given by @p key
template <typename T, HashedString key, bool RO = ReadOnly,
typename = std::enable_if_t<!RO>>
T& component(IndexType istate) {
template <typename T, HashedString key>
T& component(IndexType istate) requires(!ReadOnly) {
assert(checkOptional(key, istate));
return *std::any_cast<T*>(self().component_impl(key, istate));
}
Expand All @@ -617,8 +602,8 @@ class MultiTrajectory {
/// @param key String key for the component to access
/// @param istate The track state index to operate on
/// @return Mutable reference to the component given by @p key
template <typename T, bool RO = ReadOnly, typename = std::enable_if_t<!RO>>
T& component(HashedString key, IndexType istate) {
template <typename T>
T& component(HashedString key, IndexType istate) requires(!ReadOnly) {
assert(checkOptional(key, istate));
return *std::any_cast<T*>(self().component_impl(key, istate));
}
Expand Down Expand Up @@ -657,8 +642,8 @@ class MultiTrajectory {
self().allocateCalibrated_impl(istate, measdim);
}

template <bool RO = ReadOnly, typename = std::enable_if_t<!RO>>
void setUncalibratedSourceLink(IndexType istate, SourceLink sourceLink) {
void setUncalibratedSourceLink(IndexType istate,
SourceLink sourceLink) requires(!ReadOnly) {
self().setUncalibratedSourceLink_impl(istate, std::move(sourceLink));
}

Expand All @@ -670,15 +655,16 @@ class MultiTrajectory {
return self().referenceSurface_impl(istate);
}

template <bool RO = ReadOnly, typename = std::enable_if_t<!RO>>
void setReferenceSurface(IndexType istate,
std::shared_ptr<const Surface> surface) {
void setReferenceSurface(
IndexType istate,
std::shared_ptr<const Surface> surface) requires(!ReadOnly) {
self().setReferenceSurface_impl(istate, std::move(surface));
}

private:
template <typename T, bool RO = ReadOnly, typename = std::enable_if_t<!RO>>
void copyDynamicFrom(IndexType dstIdx, const T& src, IndexType srcIdx) {
template <typename T>
void copyDynamicFrom(IndexType dstIdx, const T& src,
IndexType srcIdx) requires(!ReadOnly) {
const auto& dynamicKeys = src.self().dynamicKeys_impl();
for (const auto key : dynamicKeys) {
std::any srcPtr = src.self().component_impl(key, srcIdx);
Expand Down
Loading

0 comments on commit 9ba3f7d

Please sign in to comment.