CMS 3D CMS Logo

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.

◆ ~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.

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_.

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 }
const math::XYZPoint & position() const
cluster centroid position
Definition: CaloCluster.h:153
AlgoId algo() const
algorithm identifier
Definition: CaloCluster.h:189
T get() const
get a component
Definition: Candidate.h:221
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
CaloCluster_iterator clustersBegin() const
fist iterator over BasicCluster constituents
Definition: SuperCluster.h:88
CaloCluster_iterator clustersEnd() const
last iterator over BasicCluster constituents
Definition: SuperCluster.h:91
const reco::SuperClusterCollection * superClusterCollection_
double energy() const
cluster energy
Definition: CaloCluster.h:148
XYZVectorD XYZVector
spatial vector with cartesian internal representation
Definition: Vector3D.h:31
const CaloClusterPtr & seed() const
seed BasicCluster
Definition: SuperCluster.h:79
static int position[264][3]
Definition: ReadPGInfo.cc:289
T const * get() const
Returns C++ pointer to the item.
Definition: Ref.h:232
const reco::BasicClusterCollection * basicClusterCollection_
double eta() const
pseudorapidity of cluster centroid
Definition: CaloCluster.h:180

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().