ACTS
Experiment-independent tracking
Loading...
Searching...
No Matches
Acts::TrackStateTypeBase< Derived, ReadOnly > Class Template Reference

CRTP base class for TrackStateType and TrackStateTypeMap. More...

#include <Acts/EventData/TrackStateType.hpp>

Inheritance diagram for Acts::TrackStateTypeBase< Derived, ReadOnly >:
[legend]

Public Types

using bitset_type = std::bitset<kRawBits>
 Type alias for bitset representation.
using raw_type = std::uint64_t
 Type alias for underlying raw data type.

Public Member Functions

bool hasMaterial () const
 Checks if the track state has material.
bool hasMeasurement () const
 Checks if the track state has a measurement.
bool hasNoExpectedHit () const
 Checks if the track state has no expected hit.
bool hasParameters () const
 Checks if the track state has parameters.
bool isHole () const
 Checks if the track state is a hole.
bool isMaterial () const
 Checks if the track state is a pure material state.
bool isMeasurement () const
 Checks if the track state is a pure measurement state.
bool isOutlier () const
 Checks if the track state is an outlier.
bool isSharedHit () const
 Checks if the track state has a shared hit.
bool isSplitHit () const
 Checks if the track state has a split hit.
template<typename DerivedOther, bool ReadOnlyOther>
requires (!ReadOnly)
Derived operator= (const TrackStateTypeBase< DerivedOther, ReadOnlyOther > &other)
 Assigns the flags from another TrackStateTypeBase.
void reset ()
 Resets all flags to zero.
Derived & setHasMaterial (bool value=true)
 Sets whether the track state has material.
Derived & setHasMeasurement (bool value=true)
 Sets whether the track state has a measurement.
Derived & setHasNoExpectedHit (bool value=true)
 Sets the track state to have no expected hit.
Derived & setHasParameters (bool value=true)
 Sets whether the track state has parameters.
Derived & setIsHole (bool value=true)
 Sets the track state to be a hole.
Derived & setIsMaterial ()
 Sets the track state to be a pure material state.
Derived & setIsMeasurement ()
 Sets the track state to be a pure measurement state.
Derived & setIsOutlier (bool value=true)
 Sets the track state to be an outlier.
Derived & setIsSharedHit (bool value=true)
 Sets the track state to be a shared hit.
Derived & setIsSplitHit (bool value=true)
 Sets the track state to be a split hit.
void setUnchecked (std::size_t pos, bool value=true)
 Change the value of the bit at position pos to value.
void setUnchecked (TrackStateFlag flag, bool value=true)
 Change the value of the bit for flag to value.
bool test (std::size_t pos) const
 Return if the bit at position pos is set.
bool test (TrackStateFlag flag) const
 Return if the bit for flag is set.

Static Public Attributes

static constexpr std::size_t kRawBits
 Number of bits available in the raw storage type.

Protected Member Functions

void assertConsistency () const
 Asserts the consistency of the current flag combination.
bitset_type bits () const
 Returns the bitset representation of the underlying raw data.
Derived & self ()
const Derived & self () const

Detailed Description

template<typename Derived, bool ReadOnly>
class Acts::TrackStateTypeBase< Derived, ReadOnly >

CRTP base class for TrackStateType and TrackStateTypeMap.

Template Parameters
DerivedThe derived class
ReadOnlyWhether the derived class is read-only

Member Typedef Documentation

◆ bitset_type

template<typename Derived, bool ReadOnly>
using Acts::TrackStateTypeBase< Derived, ReadOnly >::bitset_type = std::bitset<kRawBits>

Type alias for bitset representation.

◆ raw_type

template<typename Derived, bool ReadOnly>
using Acts::TrackStateTypeBase< Derived, ReadOnly >::raw_type = std::uint64_t

Type alias for underlying raw data type.

Member Function Documentation

◆ assertConsistency()

template<typename Derived, bool ReadOnly>
void Acts::TrackStateTypeBase< Derived, ReadOnly >::assertConsistency ( ) const
protected

Asserts the consistency of the current flag combination.

◆ bits()

