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 43 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 30 of file HGCalClusteringAlgoBase.h.

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

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

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

◆ sorted_indices()

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

Definition at line 18 of file HGCalClusteringAlgoBase.h.

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

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

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

testProducerWithPsetDescEmpty_cfi.i2
i2
Definition: testProducerWithPsetDescEmpty_cfi.py:46
testProducerWithPsetDescEmpty_cfi.i1
i1
Definition: testProducerWithPsetDescEmpty_cfi.py:45
findQualityFiles.v
v
Definition: findQualityFiles.py:179
heavyIonCSV_trainingSettings.idx
idx
Definition: heavyIonCSV_trainingSettings.py:5
mps_fire.end
end
Definition: mps_fire.py:242