Skip to content

Commit

Permalink
Merge branch 'main' into ci/noskips
Browse files Browse the repository at this point in the history
  • Loading branch information
paulgessinger authored Apr 17, 2023
2 parents a2ed20a + a1b43a8 commit eb6688f
Show file tree
Hide file tree
Showing 67 changed files with 2,217 additions and 547 deletions.
14 changes: 6 additions & 8 deletions .github/workflows/builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,7 @@ jobs:
&& source /usr/local/bin/thisdd4hep_only.sh
&& source /usr/local/bin/geant4.sh
&& source build/python/setup.sh
&& export PYTHONPATH=/usr/local/python:$PYTHONPATH
&& export LD_LIBRARY_PATH=$PWD/build/thirdparty/OpenDataDetector/factory:$LD_LIBRARY_PATH
&& pip3 install -r Examples/Python/tests/requirements.txt
&& pytest -rFsv -k "not exatrkx" -v
Expand Down Expand Up @@ -300,16 +301,13 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
image:
- ubuntu2004
- ubuntu2204
- ubuntu2204_clang
std: [17, 20]
exclude:
- image: ubuntu2204
std: 17
include:
- image: ubuntu2004
std: 17
- image: ubuntu2204_cpp20
std: 20
- image: ubuntu2204_clang
std: 17
container: ghcr.io/acts-project/${{ matrix.image }}:v41
env:
INSTALL_DIR: ${{ github.workspace }}/install
Expand Down
4 changes: 0 additions & 4 deletions Alignment/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
add_library(ActsAlignment SHARED
src/Kernel/detail/AlignmentEngine.cpp)

target_compile_features(
ActsAlignment
PUBLIC cxx_std_17)

