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.

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  }

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

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  }

References mps_fire::end, testProducerWithPsetDescEmpty_cfi::i1, testProducerWithPsetDescEmpty_cfi::i2, heavyIonCSV_trainingSettings::idx, jetUpdater_cfi::sort, 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
jetUpdater_cfi.sort
sort
Definition: jetUpdater_cfi.py:29