CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Attributes
HGCalDepthPreClusterer Class Reference

#include <HGCalDepthPreClusterer.h>

Public Types

typedef std::vector< reco::BasicClusterClusterCollection
 

Public Member Functions

void getEvent (const edm::Event &ev)
 
void getEventSetup (const edm::EventSetup &es)
 
 HGCalDepthPreClusterer ()
 
 HGCalDepthPreClusterer (const edm::ParameterSet &conf, edm::ConsumesCollector &sumes, double radius_in, uint32_t min_clusters)
 
std::vector< reco::HGCalMultiClustermakePreClusters (const reco::HGCalMultiCluster::ClusterCollection &) const
 

Private Attributes

std::unique_ptr< hgcal::ClusterToolsclusterTools
 
uint32_t minClusters
 
float radius
 

Detailed Description

Definition at line 13 of file HGCalDepthPreClusterer.h.

Member Typedef Documentation

Definition at line 30 of file HGCalDepthPreClusterer.h.

Constructor & Destructor Documentation

HGCalDepthPreClusterer::HGCalDepthPreClusterer ( )
inline

Definition at line 17 of file HGCalDepthPreClusterer.h.

17  : radius(0.), minClusters(0.), clusterTools(nullptr)
18  {
19  }
std::unique_ptr< hgcal::ClusterTools > clusterTools
HGCalDepthPreClusterer::HGCalDepthPreClusterer ( const edm::ParameterSet conf,
edm::ConsumesCollector sumes,
double  radius_in,
uint32_t  min_clusters 
)
inline

Definition at line 21 of file HGCalDepthPreClusterer.h.

21  :
22  radius(radius_in),
23  minClusters(min_clusters),
24  clusterTools(std::make_unique<hgcal::ClusterTools>(conf,sumes)) {
25  }
std::unique_ptr< hgcal::ClusterTools > clusterTools

Member Function Documentation

void HGCalDepthPreClusterer::getEvent ( const edm::Event ev)
inline

Definition at line 27 of file HGCalDepthPreClusterer.h.

References clusterTools.

27 { clusterTools->getEvent(ev); }
std::unique_ptr< hgcal::ClusterTools > clusterTools
void HGCalDepthPreClusterer::getEventSetup ( const edm::EventSetup es)
inline

Definition at line 28 of file HGCalDepthPreClusterer.h.

References clusterTools.

28 { clusterTools->getEventSetup(es); }
std::unique_ptr< hgcal::ClusterTools > clusterTools
std::vector< reco::HGCalMultiCluster > HGCalDepthPreClusterer::makePreClusters ( const reco::HGCalMultiCluster::ClusterCollection thecls) const

Definition at line 26 of file HGCalDepthPreClusterer.cc.

References clusterTools, i, createfilelist::int, j, minClusters, reco::HGCalMultiCluster::push_back(), radius, reco::HGCalMultiCluster::size(), sorted_indices(), groupFilesInBlocks::temp, and z.

26  {
27 
28  std::vector<reco::HGCalMultiCluster> thePreClusters;
29  std::vector<size_t> es = sorted_indices(thecls);
30  std::vector<int> vused(es.size(),0);
31  unsigned int used = 0;
32  const float radius2 = radius*radius;
33 
34  for(unsigned int i = 0; i < es.size(); ++i) {
35  if(vused[i]==0) {
37  temp.push_back(thecls[es[i]]);
38  vused[i]=(thecls[es[i]]->z()>0)? 1 : -1;
39  ++used;
40  for(unsigned int j = i+1; j < es.size(); ++j) {
41  if(vused[j]==0) {
42  if( dist2(thecls[es[i]],thecls[es[j]]) < radius2 && int(thecls[es[i]]->z()*vused[i])>0 ) {
43  temp.push_back(thecls[es[j]]);
44  vused[j]=vused[i];
45  ++used;
46  }
47  }
48  }
49  if( temp.size() > minClusters ) {
50  thePreClusters.push_back(temp);
51  auto& back = thePreClusters.back();
52  back.setPosition(clusterTools->getMultiClusterPosition(back));
53  back.setEnergy(clusterTools->getMultiClusterEnergy(back));
54  }
55  }
56  }
57 
58 
59 
60  return thePreClusters;
61 }
int i
Definition: DBlmapReader.cc:9
std::unique_ptr< hgcal::ClusterTools > clusterTools
unsigned int size() const
void push_back(const edm::Ptr< reco::BasicCluster > &b)
int j
Definition: DBlmapReader.cc:9
std::vector< size_t > sorted_indices(const std::vector< T > &v)

Member Data Documentation

std::unique_ptr<hgcal::ClusterTools> HGCalDepthPreClusterer::clusterTools
private

Definition at line 39 of file HGCalDepthPreClusterer.h.

Referenced by getEvent(), getEventSetup(), and makePreClusters().

uint32_t HGCalDepthPreClusterer::minClusters
private

Definition at line 37 of file HGCalDepthPreClusterer.h.

Referenced by makePreClusters().

float HGCalDepthPreClusterer::radius
private

Definition at line 36 of file HGCalDepthPreClusterer.h.

Referenced by makePreClusters().