ATLAS Offline Software
Loading...
Searching...
No Matches
ActsTrk::detail::MeasurementRange Struct Reference

#include <AtlasUncalibSourceLinkAccessor.h>

Inheritance diagram for ActsTrk::detail::MeasurementRange:
Collaboration diagram for ActsTrk::detail::MeasurementRange:

Public Member Functions

bool isConsistentRange () const
 MeasurementRange ()
 MeasurementRange (unsigned int container_idx, unsigned int start_element_idx, unsigned int end_element_idx)
void updateEnd (std::size_t container_idx, unsigned int end_element_idx)
unsigned int containerIndex () const
unsigned int elementBeginIndex () const
unsigned int elementEndIndex () const
bool empty () const
bool isMeasurementExpected () const

Static Public Member Functions

static constexpr unsigned int createRangeValue (unsigned int container_idx, unsigned int index)
static constexpr unsigned int extractContainerIndex (unsigned int value)
static constexpr unsigned int extractElementIndex (unsigned int value)
static MeasurementRange noMeasurementExpected ()

Public Attributes

T1 first_type
 STL member.
T2 second_type
 STL member.

Static Public Attributes

static constexpr unsigned int CONTAINER_IDX_SHIFT = 28
static constexpr unsigned int CONTAINER_IDX_MASK = (1u << 31) | (1u << 30) | (1u << 29) | (1u << 28)
static constexpr unsigned int ELEMENT_IDX_MASK = ~CONTAINER_IDX_MASK

Detailed Description

Definition at line 23 of file AtlasUncalibSourceLinkAccessor.h.

Constructor & Destructor Documentation

◆ MeasurementRange() [1/2]

ActsTrk::detail::MeasurementRange::MeasurementRange ( )
inline

Definition at line 46 of file AtlasUncalibSourceLinkAccessor.h.

46: std::pair<unsigned int, unsigned int>(std::numeric_limits<unsigned int>::max(), std::numeric_limits<unsigned int>::max()) {}

◆ MeasurementRange() [2/2]

ActsTrk::detail::MeasurementRange::MeasurementRange ( unsigned int container_idx,
unsigned int start_element_idx,
unsigned int end_element_idx )
inline

Definition at line 47 of file AtlasUncalibSourceLinkAccessor.h.

48 : std::pair<unsigned int, unsigned int>( createRangeValue(container_idx, start_element_idx),
49 createRangeValue(container_idx, end_element_idx) ) {
50 }
static constexpr unsigned int createRangeValue(unsigned int container_idx, unsigned int index)

Member Function Documentation

◆ containerIndex()

unsigned int ActsTrk::detail::MeasurementRange::containerIndex ( ) const
inline

Definition at line 63 of file AtlasUncalibSourceLinkAccessor.h.

64 {
65 assert(isConsistentRange());
66 return extractContainerIndex(this->first);
67 }
static constexpr unsigned int extractContainerIndex(unsigned int value)

◆ createRangeValue()

constexpr unsigned int ActsTrk::detail::MeasurementRange::createRangeValue ( unsigned int container_idx,
unsigned int index )
inlinestaticconstexpr

Definition at line 28 of file AtlasUncalibSourceLinkAccessor.h.

29 {
30 assert(container_idx < (1u << (32 - CONTAINER_IDX_SHIFT)));
31 assert((index & CONTAINER_IDX_MASK) == 0u);
32 return (container_idx << CONTAINER_IDX_SHIFT) | index;
33 }
str index
Definition DeMoScan.py:362
static constexpr unsigned int CONTAINER_IDX_SHIFT
static constexpr unsigned int CONTAINER_IDX_MASK

◆ elementBeginIndex()

unsigned int ActsTrk::detail::MeasurementRange::elementBeginIndex ( ) const
inline

Definition at line 68 of file AtlasUncalibSourceLinkAccessor.h.

69 {
70 assert(isConsistentRange());
71 return extractElementIndex(this->first);
72 }
static constexpr unsigned int extractElementIndex(unsigned int value)

◆ elementEndIndex()

unsigned int ActsTrk::detail::MeasurementRange::elementEndIndex ( ) const
inline

Definition at line 73 of file AtlasUncalibSourceLinkAccessor.h.

74 {
75 assert(isConsistentRange());
76 return extractElementIndex(this->second);
77 }

◆ empty()

bool ActsTrk::detail::MeasurementRange::empty ( ) const
inline

Definition at line 78 of file AtlasUncalibSourceLinkAccessor.h.

78{ assert(isConsistentRange()); return this->first == this->second; }
bool first
Definition DeMoScan.py:534

◆ extractContainerIndex()

constexpr unsigned int ActsTrk::detail::MeasurementRange::extractContainerIndex ( unsigned int value)
inlinestaticconstexpr

Definition at line 34 of file AtlasUncalibSourceLinkAccessor.h.

34 {
35 return (value & CONTAINER_IDX_MASK) >> CONTAINER_IDX_SHIFT;
36 }

◆ extractElementIndex()

constexpr unsigned int ActsTrk::detail::MeasurementRange::extractElementIndex ( unsigned int value)
inlinestaticconstexpr

Definition at line 37 of file AtlasUncalibSourceLinkAccessor.h.

37 {
38 return value & ELEMENT_IDX_MASK;
39 }

◆ isConsistentRange()

bool ActsTrk::detail::MeasurementRange::isConsistentRange ( ) const
inline

Definition at line 40 of file AtlasUncalibSourceLinkAccessor.h.

40 {
41 return extractContainerIndex(this->first) == extractContainerIndex(this->second)
42 && ( extractElementIndex(this->first) <= extractElementIndex(this->second)
43 || (extractElementIndex(this->first)==ELEMENT_IDX_MASK && extractElementIndex(this->second)==0));
44 }

◆ isMeasurementExpected()

bool ActsTrk::detail::MeasurementRange::isMeasurementExpected ( ) const
inline

Definition at line 79 of file AtlasUncalibSourceLinkAccessor.h.

79{ assert(isConsistentRange()); return this->first <= this->second; }

◆ noMeasurementExpected()

MeasurementRange ActsTrk::detail::MeasurementRange::noMeasurementExpected ( )
inlinestatic

◆ updateEnd()

void ActsTrk::detail::MeasurementRange::updateEnd ( std::size_t container_idx,
unsigned int end_element_idx )
inline

Definition at line 58 of file AtlasUncalibSourceLinkAccessor.h.

58 {
59 assert( extractContainerIndex(this->first) == container_idx);
60 this->second = createRangeValue(container_idx, end_element_idx);
61 }

Member Data Documentation

◆ CONTAINER_IDX_MASK

unsigned int ActsTrk::detail::MeasurementRange::CONTAINER_IDX_MASK = (1u << 31) | (1u << 30) | (1u << 29) | (1u << 28)
staticconstexpr

Definition at line 26 of file AtlasUncalibSourceLinkAccessor.h.

◆ CONTAINER_IDX_SHIFT

unsigned int ActsTrk::detail::MeasurementRange::CONTAINER_IDX_SHIFT = 28
staticconstexpr

Definition at line 25 of file AtlasUncalibSourceLinkAccessor.h.

◆ ELEMENT_IDX_MASK

unsigned int ActsTrk::detail::MeasurementRange::ELEMENT_IDX_MASK = ~CONTAINER_IDX_MASK
staticconstexpr

Definition at line 27 of file AtlasUncalibSourceLinkAccessor.h.

◆ first_type

T1 std::pair< T1, T2 >::first_type
inherited

STL member.

◆ second_type

T2 std::pair< T1, T2 >::second_type
inherited

STL member.


The documentation for this struct was generated from the following file: