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 27 of file EgammaHLTEcalIsolation.h.

Constructor & Destructor Documentation

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

Definition at line 33 of file EgammaHLTEcalIsolation.h.

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

Member Function Documentation

float EgammaHLTEcalIsolation::getConeSize ( )
inline

Get isolation cone size.

Definition at line 51 of file EgammaHLTEcalIsolation.h.

References conesize.

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

Get Et cut for ecal hits.

Definition at line 49 of file EgammaHLTEcalIsolation.h.

References etMin.

49 { 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 23 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().

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

Member Data Documentation

int EgammaHLTEcalIsolation::algoType_
private

Definition at line 61 of file EgammaHLTEcalIsolation.h.

Referenced by isolPtSum().

double EgammaHLTEcalIsolation::conesize
private

Definition at line 60 of file EgammaHLTEcalIsolation.h.

Referenced by getConeSize(), and isolPtSum().

double EgammaHLTEcalIsolation::etMin
private

Definition at line 59 of file EgammaHLTEcalIsolation.h.

Referenced by getetMin(), and isolPtSum().