Skip to content

Commit

Permalink
Merge branch 'main' into kalman-refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
kodiakhq[bot] authored Oct 24, 2023
2 parents 93a776c + a07ffcd commit 18ce23e
Show file tree
Hide file tree
Showing 166 changed files with 8,894 additions and 701 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -466,6 +466,7 @@ jobs:
&& sudo chown $USER /usr/local/acts
&& wget --verbose --progress=dot:giga --continue --retry-connrefused --tries=5 --timeout=2 -O deps.tar.gz https://acts.web.cern.ch/ACTS/ci/macOS/deps.67dd08d.tar.gz
&& tar -xf deps.tar.gz -C /usr/local/acts
&& python3 -m pip install pyyaml jinja2
- name: Restore ccache
uses: actions/cache/restore@v3
Expand All @@ -485,6 +486,7 @@ jobs:
cmake -B build -S .
-GNinja
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache
-DPython_EXECUTABLE=$(command -v python3)
-DCMAKE_BUILD_TYPE=Release
-DCMAKE_CXX_FLAGS=-Werror
-DCMAKE_CXX_STANDARD=17
Expand Down
8 changes: 5 additions & 3 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ variables:
CCACHE_DIR: ${CI_PROJECT_DIR}/ccache
CCACHE_MAXSIZE: 2G
CCACHE_KEY_SUFFIX: r1
CTEST_OUTPUT_ON_FAILURE: 1

clang_tidy:
stage: build
Expand Down Expand Up @@ -49,6 +50,7 @@ clang_tidy:
clang-tidy/clang-tidy.log
clang-tidy/clang-tidy.json
--exclude "*thirdparty*"
--exclude "*ActsPodioEdm*"
# Check the combined report against the defined limits
- CI/clang_tidy/check_clang_tidy.py --report clang-tidy/clang-tidy.json --config CI/clang_tidy/limits.yml
Expand All @@ -58,7 +60,7 @@ clang_tidy:

build_exatrkx:
stage: build
image: ghcr.io/acts-project/ubuntu2004_exatrkx:v41
image: ghcr.io/acts-project/ubuntu2004_exatrkx:v43
tags:
- docker