template<typename Derived, bool ReadOnly>
bitset_type Acts::TrackStateTypeBase< Derived, ReadOnly >::bits ( ) const
protected

Returns the bitset representation of the underlying raw data.

Returns
the bitset representation

◆ hasMaterial()

template<typename Derived, bool ReadOnly>
bool Acts::TrackStateTypeBase< Derived, ReadOnly >::hasMaterial ( ) const

Checks if the track state has material.

Note
use isMaterial() to check for a pure material state
Returns
true if material is present

◆ hasMeasurement()

template<typename Derived, bool ReadOnly>
bool Acts::TrackStateTypeBase< Derived, ReadOnly >::hasMeasurement ( ) const

Checks if the track state has a measurement.

Note
use isMeasurement() to check for a pure measurement state
Returns
true if a measurement is present

◆ hasNoExpectedHit()

template<typename Derived, bool ReadOnly>
bool Acts::TrackStateTypeBase< Derived, ReadOnly >::hasNoExpectedHit ( ) const

Checks if the track state has no expected hit.

Returns
true if it has no expected hit

◆ hasParameters()

template<typename Derived, bool ReadOnly>
bool Acts::TrackStateTypeBase< Derived, ReadOnly >::hasParameters ( ) const

Checks if the track state has parameters.

Returns
true if parameters are present

◆ isHole()

template<typename Derived, bool ReadOnly>
bool Acts::TrackStateTypeBase< Derived, ReadOnly >::isHole ( ) const

Checks if the track state is a hole.

Returns
true if it is a hole

◆ isMaterial()

template<typename Derived, bool ReadOnly>
bool Acts::TrackStateTypeBase< Derived, ReadOnly >::isMaterial ( ) const

Checks if the track state is a pure material state.

Note
use hasMaterial() to check for the presence of material
Returns
true if it is a pure material state

◆ isMeasurement()

template<typename Derived, bool ReadOnly>
bool Acts::TrackStateTypeBase< Derived, ReadOnly >::isMeasurement ( ) const

Checks if the track state is a pure measurement state.

Note
use hasMeasurement() to check for the presence of a measurement
Returns
true if it is a pure measurement state

◆ isOutlier()

template<typename Derived, bool ReadOnly>
bool Acts::TrackStateTypeBase< Derived, ReadOnly >::isOutlier ( ) const

Checks if the track state is an outlier.

Returns
true if it is an outlier

◆ isSharedHit()

template<typename Derived, bool ReadOnly>
bool Acts::TrackStateTypeBase< Derived, ReadOnly >::isSharedHit ( ) const

Checks if the track state has a shared hit.

Returns
true if it has a shared hit

◆ isSplitHit()

template<typename Derived, bool ReadOnly>
bool Acts::TrackStateTypeBase< Derived, ReadOnly >::isSplitHit ( ) const

Checks if the track state has a split hit.

Returns
true if it has a split hit

◆ operator=()

template<typename Derived, bool ReadOnly>
template<typename DerivedOther, bool ReadOnlyOther>
requires (!ReadOnly)
Derived Acts::TrackStateTypeBase< Derived, ReadOnly >::operator= ( const TrackStateTypeBase< DerivedOther, ReadOnlyOther > & other)

Assigns the flags from another TrackStateTypeBase.

◆ reset()

template<typename Derived, bool ReadOnly>
void Acts::TrackStateTypeBase< Derived, ReadOnly >::reset ( )

Resets all flags to zero.

◆ self() [1/2]

template<typename Derived, bool ReadOnly>
Derived & Acts::TrackStateTypeBase< Derived, ReadOnly >::self ( )
protected

◆ self() [2/2]

template<typename Derived, bool ReadOnly>
const Derived & Acts::TrackStateTypeBase< Derived, ReadOnly >::self ( ) const
protected

◆ setHasMaterial()

template<typename Derived, bool ReadOnly>
Derived & Acts::TrackStateTypeBase< Derived, ReadOnly >::setHasMaterial ( bool value = true)

Sets whether the track state has material.

Parameters
valuethe value to set
Returns
self-reference for chaining

◆ setHasMeasurement()

