CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
EcalClusterIsoCalculator Class Reference

#include <EcalClusterIsoCalculator.h>

Public Member Functions

 EcalClusterIsoCalculator (const edm::Event &iEvent, const edm::EventSetup &iSetup, const edm::Handle< reco::BasicClusterCollection > barrel, const edm::Handle< reco::BasicClusterCollection > endcap)
 
double getBkgSubEcalClusterIso (const reco::SuperClusterRef clus, const double radius, const double threshold)
 Return the background-subtracted ecal cluster energy in a cone around the SC. More...
 
double getEcalClusterIso (const reco::SuperClusterRef clus, const double radius, const double threshold)
 Return the ecal cluster energy in a cone around the SC. More...
 

Private Attributes

const reco::BasicClusterCollectionfEBclusters_
 
const reco::BasicClusterCollectionfEEclusters_
 
const CaloGeometrygeometry_
 

Detailed Description

Definition at line 17 of file EcalClusterIsoCalculator.h.

Constructor & Destructor Documentation

◆ EcalClusterIsoCalculator()

EcalClusterIsoCalculator::EcalClusterIsoCalculator ( const edm::Event iEvent,
const edm::EventSetup iSetup,
const edm::Handle< reco::BasicClusterCollection barrel,
const edm::Handle< reco::BasicClusterCollection endcap 
)

Definition at line 19 of file EcalClusterIsoCalculator.cc.

22  {
23  if (pEBclusters.isValid())
24  fEBclusters_ = pEBclusters.product();
25  else
26  fEBclusters_ = nullptr;
27 
28  if (pEEclusters.isValid())
29  fEEclusters_ = pEEclusters.product();
30  else
31  fEEclusters_ = nullptr;
32 
33  ESHandle<CaloGeometry> geometryHandle;
34  iSetup.get<CaloGeometryRecord>().get(geometryHandle);
35  if (geometryHandle.isValid())
36  geometry_ = geometryHandle.product();
37  else
38  geometry_ = nullptr;
39 }

References edm::EventSetup::get(), edm::get(), edm::ESHandleBase::isValid(), edm::HandleBase::isValid(), edm::Handle< T >::product(), and edm::ESHandle< T >::product().

Member Function Documentation

◆ getBkgSubEcalClusterIso()

double EcalClusterIsoCalculator::getBkgSubEcalClusterIso ( const reco::SuperClusterRef  clus,
const double  radius,
const double  threshold 
)

Return the background-subtracted ecal cluster energy in a cone around the SC.

Definition at line 93 of file EcalClusterIsoCalculator.cc.

95  {
96  if (!fEBclusters_) {
97  return -100;
98  }
99 
100  if (!fEEclusters_) {
101  return -100;
102  }
103 
104  double SClusterEta = cluster->eta();
105  double TotalEt = 0;
106 
107  TotalEt = -cluster->rawEnergy() / cosh(cluster->eta());
108 
109  for (BasicClusterCollection::const_iterator iclu = fEBclusters_->begin(); iclu != fEBclusters_->end(); ++iclu) {
110  const BasicCluster *clu = &(*iclu);
111  math::XYZVector ClusPoint(clu->x(), clu->y(), clu->z());
112  double eta = ClusPoint.eta();
113 
114  double dEta = fabs(eta - SClusterEta);
115 
116  if (dEta < x * 0.1) {
117  double et = clu->energy() / cosh(eta);
118  if (et < threshold)
119  et = 0;
120  TotalEt += et;
121  }
122  }
123 
124  for (BasicClusterCollection::const_iterator iclu = fEEclusters_->begin(); iclu != fEEclusters_->end(); ++iclu) {
125  const BasicCluster *clu = &(*iclu);
126  math::XYZVector ClusPoint(clu->x(), clu->y(), clu->z());
127  double eta = ClusPoint.eta();
128  double dEta = fabs(eta - SClusterEta);
129 
130  if (dEta < x * 0.1) {
131  double et = clu->energy() / cosh(eta);
132  if (et < threshold)
133  et = 0;
134  TotalEt += et;
135  }
136  }
137 
138  double Cx = getEcalClusterIso(cluster, x, threshold);
139  double CCx = (Cx - TotalEt / 40.0 * x) * (1 / (1 - x / 40.));
140 
141  return CCx;
142 }

References HLT_FULL_cff::dEta, reco::CaloCluster::energy(), EgHLTOffHistBins_cfi::et, PVValHelper::eta, remoteMonitoring_LED_IterMethod_cfg::threshold, reco::CaloCluster::x(), reco::CaloCluster::y(), and reco::CaloCluster::z().

Referenced by photonIsolationHIProducer::produce().

◆ getEcalClusterIso()

double EcalClusterIsoCalculator::getEcalClusterIso ( const reco::SuperClusterRef  clus,
const double  radius,
const double  threshold 
)

Return the ecal cluster energy in a cone around the SC.

Definition at line 41 of file EcalClusterIsoCalculator.cc.

