Main Page
Namespaces
Classes
Package Documentation
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Pages
RecoTauTag
HLTProducers
src
L2TauSimpleClustering.cc
Go to the documentation of this file.
1
#include "
RecoTauTag/HLTProducers/interface/L2TauSimpleClustering.h
"
2
#include "Math/GenVector/VectorUtil.h"
3
4
5
L2TauSimpleClustering::L2TauSimpleClustering
()
6
{
7
m_clusterRadius
=0.08;
8
}
9
10
L2TauSimpleClustering::L2TauSimpleClustering
(
double
radius
)
11
{
12
m_clusterRadius
=
radius
;
13
}
14
15
L2TauSimpleClustering::~L2TauSimpleClustering
()
16
{}
17
18
19
math::PtEtaPhiELorentzVectorCollection
20
L2TauSimpleClustering::clusterize
(
const
math::PtEtaPhiELorentzVectorCollection
& myRecHits)
21
{
22
23
math::PtEtaPhiELorentzVectorCollection
m_clusters;
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
}
63
L2TauSimpleClustering::~L2TauSimpleClustering
~L2TauSimpleClustering()
Definition:
L2TauSimpleClustering.cc:15
L2TauSimpleClustering::clusterize
math::PtEtaPhiELorentzVectorCollection clusterize(const math::PtEtaPhiELorentzVectorCollection &)
Definition:
L2TauSimpleClustering.cc:20
L2TauSimpleClustering::m_clusterRadius
double m_clusterRadius
Definition:
L2TauSimpleClustering.h:31
L2TauSimpleClustering.h
math::PtEtaPhiELorentzVectorCollection
std::vector< PtEtaPhiELorentzVector > PtEtaPhiELorentzVectorCollection
Definition:
LorentzVectorFwd.h:30
j
int j
Definition:
DBlmapReader.cc:9
h
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition:
Activities.doc:4
L2TauSimpleClustering::L2TauSimpleClustering
L2TauSimpleClustering()
Definition:
L2TauSimpleClustering.cc:5
HLT_25ns14e33_v1_cff.DeltaR
tuple DeltaR
Definition:
HLT_25ns14e33_v1_cff.py:6041
CosmicsPD_Skims.radius
tuple radius
Definition:
CosmicsPD_Skims.py:135
Generated for CMSSW Reference Manual by
1.8.5