CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
TrackAlgoPriorityOrder Class Reference

#include <TrackAlgoPriorityOrder.h>

Public Member Functions

unsigned int priority (reco::TrackBase::TrackAlgorithm algo) const
 
 TrackAlgoPriorityOrder (const std::vector< reco::TrackBase::TrackAlgorithm > &algoOrder)
 

Private Attributes

std::array< unsigned int, reco::TrackBase::algoSizepriority_
 

Detailed Description

Definition at line 6 of file TrackAlgoPriorityOrder.h.

Constructor & Destructor Documentation

TrackAlgoPriorityOrder::TrackAlgoPriorityOrder ( const std::vector< reco::TrackBase::TrackAlgorithm > &  algoOrder)
explicit

Definition at line 8 of file TrackAlgoPriorityOrder.cc.

References ecalcalib_dqm_sourceclient-live_cfg::algo, end, mps_fire::i, bookConverter::priorities(), priority_, and trackAlgoPriorityOrder.

10  // with less than 1 element there is nothing to do
11  if (algoOrder.size() <= 1)
12  return;
13 
14  // Reordering the algo priorities is just a matter of taking the
15  // current priorities of the algos, sorting them, and inserting back
16  //
17  // iter0 2 2
18  // iter1 4 -> 3
19  // iter2 3 4
20  std::vector<unsigned int> priorities;
21  priorities.reserve(algoOrder.size());
22  for (const auto algo : algoOrder) {
23  priorities.push_back(trackAlgoPriorityOrder[algo]);
24  }
25 
26  std::sort(priorities.begin(), priorities.end());
27 
28  for (size_t i = 0, end = priorities.size(); i != end; ++i) {
29  priority_[algoOrder[i]] = priorities[i];
30  }
31 }
std::array< unsigned int, reco::TrackBase::algoSize > priority_
#define end
Definition: vmac.h:39
std::array< unsigned int, reco::TrackBase::algoSize > trackAlgoPriorityOrder

Member Function Documentation

unsigned int TrackAlgoPriorityOrder::priority ( reco::TrackBase::TrackAlgorithm  algo) const
inline

Definition at line 10 of file TrackAlgoPriorityOrder.h.

References ecalcalib_dqm_sourceclient-live_cfg::algo, and priority_.

10 { return priority_[algo]; }
std::array< unsigned int, reco::TrackBase::algoSize > priority_

Member Data Documentation

std::array<unsigned int, reco::TrackBase::algoSize> TrackAlgoPriorityOrder::priority_
private

Definition at line 13 of file TrackAlgoPriorityOrder.h.

Referenced by priority(), and TrackAlgoPriorityOrder().