Skip to content

Commit

Permalink
Merge branch 'main' of github.com:acts-project/acts into ex-rename-vt…
Browse files Browse the repository at this point in the history
…x-perf-writer
  • Loading branch information
andiwand committed Oct 18, 2024
2 parents b4f776d + 26d18cb commit 718fb64
Show file tree
Hide file tree
Showing 82 changed files with 1,006 additions and 475 deletions.
Binary file not shown.
Binary file not shown.
Binary file not shown.
10 changes: 7 additions & 3 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 Down Expand Up @@ -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 Down
10 changes: 7 additions & 3 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 Down Expand Up @@ -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
7 changes: 5 additions & 2 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 Down
2 changes: 1 addition & 1 deletion CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"inherits": "common",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Release",
"CMAKE_CXX_FLAGS": "-Werror",
"CMAKE_COMPILE_WARNING_AS_ERROR": "ON",
"ACTS_FORCE_ASSERTIONS": "ON",
"ACTS_ENABLE_LOG_FAILURE_THRESHOLD": "ON",
"ACTS_BUILD_BENCHMARKS": "ON",
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
6 changes: 3 additions & 3 deletions Core/include/Acts/EventData/TrackProxy.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,8 @@ class TrackProxy {
return std::distance(tsRange.begin(), tsRange.end());
}

/// Return the number of measurements for the track. Const version
/// Return a mutable reference to the number of measurements for the track.
/// Mutable version
/// @note Only available if the track proxy is not read-only
/// @return The number of measurements
unsigned int& nMeasurements()
Expand All @@ -333,8 +334,7 @@ class TrackProxy {
return component<unsigned int, hashString("nMeasurements")>();
}

/// Return a mutable reference to the number of measurements for the track.
/// Mutable version
/// Return the number of measurements for the track. Const version
/// @return The number of measurements
unsigned int nMeasurements() const {
return component<unsigned int, hashString("nMeasurements")>();
Expand Down
28 changes: 28 additions & 0 deletions Core/include/Acts/EventData/TransformationHelpers.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,39 @@
#include "Acts/Definitions/TrackParametrization.hpp"
#include "Acts/Geometry/GeometryContext.hpp"
#include "Acts/Utilities/Result.hpp"
#include "Acts/Utilities/detail/periodic.hpp"

namespace Acts {

class Surface;

/// Reflect bound track parameters.
///
/// @param boundParams Bound track parameters vector
/// @return Reflected bound track parameters vector
inline BoundVector reflectBoundParameters(const BoundVector& boundParams) {
BoundVector reflected = boundParams;
auto [phi, theta] = detail::normalizePhiTheta(
boundParams[eBoundPhi] - M_PI, M_PI - boundParams[eBoundTheta]);
reflected[eBoundPhi] = phi;
reflected[eBoundTheta] = theta;
reflected[eBoundQOverP] = -boundParams[eBoundQOverP];
return reflected;
}

/// Reflect free track parameters.
///
/// @param freeParams Free track parameters vector
/// @return Reflected free track parameters vector
inline FreeVector reflectFreeParameters(const FreeVector& freeParams) {
FreeVector reflected = freeParams;
reflected[eFreeDir0] = -freeParams[eFreeDir0];
reflected[eFreeDir1] = -freeParams[eFreeDir1];
reflected[eFreeDir2] = -freeParams[eFreeDir2];
reflected[eFreeQOverP] = -freeParams[eFreeQOverP];
return reflected;
}

/// Transform bound track parameters into equivalent free track parameters.
///
/// @param surface Surface onto which the input parameters are bound
Expand Down
2 changes: 1 addition & 1 deletion Core/include/Acts/Geometry/CylinderVolumeBounds.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ class CylinderVolumeBounds : public VolumeBounds {
/// Copy Constructor
///
/// @param cylbo is the source cylinder volume bounds for the copy
CylinderVolumeBounds(const CylinderVolumeBounds& cylbo) = default;
CylinderVolumeBounds(const CylinderVolumeBounds& cylbo);

~CylinderVolumeBounds() override = default;
CylinderVolumeBounds& operator=(const CylinderVolumeBounds& cylbo) = default;
Expand Down
37 changes: 37 additions & 0 deletions Core/include/Acts/Seeding/EstimateTrackParamsFromSeed.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -287,4 +287,41 @@ std::optional<BoundVector> estimateTrackParamsFromSeed(
return params;
}

/// Configuration for the estimation of the covariance matrix of the track
/// parameters with `estimateTrackParamCovariance`.
struct EstimateTrackParamCovarianceConfig {
/// The initial sigmas for the track parameters
BoundVector initialSigmas = {1. * UnitConstants::mm,
1. * UnitConstants::mm,
1. * UnitConstants::degree,
1. * UnitConstants::degree,
1. * UnitConstants::e / UnitConstants::GeV,
1. * UnitConstants::ns};

/// The initial relative uncertainty of the q/pt
double initialSigmaPtRel = 0.1;

/// The inflation factors for the variances of the track parameters
BoundVector initialVarInflation = {1., 1., 1., 1., 1., 1.};
/// The inflation factor for time uncertainty if the time parameter was not
/// estimated
double noTimeVarInflation = 100.;
};

/// Estimate the covariance matrix of the given track parameters based on the
/// provided configuration. The assumption is that we can model the uncertainty
/// of the track parameters as a diagonal matrix with the provided initial
/// sigmas. The inflation factors are used to inflate the initial variances
/// based on the provided configuration. The uncertainty of q/p is estimated
/// based on the relative uncertainty of the q/pt and the theta uncertainty.
///
/// @param config is the configuration for the estimation
/// @param params is the track parameters
/// @param hasTime is true if the track parameters have time
///
/// @return the covariance matrix of the track parameters
BoundMatrix estimateTrackParamCovariance(
const EstimateTrackParamCovarianceConfig& config, const BoundVector& params,
bool hasTime);

} // namespace Acts
1 change: 1 addition & 0 deletions Core/include/Acts/Seeding/HoughTransformUtils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include "Acts/Utilities/Logger.hpp"
#include "Acts/Utilities/Result.hpp"

#include <algorithm>
#include <array>
#include <map>
#include <optional>
Expand Down
Loading

0 comments on commit 718fb64

Please sign in to comment.