CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
TrackAlgoPriorityOrder.cc
Go to the documentation of this file.
2 
5 
7 
8 TrackAlgoPriorityOrder::TrackAlgoPriorityOrder(const std::vector<reco::TrackBase::TrackAlgorithm>& algoOrder)
9  : priority_(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 }
TrackAlgoPriorityOrder(const std::vector< reco::TrackBase::TrackAlgorithm > &algoOrder)
std::array< unsigned int, reco::TrackBase::algoSize > priority_
constexpr std::array< unsigned int, reco::TrackBase::algoSize > trackAlgoPriorityOrder
string end
Definition: dataset.py:937