diff --git a/CI/setup_cvmfs_lcg.sh b/CI/setup_cvmfs_lcg.sh index 41fc7573dff..de711e0548e 100644 --- a/CI/setup_cvmfs_lcg.sh +++ b/CI/setup_cvmfs_lcg.sh @@ -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 @@ -11,4 +11,4 @@ else fi dir="$( cd "$( dirname "${this_script}" )" && pwd )" -source $dir/setup_cvmfs_lcg101.sh +source $dir/setup_cvmfs_lcg105.sh diff --git a/CI/setup_cvmfs_lcg100.sh b/CI/setup_cvmfs_lcg100.sh deleted file mode 100644 index a7bede7f296..00000000000 --- a/CI/setup_cvmfs_lcg100.sh +++ /dev/null @@ -1,19 +0,0 @@ -# setup appropriate LCG 100 release via cvmfs - -if test -e /etc/centos-release && grep 'CentOS Linux release 7' /etc/centos-release; then - lcg_os=centos7 -elif test -e /etc/centos-release && grep 'CentOS Stream release 8' /etc/centos-release; then - lcg_os=centos8 -else - echo "Unsupported system" 1>&2 - return -fi - -lcg_release=LCG_100 -lcg_compiler=gcc10-opt -lcg_platform=x86_64-${lcg_os}-${lcg_compiler} -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} diff --git a/CI/setup_cvmfs_lcg101.sh b/CI/setup_cvmfs_lcg101.sh deleted file mode 100644 index 20b816e2fe0..00000000000 --- a/CI/setup_cvmfs_lcg101.sh +++ /dev/null @@ -1,19 +0,0 @@ -# setup appropriate LCG 101 release via cvmfs - -if test -e /etc/centos-release && grep 'CentOS Linux release 7' /etc/centos-release; then - lcg_os=centos7 -elif test -e /etc/centos-release && grep 'CentOS Stream release 8' /etc/centos-release; then - lcg_os=centos8 -else - echo "Unsupported system" 1>&2 - return -fi - -lcg_release=LCG_101 -lcg_compiler=gcc11-opt -lcg_platform=x86_64-${lcg_os}-${lcg_compiler} -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} diff --git a/CI/setup_cvmfs_lcg105.sh b/CI/setup_cvmfs_lcg105.sh index c45bba4493e..531d8c827fa 100644 --- a/CI/setup_cvmfs_lcg105.sh +++ b/CI/setup_cvmfs_lcg105.sh @@ -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} - diff --git a/CMakeLists.txt b/CMakeLists.txt index 714a9521804..f2bedbc0b40 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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 diff --git a/Core/include/Acts/AmbiguityResolution/ScoreBasedAmbiguityResolution.hpp b/Core/include/Acts/AmbiguityResolution/ScoreBasedAmbiguityResolution.hpp index 2bbb812848b..afc19083117 100644 --- a/Core/include/Acts/AmbiguityResolution/ScoreBasedAmbiguityResolution.hpp +++ b/Core/include/Acts/AmbiguityResolution/ScoreBasedAmbiguityResolution.hpp @@ -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 class holder_t, bool ReadOnly> + template class holder_t, bool ReadOnly = true> struct OptionalCuts { using OptionalFilter = std::function class holder_t, bool ReadOnly> + template class holder_t, bool ReadOnly = true> std::vector simpleScore( const TrackContainer& tracks, const std::vector>& trackFeaturesVectors, @@ -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 class holder_t, bool ReadOnly> + template class holder_t, bool ReadOnly = true> std::vector ambiguityScore( const TrackContainer& tracks, const std::vector>& trackFeaturesVectors, @@ -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 class holder_t, bool ReadOnly> + template class holder_t, bool ReadOnly = true> std::vector solveAmbiguity( const TrackContainer& tracks, const std::vector>& measurementsPerTrack, diff --git a/Core/include/Acts/EventData/MultiTrajectory.hpp b/Core/include/Acts/EventData/MultiTrajectory.hpp index d880177c57c..9a148efeb9d 100644 --- a/Core/include/Acts/EventData/MultiTrajectory.hpp +++ b/Core/include/Acts/EventData/MultiTrajectory.hpp @@ -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 > - TrackStateProxy getTrackState(IndexType istate) { + TrackStateProxy getTrackState(IndexType istate) requires(!ReadOnly) { return {*this, istate}; } @@ -238,9 +237,8 @@ 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 > IndexType addTrackState(TrackStatePropMask mask = TrackStatePropMask::All, - IndexType iprevious = kInvalid) { + IndexType iprevious = kInvalid) requires(!ReadOnly) { return self().addTrackState_impl(mask, iprevious); } @@ -248,10 +246,9 @@ class MultiTrajectory { /// 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 > TrackStateProxy makeTrackState( TrackStatePropMask mask = TrackStatePropMask::All, - IndexType iprevious = kInvalid) { + IndexType iprevious = kInvalid) requires(!ReadOnly) { return getTrackState(addTrackState(mask, iprevious)); } @@ -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 > - void applyBackwards(IndexType iendpoint, F&& callable) { + template + void applyBackwards(IndexType iendpoint, F&& callable) requires(!ReadOnly) { static_assert(detail_lt::VisitorConcept, "Callable needs to satisfy VisitorConcept"); @@ -327,8 +324,7 @@ class MultiTrajectory { /// @param iendpoint Trajectory entry point to start from /// @return Iterator pair to iterate over /// @note Mutable version - template > - auto reverseTrackStateRange(IndexType iendpoint) { + auto reverseTrackStateRange(IndexType iendpoint) requires(!ReadOnly) { using range_t = detail_lt::TrackStateRange; if (iendpoint == kInvalid) { @@ -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 > - auto forwardTrackStateRange(IndexType istartpoint) { + auto forwardTrackStateRange(IndexType istartpoint) requires(!ReadOnly) { using range_t = detail_lt::TrackStateRange; if (istartpoint == kInvalid) { @@ -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 > - void addColumn(std::string_view key) { + template + void addColumn(std::string_view key) requires(!ReadOnly) { self().template addColumn_impl(key); } @@ -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 > - 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 @@ -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 > - typename TrackStateProxy::Parameters parameters(IndexType parIdx) { + typename TrackStateProxy::Parameters parameters(IndexType parIdx) requires( + !ReadOnly) { return self().parameters_impl(parIdx); } @@ -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 > - typename TrackStateProxy::Covariance covariance(IndexType covIdx) { + typename TrackStateProxy::Covariance covariance(IndexType covIdx) requires( + !ReadOnly) { return self().covariance_impl(covIdx); } @@ -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 > - typename TrackStateProxy::Covariance jacobian(IndexType istate) { + typename TrackStateProxy::Covariance jacobian(IndexType istate) requires( + !ReadOnly) { return self().jacobian_impl(istate); } @@ -479,10 +471,9 @@ class MultiTrajectory { /// @tparam measdim the measurement dimension /// @param istate The track state /// @return Mutable proxy - template > + template typename TrackStateProxy::template Calibrated calibrated( - IndexType istate) { + IndexType istate) requires(!ReadOnly) { return self().template calibrated_impl(istate); } @@ -502,16 +493,14 @@ class MultiTrajectory { /// @tparam measdim the measurement dimension /// @param istate The track state /// @return Mutable proxy - template > + template typename TrackStateProxy::template CalibratedCovariance - calibratedCovariance(IndexType istate) { + calibratedCovariance(IndexType istate) requires(!ReadOnly) { return self().template calibratedCovariance_impl(istate); } - template > 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! @@ -528,9 +517,8 @@ class MultiTrajectory { calibrated(istate).data(), calibratedSize(istate)}; } - template > 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! @@ -576,18 +564,16 @@ class MultiTrajectory { /// or projector. See @c TrackStatePropMask. /// @note The track states both need to be stored in the /// same @c MultiTrajectory instance - template > 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 > - void unset(TrackStatePropMask target, IndexType istate) { + void unset(TrackStatePropMask target, IndexType istate) requires(!ReadOnly) { self().unset_impl(target, istate); } @@ -595,8 +581,8 @@ class MultiTrajectory { /// @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 > - void addTrackStateComponents(IndexType istate, TrackStatePropMask mask) { + void addTrackStateComponents(IndexType istate, + TrackStatePropMask mask) requires(!ReadOnly) { self().addTrackStateComponents_impl(istate, mask); } @@ -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 > - T& component(IndexType istate) { + template + T& component(IndexType istate) requires(!ReadOnly) { assert(checkOptional(key, istate)); return *std::any_cast(self().component_impl(key, istate)); } @@ -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 > - T& component(HashedString key, IndexType istate) { + template + T& component(HashedString key, IndexType istate) requires(!ReadOnly) { assert(checkOptional(key, istate)); return *std::any_cast(self().component_impl(key, istate)); } @@ -657,8 +642,8 @@ class MultiTrajectory { self().allocateCalibrated_impl(istate, measdim); } - template > - void setUncalibratedSourceLink(IndexType istate, SourceLink sourceLink) { + void setUncalibratedSourceLink(IndexType istate, + SourceLink sourceLink) requires(!ReadOnly) { self().setUncalibratedSourceLink_impl(istate, std::move(sourceLink)); } @@ -670,15 +655,16 @@ class MultiTrajectory { return self().referenceSurface_impl(istate); } - template > - void setReferenceSurface(IndexType istate, - std::shared_ptr surface) { + void setReferenceSurface( + IndexType istate, + std::shared_ptr surface) requires(!ReadOnly) { self().setReferenceSurface_impl(istate, std::move(surface)); } private: - template > - void copyDynamicFrom(IndexType dstIdx, const T& src, IndexType srcIdx) { + template + 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); diff --git a/Core/include/Acts/EventData/TrackContainer.hpp b/Core/include/Acts/EventData/TrackContainer.hpp index 7c42a9d18f0..d2cf6c24ec2 100644 --- a/Core/include/Acts/EventData/TrackContainer.hpp +++ b/Core/include/Acts/EventData/TrackContainer.hpp @@ -12,6 +12,7 @@ #include "Acts/Definitions/TrackParametrization.hpp" #include "Acts/Definitions/Units.hpp" #include "Acts/EventData/MultiTrajectory.hpp" +#include "Acts/EventData/MultiTrajectoryBackendConcept.hpp" #include "Acts/EventData/TrackContainerBackendConcept.hpp" #include "Acts/EventData/TrackProxy.hpp" #include "Acts/EventData/Types.hpp" @@ -36,7 +37,8 @@ struct IsReadOnlyTrackContainer; /// @tparam track_container_t the track container backend /// @tparam traj_t the track state container backend /// @tparam holder_t ownership management class for the backend -template class holder_t = detail::RefHolder> class TrackContainer { public: @@ -105,10 +107,8 @@ class TrackContainer { /// You need to ensure suitable lifetime /// @param container the track container backend /// @param traj the track state container backend - template