Skip to content

Commit

Permalink
Merge branch 'main' into overstepping
Browse files Browse the repository at this point in the history
  • Loading branch information
AJPfleger authored May 18, 2022
2 parents 226d2da + 6c2807a commit b59c43e
Show file tree
Hide file tree
Showing 44 changed files with 218 additions and 128 deletions.
3 changes: 2 additions & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ build:
-DCMAKE_BUILD_TYPE=Release
-DCMAKE_CXX_FLAGS=-w
-DCMAKE_CUDA_FLAGS=-w
-DCMAKE_CUDA_ARCHITECTURES="75;86"
-DACTS_BUILD_PLUGIN_EXATRKX=ON
-DACTS_BUILD_EXAMPLES_EXATRKX=ON
-DACTS_BUILD_EXAMPLES_PYTHON_BINDINGS=ON
Expand All @@ -86,7 +87,7 @@ test:
stage: test
dependencies:
- build
image: ghcr.io/acts-project/ubuntu2004_exatrkx:v22
image: ghcr.io/acts-project/ubuntu2004_exatrkx:v23
tags:
- docker-gpu-nvidia
script:
Expand Down
11 changes: 0 additions & 11 deletions CI/physmon/phys_perf_mon.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,6 @@ echo "::group::Generate validation dataset"
CI/physmon/physmon.py $outdir 2>&1 > $outdir/run.log
echo "::endgroup::"

echo "::group::full_chain_odd"
thirdparty/OpenDataDetector/ci/full_chain_odd.py -o $outdir

# this will currently produce an error code because of the small amount of particles
build/bin/ActsAnalysisResidualsAndPulls \
--predicted --filtered --smoothed --silent \
-i $outdir/trackstates_ckf.root \
-o $outdir/acts_analysis_residuals_and_pulls.root \
|| true
echo "::endgroup::"

set +e

ec=0
Expand Down
20 changes: 20 additions & 0 deletions CI/physmon/physmon.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import shutil
import os
import sys
import subprocess

sys.path += [
str(Path(__file__).parent.parent.parent / "Examples/Scripts/Python/"),
Expand Down Expand Up @@ -97,3 +98,22 @@
perf_file = tp / "performance_ckf.root"
assert perf_file.exists(), "Performance file not found"
shutil.copy(perf_file, outdir / f"performance_ckf_tracks_{label}.root")

if not truthSmeared and not truthEstimated:
residual_app = srcdir / "build/bin/ActsAnalysisResidualsAndPulls"
# @TODO: Add try/except
subprocess.check_call(
[
str(residual_app),
"--predicted",
"--filtered",
"--smoothed",
"--silent",
"-i",
str(tp / "trackstates_ckf.root"),
"-o",
str(outdir / "acts_analysis_residuals_and_pulls.root"),
"--save",
"",
]
)
Binary file modified CI/physmon/reference/acts_analysis_residuals_and_pulls.root
Binary file not shown.
5 changes: 1 addition & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,6 @@ set_option_if(ACTS_BUILD_PLUGIN_LEGACY ACTS_BUILD_EVERYTHING)
set_option_if(ACTS_BUILD_PLUGIN_AUTODIFF ACTS_BUILD_EVERYTHING)
set_option_if(ACTS_BUILD_EXAMPLES_EXATRKX ACTS_BUILD_PLUGIN_EXATRKX)

# Done with conditional option setting, unset it now
unset(ACTS_BUILD_EVERYTHING CACHE)

# feature tests
include(CheckCXXSourceCompiles)

Expand All @@ -137,7 +134,7 @@ include(ActsCompilerOptions) # default compile options
include(ActsComponentsHelpers) # handle components via add_..._if commands
include(ActsStaticAnalysis)

# place build products in `<build_dir>/bin` and `<build_dir>/lib` for simple use
# place build products in `<build>/bin` and `<build>/lib` for simple use
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/${CMAKE_INSTALL_BINDIR}")
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}")

Expand Down
2 changes: 1 addition & 1 deletion Core/include/Acts/Definitions/Common.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ static constexpr ActsScalar s_onSurfaceTolerance = 1e-4;
static constexpr ActsScalar s_curvilinearProjTolerance = 0.999995;

