Skip to content

Commit

Permalink
Merge branch 'main' into shrink-z-orthogonal
Browse files Browse the repository at this point in the history
  • Loading branch information
paulgessinger authored Dec 6, 2023
2 parents edaa955 + a8a0576 commit 4070352
Show file tree
Hide file tree
Showing 794 changed files with 9,814 additions and 7,067 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ jobs:
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Check
run: >
sudo apt-get install -y git
Expand All @@ -53,6 +55,8 @@ jobs:
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Check
run: >
CI/check_include_guards.py . --fail-global --exclude "*thirdparty/*"
Expand All @@ -68,9 +72,21 @@ jobs:
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Check
run: >
CI/check_end_of_file.py . --exclude "thirdparty/*" --reject-multiple-newlines --github
size_t:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Check
run: >
CI/check_size_t.py . --exclude "thirdparty/*"
boost_test_macro:
runs-on: ubuntu-latest
steps:
Expand All @@ -83,6 +99,8 @@ jobs:
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Check
run: >
CI/check_smearing_config.py .
Expand All @@ -91,6 +109,8 @@ jobs:
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Check
run: >
docs/parse_cmake_options.py CMakeLists.txt --write docs/getting_started.md --verify
Expand All @@ -99,6 +119,8 @@ jobs:
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install codespell
run: >
pip install codespell==2.2.5
Expand All @@ -120,9 +142,21 @@ jobs:
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install dependencies
run: >
pip install -r CI/requirements_fpe_masks.txt
- name: Check
run: >
CI/check_fpe_masks.py --token ${{ secrets.GITHUB_TOKEN }}
unused_files:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Check
run: >
CI/check_unused_files.py
2 changes: 1 addition & 1 deletion .github/workflows/iwyu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:
-DACTS_BUILD_EXAMPLES_EDM4HEP=ON
- name: Run IWYU
run: python3 iwyu-install/bin/iwyu_tool.py -p acts-build/ -j2 -- --mapping_file=acts/CI/iwyu/mapping.imp | tee iwyu-output.txt
run: python3 iwyu-install/bin/iwyu_tool.py -p acts-build/ -j2 -- -Xiwyu --mapping_file=$(pwd)/acts/CI/iwyu/mapping.imp | tee iwyu-output.txt
- name: Filter IWYU output
run: python3 acts/CI/iwyu/filter.py acts/CI/iwyu/filter.yaml iwyu-output.txt iwyu-filtered.txt
- name: Apply IWYU
Expand Down
11 changes: 2 additions & 9 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ variables:
clang_tidy:
stage: build
image: ghcr.io/acts-project/ubuntu2004:v41
tags:
- large
artifacts:
paths:
- src/clang-tidy/
Expand Down Expand Up @@ -440,18 +442,9 @@ lcg_104:

parallel:
matrix:
- OS: [centos7]
COMPILER:
- gcc11
- gcc12

- OS: [alma9]
COMPILER:
- gcc11
- gcc12
- gcc13
- clang16

- OS: [centos8]
COMPILER: [gcc11]

