Skip to content

Commit

Permalink
Merge branch 'main' into uptuna_seeding
Browse files Browse the repository at this point in the history
  • Loading branch information
kodiakhq[bot] authored Feb 5, 2024
2 parents 0819498 + c4f5a41 commit 3a77541
Show file tree
Hide file tree
Showing 252 changed files with 8,083 additions and 3,261 deletions.
2 changes: 1 addition & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ linux_test_examples:
- export LD_LIBRARY_PATH=$PWD/build/thirdparty/OpenDataDetector/factory:$LD_LIBRARY_PATH
- cd src
- pip3 install -r Examples/Python/tests/requirements.txt
- pytest -rFsv -k "not exatrkx" -v -n auto
- pytest -rFsv -k "not exatrkx" -v

linux_physmon:
stage: test
Expand Down
2 changes: 1 addition & 1 deletion .policy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ approval_rules:
ignore_update_merges: true
if:
targets_branch:
pattern: "^main$"
pattern: "^(main|develop\\/.+)$"

- name: Is a backport
requires:
Expand Down
3 changes: 2 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ repos:
rev: 'v14.0.0'
hooks:
- id: clang-format
files: ".*\\.(cpp|hpp|ipp|cu|cuh)$"
types_or: [file]
files: \.(cpp|hpp|ipp|cu|cuh)$

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.2.0
Expand Down
2 changes: 2 additions & 0 deletions CI/check_unused_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ def main():
"vertexing_event_mu20_beamspot.csv",
"vertexing_event_mu20_tracks.csv",
"vertexing_event_mu20_vertices_AMVF.csv",
"event000000001-MuonDriftCircle.csv",
"event000000001-MuonSimHit.csv",
# TODO Move the following files to a better place?
"Magfield.ipynb",
"SolenoidField.ipynb",
Expand Down
1 change: 1 addition & 0 deletions CI/codespell_ignore.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@ ans
dthe
dthe
vart
pixelx
Binary file modified CI/physmon/reference/performance_ambi_orthogonal.root
Binary file not shown.
Binary file modified CI/physmon/reference/performance_ambi_seeded.root
Binary file not shown.
Binary file modified CI/physmon/reference/performance_ambi_ttbar.root
Binary file not shown.
Binary file modified CI/physmon/reference/performance_amvf_gridseeder_seeded_hist.root
Binary file not shown.
Binary file modified CI/physmon/reference/performance_amvf_gridseeder_ttbar_hist.root
Binary file not shown.
Binary file modified CI/physmon/reference/performance_amvf_orthogonal_hist.root
Binary file not shown.
Binary file modified CI/physmon/reference/performance_amvf_seeded_hist.root
Binary file not shown.
Binary file modified CI/physmon/reference/performance_amvf_truth_estimated_hist.root
Binary file not shown.
Binary file modified CI/physmon/reference/performance_amvf_truth_smeared_hist.root
Binary file not shown.
Binary file modified CI/physmon/reference/performance_amvf_ttbar_hist.root
Binary file not shown.
Binary file modified CI/physmon/reference/performance_ckf_orthogonal.root
Binary file not shown.
Binary file modified CI/physmon/reference/performance_ckf_seeded.root
Binary file not shown.
Binary file modified CI/physmon/reference/performance_ckf_truth_estimated.root
Binary file not shown.
Binary file modified CI/physmon/reference/performance_ckf_truth_smeared.root
Binary file not shown.
Binary file modified CI/physmon/reference/performance_ckf_ttbar.root
Binary file not shown.
Binary file modified CI/physmon/reference/performance_gsf.root
Binary file not shown.
Binary file modified CI/physmon/reference/performance_ivf_orthogonal_hist.root
Binary file not shown.
Binary file modified CI/physmon/reference/performance_ivf_seeded_hist.root
Binary file not shown.
Binary file modified CI/physmon/reference/performance_ivf_truth_estimated_hist.root
Binary file not shown.
Binary file modified CI/physmon/reference/performance_ivf_truth_smeared_hist.root
Binary file not shown.
Binary file modified CI/physmon/reference/performance_truth_tracking.root
Binary file not shown.
Binary file modified CI/physmon/reference/tracksummary_ckf_orthogonal_hist.root
Binary file not shown.
Binary file modified CI/physmon/reference/tracksummary_ckf_seeded_hist.root
Binary file not shown.
Binary file modified CI/physmon/reference/tracksummary_ckf_truth_estimated_hist.root
Binary file not shown.
Binary file modified CI/physmon/reference/tracksummary_ckf_truth_smeared_hist.root
Binary file not shown.
Binary file modified CI/physmon/reference/tracksummary_ckf_ttbar_hist.root
Binary file not shown.
9 changes: 9 additions & 0 deletions CI/physmon/workflows/physmon_ckf_tracking.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,15 @@ def run_ckf_tracking(truthSmearedSeeded, truthEstimatedSeeded, label):
else SeedingAlgorithm.Default
if label == "seeded"
else SeedingAlgorithm.Orthogonal,
initialSigmas=[
1 * u.mm,
1 * u.mm,
1 * u.degree,
1 * u.degree,
0.1 / u.GeV,
1 * u.ns,
],
initialVarInflation=[1.0] * 6,
geoSelectionConfigFile=setup.geoSel,
rnd=rnd, # only used by SeedingAlgorithm.TruthSmeared
outputDirRoot=tp,
Expand Down
9 changes: 9 additions & 0 deletions CI/physmon/workflows/physmon_vertexing.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,15 @@ def run_vertexing(fitter, mu, events):
),
SeedFinderOptionsArg(bFieldInZ=2 * u.T),
seedingAlgorithm=SeedingAlgorithm.Default,
initialSigmas=[
1 * u.mm,
1 * u.mm,
1 * u.degree,
1 * u.degree,
0.1 / u.GeV,
1 * u.ns,
],
initialVarInflation=[1.0] * 6,
geoSelectionConfigFile=setup.geoSel,
)

