Skip to content

Commit

Permalink
Merge branch 'acts-project:main' into fix-edgeholes
Browse files Browse the repository at this point in the history
  • Loading branch information
pbutti authored Dec 9, 2024
2 parents 5cb0ada + 341d2b0 commit 29ed187
Show file tree
Hide file tree
Showing 234 changed files with 3,079 additions and 3,132 deletions.
81 changes: 3 additions & 78 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,51 +38,6 @@ jobs:
- name: Run pre-commit
run: pre-commit run --all-files --show-diff-on-failure

license:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Check
run: >
sudo apt-get install -y git
&& CI/check_license.py . --exclude "*thirdparty/*"
include_guards:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Check
run: >
CI/check_include_guards.py . --fail-global --exclude "*thirdparty/*"
pragma_once:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Check
run: >
CI/check_pragma_once.sh
type_t:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Check
run: >
CI/check_type_t.py . --exclude "thirdparty/*"
boost_test_macro:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Check
run: >
CI/check_boost_test_macro.sh
smearing_config:
runs-on: ubuntu-latest
steps:
Expand All @@ -93,39 +48,7 @@ jobs:
- name: Check
run: >
CI/check_smearing_config.py .
cmake_options:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Check
run: >
docs/parse_cmake_options.py CMakeLists.txt --write docs/getting_started.md --verify
spelling:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install codespell
run: >
pip install codespell==2.2.5
- name: Check
run: >
CI/check_spelling
math_macros:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Check
run: >
CI/check_math_macros.py . --exclude "thirdparty/*"
missing_includes:
runs-on: ubuntu-latest
steps:
Expand All @@ -136,6 +59,7 @@ jobs:
- name: Check
run: >
CI/missing_include_check.sh
fpe_masks:
runs-on: ubuntu-latest
steps:
Expand All @@ -149,6 +73,7 @@ jobs:
- name: Check
run: >
CI/check_fpe_masks.py --token ${{ secrets.GITHUB_TOKEN }}
unused_files:
runs-on: ubuntu-latest
steps:
Expand Down
70 changes: 43 additions & 27 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -142,33 +142,49 @@ build_exatrkx:
- cmake --build build -- -j6
- ccache -s

# test_exatrkx_unittests:
# stage: test
# needs:
# - build_exatrkx
# image: ghcr.io/acts-project/ubuntu2204_exatrkx:63
# tags:
# - docker-gpu-nvidia
# script:
# - ctest --test-dir build -R ExaTrkX
#
# test_exatrkx_python:
# stage: test
# needs:
# - build_exatrkx
# image: ghcr.io/acts-project/ubuntu2204_exatrkx:63
# tags:
# - docker-gpu-nvidia
# script:
# - apt-get update -y
# - apt-get install -y python3 libxxhash0
# - source build/this_acts_withdeps.sh
# - git clone $CLONE_URL src
# - cd src
# - git checkout $HEAD_SHA
# - pip3 install -r Examples/Python/tests/requirements.txt
# - nvidia-smi
# - pytest -rFsv -k test_exatrkx
test_exatrkx_unittests:
stage: test
needs:
- build_exatrkx
image: ghcr.io/acts-project/ubuntu2204_exatrkx:63
variables:
DEPENDENCY_URL: https://acts.web.cern.ch/ACTS/ci/ubuntu-22.04/deps.$DEPENDENCY_TAG.tar.zst
tags:
- docker-gpu-nvidia
script:

- apt-get update -y
- git clone $CLONE_URL src
- cd src
- git checkout $HEAD_SHA
- source CI/dependencies.sh
- cd ..
- ctest --test-dir build -R ExaTrkX

test_exatrkx_python:
stage: test
needs:
- build_exatrkx
image: ghcr.io/acts-project/ubuntu2204_exatrkx:63
variables:
DEPENDENCY_URL: https://acts.web.cern.ch/ACTS/ci/ubuntu-22.04/deps.$DEPENDENCY_TAG.tar.zst
tags:
- docker-gpu-nvidia
script:
- apt-get update -y
- git clone $CLONE_URL src
- cd src
- git checkout $HEAD_SHA
- nvidia-smi
- source CI/dependencies.sh
- source ../build/this_acts_withdeps.sh
- python3 -m pip install -r Examples/Python/tests/requirements.txt
- echo $PYTHONPATH
- which python3
- python3 --version
- python3 -c "import acts"
- pytest -rFsv -k torch --collect-only
- pytest -rFsv -k gpu-torch # For now only test torch GPU pipeline

build_linux_ubuntu:
stage: build
Expand Down
3 changes: 2 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ repos:
- id: codespell
args: [
"-S", "*.ipynb,*.onnx,_build,*.svg",
"-I", "./CI/codespell_ignore.txt"
"-I", "./CI/codespell_ignore.txt",
"-w"
]
exclude: ^CI/.*$

Expand Down
1 change: 0 additions & 1 deletion CI/codespell_ignore.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ coner
dthe
iself
sortings
fime
gaus
te
parm
Expand Down
9 changes: 9 additions & 0 deletions CI/physmon/phys_perf_mon.sh
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,15 @@ function trackfinding() {
$path/performance_finding_ckf_ambi.html \
$path/performance_finding_ckf_ambi
fi

if [ -f $refdir/$path/performance_finding_ckf_ml_solver.root ]; then
run_histcmp \
$outdir/data/$path/performance_finding_ckf_ml_solver.root \
$refdir/$path/performance_finding_ckf_ml_solver.root \
"ML Ambisolver | ${name}" \
$path/performance_finding_ckf_ml_solver.html \
$path/performance_finding_ckf_ml_solver
fi
}