12 changes: 12 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
repos:
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: 'v14.0.0'
hooks:
- id: clang-format
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.2.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files
7 changes: 6 additions & 1 deletion .zenodo.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"name": "Xiaocong Ai"
},
{
"affiliation": "Universitaet Freiburg",
"affiliation": "Universitaet Regensburg",
"name": "Benjamin Huth"
},
{
Expand Down Expand Up @@ -113,6 +113,11 @@
"name": "Stephen Nicholas Swatman",
"orcid": "0000-0002-3747-3229"
}
{
"affiliation": "CERN / TU Wien",
"name": "Felix Russo",
"orcid": "0009-0005-8975-2245"
}
],
"access_right": "open",
"related_identifiers": [
Expand Down
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ The following people have contributed to the project (in alphabetical order):
- Fabian Klimpel, CERN
- Robert Langenberg, UMass
- Alexander J. Pfleger, CERN, University of Graz
- Felix Russo, CERN, TU Wien
- Andreas Salzburger, CERN
- Bastian Schlag, CERN, JGU Mainz
- Andreas Stefl, CERN, TU Wien
Expand Down
18 changes: 9 additions & 9 deletions Alignment/include/ActsAlignment/Kernel/Alignment.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ struct AlignmentOptions {
const AlignedTransformUpdater& aTransformUpdater,
const std::vector<Acts::DetectorElementBase*>& aDetElements = {},
double chi2CutOff = 0.5,
const std::pair<size_t, double>& deltaChi2CutOff = {5, 0.01},
size_t maxIters = 5,
const std::pair<std::size_t, double>& deltaChi2CutOff = {5, 0.01},
std::size_t maxIters = 5,
const std::map<unsigned int, AlignmentMask>& iterState = {})
: fitOptions(fOptions),
alignedTransformUpdater(aTransformUpdater),
Expand All @@ -79,10 +79,10 @@ struct AlignmentOptions {

// The delta of average chi2/ndf within a couple of iterations to determine if
// alignment is converged
std::pair<size_t, double> deltaAverageChi2ONdfCutOff = {5, 0.01};
std::pair<std::size_t, double> deltaAverageChi2ONdfCutOff = {5, 0.01};

// The maximum number of iterations to run alignment
size_t maxIterations = 5;
std::size_t maxIterations = 5;

// The alignment mask for different iterations
std::map<unsigned int, AlignmentMask> iterationState;
Expand Down Expand Up @@ -111,16 +111,16 @@ struct AlignmentResult {
double chi2 = 0;

// The measurement dimension from all tracks
size_t measurementDim = 0;
std::size_t measurementDim = 0;

// The alignment degree of freedom
size_t alignmentDof = 0;
std::size_t alignmentDof = 0;

// The number of tracks used for alignment
size_t numTracks = 0;
std::size_t numTracks = 0;

// The indexed alignable surfaces
std::unordered_map<const Acts::Surface*, size_t> idxedAlignSurfaces;
std::unordered_map<const Acts::Surface*, std::size_t> idxedAlignSurfaces;

Acts::Result<void> result{Acts::Result<void>::success()};
};
Expand Down Expand Up @@ -163,7 +163,7 @@ struct Alignment {
const Acts::GeometryContext& gctx,
const std::vector<source_link_t>& sourcelinks,
const start_parameters_t& sParameters, const fit_options_t& fitOptions,
const std::unordered_map<const Acts::Surface*, size_t>&
const std::unordered_map<const Acts::Surface*, std::size_t>&
idxedAlignSurfaces,
const AlignmentMask& alignMask) const;

Expand Down
5 changes: 3 additions & 2 deletions Alignment/include/ActsAlignment/Kernel/Alignment.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ ActsAlignment::Alignment<fitter_t>::evaluateTrackAlignmentState(
const Acts::GeometryContext& gctx,
const std::vector<source_link_t>& sourcelinks,
const start_parameters_t& sParameters, const fit_options_t& fitOptions,
const std::unordered_map<const Acts::Surface*, size_t>& idxedAlignSurfaces,
const std::unordered_map<const Acts::Surface*, std::size_t>&
idxedAlignSurfaces,
const ActsAlignment::AlignmentMask& alignMask) const {
Acts::TrackContainer tracks{Acts::VectorTrackContainer{},
Acts::VectorMultiTrajectory{}};
Expand Down Expand Up @@ -122,7 +123,7 @@ void ActsAlignment::Alignment<fitter_t>::calculateAlignmentParameters(
// Get the inverse of chi2 second derivative matrix (we need this to
// calculate the covariance of the alignment parameters)
// @Todo: use more stable method for solving the inverse
size_t alignDof = alignResult.alignmentDof;
std::size_t alignDof = alignResult.alignmentDof;
Acts::ActsDynamicMatrix sumChi2SecondDerivativeInverse =
Acts::ActsDynamicMatrix::Zero(alignDof, alignDof);
sumChi2SecondDerivativeInverse = sumChi2SecondDerivative.inverse();
Expand Down
37 changes: 19 additions & 18 deletions Alignment/include/ActsAlignment/Kernel/detail/AlignmentEngine.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ using namespace Acts;
///
struct TrackAlignmentState {
// The dimension of measurements
size_t measurementDim = 0;
std::size_t measurementDim = 0;

// The dimension of track parameters
size_t trackParametersDim = 0;
std::size_t trackParametersDim = 0;

// The contributed alignment degree of freedom
size_t alignmentDof = 0;
std::size_t alignmentDof = 0;

// The measurements covariance
ActsDynamicMatrix measurementCovariance;
Expand Down Expand Up @@ -65,7 +65,8 @@ struct TrackAlignmentState {

// The alignable surfaces on the track and their indices in both the global
// alignable surfaces pool and those relevant with this track
std::unordered_map<const Surface*, std::pair<size_t, size_t>> alignedSurfaces;
std::unordered_map<const Surface*, std::pair<std::size_t, std::size_t>>
alignedSurfaces;
};

/// Reset some columns of the alignment to bound derivative to zero if the
Expand Down Expand Up @@ -104,24 +105,24 @@ void resetAlignmentDerivative(Acts::AlignmentToBoundMatrix& alignToBound,
template <typename traj_t, typename parameters_t = BoundTrackParameters>
TrackAlignmentState trackAlignmentState(
const GeometryContext& gctx, const traj_t& multiTraj,
const size_t& entryIndex,
const std::pair<ActsDynamicMatrix, std::unordered_map<size_t, size_t>>&
const std::size_t& entryIndex,
const std::pair<ActsDynamicMatrix,
std::unordered_map<std::size_t, std::size_t>>&
globalTrackParamsCov,
const std::unordered_map<const Surface*, size_t>& idxedAlignSurfaces,
const std::unordered_map<const Surface*, std::size_t>& idxedAlignSurfaces,
const AlignmentMask& alignMask) {
using CovMatrix = typename parameters_t::CovarianceMatrix;

// Construct an alignment state
TrackAlignmentState alignState;

// Remember the index within the trajectory and whether it's alignable
std::vector<std::pair<size_t, bool>> measurementStates;
std::vector<std::pair<std::size_t, bool>> measurementStates;
measurementStates.reserve(15);
// Number of smoothed states on the track
// size_t nSmoothedStates = 0; // commented because clang-tidy complains about
// unused
// Number of alignable surfaces on the track
size_t nAlignSurfaces = 0;
// std::size_t nSmoothedStates = 0; // commented because clang-tidy complains
// about unused Number of alignable surfaces on the track
std::size_t nAlignSurfaces = 0;

// Visit the track states on the track
multiTraj.visitBackwards(entryIndex, [&](const auto& ts) {
Expand Down Expand Up @@ -192,12 +193,12 @@ TrackAlignmentState trackAlignmentState(

// Loop over the measurement states to fill those alignment matrices
// This is done in reverse order
size_t iMeasurement = alignState.measurementDim;
size_t iParams = alignState.trackParametersDim;
size_t iSurface = nAlignSurfaces;
std::size_t iMeasurement = alignState.measurementDim;
std::size_t iParams = alignState.trackParametersDim;
std::size_t iSurface = nAlignSurfaces;
for (const auto& [rowStateIndex, isAlignable] : measurementStates) {
const auto& state = multiTraj.getTrackState(rowStateIndex);
const size_t measdim = state.calibratedSize();
const std::size_t measdim = state.calibratedSize();
// Update index of current measurement and parameter
iMeasurement -= measdim;
iParams -= eBoundSize;
Expand Down Expand Up @@ -251,14 +252,14 @@ TrackAlignmentState trackAlignmentState(
// @Todo: add helper function to select rows/columns of a matrix
for (unsigned int iColState = 0; iColState < measurementStates.size();
iColState++) {
size_t colStateIndex = measurementStates.at(iColState).first;
std::size_t colStateIndex = measurementStates.at(iColState).first;
// Retrieve the block from the source covariance matrix
CovMatrix correlation =
sourceTrackParamsCov.block<eBoundSize, eBoundSize>(
stateRowIndices.at(rowStateIndex),
stateRowIndices.at(colStateIndex));
// Fill the block of the target covariance matrix
size_t iCol =
std::size_t iCol =
alignState.trackParametersDim - (iColState + 1) * eBoundSize;
alignState.trackParametersCovariance.block<eBoundSize, eBoundSize>(
iParams, iCol) = correlation;
Expand Down
Loading

0 comments on commit 4070352

Please sign in to comment.