CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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

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

Definition at line 44 of file HGCalClusteringAlgoBase.h.

Function Documentation

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

Definition at line 31 of file HGCalClusteringAlgoBase.h.

References SplitLinear::begin, dataset::end, and findQualityFiles::v.

Referenced by CSCXonStrip_MatchGatti::findXOnStrip(), HGCalImagingAlgo::getClusters(), 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  }
string end
Definition: dataset.py:937
template<typename T >
std::vector<size_t> hgcal_clustering::sorted_indices ( const std::vector< T > &  v)

Definition at line 19 of file HGCalClusteringAlgoBase.h.

References SplitLinear::begin, dataset::end, and findQualityFiles::v.

Referenced by HGCalImagingAlgo::calculateDistanceToHigher(), HGCalImagingAlgo::findAndAssignClusters(), HGCalDepthPreClusterer::makePreClusters(), and HGCal3DClustering::organizeByLayer().

19  {
20  // initialize original index locations
21  std::vector<size_t> idx(v.size());
22  std::iota(std::begin(idx), std::end(idx), 0);
23 
24  // sort indices based on comparing values in v
25  std::sort(idx.begin(), idx.end(), [&v](size_t i1, size_t i2) { return v[i1] > v[i2]; });
26 
27  return idx;
28  }
string end
Definition: dataset.py:937