CMS 3D CMS Logo

Classes | Functions | Variables
impl Namespace Reference

Classes

struct  MakeArray
 
struct  MakeArray< T, N, 0 >
 

Functions

constexpr unsigned int findIndex (const reco::TrackBase::TrackAlgorithm algo, const unsigned int index)
 
template<typename T , size_t N>
constexpr std::array< T, NmakeArray ()
 
constexpr unsigned int priorityForAlgo (const reco::TrackBase::TrackAlgorithm algo)
 

Variables

constexpr reco::TrackBase::TrackAlgorithm algoPriorityOrder []
 

Detailed Description

To obtain the priority order, please use the TrackAlgoPriorityOrder class instead. This header is internal to it, and exists in a separate file only to allow a unit test to be run.

The trackAlgoPriorityOrder maps an reco::TrackBase::TrackAlgorithm enumerator to its priority in track list merging. The mapping is needed because the order of the enumerators themselves does not, in general, convey useful information.

Function Documentation

◆ findIndex()

constexpr unsigned int impl::findIndex ( const reco::TrackBase::TrackAlgorithm  algo,
const unsigned int  index 
)
constexpr

Recursive implementation of searching the index of an algorithm in the algoPriorityOrder

Parameters
algoAlgorithm whose index is searched for
indexCurrent index
Returns
Index of the algorithm; if not found results compile error

Definition at line 86 of file trackAlgoPriorityOrder.h.

86  {
87  return index < sizeof(algoPriorityOrder)/sizeof(unsigned int) ?
89  throw "Index out of bounds, this means that some reco::TrackBase::TrackAlgorithm enumerator is missing from impl::algoPriorityOrder array.";
90  }

References algoPriorityOrder.

Referenced by priorityForAlgo().

◆ makeArray()

template<typename T , size_t N>
constexpr std::array<T, N> impl::makeArray ( )
constexpr

Create compile-time an std::array mapping reco::TrackBase::TrackAlgorithm enumerators to their order priorities as defined in impl::algoPriorityOrder array.

Template Parameters
Tvalue_type of the std::array
NSize of the std::array

Definition at line 147 of file trackAlgoPriorityOrder.h.

147  {
148  return MakeArray<T, N, N>::value();
149  }

References impl::MakeArray< T, N, I >::value().

◆ priorityForAlgo()

constexpr unsigned int impl::priorityForAlgo ( const reco::TrackBase::TrackAlgorithm  algo)
constexpr

Find the order priority for a track algorithm

Parameters
algoalgorithm whose index is searched for
Returns
Index of the algorithm in impl::algoPriorityOrder array; if not found results compile error
See also
findIndex()

Definition at line 101 of file trackAlgoPriorityOrder.h.

101 { return findIndex(algo, 0); }

References findIndex().

Referenced by impl::MakeArray< T, N, I >::value().

Variable Documentation

◆ algoPriorityOrder

constexpr reco::TrackBase::TrackAlgorithm impl::algoPriorityOrder[]
constexpr

This array defines the priority order in merging for the algorithms. The order is ascending, i.e. the first algorithm has the highest priority etc. The size of the array should be reco::TrackBase:algoSize (checked below with static_assert), and each reco::TrackBase::TrackAlgorithm enumerator should be in the array exactly once (checked below in findIndex() function).

Definition at line 28 of file trackAlgoPriorityOrder.h.

Referenced by findIndex().

cmsdt::algo
algo
Definition: constants.h:171
impl::algoPriorityOrder
constexpr reco::TrackBase::TrackAlgorithm algoPriorityOrder[]
Definition: trackAlgoPriorityOrder.h:28
impl::findIndex
constexpr unsigned int findIndex(const reco::TrackBase::TrackAlgorithm algo, const unsigned int index)
Definition: trackAlgoPriorityOrder.h:86
relativeConstraints.value
value
Definition: relativeConstraints.py:53
AlignmentPI::index
index
Definition: AlignmentPayloadInspectorHelper.h:46