target_include_directories(
ActsAlignment
PUBLIC
Expand Down
27 changes: 20 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ option(ACTS_USE_SYSTEM_ACTSVG "Use the ActSVG system library" ${ACTS_USE_SYSTEM_
option(ACTS_BUILD_PLUGIN_ACTSVG "Build SVG display plugin" OFF)
option(ACTS_BUILD_PLUGIN_CUDA "Build CUDA plugin" OFF)
option(ACTS_BUILD_PLUGIN_DD4HEP "Build DD4hep plugin" OFF)
option(ACTS_BUILD_PLUGIN_EDM4HEP "Build EDM4hep plugin" OFF)
option(ACTS_BUILD_PLUGIN_GEANT4 "Build Geant4 plugin" OFF)
option(ACTS_BUILD_PLUGIN_EXATRKX "Build the Exa.TrkX plugin" OFF)
option(ACTS_EXATRKX_ENABLE_ONNX "Build the Onnx backend for the exatrkx plugin" OFF)
Expand Down Expand Up @@ -120,6 +121,9 @@ set_option_if(
ACTS_BUILD_PLUGIN_DD4HEP
ACTS_BUILD_EXAMPLES_DD4HEP OR ACTS_BUILD_EVERYTHING OR
ACTS_BUILD_EXAMPLES_EDM4HEP)
set_option_if(
ACTS_BUILD_PLUGIN_EDM4HEP
ACTS_BUILD_EXAMPLES_EDM4HEP OR ACTS_BUILD_EVERYTHING)
set_option_if(
ACTS_BUILD_PLUGIN_GEANT4
ACTS_BUILD_EXAMPLES_GEANT4 OR ACTS_BUILD_EVERYTHING)
Expand All @@ -142,15 +146,15 @@ set_option_if(ACTS_BUILD_PLUGIN_EXATRKX ACTS_BUILD_EXAMPLES_EXATRKX)
# feature tests
include(CheckCXXSourceCompiles)

# function that tests if the root installation is compatible (i.e., compiled with C++17)
# function that tests if the root installation is compatible
function(check_root_compatibility)
get_target_property(ROOT_INCLUDE_DIR ROOT::Core INTERFACE_INCLUDE_DIRECTORIES)
set(CMAKE_REQUIRED_FLAGS -std=c++17)
set(CMAKE_REQUIRED_INCLUDES ${ROOT_INCLUDE_DIR})
check_cxx_source_compiles("#include <string>\n#include <TString.h>\nint main(){}" ROOT_COMPATIBILITY_CHECK)
if(NOT ROOT_COMPATIBILITY_CHECK)
message(FATAL_ERROR "Root installation is misconfigured. Ensure that your Root installation was compiled with C++17.")
endif()
#yolo
#check_cxx_source_compiles("#include <string>\n#include <TString.h>\nint main(){}" ROOT_COMPATIBILITY_CHECK)
#if(NOT ROOT_COMPATIBILITY_CHECK)
# message(FATAL_ERROR "Root installation is misconfigured. Ensure that your Root installation was compiled.")
#endif()
endfunction()

# additional configuration and tools
Expand Down Expand Up @@ -342,7 +346,7 @@ if(ACTS_BUILD_EXAMPLES_DD4HEP AND ACTS_BUILD_EXAMPLES_GEANT4)
elseif(ACTS_BUILD_EXAMPLES_DD4HEP)
find_package(DD4hep ${_acts_dd4hep_version} REQUIRED CONFIG COMPONENTS DDCore DDDetectors)
endif()
if(ACTS_BUILD_EXAMPLES_EDM4HEP)
if(ACTS_BUILD_PLUGIN_EDM4HEP)
find_package(podio ${_acts_podio_version} REQUIRED CONFIG)
find_package(EDM4HEP ${_acts_edm4hep_version} REQUIRED CONFIG)
endif()
Expand All @@ -354,6 +358,15 @@ if(ACTS_BUILD_EXAMPLES_HEPMC3)
endif()
if(ACTS_BUILD_EXAMPLES_PYTHIA8)
find_package(Pythia8 REQUIRED)

if(DEFINED CMAKE_CXX_STANDARD)
if(${CMAKE_CXX_STANDARD} GREATER_EQUAL 20)
message(WARNING "ACTS is configured to build with C++20."
"As of version 309, Pythia8 does not compile under C++20."
"You can find a patch file at: https://gist.github.com/paulgessinger/7a823b4015d4511cf829472291c8ddcf")
endif()
endif()

endif()
# other dependencies
if(ACTS_BUILD_DOCS)
Expand Down
2 changes: 1 addition & 1 deletion Core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ add_library(
ActsCore SHARED "")
target_compile_features(
ActsCore
PUBLIC cxx_std_17)
PUBLIC ${ACTS_CXX_STANDARD_FEATURE})
target_include_directories(
ActsCore
PUBLIC
Expand Down
32 changes: 21 additions & 11 deletions Core/include/Acts/EventData/MultiTrajectory.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -714,6 +714,27 @@ class TrackStateProxy {
projectorBitset.to_ullong();
}

/// Get the projector bitset, a compressed form of a projection matrix
/// @note This is mainly to copy explicitly a projector from one state
/// to another. Use the `projector` or `effectiveProjector` method if
/// you want to access the matrix.
/// @return The projector bitset
ProjectorBitset projectorBitset() const {
assert(has<hashString("projector")>());
return component<ProjectorBitset, hashString("projector")>();
}

/// Set the projector bitset, a compressed form of a projection matrix
/// @param proj The projector bitset
///
/// @note This is mainly to copy explicitly a projector from one state
/// to another. If you have a projection matrix, set it with `setProjector`.
template <bool RO = ReadOnly, typename = std::enable_if_t<!RO>>
void setProjectorBitset(ProjectorBitset proj) {
assert(has<hashString("projector")>());
component<ProjectorBitset, hashString("projector")>() = proj;
}

/// Uncalibrated measurement in the form of a source link. Const version
/// @return The uncalibrated measurement source link
SourceLink getUncalibratedSourceLink() const;
Expand Down Expand Up @@ -950,17 +971,6 @@ class TrackStateProxy {
hashString("referenceSurface")>();
}

ProjectorBitset projectorBitset() const {
assert(has<hashString("projector")>());
return component<ProjectorBitset, hashString("projector")>();
}

template <bool RO = ReadOnly, typename = std::enable_if_t<!RO>>
void setProjectorBitset(ProjectorBitset proj) {
assert(has<hashString("projector")>());
component<ProjectorBitset, hashString("projector")>() = proj;
}

TransitiveConstPointer<ConstIf<MultiTrajectory<Trajectory>, ReadOnly>> m_traj;
IndexType m_istate;

Expand Down
52 changes: 15 additions & 37 deletions Core/include/Acts/EventData/SpacePointData.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,22 +53,14 @@ class SpacePointData {
void clear();

///
bool hasDynamicVariable() const { return not m_topHalfStripLength.empty(); }
bool hasDynamicVariable() const { return not m_topStripVector.empty(); }

const float& getTopHalfStripLength(std::size_t idx) const {
return m_topHalfStripLength[idx];
const Acts::Vector3& getTopStripVector(std::size_t idx) const {
return m_topStripVector[idx];
}

const float& getBottomHalfStripLength(std::size_t idx) const {
return m_bottomHalfStripLength[idx];
}

const Acts::Vector3& getTopStripDirection(std::size_t idx) const {
return m_topStripDirection[idx];
}

const Acts::Vector3& getBottomStripDirection(std::size_t idx) const {
return m_bottomStripDirection[idx];
const Acts::Vector3& getBottomStripVector(std::size_t idx) const {
return m_bottomStripVector[idx];
}

const Acts::Vector3& getStripCenterDistance(std::size_t idx) const {
Expand All @@ -79,20 +71,12 @@ class SpacePointData {
return m_topStripCenterPosition[idx];
}

void setTopHalfStripLength(std::size_t idx, const float& value) {
m_topHalfStripLength[idx] = value;
}

void setBottomHalfStripLength(std::size_t idx, const float& value) {
m_bottomHalfStripLength[idx] = value;
}

void setTopStripDirection(std::size_t idx, const Acts::Vector3& value) {
m_topStripDirection[idx] = value;
void setTopStripVector(std::size_t idx, const Acts::Vector3& value) {
m_topStripVector[idx] = value;
}

void setBottomStripDirection(std::size_t idx, const Acts::Vector3& value) {
m_bottomStripDirection[idx] = value;
void setBottomStripVector(std::size_t idx, const Acts::Vector3& value) {
m_bottomStripVector[idx] = value;
}

void setStripCenterDistance(std::size_t idx, const Acts::Vector3& value) {
Expand All @@ -109,10 +93,8 @@ class SpacePointData {
std::vector<float> m_deltaR{};

/// dynamic variables
std::vector<float> m_topHalfStripLength{};
std::vector<float> m_bottomHalfStripLength{};
std::vector<Acts::Vector3> m_topStripDirection{};
std::vector<Acts::Vector3> m_bottomStripDirection{};
std::vector<Acts::Vector3> m_topStripVector{};
std::vector<Acts::Vector3> m_bottomStripVector{};
std::vector<Acts::Vector3> m_stripCenterDistance{};
std::vector<Acts::Vector3> m_topStripCenterPosition{};
};
Expand Down Expand Up @@ -142,10 +124,8 @@ inline void SpacePointData::resize(std::size_t n, bool resizeDynamic) {
m_deltaR.resize(n, 0.);

if (resizeDynamic) {
m_topHalfStripLength.resize(n, 0.);
m_bottomHalfStripLength.resize(n, 0.);
m_topStripDirection.resize(n, {0, 0, 0});
m_bottomStripDirection.resize(n, {0, 0, 0});
m_topStripVector.resize(n, {0, 0, 0});
m_bottomStripVector.resize(n, {0, 0, 0});
m_stripCenterDistance.resize(n, {0, 0, 0});
m_topStripCenterPosition.resize(n, {0, 0, 0});
}
Expand All @@ -156,10 +136,8 @@ inline void SpacePointData::clear() {
m_quality.clear();
m_deltaR.clear();
// dynamicvariables
m_topHalfStripLength.clear();
m_bottomHalfStripLength.clear();
m_topStripDirection.clear();
m_bottomStripDirection.clear();
m_topStripVector.clear();
m_bottomStripVector.clear();
m_stripCenterDistance.clear();
m_topStripCenterPosition.clear();
}
Expand Down
2 changes: 1 addition & 1 deletion Core/include/Acts/Seeding/BinnedSPGroup.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ class BinnedSPGroup {
BinnedSPGroup() = delete;

template <typename spacepoint_iterator_t, typename callable_t>
BinnedSPGroup<external_spacepoint_t>(
BinnedSPGroup(
spacepoint_iterator_t spBegin, spacepoint_iterator_t spEnd,
callable_t&& toGlobal,
std::shared_ptr<const Acts::BinFinder<external_spacepoint_t>>
Expand Down
7 changes: 4 additions & 3 deletions Core/include/Acts/Seeding/SeedFinder.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@

namespace Acts {

enum class SpacePointCandidateType : short { BOTTOM, TOP };

template <typename external_spacepoint_t, typename platform_t = void*>
class SeedFinder {
///////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -139,8 +141,7 @@ class SeedFinder {
/// @param outVec Output object containing top or bottom SPs that are compatible with a certain middle SPs
/// @param deltaRMinSP minimum allowed r-distance between dublet components
/// @param deltaRMaxSP maximum allowed r-distance between dublet components
/// @param isBottom wheter otherSPs contains outer or inner SPs
template <typename out_range_t>
template <Acts::SpacePointCandidateType candidateType, typename out_range_t>
void getCompatibleDoublets(
Acts::SpacePointData& spacePointData,
const Acts::SeedFinderOptions& options,
Expand All @@ -149,7 +150,7 @@ class SeedFinder {
otherSPsNeighbours,
const InternalSpacePoint<external_spacepoint_t>& mediumSP,
std::vector<LinCircle>& linCircleVec, out_range_t& outVec,
const float& deltaRMinSP, const float& deltaRMaxSP, bool isBottom) const;
const float& deltaRMinSP, const float& deltaRMaxSP) const;

/// Iterates over the seed candidates tests the compatibility between three
/// SPs and calls for the seed confirmation
Expand Down
Loading

0 comments on commit eb6688f

Please sign in to comment.