18 #define PI 3.141592654 19 #define TWOPI 6.283185308 23 const std::vector<const reco::SuperCluster*>& sclusters,
24 const std::vector<const reco::BasicCluster*>& bclusters)
const {
36 bool MATCHEDSC =
false;
40 for(std::vector<const reco::SuperCluster*>::const_iterator scItr = sclusters.begin(); scItr != sclusters.end(); ++scItr){
45 float SCphi = supercluster->
phi();
46 float SCeta = supercluster->
eta();
50 if(candSCphi<0) candSCphi+=
TWOPI;
51 if(SCphi<0) SCphi+=
TWOPI;
52 deltaphi=fabs(candSCphi-SCphi);
54 if(deltaphi>
PI) deltaphi=
TWOPI-deltaphi;
55 float deltaeta=fabs(SCeta-candSCeta);
56 deltacur =
sqrt(deltaphi*deltaphi+ deltaeta*deltaeta);
58 if (deltacur < delta1) {
60 matchedsupercluster = supercluster;
69 for(std::vector<const reco::BasicCluster*>::const_iterator cItr = bclusters.begin(); cItr != bclusters.end(); ++cItr){
73 int ebc_bcalgo = cluster->algo();
74 float ebc_bce = cluster->energy();
75 float ebc_bceta = cluster->eta();
76 float ebc_bcphi = cluster->phi();
77 float ebc_bcet = ebc_bce*
sin(2*atan(
exp(ebc_bceta)));
85 bool inSuperCluster =
false;
89 for(;theEclust != matchedsupercluster->
clustersEnd();
91 if (&(**theEclust) == cluster) inSuperCluster =
true;
93 if (!inSuperCluster) {
95 if(ebc_bcphi<0) ebc_bcphi+=
TWOPI;
96 if(candSCphi<0) candSCphi+=
TWOPI;
97 deltaphi=fabs(ebc_bcphi-candSCphi);
99 if(deltaphi>
PI) deltaphi=
TWOPI-deltaphi;
100 float deltaeta=fabs(ebc_bceta-candSCeta);
101 newDelta=
sqrt(deltaphi*deltaphi+ deltaeta*deltaeta);
Sin< T >::type sin(const T &t)
double eta() const
pseudorapidity of cluster centroid
float isolPtSum(const reco::RecoCandidate *recocandidate, const std::vector< const reco::SuperCluster * > &sclusters, const std::vector< const reco::BasicCluster * > &bclusters) const
CaloCluster_iterator clustersBegin() const
fist iterator over BasicCluster constituents
const CaloClusterPtr & seed() const
seed BasicCluster
double phi() const
azimuthal angle of cluster centroid
virtual reco::SuperClusterRef superCluster() const
reference to a SuperCluster
CaloCluster_iterator clustersEnd() const
last iterator over BasicCluster constituents