Skip to content
Snippets Groups Projects
Commit af8ed334 authored by Xiaocong Ai's avatar Xiaocong Ai Committed by Xiaocong Ai
Browse files

Add the TrackStateTypeFlag for TrackState

parent 671122ab
Branches
Tags
1 merge request!706Kf with nested material interaction
......@@ -17,6 +17,18 @@
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
};
class Surface;
/// @class TrackState
......@@ -44,6 +56,7 @@ class TrackState {
/// @param m The measurement object
TrackState(SourceLink m) : m_surface(&m.referenceSurface()) {
measurement.uncalibrated = std::move(m);
m_typeFlags.set(MeasurementFlag);
}
/// Constructor from parameters
......@@ -53,6 +66,7 @@ class TrackState {
TrackState(parameters_t p) {
m_surface = &p.referenceSurface();
parameter.predicted = std::move(p);
m_typeFlags.set(ParameterFlag);
}
/// Virtual destructor
......@@ -64,7 +78,8 @@ class TrackState {
TrackState(const TrackState& rhs)
: parameter(rhs.parameter),
measurement(rhs.measurement),
m_surface(rhs.m_surface) {}
m_surface(rhs.m_surface),
m_typeFlags(rhs.m_typeFlags) {}
/// Copy move constructor
///
......@@ -72,7 +87,8 @@ class TrackState {
TrackState(TrackState&& rhs)
: parameter(std::move(rhs.parameter)),
measurement(std::move(rhs.measurement)),
m_surface(std::move(rhs.m_surface)) {}
m_surface(std::move(rhs.m_surface)),
m_typeFlags(std::move(rhs.m_typeFlags)) {}
/// Assignment operator
///
......@@ -81,6 +97,7 @@ class TrackState {
parameter = rhs.parameter;
measurement = rhs.measurement;
m_surface = rhs.m_surface;
m_typeFlags = rhs.m_typeFlags;
return (*this);
}
......@@ -91,12 +108,27 @@ class TrackState {
parameter = std::move(rhs.parameter);
measurement = std::move(rhs.measurement);
m_surface = std::move(rhs.m_surface);
m_typeFlags = std::move(rhs.m_typeFlags);
return (*this);
}
/// @brief return method for the surface
const Surface& referenceSurface() const { return (*m_surface); }
/// @brief set the type flag
void setType(const TrackStateFlag& flag, bool status = true) {
m_typeFlags.set(flag, status);
}
/// @brief test if the tracks state is flagged as a given type
bool isType(const TrackStateFlag& flag) const {
assert(flag < NumTrackStateFlags);
return m_typeFlags.test(flag);
}
/// @brief return method for the type flags
std::bitset<NumTrackStateFlags> type() const { return m_typeFlags; }
/// @brief number of Measured parameters, forwarded
/// @note This only returns a value if there is a calibrated measurement
/// set. If not, this returns boost::none
......@@ -141,5 +173,7 @@ class TrackState {
private:
/// The surface of this TrackState
const Surface* m_surface = nullptr;
/// The type flag of this TrackState
std::bitset<NumTrackStateFlags> m_typeFlags;
};
} // namespace Acts
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment