19 #define PI 3.141592654
20 #define TWOPI 6.283185308
24 const std::vector<const reco::SuperCluster*> sclusters,
25 const std::vector<const reco::BasicCluster*> bclusters){
37 bool MATCHEDSC =
false;
41 for(std::vector<const reco::SuperCluster*>::const_iterator scItr = sclusters.begin(); scItr != sclusters.end(); ++scItr){
46 float SCphi = supercluster->
phi();
47 float SCeta = supercluster->
eta();
51 if(candSCphi<0) candSCphi+=
TWOPI;
52 if(SCphi<0) SCphi+=
TWOPI;
53 deltaphi=fabs(candSCphi-SCphi);
55 if(deltaphi>
PI) deltaphi=
TWOPI-deltaphi;
56 float deltaeta=fabs(SCeta-candSCeta);
57 deltacur =
sqrt(deltaphi*deltaphi+ deltaeta*deltaeta);
59 if (deltacur < delta1) {
61 matchedsupercluster = supercluster;
70 for(std::vector<const reco::BasicCluster*>::const_iterator cItr = bclusters.begin(); cItr != bclusters.end(); ++cItr){
74 int ebc_bcalgo = cluster->algo();
75 float ebc_bce = cluster->energy();
76 float ebc_bceta = cluster->eta();
77 float ebc_bcphi = cluster->phi();
78 float ebc_bcet = ebc_bce*
sin(2*atan(
exp(ebc_bceta)));
86 bool inSuperCluster =
false;
90 for(;theEclust != matchedsupercluster->
clustersEnd();
92 if (&(**theEclust) == cluster) inSuperCluster =
true;
94 if (!inSuperCluster) {
96 if(ebc_bcphi<0) ebc_bcphi+=
TWOPI;
97 if(candSCphi<0) candSCphi+=
TWOPI;
98 deltaphi=fabs(ebc_bcphi-candSCphi);
100 if(deltaphi>
PI) deltaphi=
TWOPI-deltaphi;
101 float deltaeta=fabs(ebc_bceta-candSCeta);
102 newDelta=
sqrt(deltaphi*deltaphi+ deltaeta*deltaeta);
Sin< T >::type sin(const T &t)
Exp< T >::type exp(const T &t)
double eta() const
pseudorapidity of cluster centroid
CaloCluster_iterator clustersBegin() const
fist iterator over BasicCluster constituents
const CaloClusterPtr & seed() const
seed BasicCluster
double phi() const
azimuthal angle of cluster centroid
float isolPtSum(const reco::RecoCandidate *recocandidate, const std::vector< const reco::SuperCluster * > sclusters, const std::vector< const reco::BasicCluster * > bclusters)
virtual reco::SuperClusterRef superCluster() const
reference to a SuperCluster
CaloCluster_iterator clustersEnd() const
last iterator over BasicCluster constituents