CMS 3D CMS Logo

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

◆ decrease_sorted_indices()

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

Definition at line 14 of file ComputeClusterTime.cc.

References testProducerWithPsetDescEmpty_cfi::i1, testProducerWithPsetDescEmpty_cfi::i2, heavyIonCSV_trainingSettings::idx, jetUpdater_cfi::sort, and 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 };