CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Functions
ComputeClusterTime.cc File Reference
#include "RecoLocalCalo/HGCalRecProducers/interface/ComputeClusterTime.h"

Go to the source code of this file.

Functions

std::vector< size_t > decrease_sorted_indices (const std::vector< float > &v)
 

Function Documentation

std::vector<size_t> decrease_sorted_indices ( const std::vector< float > &  v)

Definition at line 14 of file ComputeClusterTime.cc.

References findQualityFiles::v.

Referenced by hgcalsimclustertime::ComputeClusterTime::fixSizeHighestDensity().

14  {
15  // initialize original index locations
16  std::vector<size_t> idx(v.size());
17  std::iota(idx.begin(), idx.end(), 0);
18 
19  // sort indices based on comparing values in v (decreasing order)
20  std::sort(idx.begin(), idx.end(), [&v](size_t i1, size_t i2) { return v[i1] < v[i2]; });
21  return idx;
22 };