function vertexing() {
Expand Down
4 changes: 3 additions & 1 deletion CI/physmon/physmon_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ def makeSetup() -> PhysmonSetup:
level=acts.logging.INFO,
)

detector, trackingGeometry, decorators = getOpenDataDetector(matDeco)
detector = getOpenDataDetector(matDeco)
trackingGeometry = detector.trackingGeometry()
decorators = detector.contextDecorators()
setup = PhysmonSetup(
detector=detector,
trackingGeometry=trackingGeometry,
Expand Down
Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion CI/physmon/workflows/physmon_trackfinding_1muon.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def run_ckf_tracking(label, seeding):
rnd=rnd,
postSelectParticles=ParticleSelectorConfig(
pt=(0.9 * u.GeV, None),
measurements=(9, None),
hits=(9, None),
removeNeutral=True,
),
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
rnd=rnd,
postSelectParticles=ParticleSelectorConfig(
pt=(0.9 * u.GeV, None),
measurements=(9, None),
hits=(9, None),
removeNeutral=True,
),
)
Expand Down
29 changes: 28 additions & 1 deletion CI/physmon/workflows/physmon_trackfinding_ttbar_pu200.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@
CkfConfig,
addCKFTracks,
addAmbiguityResolution,
addAmbiguityResolutionML,
AmbiguityResolutionConfig,
AmbiguityResolutionMLConfig,
addVertexFitting,
VertexFinder,
TrackSelectorConfig,
Expand Down Expand Up @@ -69,7 +71,7 @@
),
postSelectParticles=ParticleSelectorConfig(
pt=(0.5 * u.GeV, None),
measurements=(9, None),
hits=(9, None),
removeNeutral=True,
),
)
Expand Down Expand Up @@ -134,13 +136,25 @@
outputDirRoot=tp,
)

addAmbiguityResolutionML(
s,
AmbiguityResolutionMLConfig(
maximumSharedHits=3, maximumIterations=1000000, nMeasurementsMin=6
),
tracks="ckf_tracks",
outputDirRoot=tp,
onnxModelFile=Path(__file__).resolve().parent.parent.parent.parent
/ "thirdparty/OpenDataDetector/data/duplicateClassifier.onnx",
)

addAmbiguityResolution(
s,
AmbiguityResolutionConfig(
maximumSharedHits=3,
maximumIterations=100000,
nMeasurementsMin=6,
),
tracks="ckf_tracks",
outputDirRoot=tp,
)

Expand Down Expand Up @@ -187,6 +201,17 @@
tp / "performance_fitting_ambi.root",
tp / "performance_fitting_ckf_ambi.root",
)

shutil.move(
tp / "performance_finding_ambiML.root",
tp / "performance_finding_ckf_ml_solver.root",
)

shutil.move(
tp / "performance_fitting_ambiML.root",
tp / "performance_fitting_ckf_ml_solver.root",
)

for vertexing in ["amvf_gauss_notime", "amvf_grid_time"]:
shutil.move(
tp / f"{vertexing}/performance_vertexing.root",
Expand All @@ -200,6 +225,8 @@
"performance_fitting_ckf.root",
"performance_finding_ckf_ambi.root",
"performance_fitting_ckf_ambi.root",
"performance_finding_ckf_ml_solver.root",
"performance_fitting_ckf_ml_solver.root",
"performance_vertexing_amvf_gauss_notime.root",
"performance_vertexing_amvf_grid_time.root",
]:
Expand Down
51 changes: 51 additions & 0 deletions Core/include/Acts/AmbiguityResolution/AmbiguityNetworkConcept.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
// This file is part of the ACTS project.
//
// Copyright (C) 2016 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 https://mozilla.org/MPL/2.0/.

#pragma once

#include "Acts/EventData/TrackContainer.hpp"
#include "Acts/EventData/TrackContainerFrontendConcept.hpp"
#include "Acts/EventData/VectorMultiTrajectory.hpp"
#include "Acts/EventData/VectorTrackContainer.hpp"
#include "Acts/Utilities/Concepts.hpp"

namespace Acts {

/// @brief Concept for the ambiguity network used in the ambiguity resolution
///
/// The ambiguity network correspond to the AmbiguityTrackClassifier found in
/// the Onnx plugin. It is used to score the tracks and select the best ones.
///
/// The constructor of the Ambiguity Solver network should take string as input
/// corresponding to the path of the ONNX model.
/// The implementation of the Ambiguity Solver network should have two methods:
/// - inferScores: takes clusters (a list of track ID associated with a cluster
/// ID) and the track container and return an outputTensor (list of scores for
/// each track in the clusters).
/// - trackSelection: Takes clusters and the output tensor from the inferScores
/// method and return the list of track ID to keep.
///
/// @tparam N the type of the network
template <typename network_t>
concept AmbiguityNetworkConcept = requires(
TrackContainer<VectorTrackContainer, VectorMultiTrajectory,
detail::ValueHolder> &tracks,
std::unordered_map<std::size_t, std::vector<std::size_t>> &clusters,
std::vector<std::vector<float>> &outputTensor, const char *modelPath,
network_t &n) {
{ network_t(modelPath) } -> std::same_as<network_t>;

{
n.inferScores(clusters, tracks)
} -> std::same_as<std::vector<std::vector<float>>>;
{
n.trackSelection(clusters, outputTensor)
} -> std::same_as<std::vector<std::size_t>>;
};

} // namespace Acts
Loading

0 comments on commit 29ed187

Please sign in to comment.