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

#include <EgammaEcalIsolation.h>

Public Member Functions

 EgammaEcalIsolation (double extRadius, double etLow, const reco::BasicClusterCollection *, const reco::SuperClusterCollection *)
 
double getEcalEtSum (const reco::Candidate *)
 
 ~EgammaEcalIsolation ()
 

Private Attributes

const
reco::BasicClusterCollection
basicClusterCollection_
 
double conesize
 
double etMin
 
const
reco::SuperClusterCollection
superClusterCollection_
 

Detailed Description

Definition at line 28 of file EgammaEcalIsolation.h.

Constructor & Destructor Documentation

EgammaEcalIsolation::EgammaEcalIsolation ( double  extRadius,
double  etLow,
const reco::BasicClusterCollection basicClusterCollection,
const reco::SuperClusterCollection superClusterCollection 
)

Definition at line 23 of file EgammaEcalIsolation.cc.

26  :
27  etMin(etLow),
28  conesize(extRadius),
29  basicClusterCollection_(basicClusterCollection),
30  superClusterCollection_(superClusterCollection)
31 {
32 }
const reco::SuperClusterCollection * superClusterCollection_
const reco::BasicClusterCollection * basicClusterCollection_
EgammaEcalIsolation::~EgammaEcalIsolation ( )

Definition at line 34 of file EgammaEcalIsolation.cc.

34 {}

Member Function Documentation

double EgammaEcalIsolation::getEcalEtSum ( const reco::Candidate candidate)

Definition at line 36 of file EgammaEcalIsolation.cc.

References basicClusterCollection_, reco::SuperCluster::clustersBegin(), reco::SuperCluster::clustersEnd(), conesize, etMin, create_public_lumi_plots::exp, reco::Candidate::get(), edm::Ref< C, T, F >::get(), reco::CaloCluster::position(), position, reco::SuperCluster::seed(), funct::sin(), and superClusterCollection_.

36  {
37 
38 
39  double ecalIsol=0.;
41  math::XYZVector position(sc.get()->position().x(),
42  sc.get()->position().y(),
43  sc.get()->position().z());
44 
45  // match the photon hybrid supercluster with those with Algo==0 (island)
46  double delta1=1000.;
47  double deltacur=1000.;
48  const reco::SuperCluster *matchedsupercluster=0;
49  bool MATCHEDSC = false;
50 
51  for(reco::SuperClusterCollection::const_iterator scItr = superClusterCollection_->begin(); scItr != superClusterCollection_->end(); ++scItr){
52 
53  const reco::SuperCluster *supercluster = &(*scItr);
54 
55  math::XYZVector currentPosition(supercluster->position().x(),
56  supercluster->position().y(),
57  supercluster->position().z());
58 
59 
60  if(supercluster->seed()->algo() == 0){
61  deltacur = DeltaR(currentPosition, position);
62 
63  if (deltacur < delta1) {
64  delta1=deltacur;
65  matchedsupercluster = supercluster;
66  MATCHEDSC = true;
67  }
68  }
69  }
70 
71  const reco::BasicCluster *cluster= 0;
72 
73  //loop over basic clusters
74  for(reco::BasicClusterCollection::const_iterator cItr = basicClusterCollection_->begin(); cItr != basicClusterCollection_->end(); ++cItr){
75 
76  cluster = &(*cItr);
77 // double ebc_bcchi2 = cluster->chi2();
78  int ebc_bcalgo = cluster->algo();
79  double ebc_bce = cluster->energy();
80  double ebc_bceta = cluster->eta();
81  double ebc_bcet = ebc_bce*sin(2*atan(exp(ebc_bceta)));
82  double newDelta = 0.;
83 
84 
85  if (ebc_bcet > etMin && ebc_bcalgo == 0) {
86  // if (ebc_bcchi2 < 30.) {
87 
88  if(MATCHEDSC){
89  bool inSuperCluster = false;
90 
91  reco::CaloCluster_iterator theEclust = matchedsupercluster->clustersBegin();
92  // loop over the basic clusters of the matched supercluster
93  for(;theEclust != matchedsupercluster->clustersEnd();
94  theEclust++) {
95  if ((**theEclust) == (*cluster) ) inSuperCluster = true;
96  }
97  if (!inSuperCluster) {
98 
99  math::XYZVector basicClusterPosition(cluster->position().x(),
100  cluster->position().y(),
101  cluster->position().z());
102  newDelta=DeltaR(basicClusterPosition,position);
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  // std::cout << "Will return ecalIsol = " << ecalIsol << std::endl;
114  return ecalIsol;
115 
116 }
const math::XYZPoint & position() const
cluster centroid position
Definition: CaloCluster.h:126
Definition: deltaR.h:79
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
T const * get() const
Returns C++ pointer to the item.
Definition: Ref.h:242
const reco::SuperClusterCollection * superClusterCollection_
XYZVectorD XYZVector
spatial vector with cartesian internal representation
Definition: Vector3D.h:30
static int position[264][3]
Definition: ReadPGInfo.cc:509
CaloCluster_iterator clustersBegin() const
fist iterator over BasicCluster constituents
Definition: SuperCluster.h:75
T get() const
get a component
Definition: Candidate.h:219
const reco::BasicClusterCollection * basicClusterCollection_
const CaloClusterPtr & seed() const
seed BasicCluster
Definition: SuperCluster.h:66
CaloCluster_iterator clustersEnd() const
last iterator over BasicCluster constituents
Definition: SuperCluster.h:78

Member Data Documentation

const reco::BasicClusterCollection* EgammaEcalIsolation::basicClusterCollection_
private

Definition at line 51 of file EgammaEcalIsolation.h.

Referenced by getEcalEtSum().

double EgammaEcalIsolation::conesize
private

Definition at line 49 of file EgammaEcalIsolation.h.

Referenced by getEcalEtSum().

double EgammaEcalIsolation::etMin
private

Definition at line 48 of file EgammaEcalIsolation.h.

Referenced by getEcalEtSum().

const reco::SuperClusterCollection* EgammaEcalIsolation::superClusterCollection_
private

Definition at line 52 of file EgammaEcalIsolation.h.

Referenced by getEcalEtSum().