43  {
44  if (!fEBclusters_) {
45  return -100;
46  }
47 
48  if (!fEEclusters_) {
49  return -100;
50  }
51 
52  math::XYZVector SClusPoint(cluster->position().x(), cluster->position().y(), cluster->position().z());
53 
54  double TotalEt = 0;
55 
56  TotalEt = -cluster->rawEnergy() / cosh(cluster->eta());
57 
58  // Loop over barrel basic clusters
59  for (BasicClusterCollection::const_iterator iclu = fEBclusters_->begin(); iclu != fEBclusters_->end(); ++iclu) {
60  const BasicCluster *clu = &(*iclu);
61  math::XYZVector ClusPoint(clu->x(), clu->y(), clu->z());
62  double eta = ClusPoint.eta();
63 
64  double dR2 = reco::deltaR2(*clu, *cluster);
65 
66  if (dR2 < (x * x * 0.01)) {
67  double et = clu->energy() / cosh(eta);
68  if (et < threshold)
69  et = 0;
70  TotalEt += et;
71  }
72  }
73 
74  for (BasicClusterCollection::const_iterator iclu = fEEclusters_->begin(); iclu != fEEclusters_->end(); ++iclu) {
75  const BasicCluster *clu = &(*iclu);
76  const GlobalPoint clusPoint(clu->x(), clu->y(), clu->z());
77  math::XYZVector ClusPoint(clu->x(), clu->y(), clu->z());
78  double eta = ClusPoint.eta();
79 
80  double dR2 = reco::deltaR2(*clu, *cluster);
81 
82  if (dR2 < (x * x * 0.01)) {
83  double et = clu->energy() / cosh(eta);
84  if (et < threshold)
85  et = 0;
86  TotalEt += et;
87  }
88  }
89 
90  return TotalEt;
91 }

References reco::deltaR2(), reco::CaloCluster::energy(), EgHLTOffHistBins_cfi::et, PVValHelper::eta, remoteMonitoring_LED_IterMethod_cfg::threshold, reco::CaloCluster::x(), reco::CaloCluster::y(), and reco::CaloCluster::z().

Member Data Documentation

◆ fEBclusters_

const reco::BasicClusterCollection* EcalClusterIsoCalculator::fEBclusters_
private

Definition at line 30 of file EcalClusterIsoCalculator.h.

◆ fEEclusters_

const reco::BasicClusterCollection* EcalClusterIsoCalculator::fEEclusters_
private

Definition at line 31 of file EcalClusterIsoCalculator.h.

◆ geometry_

const CaloGeometry* EcalClusterIsoCalculator::geometry_
private

Definition at line 32 of file EcalClusterIsoCalculator.h.

edm::ESHandle::product
T const * product() const
Definition: ESHandle.h:86
reco::CaloCluster::y
double y() const
y coordinate of cluster centroid
Definition: CaloCluster.h:175
CaloGeometryRecord
Definition: CaloGeometryRecord.h:30
reco::CaloCluster::z
double z() const
z coordinate of cluster centroid
Definition: CaloCluster.h:178
DDAxes::x
edm::EventSetup::get
T get() const
Definition: EventSetup.h:80
PVValHelper::eta
Definition: PVValidationHelpers.h:69
reco::CaloCluster
Definition: CaloCluster.h:31
edm::ESHandle< CaloGeometry >
Point3DBase< float, GlobalTag >
reco::deltaR2
constexpr auto deltaR2(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
Definition: deltaR.h:16
math::XYZVector
XYZVectorD XYZVector
spatial vector with cartesian internal representation
Definition: Vector3D.h:31
EgHLTOffHistBins_cfi.et
et
Definition: EgHLTOffHistBins_cfi.py:8
get
#define get
edm::ESHandleBase::isValid
bool isValid() const
Definition: ESHandle.h:44
HLT_FULL_cff.dEta
dEta
Definition: HLT_FULL_cff.py:13767
EcalClusterIsoCalculator::fEBclusters_
const reco::BasicClusterCollection * fEBclusters_
Definition: EcalClusterIsoCalculator.h:30
EcalClusterIsoCalculator::fEEclusters_
const reco::BasicClusterCollection * fEEclusters_
Definition: EcalClusterIsoCalculator.h:31
remoteMonitoring_LED_IterMethod_cfg.threshold
threshold
Definition: remoteMonitoring_LED_IterMethod_cfg.py:426
reco::CaloCluster::energy
double energy() const
cluster energy
Definition: CaloCluster.h:149
reco::CaloCluster::x
double x() const
x coordinate of cluster centroid
Definition: CaloCluster.h:172
EcalClusterIsoCalculator::getEcalClusterIso
double getEcalClusterIso(const reco::SuperClusterRef clus, const double radius, const double threshold)
Return the ecal cluster energy in a cone around the SC.
Definition: EcalClusterIsoCalculator.cc:41
EcalClusterIsoCalculator::geometry_
const CaloGeometry * geometry_
Definition: EcalClusterIsoCalculator.h:32