template<typename Derived, bool ReadOnly>
Derived & Acts::TrackStateTypeBase< Derived, ReadOnly >::setHasMeasurement ( bool value = true)

Sets whether the track state has a measurement.

Parameters
valuethe value to set
Returns
self-reference for chaining

◆ setHasNoExpectedHit()

template<typename Derived, bool ReadOnly>
Derived & Acts::TrackStateTypeBase< Derived, ReadOnly >::setHasNoExpectedHit ( bool value = true)

Sets the track state to have no expected hit.

Parameters
valuethe value to set
Returns
self-reference for chaining

◆ setHasParameters()

template<typename Derived, bool ReadOnly>
Derived & Acts::TrackStateTypeBase< Derived, ReadOnly >::setHasParameters ( bool value = true)

Sets whether the track state has parameters.

Parameters
valuethe value to set
Returns
self-reference for chaining

◆ setIsHole()

template<typename Derived, bool ReadOnly>
Derived & Acts::TrackStateTypeBase< Derived, ReadOnly >::setIsHole ( bool value = true)

Sets the track state to be a hole.

Parameters
valuethe value to set
Returns
self-reference for chaining

◆ setIsMaterial()

template<typename Derived, bool ReadOnly>
Derived & Acts::TrackStateTypeBase< Derived, ReadOnly >::setIsMaterial ( )

Sets the track state to be a pure material state.

Returns
self-reference for chaining

◆ setIsMeasurement()

template<typename Derived, bool ReadOnly>
Derived & Acts::TrackStateTypeBase< Derived, ReadOnly >::setIsMeasurement ( )

Sets the track state to be a pure measurement state.

Returns
self-reference for chaining

◆ setIsOutlier()

template<typename Derived, bool ReadOnly>
Derived & Acts::TrackStateTypeBase< Derived, ReadOnly >::setIsOutlier ( bool value = true)

Sets the track state to be an outlier.

Parameters
valuethe value to set
Returns
self-reference for chaining

◆ setIsSharedHit()

template<typename Derived, bool ReadOnly>
Derived & Acts::TrackStateTypeBase< Derived, ReadOnly >::setIsSharedHit ( bool value = true)

Sets the track state to be a shared hit.

Parameters
valuethe value to set
Returns
self-reference for chaining

◆ setIsSplitHit()

template<typename Derived, bool ReadOnly>
Derived & Acts::TrackStateTypeBase< Derived, ReadOnly >::setIsSplitHit ( bool value = true)

Sets the track state to be a split hit.

Parameters
valuethe value to set
Returns
self-reference for chaining

◆ setUnchecked() [1/2]

template<typename Derived, bool ReadOnly>
void Acts::TrackStateTypeBase< Derived, ReadOnly >::setUnchecked ( std::size_t pos,
bool value = true )

Change the value of the bit at position pos to value.

Parameters
posthe position of the bit to change
valuethe value to change the bit to

◆ setUnchecked() [2/2]

template<typename Derived, bool ReadOnly>
void Acts::TrackStateTypeBase< Derived, ReadOnly >::setUnchecked ( TrackStateFlag flag,
bool value = true )

Change the value of the bit for flag to value.

Parameters
flagthe flag to change
valuethe value to change the bit to

◆ test() [1/2]

template<typename Derived, bool ReadOnly>
bool Acts::TrackStateTypeBase< Derived, ReadOnly >::test ( std::size_t pos) const

Return if the bit at position pos is set.

Parameters
posthe position of the bit to test
Returns
if the bit at pos is one or not

◆ test() [2/2]

template<typename Derived, bool ReadOnly>
bool Acts::TrackStateTypeBase< Derived, ReadOnly >::test ( TrackStateFlag flag) const

Return if the bit for flag is set.

Parameters
flagthe flag to test
Returns
if the bit for flag is one or not

Member Data Documentation

◆ kRawBits

template<typename Derived, bool ReadOnly>
std::size_t Acts::TrackStateTypeBase< Derived, ReadOnly >::kRawBits
staticconstexpr
Initial value:
=
std::numeric_limits<std::make_unsigned_t<raw_type>>::digits

Number of bits available in the raw storage type.