Expand Down Expand Up @@ -104,7 +106,7 @@ test_exatrkx_unittests:
stage: test
needs:
- build_exatrkx
image: ghcr.io/acts-project/ubuntu2004_exatrkx:v41
image: ghcr.io/acts-project/ubuntu2004_exatrkx:v43
tags:
- docker-gpu-nvidia
script:
Expand All @@ -114,7 +116,7 @@ test_exatrkx_python:
stage: test
needs:
- build_exatrkx
image: ghcr.io/acts-project/ubuntu2004_exatrkx:v41
image: ghcr.io/acts-project/ubuntu2004_exatrkx:v43
tags:
- docker-gpu-nvidia
script:
Expand Down
4 changes: 3 additions & 1 deletion CI/physmon/fpe_masks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
"Fatras/include/ActsFatras/Kernel/detail/SimulationActor.hpp:177":
FLTUND: 1
"Core/include/Acts/TrackFitting/detail/GsfUtils.hpp:197":
FLTUND: 1
FLTUND: 1
"Core/include/Acts/TrackFitting/detail/GsfUtils.hpp:201":
FLTUND: 1
"Core/include/Acts/Vertexing/AdaptiveMultiVertexFinder.ipp:120":
FLTUND: 1
Binary file modified CI/physmon/reference/performance_ambi_ttbar.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_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_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_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_seeding_ttbar.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_ttbar_hist.root
Binary file not shown.
7 changes: 0 additions & 7 deletions CI/physmon/workflows/physmon_ckf_tracking.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,6 @@ def run_ckf_tracking(truthSmearedSeeded, truthEstimatedSeeded, label):
s,
setup.field,
seeder=acts.VertexSeedFinder.GaussianSeeder,
associatedParticles=None
if label in ["seeded", "orthogonal"]
else "particles_input",
outputProtoVertices="ivf_protovertices",
outputVertices="ivf_fittedVertices",
vertexFinder=VertexFinder.Iterative,
Expand All @@ -156,9 +153,6 @@ def run_ckf_tracking(truthSmearedSeeded, truthEstimatedSeeded, label):
s,
setup.field,
seeder=acts.VertexSeedFinder.GaussianSeeder,
associatedParticles=None
if label in ["seeded", "orthogonal"]
else "particles_input",
outputProtoVertices="amvf_protovertices",
outputVertices="amvf_fittedVertices",
vertexFinder=VertexFinder.AMVF,
Expand All @@ -172,7 +166,6 @@ def run_ckf_tracking(truthSmearedSeeded, truthEstimatedSeeded, label):
s,
setup.field,
seeder=acts.VertexSeedFinder.AdaptiveGridSeeder,
associatedParticles=None,
outputProtoVertices="amvf_gridseeder_protovertices",
outputVertices="amvf_gridseeder_fittedVertices",
vertexFinder=VertexFinder.AMVF,
Expand Down
4 changes: 1 addition & 3 deletions CI/physmon/workflows/physmon_track_finding_ttbar.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
),
acts.examples.Sequencer.FpeMask(
"Examples/Algorithms/Fatras/src/FatrasSimulation.cpp",
(172, 173),
(235, 236),
acts.FpeType.FLTOVF,
1,
),
Expand Down Expand Up @@ -161,7 +161,6 @@
s,
setup.field,
seeder=acts.VertexSeedFinder.GaussianSeeder,
associatedParticles=None,
outputProtoVertices="amvf_protovertices",
outputVertices="amvf_fittedVertices",
vertexFinder=VertexFinder.AMVF,
Expand All @@ -172,7 +171,6 @@
s,
setup.field,
seeder=acts.VertexSeedFinder.AdaptiveGridSeeder,
associatedParticles=None,
outputProtoVertices="amvf_gridseeder_protovertices",
outputVertices="amvf_gridseeder_fittedVertices",
vertexFinder=VertexFinder.AMVF,
Expand Down
4 changes: 2 additions & 2 deletions CI/physmon/workflows/physmon_truth_tracking_gsf.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