/// @enum NavigationDirection
/// The navigation direciton is always with
/// The navigation direction is always with
/// respect to a given momentum or direction
enum class NavigationDirection : int { Backward = -1, Forward = 1 };

Expand Down
2 changes: 1 addition & 1 deletion Core/include/Acts/Propagator/EigenStepper.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class EigenStepper {
/// @param [in] gctx is the context object for the geometry
/// @param [in] fieldCacheIn is the cache object for the magnetic field
/// @param [in] par The track parameters at start
/// @param [in] ndir The navigation direciton w.r.t momentum
/// @param [in] ndir The navigation direction w.r.t momentum
/// @param [in] ssize is the maximum step size
/// @param [in] stolerance is the stepping tolerance
///
Expand Down
2 changes: 1 addition & 1 deletion Core/include/Acts/Propagator/MultiEigenStepperLoop.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ class MultiEigenStepperLoop
/// @param [in] mctx is the context object for the magnetic field
/// @param [in] bfield the shared magnetic filed provider
/// @param [in] multipars The track multi-component track-parameters at start
/// @param [in] ndir The navigation direciton w.r.t momentum
/// @param [in] ndir The navigation direction w.r.t momentum
/// @param [in] ssize is the maximum step size
/// @param [in] stolerance is the stepping tolerance
///
Expand Down
2 changes: 1 addition & 1 deletion Core/include/Acts/Propagator/StraightLineStepper.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class StraightLineStepper {
/// @param [in] gctx is the context object for the geometry
/// @param [in] mctx is the context object for the magnetic field
/// @param [in] par The track parameters at start
/// @param [in] ndir The navigation direciton w.r.t momentum
/// @param [in] ndir The navigation direction w.r.t momentum
/// @param [in] ssize is the maximum step size
/// @param [in] stolerance is the stepping tolerance
///
Expand Down
2 changes: 1 addition & 1 deletion Core/include/Acts/TrackFitting/KalmanFitter.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,7 @@ class KalmanFitter {
return KalmanFitterError::ReverseNavigationFailed;
}

// Remember the navigation direciton has been reversed
// Remember the navigation direction has been reversed
result.reversed = true;

// Reverse navigation direction
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ namespace ActsExamples {
/// track efficiency, fake rate etc.
/// @TODO: add duplication plots
///
/// A common file can be provided for to the writer to attach his TTree,
/// A common file can be provided for the writer to attach his TTree,
/// this is done by setting the Config::rootFile pointer to an existing file
///
/// Safe to use from multiple writer threads - uses a std::mutex lock.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ namespace ActsExamples {
///
/// Efficiency here is the fraction of smoothed tracks compared to all tracks.
///
/// A common file can be provided for to the writer to attach his TTree,
/// A common file can be provided for the writer to attach his TTree,
/// this is done by setting the Config::rootFile pointer to an existing file
///
/// Safe to use from multiple writer threads - uses a std::mutex lock.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ namespace ActsExamples {
/// in the root file for optimised data writing speed
/// The event number is part of the written data.
///
/// A common file can be provided for to the writer to attach his TTree,
/// A common file can be provided for the writer to attach his TTree,
/// this is done by setting the Config::rootFile pointer to an existing file
///
/// Safe to use from multiple writer threads - uses a std::mutex lock.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ namespace ActsExamples {
/// in the root file for optimised data writing speed
/// The event number is part of the written data.
///
/// A common file can be provided for to the writer to attach his TTree,
/// A common file can be provided for the writer to attach his TTree,
/// this is done by setting the Config::rootFile pointer to an existing file
///
/// Safe to use from multiple writer threads - uses a std::mutex lock.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ using PropagationSteps = std::vector<Acts::detail::Step>;
/// data writing speed.
/// The event number is part of the written data.
///
/// A common file can be provided for to the writer to attach his TTree,
/// A common file can be provided for the writer to attach his TTree,
/// this is done by setting the Config::rootFile pointer to an existing file
///
/// Safe to use from multiple writer threads - uses a std::mutex lock.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ namespace ActsExamples {
/// Each entry in the TTree corresponds to one trajectory for optimum
/// writing speed. The event number is part of the written data.
///
/// A common file can be provided for to the writer to attach his TTree,
/// A common file can be provided for the writer to attach his TTree,
/// this is done by setting the Config::rootFile pointer to an existing
/// file
///
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ namespace ActsExamples {
/// Each entry in the TTree corresponds to all reconstructed trajectories in one
/// single event. The event number is part of the written data.
///
/// A common file can be provided for to the writer to attach his TTree,
/// A common file can be provided for the writer to attach his TTree,
/// this is done by setting the Config::rootFile pointer to an existing
/// file
///
Expand Down
3 changes: 1 addition & 2 deletions Examples/Python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -145,10 +145,9 @@ else()
endif()

add_custom_target(ActsPythonGlueCode)
configure_file(setup.sh.in ${_python_dir}/setup.sh COPYONLY)
configure_file(setup.sh.in ${_python_dir}/setup.sh @ONLY)
install(FILES setup.sh.in DESTINATION "python" RENAME setup.sh)


foreach(f ${py_files})
set(_target ${_python_dir}/acts/${f})
get_filename_component(_dir ${_target} DIRECTORY)
Expand Down
2 changes: 1 addition & 1 deletion Examples/Python/python/acts/examples/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ def dump_args_calls(
import collections

for n in dir(mod):
if n.startswith("_") or n == "Config":
if n.startswith("_") or n == "Config" or n == "Interval":
continue
f = getattr(mod, n)
if not (
Expand Down
29 changes: 27 additions & 2 deletions Examples/Python/setup.sh.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,28 @@
python_dir=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
# This file is part of the Acts project.
#
# Copyright (C) 2021-2022 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/.

export PYTHONPATH=$python_dir:$PYTHONPATH
# This script sets up the ACTS Python bindings in the environment in a somewhat
# robust way.

if [ -n "$ZSH_VERSION" ]; then
export PYTHONPATH=${0:a:h}:$PYTHONPATH
elif [ -n "$BASH_VERSION" ]; then
python_dir=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
export PYTHONPATH=$python_dir:$PYTHONPATH
else
# If the current shell is not ZSH or Bash, we can't guarantee that the
# script will work, so we throw an error.
echo "ERROR: neither ZSH nor Bash was detected, other shells are not supported. The environment has not been modified."
exit 1
fi

# This message might seem excessive, but the Acts bindings are only installed
# for one Python version, and it is not trivial for the user to find out which.
# Thus, we let them know explicitly so they can more easily debug any potential
# import errors.
echo "INFO: Acts Python @Python_VERSION_MAJOR@.@Python_VERSION_MINOR@ bindings setup complete."
2 changes: 1 addition & 1 deletion Examples/Scripts/Benchmarking/CKF_timing_vs_mu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ done
#check input for DDhep input
if [ "${detector}" == DD4hep ]; then
if [ -z "${dd4hepInput}" ]; then
echo "Empty input for --dd4hep-input. A file like $<src_dir>/thirdparty/OpenDataDetector/xml/OpenDataDetector.xml must be provided. Have to exit."
echo "Empty input for --dd4hep-input. A file like $<source>/thirdparty/OpenDataDetector/xml/OpenDataDetector.xml must be provided. Have to exit."
exit 1
fi
if [ ! -f "${dd4hepInput}" ]; then
Expand Down
2 changes: 1 addition & 1 deletion Examples/Scripts/Benchmarking/KF_timing.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ done
#check input for DDhep input
if [ "${detector}" == DD4hep ]; then
if [ -z "${dd4hepInput}" ]; then
echo "Empty input for --dd4hep-input. A file like $<src_dir>/Examples/Detectors/DD4hepDetector/compact/OpenDataDetector/OpenDataDetector.xml must be provided. Have to exit"
echo "Empty input for --dd4hep-input. A file like $<source/Examples/Detectors/DD4hepDetector/compact/OpenDataDetector/OpenDataDetector.xml must be provided. Have to exit"
exit 1
fi
if [ ! -f "${dd4hepInput}" ]; then
Expand Down
27 changes: 18 additions & 9 deletions Examples/Scripts/Python/ckf_tracks.py
Original file line number Diff line number Diff line change
@@ -1,23 +1,29 @@
#!/usr/bin/env python3
from pathlib import Path
from typing import Optional, Union
from collections import namedtuple

from acts.examples import Sequencer, GenericDetector, RootParticleReader

import acts

from acts import UnitConstants as u
from seeding import TruthSeedRanges

CKFPerformanceConfig = namedtuple(
"CKFPerformanceConfig",
["truthMatchProbMin", "nMeasurementsMin", "ptMin"],
defaults=[None] * 3,
)


@acts.examples.NamedTypeArgs(
truthSeedRanges=TruthSeedRanges,
CKFPerformanceConfigArg=CKFPerformanceConfig,
)
def addCKFTracks(
s: acts.examples.Sequencer,
trackingGeometry: acts.TrackingGeometry,
field: acts.MagneticFieldProvider,
truthSeedRanges: TruthSeedRanges = TruthSeedRanges(),
CKFPerformanceConfigArg: CKFPerformanceConfig = CKFPerformanceConfig(),
outputDirCsv: Optional[Union[Path, str]] = None,
outputDirRoot: Optional[Union[Path, str]] = None,
selectedParticles: str = "truth_seeds_selected",
Expand All @@ -30,8 +36,8 @@ def addCKFTracks(
the sequencer module to which we add the Seeding steps (returned from addSeeding)
trackingGeometry : tracking geometry
field : magnetic field
truthSeedRanges : TruthSeedRanges(nHits, pt)
CKFPerformanceWriter configuration. Each range is specified as a tuple of (min,max), though currently only the min is used.
CKFPerformanceConfigArg : CKFPerformanceConfig(truthMatchProbMin, nMeasurementsMin, ptMin)
CKFPerformanceWriter configuration.
Defaults specified in Examples/Io/Performance/ActsExamples/Io/Performance/CKFPerformanceWriter.hpp
outputDirCsv : Path|str, path, None
the output folder for the Csv output, None triggers no output
Expand Down Expand Up @@ -105,9 +111,12 @@ def addCKFTracks(
inputParticles=selectedParticles,
inputTrajectories=trackFinder.config.outputTrajectories,
inputMeasurementParticlesMap="measurement_particles_map",
# The bottom seed could be the first, second or third hits on the truth track
nMeasurementsMin=truthSeedRanges.nHits[0],
ptMin=truthSeedRanges.pt[0],
**acts.examples.defaultKWArgs(
# The bottom seed could be the first, second or third hits on the truth track
nMeasurementsMin=CKFPerformanceConfigArg.nMeasurementsMin,
ptMin=CKFPerformanceConfigArg.ptMin,
truthMatchProbMin=CKFPerformanceConfigArg.truthMatchProbMin,
),
filePath=str(outputDirRoot / "performance_ckf.root"),
)
s.addWriter(ckfPerfWriter)
Expand Down Expand Up @@ -233,7 +242,7 @@ def runCKFTracks(
s,
trackingGeometry,
field,
TruthSeedRanges(pt=(400.0 * u.MeV, None), nHits=(6, None)),
CKFPerformanceConfig(ptMin=400.0 * u.MeV, nMeasurementsMin=6),
outputDirRoot=outputDir,
outputDirCsv=outputDir / "csv" if outputCsv else None,
)
Expand Down
4 changes: 2 additions & 2 deletions Examples/Scripts/Python/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def getOpenDataDetector(mdecorator=None):
lib_name = "libOpenDataDetector.so"
elif sys.platform == "darwin":
env_vars = ["DYLD_LIBRARY_PATH", "DD4HEP_LIBRARY_PATH"]
lib_name = "libOpenDataDetector.dyld"
lib_name = "libOpenDataDetector.dylib"

if lib_name is not None and len(env_vars) > 0:
found = False
Expand All @@ -41,7 +41,7 @@ def getOpenDataDetector(mdecorator=None):
if not found:
msg = (
"Unable to find OpenDataDetector factory library. "
f"You might need to point {'/'.join(env_vars)} at it"
f"You might need to point {'/'.join(env_vars)} to build/thirdparty/OpenDataDetector/factory or other ODD install location"
)
raise RuntimeError(msg)

Expand Down
Loading

0 comments on commit b59c43e

Please sign in to comment.