CMS 3D CMS Logo

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules 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::BasicClusterCollectionbasicClusterCollection_
 
double conesize
 
double etMin
 
const reco::SuperClusterCollectionsuperClusterCollection_
 

Detailed Description

Definition at line 26 of file EgammaEcalIsolation.h.

Constructor & Destructor Documentation

◆ EgammaEcalIsolation()

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

Definition at line 22 of file EgammaEcalIsolation.cc.

26  : etMin(etLow),
29  superClusterCollection_(superClusterCollection) {}

◆ ~EgammaEcalIsolation()

EgammaEcalIsolation::~EgammaEcalIsolation ( )

Definition at line 31 of file EgammaEcalIsolation.cc.

31 {}

Member Function Documentation

◆ getEcalEtSum()

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

Definition at line 33 of file EgammaEcalIsolation.cc.

33  {
34  double ecalIsol = 0.;
36  math::XYZVector position(sc.get()->position().x(), sc.get()->position().y(), sc.get()->position().z());
37 
38  // match the photon hybrid supercluster with those with Algo==0 (island)
39  double delta1 = 1000.;
40  double deltacur = 1000.;
41  const reco::SuperCluster* matchedsupercluster = nullptr;
42  bool MATCHEDSC = false;
43 
44  for (reco::SuperClusterCollection::const_iterator scItr = superClusterCollection_->begin();
45  scItr != superClusterCollection_->end();
46  ++scItr) {
47  const reco::SuperCluster* supercluster = &(*scItr);
48 
49  math::XYZVector currentPosition(
50  supercluster->position().x(), supercluster->position().y(), supercluster->position().z());
51 
52  if (supercluster->seed()->algo() == 0) {
53  deltacur = DeltaR(currentPosition, position);
54 
55  if (deltacur < delta1) {
56  delta1 = deltacur;
57  matchedsupercluster = supercluster;
58  MATCHEDSC = true;
59  }
60  }
61  }
62 
63  const reco::BasicCluster* cluster = nullptr;
64 
65  //loop over basic clusters
66  for (reco::BasicClusterCollection::const_iterator cItr = basicClusterCollection_->begin();
67  cItr != basicClusterCollection_->end();
68  ++cItr) {
69  cluster = &(*cItr);
70  // double ebc_bcchi2 = cluster->chi2();
71  int ebc_bcalgo = cluster->algo();
72  double ebc_bce = cluster->energy();
73  double ebc_bceta = cluster->eta();
74  double ebc_bcet = ebc_bce * sin(2 * atan(exp(ebc_bceta)));
75  double newDelta = 0.;
76 
77  if (ebc_bcet > etMin && ebc_bcalgo == 0) {
78  // if (ebc_bcchi2 < 30.) {
79 
80  if (MATCHEDSC) {
81  bool inSuperCluster = false;
82 
83  reco::CaloCluster_iterator theEclust = matchedsupercluster->clustersBegin();
84  // loop over the basic clusters of the matched supercluster
85  for (; theEclust != matchedsupercluster->clustersEnd(); theEclust++) {
86  if ((**theEclust) == (*cluster))
87  inSuperCluster = true;
88  }
89  if (!inSuperCluster) {
90  math::XYZVector basicClusterPosition(
91  cluster->position().x(), cluster->position().y(), cluster->position().z());
92  newDelta = DeltaR(basicClusterPosition, position);
93  if (newDelta < conesize) {
94  ecalIsol += ebc_bcet;
95  }
96  }
97  }
98  // } // matches ebc_bcchi2
99  } // matches ebc_bcet && ebc_bcalgo
100  }
101 
102  // std::cout << "Will return ecalIsol = " << ecalIsol << std::endl;
103  return ecalIsol;
104 }

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

Member Data Documentation

◆ basicClusterCollection_

const reco::BasicClusterCollection* EgammaEcalIsolation::basicClusterCollection_
private

Definition at line 45 of file EgammaEcalIsolation.h.

Referenced by getEcalEtSum().

◆ conesize

double EgammaEcalIsolation::conesize
private

Definition at line 43 of file EgammaEcalIsolation.h.

Referenced by getEcalEtSum().

◆ etMin

double EgammaEcalIsolation::etMin
private

Definition at line 42 of file EgammaEcalIsolation.h.

Referenced by getEcalEtSum().

◆ superClusterCollection_

const reco::SuperClusterCollection* EgammaEcalIsolation::superClusterCollection_
private

Definition at line 46 of file EgammaEcalIsolation.h.

Referenced by getEcalEtSum().

EgammaEcalIsolation::etMin
double etMin
Definition: EgammaEcalIsolation.h:42
reco::SuperCluster
Definition: SuperCluster.h:18
electronEcalRecHitIsolationLcone_cfi.extRadius
extRadius
Definition: electronEcalRecHitIsolationLcone_cfi.py:18
edm::Ref::get
T const * get() const
Returns C++ pointer to the item.
Definition: Ref.h:232
edm::PtrVectorItr
Definition: PtrVector.h:51
reco::Candidate::get
T get() const
get a component
Definition: Candidate.h:221
edm::Ref< SuperClusterCollection >
funct::sin
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
EgammaEcalIsolation::superClusterCollection_
const reco::SuperClusterCollection * superClusterCollection_
Definition: EgammaEcalIsolation.h:46
reco::CaloCluster
Definition: CaloCluster.h:31
reco::SuperCluster::seed
const CaloClusterPtr & seed() const
seed BasicCluster
Definition: SuperCluster.h:77
reco::CaloCluster::eta
double eta() const
pseudorapidity of cluster centroid
Definition: CaloCluster.h:181
math::XYZVector
XYZVectorD XYZVector
spatial vector with cartesian internal representation
Definition: Vector3D.h:31
position
static int position[264][3]
Definition: ReadPGInfo.cc:289
reco::SuperCluster::clustersBegin
CaloCluster_iterator clustersBegin() const
fist iterator over BasicCluster constituents
Definition: SuperCluster.h:86
electronAnalyzer_cfi.DeltaR
DeltaR
Definition: electronAnalyzer_cfi.py:33
reco::CaloCluster::position
const math::XYZPoint & position() const
cluster centroid position
Definition: CaloCluster.h:154
reco::CaloCluster::algo
AlgoId algo() const
algorithm identifier
Definition: CaloCluster.h:190
EgammaEcalIsolation::basicClusterCollection_
const reco::BasicClusterCollection * basicClusterCollection_
Definition: EgammaEcalIsolation.h:45
reco::SuperCluster::clustersEnd
CaloCluster_iterator clustersEnd() const
last iterator over BasicCluster constituents
Definition: SuperCluster.h:89
JetChargeProducer_cfi.exp
exp
Definition: JetChargeProducer_cfi.py:6
reco::CaloCluster::energy
double energy() const
cluster energy
Definition: CaloCluster.h:149
EgammaEcalIsolation::conesize
double conesize
Definition: EgammaEcalIsolation.h:43
EcalPileUpDepMonitor_cfi.basicClusterCollection
basicClusterCollection
Definition: EcalPileUpDepMonitor_cfi.py:5