CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
L2TauSimpleClustering Class Reference

#include <L2TauSimpleClustering.h>

Public Member Functions

math::PtEtaPhiELorentzVectorCollection clusterize (const math::PtEtaPhiELorentzVectorCollection &)
 
 L2TauSimpleClustering ()
 
 L2TauSimpleClustering (double)
 
 ~L2TauSimpleClustering ()
 

Private Attributes

double m_clusterRadius
 

Detailed Description

Definition at line 15 of file L2TauSimpleClustering.h.

Constructor & Destructor Documentation

L2TauSimpleClustering::L2TauSimpleClustering ( )

Definition at line 5 of file L2TauSimpleClustering.cc.

References m_clusterRadius.

6 {
7  m_clusterRadius=0.08;
8 }
L2TauSimpleClustering::L2TauSimpleClustering ( double  radius)

Definition at line 10 of file L2TauSimpleClustering.cc.

References m_clusterRadius, and CosmicsPD_Skims::radius.

L2TauSimpleClustering::~L2TauSimpleClustering ( )

Definition at line 15 of file L2TauSimpleClustering.cc.

16 {}

Member Function Documentation

math::PtEtaPhiELorentzVectorCollection L2TauSimpleClustering::clusterize ( const math::PtEtaPhiELorentzVectorCollection myRecHits)

Definition at line 20 of file L2TauSimpleClustering.cc.

References h, j, and m_clusterRadius.

Referenced by L2TauIsolationProducer::produce(), L2TauModularIsolationProducer::produce(), and L2TauNarrowConeIsolationProducer::produce().

21 {
22 
24 
25  //If we have Hits do Clustering
26  if(myRecHits.size()>0)
27  {
28  //Create the first Cluster by maximum Crystal
29  m_clusters.push_back(myRecHits[0]);
30 
31  //Loop on The Clusters if there are at least two hits
32  if(myRecHits.size()>=2)
33  for(math::PtEtaPhiELorentzVectorCollection::const_iterator h = myRecHits.begin()+1;h!=myRecHits.end();++h)
34  {
35  //These vars are used to find the nearest clusters to this hits
36  double dR_min=100;
37  int ptr=0;
38  int ptr_min=-1;
39 
40  for(math::PtEtaPhiELorentzVectorCollection::iterator j=m_clusters.begin()+1;j!=m_clusters.end();j++)
41  {
42  if(ROOT::Math::VectorUtil::DeltaR(*h,*j)<m_clusterRadius)
43  {
44  if(ROOT::Math::VectorUtil::DeltaR(*h,*j)<dR_min)
45  {
46  dR_min=ROOT::Math::VectorUtil::DeltaR(*h,*j);
47  ptr_min=ptr;
48  }
49  }
50  ptr++;
51  }
52 
53  //If it does not belong to cluster add a new one else add the Crystal to the Cluster
54  if(ptr_min==-1)
55  m_clusters.push_back(*h);
56  else
57  m_clusters[ptr_min]+=*h;
58  }
59 
60  }
61  return m_clusters;
62 }
std::vector< PtEtaPhiELorentzVector > PtEtaPhiELorentzVectorCollection
int j
Definition: DBlmapReader.cc:9
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4

Member Data Documentation

double L2TauSimpleClustering::m_clusterRadius
private

Definition at line 31 of file L2TauSimpleClustering.h.

Referenced by clusterize(), and L2TauSimpleClustering().