Expand Down
3 changes: 0 additions & 3 deletions CI/run_examples.sh
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,3 @@ run_example ActsExampleMaterialValidationGeneric
# TODO: Run (AdaptiveMulti|Iterative)?Vertex(Finder|Fitter) examples (currently broken, not ready for CI)

# TODO: Bring back multi-threaded output reproducibility tests

# Run vertex finder tutorial
run_example ActsTutorialVertexFinder
23 changes: 23 additions & 0 deletions CI/setup_cvmfs_lcg105.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# setup appropriate LCG 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
# not centos. Check for RHEL
elif test -e /etc/redhat-release && grep 'Linux release 9' /etc/redhat-release; then
lcg_os=el9
else
echo "Unsupported system" 1>&2
return
fi

lcg_release=LCG_105
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}

8 changes: 4 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ endif()
# minimal dependency versions. they are defined here in a single place so
# they can be easily upgraded, although they might not be used if the
# dependency is included via `add_subdirectory(...)`.
set(_acts_actsvg_version 0.4.39)
set(_acts_actsvg_version 0.4.40)
set(_acts_autodiff_version 0.6)
set(_acts_boost_version 1.71.0)
set(_acts_dd4hep_version 1.21)
Expand Down Expand Up @@ -311,11 +311,11 @@ if(ACTS_BUILD_PLUGIN_SYCL)
find_package(SYCL REQUIRED)
endif()
if(ACTS_BUILD_PLUGIN_TGEO)
find_package(ROOT ${_acts_root_version} REQUIRED CONFIG COMPONENTS Geom)
find_package(ROOT ${_acts_root_version} REQUIRED CONFIG COMPONENTS Geom Graf)
check_root_compatibility()
endif()
if(ACTS_BUILD_ANALYSIS_APPS)
find_package(ROOT ${_acts_root_version} REQUIRED CONFIG COMPONENTS Geom)
find_package(ROOT ${_acts_root_version} REQUIRED CONFIG COMPONENTS Geom Graf)
check_root_compatibility()
endif()
if(ACTS_BUILD_PLUGIN_EXATRKX)
Expand Down Expand Up @@ -359,7 +359,7 @@ if(ACTS_BUILD_EXAMPLES)
set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads REQUIRED)
# for simplicity always request all potentially required components.
find_package(ROOT ${_acts_root_version} REQUIRED CONFIG COMPONENTS Core Geom GenVector Hist Tree TreePlayer)
find_package(ROOT ${_acts_root_version} REQUIRED CONFIG COMPONENTS Core Geom Graf GenVector Hist Tree TreePlayer)
check_root_compatibility()
add_subdirectory(thirdparty/dfelibs)
endif()
Expand Down
4 changes: 2 additions & 2 deletions Core/include/Acts/Definitions/PdgParticle.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// This file is part of the Acts project.
//
// Copyright (C) 2019 CERN for the benefit of the Acts project
// Copyright (C) 2019-2024 CERN for the benefit of the Acts project
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
Expand All @@ -13,7 +13,7 @@
namespace Acts {

/// Symbolic values for commonly used PDG particle numbers.
enum PdgParticle : int32_t {
enum PdgParticle : std::int32_t {
eInvalid = 0,
eElectron = 11,
eAntiElectron = -eElectron,
Expand Down
5 changes: 5 additions & 0 deletions Core/include/Acts/Detector/Blueprint.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@

#include "Acts/Definitions/Algebra.hpp"
#include "Acts/Definitions/Common.hpp"
#include "Acts/Detector/ProtoBinning.hpp"
#include "Acts/Geometry/VolumeBounds.hpp"
#include "Acts/Utilities/BinningData.hpp"
#include "Acts/Utilities/StringHelpers.hpp"

#include <map>
#include <memory>
#include <string>
#include <vector>
Expand Down Expand Up @@ -91,6 +93,9 @@ struct Node final {
/// Branch definition binning
std::vector<BinningValue> binning = {};

/// Portal proto material binning
std::map<unsigned int, BinningDescription> portalMaterialBinning = {};

/// Auxiliary information
std::vector<std::string> auxiliary = {};

Expand Down
110 changes: 110 additions & 0 deletions Core/include/Acts/Detector/CuboidalContainerBuilder.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
// This file is part of the Acts project.
//
// Copyright (C) 2023 CERN for the benefit of the Acts project
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.

#pragma once

#include "Acts/Detector/Blueprint.hpp"
#include "Acts/Detector/DetectorComponents.hpp"
#include "Acts/Detector/interface/IDetectorComponentBuilder.hpp"
#include "Acts/Geometry/GeometryContext.hpp"
#include "Acts/Utilities/BinningType.hpp"
#include "Acts/Utilities/Logger.hpp"

#include <memory>
#include <string>
#include <vector>

namespace Acts {
namespace Experimental {

class IRootVolumeFinderBuilder;
class IGeometryIdGenerator;

/// @brief A dedicated container builder for cuboid detector containers
///
/// It relies on the detailed implementation of the CuboidDetectorHelper
/// and allows for DetectorVolume attachment in x/y/z
///
/// There exists an option to create this container builder (recursively)
/// from a blueprint tree, which attempts to fill in the gap volumes
/// accordingly.
///
/// @note the builder expects a fully consistent set of sub volume builders
/// that will be executed in a chain
///
/// @note allowed BinningValue(s) for the cuboid container builder are
/// {binX}, {binY}, {binZ}.
///
/// @note Connecting containers isn't functional yet due to the underlying
/// issues in the CuboidDetectorHelper
///
class CuboidalContainerBuilder : public IDetectorComponentBuilder {
public:
/// Nested configuration object
struct Config {
/// The configured volume builders
std::vector<std::shared_ptr<const IDetectorComponentBuilder>> builders = {};
/// Binning prescription of attachment
BinningValue binning{};
/// The root volume finder
std::shared_ptr<const IRootVolumeFinderBuilder> rootVolumeFinderBuilder =
nullptr;
/// The geometry id generator
std::shared_ptr<const IGeometryIdGenerator> geoIdGenerator = nullptr;
/// An eventual reverse geometry id generation
bool geoIdReverseGen = false;
/// Auxiliary information, mainly for screen output
std::string auxiliary = "";
};

/// Constructor with configuration struct
///
/// @param cfg is the configuration struct
/// @param logger logging instance for screen output
CuboidalContainerBuilder(const Config& cfg,
std::unique_ptr<const Logger> logger =
getDefaultLogger("CuboidalContainerBuilder",
Logging::INFO));

/// Constructor from blueprint and logging level
///
/// It will create recursively the builders of sub volumes
///
/// @param bpNode is the entry blue print node
/// @param logLevel is the logging output level for the builder tools
///
/// @note no checking is being done on consistency of the blueprint,
/// it is assumed it has passed first through gap filling via the
/// blueprint helper.
///
/// @note that the naming of the builders is taken from the bluprint nodes
///
/// @return a cylindrical container builder representing this blueprint
CuboidalContainerBuilder(const Acts::Experimental::Blueprint::Node& bpNode,
Acts::Logging::Level logLevel = Acts::Logging::INFO);

/// The final implementation of the cylindrical container builder
///
/// @param gctx The geometry context for this call
///
/// @return an outgoing detector component
DetectorComponent construct(const GeometryContext& gctx) const final;

private:
/// configuration object
Config m_cfg;

/// Private access method to the logger
const Logger& logger() const { return *m_logger; }

/// logging instance
std::unique_ptr<const Logger> m_logger;
};

} // namespace Experimental
} // namespace Acts
85 changes: 85 additions & 0 deletions Core/include/Acts/Detector/Detector.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,13 @@
#include "Acts/Definitions/Algebra.hpp"
#include "Acts/Definitions/Common.hpp"
#include "Acts/Detector/DetectorVolume.hpp"
#include "Acts/Detector/DetectorVolumeVisitorConcept.hpp"
#include "Acts/Geometry/GeometryContext.hpp"
#include "Acts/Geometry/GeometryHierarchyMap.hpp"
#include "Acts/Geometry/GeometryIdentifier.hpp"
#include "Acts/Navigation/NavigationDelegates.hpp"
#include "Acts/Surfaces/SurfaceVisitorConcept.hpp"
#include "Acts/Utilities/Concepts.hpp"
#include "Acts/Utilities/Delegate.hpp"

#include <cstddef>
Expand Down Expand Up @@ -100,6 +103,88 @@ class Detector : public std::enable_shared_from_this<Detector> {
/// @return the map which can be queried with GeometryID for ranges
const GeometryHierarchyMap<const Surface*>& sensitiveHierarchyMap() const;

/// @brief Visit all reachable surfaces of the detector
///
/// @tparam visitor_t Type of the callable visitor
///
/// @param visitor will be handed to each root volume,
/// eventually contained volumes within the root volumes are
/// handled by the root volume
///
/// @note if a context is needed for the visit, the vistitor has to provide
/// it, e.g. as a private member
///
/// @note due to the fact that portals can be shared between volumes, multiple
/// visits may occur, duplicated addressing needs to be taken care of by the
/// visitor
template <ACTS_CONCEPT(SurfaceVisitor) visitor_t>
void visitSurfaces(visitor_t&& visitor) const {
for (const auto& v : rootVolumes()) {
v->template visitSurfaces<visitor_t>(std::forward<visitor_t>(visitor));
}
}

/// @brief Visit all reachable surfaces of the detector - non-const
///
/// @tparam visitor_t Type of the callable visitor
///
/// @param visitor will be handed to each root volume,
/// eventually contained volumes within the root volumes are
/// handled by the root volume
///
/// @note if a context is needed for the visit, the vistitor has to provide
/// it, e.g. as a private member
///
/// @note due to the fact that this doesn't run over root volumes, and
/// due to the fact that portals can be shared between volumes, multiple
/// visits may occur, duplicated addressing needs to be taken care of by the
template <ACTS_CONCEPT(MutableSurfaceVisitor) visitor_t>
void visitMutableSurfaces(visitor_t&& visitor) {
for (auto& v : volumePtrs()) {
v->template visitMutableSurfaces<visitor_t>(
std::forward<visitor_t>(visitor));
}
}

/// @brief Visit all reachable detector volumes of the detector
///
/// @tparam visitor_t Type of the callable visitor
///
/// @param visitor will be handed to each root volume,
/// eventually contained volumes within the root volumes are
/// handled by the root volume
///
/// @note if a context is needed for the visit, the vistitor has to provide
/// it, e.g. as a private member
template <ACTS_CONCEPT(DetectorVolumeVisitor) visitor_t>
void visitVolumes(visitor_t&& visitor) const {
for (const auto& v : rootVolumes()) {
v->template visitVolumes<visitor_t>(std::forward<visitor_t>(visitor));
}
}

/// @brief Visit all reachable detector volumes of the detector - non-const
///
/// @tparam visitor_t Type of the callable visitor
///
/// @param visitor will be handed to each root volume,
/// eventually contained volumes within the root volumes are
/// handled by the root volume
///
/// @note if a context is needed for the visit, the vistitor has to provide
/// it, e.g. as a private member
///
/// @note that due to non running over root volumes, multiple visits
/// may occur, duplicated addressing needs to be taken care of by the
/// visitor
template <ACTS_CONCEPT(MutableDetectorVolumeVisitor) visitor_t>
void visitMutableVolumes(visitor_t&& visitor) {
for (const auto& v : volumePtrs()) {
v->template visitMutableVolumes<visitor_t>(
std::forward<visitor_t>(visitor));
}
}

/// Update the current volume of a given navigation state
///
/// @param gctx is the Geometry context of the call
Expand Down
Loading

0 comments on commit 3a77541

Please sign in to comment.