with tempfile.TemporaryDirectory() as temp:
s = acts.examples.Sequencer(
events=500,
events=10000,
numThreads=-1,
logLevel=acts.logging.INFO,
fpeMasks=acts.examples.Sequencer.FpeMask.fromFile(
Expand All @@ -23,8 +23,8 @@
tp = Path(temp)
runTruthTrackingGsf(
setup.trackingGeometry,
setup.digiConfig,
setup.field,
setup.digiConfig,
outputDir=tp,
s=s,
)
Expand Down
2 changes: 1 addition & 1 deletion CI/physmon/workflows/physmon_truth_tracking_kalman.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
runTruthTrackingKalman(
setup.trackingGeometry,
setup.field,
digiConfigFile=setup.digiConfig,
setup.digiConfig,
outputDir=tp,
s=s,
)
Expand Down
13 changes: 10 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,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_PODIO "Build Podio plugin" OFF)
option(ACTS_BUILD_PLUGIN_EDM4HEP "Build EDM4hep plugin" OFF)
option(ACTS_BUILD_PLUGIN_FPEMON "Build FPE monitoring plugin" OFF)
option(ACTS_BUILD_PLUGIN_GEANT4 "Build Geant4 plugin" OFF)
Expand Down Expand Up @@ -128,6 +129,9 @@ set_option_if(
set_option_if(
ACTS_BUILD_PLUGIN_EDM4HEP
ACTS_BUILD_EXAMPLES_EDM4HEP OR ACTS_BUILD_EVERYTHING)
set_option_if(
ACTS_BUILD_PLUGIN_PODIO
ACTS_BUILD_EVERYTHING)
set_option_if(
ACTS_BUILD_PLUGIN_GEANT4
ACTS_BUILD_EXAMPLES_GEANT4 OR ACTS_BUILD_EVERYTHING)
Expand All @@ -136,7 +140,7 @@ set_option_if(
ACTS_BUILD_PLUGIN_DD4HEP OR ACTS_BUILD_EXAMPLES OR ACTS_BUILD_EVERYTHING)
set_option_if(
ACTS_BUILD_PLUGIN_IDENTIFICATION
ACTS_BUILD_PLUGIN_TGEO OR ACTS_BUILD_EXAMPLES OR ACTS_BUILD_EVERYTHING)
ACTS_BUILD_PLUGIN_TGEO OR ACTS_BUILD_PLUGIN_PODIO OR ACTS_BUILD_EXAMPLES OR ACTS_BUILD_EVERYTHING)
set_option_if(
ACTS_BUILD_PLUGIN_JSON
ACTS_BUILD_EXAMPLES OR ACTS_BUILD_EVERYTHING)
Expand Down Expand Up @@ -187,7 +191,7 @@ set(_acts_autodiff_version 0.6)
set(_acts_boost_version 1.71.0)
set(_acts_dd4hep_version 1.21)
set(_acts_edm4hep_version 0.7)
set(_acts_podio_version 0.6)
set(_acts_podio_version 0.16)
set(_acts_doxygen_version 1.9.4)
set(_acts_eigen3_version 3.3.7)
set(_acts_hepmc3_version 3.2.1)
Expand Down Expand Up @@ -344,8 +348,11 @@ endif()
if(ACTS_BUILD_PLUGIN_ONNX OR ACTS_EXATRKX_ENABLE_ONNX)
find_package(OnnxRuntime ${_acts_onnxruntime_version} REQUIRED)
endif()
if(ACTS_BUILD_PLUGIN_EDM4HEP)
if(ACTS_BUILD_PLUGIN_EDM4HEP OR ACTS_BUILD_PLUGIN_PODIO)
find_package(podio ${_acts_podio_version} REQUIRED CONFIG)
find_package(ROOT ${_acts_root_version} REQUIRED CONFIG COMPONENTS Core)
endif()
if(ACTS_BUILD_PLUGIN_EDM4HEP)
find_package(EDM4HEP ${_acts_edm4hep_version} REQUIRED CONFIG)
endif()
if(ACTS_BUILD_PLUGIN_GEANT4)
Expand Down
155 changes: 155 additions & 0 deletions Core/include/Acts/Detector/Blueprint.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,155 @@
// 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/Definitions/Algebra.hpp"
#include "Acts/Definitions/Common.hpp"
#include "Acts/Geometry/VolumeBounds.hpp"
#include "Acts/Utilities/BinningData.hpp"

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

namespace Acts {
namespace Experimental {

class IInternalStructureBuilder;

/// A Blueprint is an instruction tree that allows you to defina a tree sequence
/// of volume building using the provided tools.
///
/// It follows tree nomenclature and can define:
///
/// - a root node (the top of the tree)
/// - a branch node (also called inner node)
/// - leaf node (also called terminal node)
///
/// Leaf nodes can have internal builders attached, while all the external
/// builders will be created when the blueprint is interpreted.
namespace Blueprint {

struct Node final {
/// Branch constructor
///
/// @param n name of the node
/// @param t the transform
/// @param bt the boundary type
/// @param bv the boundary values
/// @param bss the binning values
/// @param cs the children of the node
Node(const std::string& n, const Transform3& t, VolumeBounds::BoundsType bt,
const std::vector<ActsScalar>& bv, const std::vector<BinningValue>& bss,
std::vector<std::unique_ptr<Node>> cs = {})
: name(n),
transform(t),
boundsType(bt),
boundaryValues(bv),
children(std::move(cs)),
binning(bss) {
for_each(children.begin(), children.end(),
[this](std::unique_ptr<Node>& c) { c->parent = this; });
}

/// Leaf constructor
///
/// @param n name of the node
/// @param t the transform
/// @param bt the boundary type
/// @param bv the boundary values
/// @param isb the internal structure builder (optional)
Node(const std::string& n, const Transform3& t, VolumeBounds::BoundsType bt,
const std::vector<ActsScalar>& bv,
std::shared_ptr<const IInternalStructureBuilder> isb = nullptr)
: name(n),
transform(t),
boundsType(bt),
boundaryValues(bv),
internalsBuilder(std::move(isb)) {}

/// Name identification of this node
std::string name = "";
/// Transform definition of this node
Transform3 transform = Transform3::Identity();
/// Boundary definition of this node
VolumeBounds::BoundsType boundsType = VolumeBounds::eOther;
/// The boundary type
std::vector<ActsScalar> boundaryValues = {};
/// Parent node - nullptr for root only
const Node* parent = nullptr;
/// Branch definitions: children
std::vector<std::unique_ptr<Node>> children = {};
/// Branch definition binning
std::vector<BinningValue> binning = {};
/// Internal structure builder - for leaf nodes
std::shared_ptr<const IInternalStructureBuilder> internalsBuilder = nullptr;

/// @brief Check if it is a leaf node
bool isLeaf() const { return children.empty(); }

/// @brief Check is it is a root
bool isRoot() const { return parent == nullptr; }

/// @brief Method to add a child to this branch
/// @param c the child to be added
void add(std::unique_ptr<Node> c) {
c->parent = this;
children.push_back(std::move(c));
}

/// @brief Turn into a dot output
template <typename stream_type>
void dotStream(stream_type& ss,
const std::string& graphName = "blueprint") const {
if (isRoot()) {
ss << "digraph " << graphName << " {" << '\n';
ss << name
<< " [shape=\"circle\";style=\"filled\";fillcolor=\"darkorange\"];"
<< '\n';

} else if (isLeaf()) {
std::string color =
(internalsBuilder != nullptr) ? "darkolivegreen1" : "darkolivegreen3";

ss << name << " [shape=\"box\";style=\"filled\";fillcolor=\"";
ss << color << "\"];" << '\n';
} else {
ss << name << " [shape=\"diamond\"];" << '\n';
}

ss << name << " [label=\"" << name << "\"];" << '\n';
for (const auto& c : children) {
ss << name << " -> " << c->name << ";" << '\n';
c->dotStream(ss);
}
if (children.empty()) {
ss << name + "_shape"
<< " [shape=\"cylinder\";style=\"filled\";fillcolor=\"lightgrey\"];"
<< '\n';
ss << name << " -> " << name + "_shape"
<< ";" << '\n';
}

if (internalsBuilder != nullptr) {
ss << name + "_int"
<< " [shape=\"doubleoctagon\";style=\"filled\";fillcolor="
"\"cadetblue1\"];"
<< '\n';
ss << name << " -> " << name + "_int"
<< ";" << '\n';
}
if (isRoot()) {
ss << "}" << '\n';
}
}
};

} // namespace Blueprint
} // namespace Experimental
} // namespace Acts
38 changes: 38 additions & 0 deletions Core/include/Acts/Detector/detail/BlueprintHelper.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
// 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/Utilities/BinningData.hpp"

namespace Acts {

namespace Experimental {

namespace detail {
namespace BlueprintHelper {

/// @brief Sort the nodes in the blueprint container node
///
/// @param node the node for which the children should be sorted
/// @param recursive if the sorting should be done recursively to children
void sort(Blueprint::Node& node, bool recursive = true);

/// @brief Fill the gaps in the blueprint container node
///
/// @param node the node for with the gaps should be filled
/// @param adjustToParent nodes, if nodes should be adjusted to parent
///
/// @note currently only cylindrical volumes are supported
void fillGaps(Blueprint::Node& node, bool adjustToParent = true);

} // namespace BlueprintHelper
} // namespace detail
} // namespace Experimental
} // namespace Acts
Loading

0 comments on commit 18ce23e

Please sign in to comment.