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
EgammaHLTEcalIsolation Class Reference

#include <RecoEgamma/EgammaHLTAlgos/interface/EgammaHLTEcalIsolation.h>

Public Member Functions

 EgammaHLTEcalIsolation (double egEcalIso_EtMin, double egEcalIso_ConeSize, int SC_algo_type)
 
float getConeSize ()
 Get isolation cone size. More...
 
float getetMin ()
 Get Et cut for ecal hits. More...
 
float isolPtSum (const reco::RecoCandidate *recocandidate, const std::vector< const reco::SuperCluster * > &sclusters, const std::vector< const reco::BasicCluster * > &bclusters)
 

Private Attributes

int algoType_
 
double conesize
 
double etMin
 

Detailed Description

Description: sum Et of all island basic clusters in cone around candidate

Definition at line 26 of file EgammaHLTEcalIsolation.h.

Constructor & Destructor Documentation

EgammaHLTEcalIsolation::EgammaHLTEcalIsolation ( double  egEcalIso_EtMin,
double  egEcalIso_ConeSize,
int  SC_algo_type 
)
inline

Definition at line 32 of file EgammaHLTEcalIsolation.h.

32  :
33  etMin(egEcalIso_EtMin), conesize(egEcalIso_ConeSize), algoType_(SC_algo_type) {
34  /*
35  std::cout << "EgammaHLTEcalIsolation instance:"
36  << " ptMin=" << etMin
37  << " conesize=" << conesize
38  << std::endl;
39  */
40 
41  }

Member Function Documentation

float EgammaHLTEcalIsolation::getConeSize ( )
inline

Get isolation cone size.

Definition at line 50 of file EgammaHLTEcalIsolation.h.

References conesize.

50 { return conesize; }
float EgammaHLTEcalIsolation::getetMin ( )
inline

Get Et cut for ecal hits.

Definition at line 48 of file EgammaHLTEcalIsolation.h.

References etMin.

48 { return etMin; }
float EgammaHLTEcalIsolation::isolPtSum ( const reco::RecoCandidate recocandidate,
const std::vector< const reco::SuperCluster * > &  sclusters,
const std::vector< const reco::BasicCluster * > &  bclusters 
)

Definition at line 22 of file EgammaHLTEcalIsolation.cc.

References algoType_, reco::SuperCluster::clustersBegin(), reco::SuperCluster::clustersEnd(), conesize, reco::CaloCluster::eta(), etMin, create_public_lumi_plots::exp, reco::CaloCluster::phi(), PI, reco::SuperCluster::seed(), funct::sin(), mathSSE::sqrt(), reco::RecoCandidate::superCluster(), and TWOPI.

Referenced by EgammaHLTEcalIsolationProducersRegional::produce().

24  {
25 
26  float ecalIsol=0.;
27 
28  float candSCphi = recocandidate->superCluster()->phi();
29  float candSCeta = recocandidate->superCluster()->eta();
30 
31 
32  // match the photon hybrid supercluster with those with Algo==0 (island)
33  float delta1=1000.;
34  float deltacur=1000.;
35  const reco::SuperCluster *matchedsupercluster=0;
36  bool MATCHEDSC = false;
37 
38 
39 
40  for(std::vector<const reco::SuperCluster*>::const_iterator scItr = sclusters.begin(); scItr != sclusters.end(); ++scItr){
41 
42 
43  const reco::SuperCluster *supercluster = *scItr;
44 
45  float SCphi = supercluster->phi();
46  float SCeta = supercluster->eta();
47 
48  if(supercluster->seed()->algo() == algoType_){
49  float deltaphi;
50  if(candSCphi<0) candSCphi+=TWOPI;
51  if(SCphi<0) SCphi+=TWOPI;
52  deltaphi=fabs(candSCphi-SCphi);
53  if(deltaphi>TWOPI) deltaphi-=TWOPI;
54  if(deltaphi>PI) deltaphi=TWOPI-deltaphi;
55  float deltaeta=fabs(SCeta-candSCeta);
56  deltacur = sqrt(deltaphi*deltaphi+ deltaeta*deltaeta);
57 
58  if (deltacur < delta1) {
59  delta1=deltacur;
60  matchedsupercluster = supercluster;
61  MATCHEDSC = true;
62  }
63  }
64  }
65 
66  const reco::BasicCluster *cluster= 0;
67 
68  //loop over basic clusters
69  for(std::vector<const reco::BasicCluster*>::const_iterator cItr = bclusters.begin(); cItr != bclusters.end(); ++cItr){
70 
71  cluster = *cItr;
72 // float ebc_bcchi2 = cluster->chi2(); //chi2 for SC was useless and it is removed in 31x
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)));
78  float newDelta;
79 
80 
81  if (ebc_bcet > etMin && ebc_bcalgo == algoType_ ) {
82  // if (ebc_bcchi2 < 30.) {
83 
84  if(MATCHEDSC){
85  bool inSuperCluster = false;
86 
87  reco::CaloCluster_iterator theEclust = matchedsupercluster->clustersBegin();
88  // loop over the basic clusters of the matched supercluster
89  for(;theEclust != matchedsupercluster->clustersEnd();
90  theEclust++) {
91  if (&(**theEclust) == cluster) inSuperCluster = true;
92  }
93  if (!inSuperCluster) {
94  float deltaphi;
95  if(ebc_bcphi<0) ebc_bcphi+=TWOPI;
96  if(candSCphi<0) candSCphi+=TWOPI;
97  deltaphi=fabs(ebc_bcphi-candSCphi);
98  if(deltaphi>TWOPI) deltaphi-=TWOPI;
99  if(deltaphi>PI) deltaphi=TWOPI-deltaphi;
100  float deltaeta=fabs(ebc_bceta-candSCeta);
101  newDelta= sqrt(deltaphi*deltaphi+ deltaeta*deltaeta);
102  if(newDelta < conesize) {
103  ecalIsol+=ebc_bcet;
104  }
105  }
106  }
107  // } // matches ebc_bcchi2
108  } // matches ebc_bcet && ebc_bcalgo
109 
110  }
111 
112 
113  return ecalIsol;
114 
115 }
#define PI
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
double eta() const
pseudorapidity of cluster centroid
Definition: CaloCluster.h:161
T sqrt(T t)
Definition: SSEVec.h:48
#define TWOPI
CaloCluster_iterator clustersBegin() const
fist iterator over BasicCluster constituents
Definition: SuperCluster.h:75
const CaloClusterPtr & seed() const
seed BasicCluster
Definition: SuperCluster.h:66
double phi() const
azimuthal angle of cluster centroid
Definition: CaloCluster.h:164
virtual reco::SuperClusterRef superCluster() const
reference to a SuperCluster
CaloCluster_iterator clustersEnd() const
last iterator over BasicCluster constituents
Definition: SuperCluster.h:78

Member Data Documentation

int EgammaHLTEcalIsolation::algoType_
private

Definition at line 60 of file EgammaHLTEcalIsolation.h.

Referenced by isolPtSum().

double EgammaHLTEcalIsolation::conesize
private

Definition at line 59 of file EgammaHLTEcalIsolation.h.

Referenced by getConeSize(), and isolPtSum().

double EgammaHLTEcalIsolation::etMin
private

Definition at line 58 of file EgammaHLTEcalIsolation.h.

Referenced by getetMin(), and isolPtSum().