CMS 3D CMS Logo

Typedefs | Functions
hgcal_clustering Namespace Reference

Typedefs

typedef std::map< DetId, float > Density
 

Functions

template<typename T >
size_t max_index (const std::vector< T > &v)
 
template<typename T >
std::vector< size_t > sorted_indices (const std::vector< T > &v)
 

Typedef Documentation

◆ Density

typedef std::map<DetId, float> hgcal_clustering::Density

Definition at line 44 of file HGCalClusteringAlgoBase.h.

Function Documentation

◆ max_index()

template<typename T >
size_t hgcal_clustering::max_index ( const std::vector< T > &  v)

Definition at line 31 of file HGCalClusteringAlgoBase.h.

References testProducerWithPsetDescEmpty_cfi::i1, testProducerWithPsetDescEmpty_cfi::i2, heavyIonCSV_trainingSettings::idx, and findQualityFiles::v.

Referenced by CSCXonStrip_MatchGatti::findXOnStrip(), HGCalImagingAlgo::getClusters(), l1tVertexFinder::VertexFinder::NNVtxEmulation(), and TICLCandidateFromTrackstersProducer::produce().

31  {
32  // initialize original index locations
33  std::vector<size_t> idx(v.size(), 0);
34  std::iota(std::begin(idx), std::end(idx), 0);
35 
36  // take the max index based on comparing values in v
37  auto maxidx = std::max_element(
38  idx.begin(), idx.end(), [&v](size_t i1, size_t i2) { return v[i1].data.rho < v[i2].data.rho; });
39 
40  return (*maxidx);
41  }

◆ sorted_indices()

template<typename T >
std::vector<size_t> hgcal_clustering::sorted_indices ( const std::vector< T > &  v)