Skip to content

Commit

Permalink
Merge branch 'main' into acts-scalar-please
Browse files Browse the repository at this point in the history
  • Loading branch information
AJPfleger authored Oct 19, 2024
2 parents d068da7 + f0d6475 commit 909bca1
Show file tree
Hide file tree
Showing 106 changed files with 1,378 additions and 701 deletions.
12 changes: 10 additions & 2 deletions CI/physmon/phys_perf_mon.sh
Original file line number Diff line number Diff line change
Expand Up @@ -225,11 +225,19 @@ function trackfinding() {
run_histcmp \
$outdir/data/$path/performance_ckf.root \
$refdir/$path/performance_ckf.root \
"CKF | ${name}" \
"CKF finding performance | ${name}" \
$path/performance_ckf.html \
$path/performance_ckf_plots \
--config $default_config

run_histcmp \
$outdir/data/$path/performance_fitting_ckf.root \
$refdir/$path/performance_fitting_ckf.root \
"CKF fitting performance | ${name}" \
$path/performance_fitting_ckf.html \
$path/performance_fitting_ckf_plots \
--config $default_config

run Examples/Scripts/generic_plotter.py \
$outdir/data/$path/tracksummary_ckf.root \
tracksummary \
Expand All @@ -252,7 +260,7 @@ function trackfinding() {
run_histcmp \
$outdir/data/$path/performance_ckf_ambi.root \
$refdir/$path/performance_ckf_ambi.root \
"Ambisolver | ${name}" \
"Ambisolver finding performance | ${name}" \
$path/performance_ckf_ambi.html \
$path/performance_ckf_ambi
fi
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
15 changes: 10 additions & 5 deletions CI/physmon/workflows/physmon_trackfinding_1muon.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@
EtaConfig,
PhiConfig,
ParticleConfig,
ParticleSelectorConfig,
addFatras,
addDigitization,
)

from acts.examples.reconstruction import (
addSeeding,
TruthSeedRanges,
ParticleSmearingSigmas,
SeedFinderConfigArg,
SeedFinderOptionsArg,
Expand Down Expand Up @@ -72,6 +72,11 @@ def run_ckf_tracking(label, seeding):
setup.field,
enableInteractions=True,
rnd=rnd,
postSelectParticles=ParticleSelectorConfig(
pt=(0.9 * u.GeV, None),
measurements=(9, None),
removeNeutral=True,
),
)

addDigitization(
Expand All @@ -86,7 +91,6 @@ def run_ckf_tracking(label, seeding):
s,
setup.trackingGeometry,
setup.field,
TruthSeedRanges(pt=(500 * u.MeV, None), nHits=(9, None)),
ParticleSmearingSigmas( # only used by SeedingAlgorithm.TruthSmeared
# zero eveything so the CKF has a chance to find the measurements
d0=0,
Expand All @@ -108,7 +112,7 @@ def run_ckf_tracking(label, seeding):
maxSeedsPerSpM=1,
sigmaScattering=5,
radLengthPerSeed=0.1,
minPt=500 * u.MeV,
minPt=0.5 * u.GeV,
impactMax=3 * u.mm,
),
SeedFinderOptionsArg(bFieldInZ=2 * u.T),
Expand All @@ -134,7 +138,7 @@ def run_ckf_tracking(label, seeding):
setup.trackingGeometry,
setup.field,
TrackSelectorConfig(
pt=(500 * u.MeV, None),
pt=(0.9 * u.GeV, None),
loc0=(-4.0 * u.mm, 4.0 * u.mm),
nMeasurementsMin=6,
maxHoles=2,
Expand All @@ -159,8 +163,9 @@ def run_ckf_tracking(label, seeding):
if seeding != SeedingAlgorithm.TruthSmeared
else []
) + [
"performance_ckf.root",
"tracksummary_ckf.root",
"performance_fitting_ckf.root",
"performance_ckf.root",
]:
perf_file = tp / file
assert perf_file.exists(), f"Performance file not found {perf_file}"
Expand Down
18 changes: 14 additions & 4 deletions CI/physmon/workflows/physmon_trackfinding_4muon_50vertices.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@
EtaConfig,
PhiConfig,
ParticleConfig,
ParticleSelectorConfig,
addFatras,
addDigitization,
)
from acts.examples.reconstruction import (
addSeeding,
TruthSeedRanges,
SeedFinderConfigArg,
SeedFinderOptionsArg,
SeedingAlgorithm,
Expand Down Expand Up @@ -69,6 +69,11 @@
setup.trackingGeometry,
setup.field,
rnd=rnd,
postSelectParticles=ParticleSelectorConfig(
pt=(0.9 * u.GeV, None),
measurements=(9, None),
removeNeutral=True,
),
)

addDigitization(
Expand All @@ -83,7 +88,6 @@
s,
setup.trackingGeometry,
setup.field,
TruthSeedRanges(pt=(500.0 * u.MeV, None), nHits=(9, None)),
SeedFinderConfigArg(
r=(33 * u.mm, 200 * u.mm),
deltaR=(1 * u.mm, 60 * u.mm),
Expand All @@ -92,7 +96,7 @@
maxSeedsPerSpM=1,
sigmaScattering=5,
radLengthPerSeed=0.1,
minPt=500 * u.MeV,
minPt=0.5 * u.GeV,
impactMax=3 * u.mm,
),
SeedFinderOptionsArg(bFieldInZ=2 * u.T, beamPos=(0.0, 0.0)),
Expand All @@ -116,7 +120,7 @@
setup.trackingGeometry,
setup.field,
TrackSelectorConfig(
pt=(500 * u.MeV, None),
pt=(0.9 * u.GeV, None),
loc0=(-4.0 * u.mm, 4.0 * u.mm),
nMeasurementsMin=6,
maxHoles=2,
Expand Down Expand Up @@ -191,6 +195,10 @@

s.run()

shutil.move(
tp / "performance_fitting_ambi.root",
tp / "performance_fitting_ckf_ambi.root",
)
shutil.move(
tp / "performance_ambi.root",
tp / "performance_ckf_ambi.root",
Expand All @@ -204,7 +212,9 @@
for file in [
"performance_seeding.root",
"tracksummary_ckf.root",
"performance_fitting_ckf.root",
"performance_ckf.root",
"performance_fitting_ckf_ambi.root",
"performance_ckf_ambi.root",
"performance_vertexing_ivf_notime.root",
"performance_vertexing_amvf_gauss_notime.root",
Expand Down
17 changes: 13 additions & 4 deletions CI/physmon/workflows/physmon_trackfinding_ttbar_pu200.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
)
from acts.examples.reconstruction import (
addSeeding,
TruthSeedRanges,
SeedFinderConfigArg,
SeedFinderOptionsArg,
SeedingAlgorithm,
Expand Down Expand Up @@ -68,6 +67,11 @@
rho=(0.0, 24 * u.mm),
absZ=(0.0, 1.0 * u.m),
),
postSelectParticles=ParticleSelectorConfig(
pt=(0.5 * u.GeV, None),
measurements=(9, None),
removeNeutral=True,
),
)

addDigitization(
Expand All @@ -82,7 +86,6 @@
s,
setup.trackingGeometry,
setup.field,
TruthSeedRanges(pt=(500.0 * u.MeV, None), nHits=(9, None)),
SeedFinderConfigArg(
r=(33 * u.mm, 200 * u.mm),
deltaR=(1 * u.mm, 60 * u.mm),
Expand All @@ -91,7 +94,7 @@
maxSeedsPerSpM=1,
sigmaScattering=5,
radLengthPerSeed=0.1,
minPt=500 * u.MeV,
minPt=0.5 * u.GeV,
impactMax=3 * u.mm,
),
SeedFinderOptionsArg(bFieldInZ=2 * u.T, beamPos=(0.0, 0.0)),
Expand All @@ -115,7 +118,7 @@
setup.trackingGeometry,
setup.field,
TrackSelectorConfig(
pt=(500 * u.MeV, None),
pt=(0.5 * u.GeV, None),
loc0=(-4.0 * u.mm, 4.0 * u.mm),
nMeasurementsMin=6,
maxHoles=2,
Expand Down Expand Up @@ -176,6 +179,10 @@

s.run()

shutil.move(
tp / "performance_fitting_ambi.root",
tp / "performance_fitting_ckf_ambi.root",
)
shutil.move(
tp / "performance_ambi.root",
tp / "performance_ckf_ambi.root",
Expand All @@ -189,7 +196,9 @@
for file in [
"performance_seeding.root",
"tracksummary_ckf.root",
"performance_fitting_ckf.root",
"performance_ckf.root",
"performance_fitting_ckf_ambi.root",
"performance_ckf_ambi.root",
"performance_vertexing_amvf_gauss_notime.root",
"performance_vertexing_amvf_grid_time.root",
Expand Down
1 change: 1 addition & 0 deletions Core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ add_subdirectory(src/MagneticField)
add_subdirectory(src/Material)
add_subdirectory(src/Navigation)
add_subdirectory(src/Propagator)
add_subdirectory(src/Seeding)
add_subdirectory(src/Surfaces)
add_subdirectory(src/TrackFinding)
add_subdirectory(src/TrackFitting)
Expand Down
11 changes: 11 additions & 0 deletions Core/include/Acts/EventData/GenericBoundTrackParameters.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,17 @@ class GenericBoundTrackParameters {
return m_surface->referenceFrame(geoCtx, position(geoCtx), momentum());
}

/// Reflect the parameters in place.
void reflectInPlace() { m_params = reflectBoundParameters(m_params); }

/// Reflect the parameters.
/// @return Reflected parameters.
GenericBoundTrackParameters<ParticleHypothesis> reflect() const {
GenericBoundTrackParameters<ParticleHypothesis> reflected = *this;
reflected.reflectInPlace();
return reflected;
}

private:
BoundVector m_params;
std::optional<BoundSquareMatrix> m_cov;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,14 @@ class GenericCurvilinearTrackParameters
Vector3 position() const {
return GenericBoundTrackParameters<ParticleHypothesis>::position({});
}

/// Reflect the parameters.
/// @return Reflected parameters.
GenericCurvilinearTrackParameters<ParticleHypothesis> reflect() const {
GenericCurvilinearTrackParameters<ParticleHypothesis> reflected = *this;
reflected.reflectInPlace();
return reflected;
}
};

} // namespace Acts
40 changes: 38 additions & 2 deletions Core/include/Acts/EventData/GenericFreeTrackParameters.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,11 @@
#include "Acts/Definitions/Common.hpp"
#include "Acts/Definitions/TrackParametrization.hpp"
#include "Acts/EventData/TrackParametersConcept.hpp"
#include "Acts/EventData/TransformationHelpers.hpp"
#include "Acts/EventData/detail/PrintParameters.hpp"
#include "Acts/Utilities/MathHelpers.hpp"
#include "Acts/Utilities/UnitVectors.hpp"
#include "Acts/Utilities/VectorHelpers.hpp"

#include <cassert>
#include <cmath>
Expand Down Expand Up @@ -55,6 +57,29 @@ class GenericFreeTrackParameters {
m_cov(std::move(cov)),
m_particleHypothesis(std::move(particleHypothesis)) {}

/// Construct from four-position, direction, absolute momentum, and charge.
///
/// @param pos4 Track position/time four-vector
/// @param dir Track direction three-vector; normalization is ignored.
/// @param qOverP Charge over momentum
/// @param cov Free parameters covariance matrix
/// @param particleHypothesis Particle hypothesis
GenericFreeTrackParameters(const Vector4& pos4, const Vector3& dir,
Scalar qOverP, std::optional<CovarianceMatrix> cov,
ParticleHypothesis particleHypothesis)
: m_params(FreeVector::Zero()),
m_cov(std::move(cov)),
m_particleHypothesis(std::move(particleHypothesis)) {
m_params[eFreePos0] = pos4[ePos0];
m_params[eFreePos1] = pos4[ePos1];
m_params[eFreePos2] = pos4[ePos2];
m_params[eFreeTime] = pos4[eTime];
m_params[eFreeDir0] = dir[eMom0];
m_params[eFreeDir1] = dir[eMom1];
m_params[eFreeDir2] = dir[eMom2];
m_params[eFreeQOverP] = qOverP;
}

/// Construct from four-position, angles, absolute momentum, and charge.
///
/// @param pos4 Track position/time four-vector
Expand Down Expand Up @@ -135,9 +160,9 @@ class GenericFreeTrackParameters {
Scalar time() const { return m_params[eFreeTime]; }

/// Phi direction.
Scalar phi() const { return phi(direction()); }
Scalar phi() const { return VectorHelpers::phi(direction()); }
/// Theta direction.
Scalar theta() const { return theta(direction()); }
Scalar theta() const { return VectorHelpers::theta(direction()); }
/// Charge over momentum.
Scalar qOverP() const { return m_params[eFreeQOverP]; }

Expand Down Expand Up @@ -175,6 +200,17 @@ class GenericFreeTrackParameters {
return m_particleHypothesis;
}

/// Reflect the parameters in place.
void reflectInPlace() { m_params = reflectFreeParameters(m_params); }

/// Reflect the parameters.
/// @return Reflected parameters.
GenericFreeTrackParameters<ParticleHypothesis> reflect() const {
GenericFreeTrackParameters<ParticleHypothesis> reflected = *this;
reflected.reflectInPlace();
return reflected;
}

private:
FreeVector m_params;
std::optional<FreeSquareMatrix> m_cov;
Expand Down
44 changes: 44 additions & 0 deletions Core/include/Acts/EventData/TrackParameterHelpers.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
// 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/Definitions/Algebra.hpp"
#include "Acts/Definitions/TrackParametrization.hpp"
#include "Acts/Utilities/detail/periodic.hpp"

namespace Acts {

/// Normalize the bound parameter angles
///
/// @param boundParams The bound parameters to normalize
///
/// @return The normalized bound parameters
inline BoundVector normalizeBoundParameters(const BoundVector& boundParams) {
BoundVector result = boundParams;
std::tie(result[eBoundPhi], result[eBoundTheta]) =
detail::normalizePhiTheta(result[eBoundPhi], result[eBoundTheta]);
return result;
}

/// Subtract bound parameters and take care of angle periodicity for phi and
/// theta.
///
/// @param lhs The left hand side bound parameters
/// @param rhs The right hand side bound parameters
///
/// @return The difference of the bound parameters
inline BoundVector subtractBoundParameters(const BoundVector& lhs,
const BoundVector& rhs) {
BoundVector result = lhs - rhs;
result[eBoundPhi] =
detail::difference_periodic(lhs[eBoundPhi], rhs[eBoundPhi], 2 * M_PI);
return result;
}

} // namespace Acts
Loading

0 comments on commit 909bca1

Please sign in to comment.