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 9 of file TrackAlgoPriorityOrder.cc.

References patPFMETCorrections_cff::algo, end, mps_fire::i, bookConverter::priorities(), priority_, and trackAlgoPriorityOrder.

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

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

Member Data Documentation

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

Definition at line 15 of file TrackAlgoPriorityOrder.h.

Referenced by priority(), and TrackAlgoPriorityOrder().