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

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

Definition at line 47 of file HGCalClusteringAlgoBase.h.

Function Documentation

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

Definition at line 34 of file HGCalClusteringAlgoBase.h.

References begin, end, training_settings::idx, and findQualityFiles::v.

Referenced by CSCXonStrip_MatchGatti::findXOnStrip(), HGCalCLUEAlgo::getClusters(), and HGCalImagingAlgo::getClusters().

34  {
35 
36  // initialize original index locations
37  std::vector<size_t> idx(v.size(),0);
38  std::iota (std::begin(idx), std::end(idx), 0);
39 
40  // take the max index based on comparing values in v
41  auto maxidx = std::max_element(idx.begin(), idx.end(), [&v](size_t i1, size_t i2) {return v[i1].data.rho < v[i2].data.rho;});
42 
43  return (*maxidx);
44 }
#define end
Definition: vmac.h:39
#define begin
Definition: vmac.h:32
template<typename T >
std::vector<size_t> hgcal_clustering::sorted_indices ( const std::vector< T > &  v)

Definition at line 18 of file HGCalClusteringAlgoBase.h.

References begin, end, training_settings::idx, and findQualityFiles::v.

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

18  {
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(),
26  [&v](size_t i1, size_t i2) {
27  return v[i1] > v[i2];
28  });
29 
30  return idx;
31 }
#define end
Definition: vmac.h:39
#define begin
Definition: vmac.h:32