Skip to content

Commit

Permalink
Remove TrackState (acts-project#289)
Browse files Browse the repository at this point in the history
The TrackState is not in use anymore and became superseded by the MultiTrajectory.
  • Loading branch information
FabianKlimpel authored and paulgessinger committed Jul 13, 2020
1 parent 87a3e54 commit 9017ba4
Show file tree
Hide file tree
Showing 13 changed files with 194 additions and 687 deletions.
33 changes: 16 additions & 17 deletions Core/include/Acts/EventData/MultiTrajectory.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,28 @@

#include <Eigen/Core>

#include "Acts/EventData/TrackState.hpp"
#include "Acts/EventData/Measurement.hpp"
#include "Acts/EventData/TrackStatePropMask.hpp"
#include "Acts/Geometry/GeometryContext.hpp"
#include "Acts/Utilities/ParameterDefinitions.hpp"
#include "Acts/Utilities/TypeTraits.hpp"

namespace Acts {

/// @enum TrackStateFlag
///
/// This enum describes the type of TrackState
enum TrackStateFlag {
MeasurementFlag = 0,
ParameterFlag = 1,
OutlierFlag = 2,
HoleFlag = 3,
MaterialFlag = 4,
NumTrackStateFlags = 5
};

using TrackStateType = std::bitset<TrackStateFlag::NumTrackStateFlags>;

// forward declarations
template <typename source_link_t>
class MultiTrajectory;
Expand Down Expand Up @@ -615,21 +629,6 @@ class MultiTrajectory {
/// Create an empty trajectory.
MultiTrajectory() = default;

/// Add a track state using information from a separate track state object.
///
/// @tparam parameters_t The parameter type used for the trackstate
/// @param trackParameters at the local point
/// @param mask The bitmask that instructs which components to allocate and
/// which to leave invalid
/// @param iprevious index of the previous state, SIZE_MAX if first
/// @note The parameter type from @p parameters_t is not currently stored in
/// MultiTrajectory.
/// @return Index of the newly added track state
template <typename parameters_t>
size_t addTrackState(const TrackState<SourceLink, parameters_t>& ts,
TrackStatePropMask mask = TrackStatePropMask::All,
size_t iprevious = SIZE_MAX);

/// Add a track state without providing explicit information. Which components
/// of the track state are initialized/allocated can be controlled via @p mask
/// @param mask The bitmask that instructs which components to allocate and
Expand Down Expand Up @@ -693,4 +692,4 @@ class MultiTrajectory {

} // namespace Acts

#include "Acts/EventData/MultiTrajectory.ipp"
#include "Acts/EventData/MultiTrajectory.ipp"
84 changes: 0 additions & 84 deletions Core/include/Acts/EventData/MultiTrajectory.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

#include <Eigen/Core>

#include "Acts/EventData/TrackState.hpp"
#include "Acts/Utilities/TypeTraits.hpp"

namespace Acts {
Expand Down Expand Up @@ -187,89 +186,6 @@ inline auto TrackStateProxy<SL, N, M, ReadOnly>::calibratedCovariance() const

} // namespace detail_lt

template <typename SL>
template <typename parameters_t>
inline size_t MultiTrajectory<SL>::addTrackState(
const TrackState<SL, parameters_t>& ts, TrackStatePropMask mask,
size_t iprevious) {
using PropMask = TrackStatePropMask;

// build a mask to allocate for the components in the trackstate
PropMask required = PropMask::None;
if (ts.parameter.predicted) {
required |= PropMask::Predicted;
}

if (ts.parameter.filtered) {
required |= PropMask::Filtered;
}

if (ts.parameter.smoothed) {
required |= PropMask::Smoothed;
}

if (ts.parameter.jacobian) {
required |= PropMask::Jacobian;
}

if (ts.measurement.uncalibrated) {
required |= PropMask::Uncalibrated;
}

if (ts.measurement.calibrated) {
required |= PropMask::Calibrated;
}

// use a TrackStateProxy to do the assignments
size_t index = addTrackState(mask | required, iprevious);
TrackStateProxy nts = getTrackState(index);

// make shared ownership held by this multi trajectory
nts.setReferenceSurface(ts.referenceSurface().getSharedPtr());

// we don't need to check allocation, because we ORed with required components
// above

if (ts.parameter.predicted) {
const auto& predicted = *ts.parameter.predicted;
nts.predicted() = predicted.parameters();
nts.predictedCovariance() = *predicted.covariance();
}

if (ts.parameter.filtered) {
const auto& filtered = *ts.parameter.filtered;
nts.filtered() = filtered.parameters();
nts.filteredCovariance() = *filtered.covariance();
}

if (ts.parameter.smoothed) {
const auto& smoothed = *ts.parameter.smoothed;
nts.smoothed() = smoothed.parameters();
nts.smoothedCovariance() = *smoothed.covariance();
}

// store jacobian
if (ts.parameter.jacobian) {
nts.jacobian() = *ts.parameter.jacobian;
}

// handle measurements
if (ts.measurement.uncalibrated) {
nts.uncalibrated() = *ts.measurement.uncalibrated;
}

if (ts.measurement.calibrated) {
std::visit([&](const auto& m) { nts.setCalibrated(m); },
*ts.measurement.calibrated);
}

nts.chi2() = ts.parameter.chi2;
nts.pathLength() = ts.parameter.pathLength;
nts.typeFlags() = ts.type();

return nts.index();
}

template <typename SL>
inline size_t MultiTrajectory<SL>::addTrackState(TrackStatePropMask mask,
size_t iprevious) {
Expand Down
181 changes: 0 additions & 181 deletions Core/include/Acts/EventData/TrackState.hpp

This file was deleted.

32 changes: 0 additions & 32 deletions Core/include/Acts/EventData/TrackStateSorters.hpp

This file was deleted.

2 changes: 0 additions & 2 deletions Core/include/Acts/Fitter/KalmanFitter.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
#include "Acts/EventData/MeasurementHelpers.hpp"
#include "Acts/EventData/MultiTrajectory.hpp"
#include "Acts/EventData/TrackParameters.hpp"
#include "Acts/EventData/TrackState.hpp"
#include "Acts/EventData/TrackStateSorters.hpp"
#include "Acts/Fitter/KalmanFitterError.hpp"
#include "Acts/Fitter/detail/VoidKalmanComponents.hpp"
#include "Acts/Geometry/GeometryContext.hpp"
Expand Down
2 changes: 0 additions & 2 deletions Core/include/Acts/TrackFinder/CombinatorialKalmanFilter.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@
#include "Acts/EventData/MeasurementHelpers.hpp"
#include "Acts/EventData/MultiTrajectory.hpp"
#include "Acts/EventData/TrackParameters.hpp"
#include "Acts/EventData/TrackState.hpp"
#include "Acts/EventData/TrackStatePropMask.hpp"
#include "Acts/EventData/TrackStateSorters.hpp"
#include "Acts/Fitter/detail/VoidKalmanComponents.hpp"
#include "Acts/Geometry/GeometryContext.hpp"
#include "Acts/MagneticField/MagneticFieldContext.hpp"
Expand Down
1 change: 0 additions & 1 deletion Tests/UnitTests/Core/EventData/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,3 @@ add_unittest(MeasurementHelpers MeasurementHelpersTests.cpp)
add_unittest(Measurement MeasurementTests.cpp)
add_unittest(MultiTrajectory MultiTrajectoryTests.cpp)
add_unittest(ParameterSet ParameterSetTests.cpp)
add_unittest(TrackState TrackStateTests.cpp)
Loading

0 comments on commit 9017ba4

Please sign in to comment.