#include <L2TauSimpleClustering.h>
Public Member Functions | |
math::PtEtaPhiELorentzVectorCollection | clusterize (const math::PtEtaPhiELorentzVectorCollection &) |
L2TauSimpleClustering (double) | |
L2TauSimpleClustering () | |
~L2TauSimpleClustering () | |
Private Attributes | |
double | m_clusterRadius |
Definition at line 15 of file L2TauSimpleClustering.h.
L2TauSimpleClustering::L2TauSimpleClustering | ( | ) |
Definition at line 5 of file L2TauSimpleClustering.cc.
References m_clusterRadius.
{ m_clusterRadius=0.08; }
L2TauSimpleClustering::L2TauSimpleClustering | ( | double | radius | ) |
Definition at line 10 of file L2TauSimpleClustering.cc.
References m_clusterRadius, and CosmicsPD_Skims::radius.
{ m_clusterRadius=radius; }
L2TauSimpleClustering::~L2TauSimpleClustering | ( | ) |
Definition at line 15 of file L2TauSimpleClustering.cc.
{}
math::PtEtaPhiELorentzVectorCollection L2TauSimpleClustering::clusterize | ( | const math::PtEtaPhiELorentzVectorCollection & | myRecHits | ) |
Definition at line 20 of file L2TauSimpleClustering.cc.
References h, j, and m_clusterRadius.
Referenced by L2TauModularIsolationProducer::produce(), L2TauNarrowConeIsolationProducer::produce(), and L2TauIsolationProducer::produce().
{ math::PtEtaPhiELorentzVectorCollection m_clusters; //If we have Hits do Clustering if(myRecHits.size()>0) { //Create the first Cluster by maximum Crystal m_clusters.push_back(myRecHits[0]); //Loop on The Clusters if there are at least two hits if(myRecHits.size()>=2) for(math::PtEtaPhiELorentzVectorCollection::const_iterator h = myRecHits.begin()+1;h!=myRecHits.end();++h) { //These vars are used to find the nearest clusters to this hits double dR_min=100; int ptr=0; int ptr_min=-1; for(math::PtEtaPhiELorentzVectorCollection::iterator j=m_clusters.begin()+1;j!=m_clusters.end();j++) { if(ROOT::Math::VectorUtil::DeltaR(*h,*j)<m_clusterRadius) { if(ROOT::Math::VectorUtil::DeltaR(*h,*j)<dR_min) { dR_min=ROOT::Math::VectorUtil::DeltaR(*h,*j); ptr_min=ptr; } } ptr++; } //If it does not belong to cluster add a new one else add the Crystal to the Cluster if(ptr_min==-1) m_clusters.push_back(*h); else m_clusters[ptr_min]+=*h; } } return m_clusters; }
double L2TauSimpleClustering::m_clusterRadius [private] |
Definition at line 31 of file L2TauSimpleClustering.h.
Referenced by clusterize(), and L2TauSimpleClustering().