CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Private Attributes
HcalRechitIsoCalculator Class Reference

#include <HcalRechitIsoCalculator.h>

Public Member Functions

double getBkgSubHcalRechitIso (const reco::SuperClusterRef clus, const double i, const double threshold, const double innerR=0.0)
 Return the background-subtracted hcal rechit energy in a cone around the SC. More...
 
double getHcalRechitIso (const reco::SuperClusterRef clus, const double i, const double threshold, const double innerR=0.0)
 Return the hcal rechit energy in a cone around the SC. More...
 
 HcalRechitIsoCalculator (const CaloGeometry *geometry, const edm::Handle< HBHERecHitCollection > hbhe, const edm::Handle< HFRecHitCollection > hfLabel, const edm::Handle< HORecHitCollection > hoLabel)
 

Private Attributes

const HBHERecHitCollectionfHBHERecHits_
 
const HFRecHitCollectionfHFRecHits_
 
const HORecHitCollectionfHORecHits_
 
const CaloGeometrygeometry_
 

Detailed Description

Definition at line 19 of file HcalRechitIsoCalculator.h.

Constructor & Destructor Documentation

HcalRechitIsoCalculator::HcalRechitIsoCalculator ( const CaloGeometry geometry,
const edm::Handle< HBHERecHitCollection hbhe,
const edm::Handle< HFRecHitCollection hfLabel,
const edm::Handle< HORecHitCollection hoLabel 
)

Definition at line 14 of file HcalRechitIsoCalculator.cc.

References relativeConstraints::geometry, edm::HandleBase::isValid(), and edm::Handle< T >::product().

17  {
18  if (hf.isValid())
19  fHFRecHits_ = hf.product();
20  else
21  fHFRecHits_ = nullptr;
22 
23  if (ho.isValid())
24  fHORecHits_ = ho.product();
25  else
26  fHORecHits_ = nullptr;
27 
28  if (hbhe.isValid())
29  fHBHERecHits_ = hbhe.product();
30  else
31  fHBHERecHits_ = nullptr;
32 
34 }
bool isValid() const
Definition: HandleBase.h:70
const HBHERecHitCollection * fHBHERecHits_
T const * product() const
Definition: Handle.h:70
const CaloGeometry * geometry_
const HORecHitCollection * fHORecHits_
const HFRecHitCollection * fHFRecHits_

Member Function Documentation

double HcalRechitIsoCalculator::getBkgSubHcalRechitIso ( const reco::SuperClusterRef  clus,
const double  i,
const double  threshold,
const double  innerR = 0.0 
)

Return the background-subtracted hcal rechit energy in a cone around the SC.

Definition at line 68 of file HcalRechitIsoCalculator.cc.

References CaloRecHit::energy(), PVValHelper::eta, PV3DBase< T, PVType, FrameType >::eta(), and HBHERecHit::id().

Referenced by photonIsolationHIProducer::produce().

71  {
72  if (!fHBHERecHits_) {
73  return -100;
74  }
75 
76  double SClusterEta = cluster->eta();
77  double TotalEt = 0;
78 
79  for (size_t index = 0; index < fHBHERecHits_->size(); index++) {
80  const HBHERecHit &rechit = (*fHBHERecHits_)[index];
81  const DetId &detid = rechit.id();
82  const GlobalPoint &hitpoint = geometry_->getPosition(detid);
83  double eta = hitpoint.eta();
84  double dEta = fabs(eta - SClusterEta);
85 
86  if (dEta < x * 0.1) {
87  double et = rechit.energy() / cosh(eta);
88  if (et < threshold)
89  et = 0;
90  TotalEt += et;
91  }
92  }
93 
94  double Rx = getHcalRechitIso(cluster, x, threshold, innerR);
95  double CRx = (Rx - TotalEt * (0.01 * x * x - innerR * innerR) / (2 * 2 * 0.1 * x)) * (1 / (1 - x / 40.));
96 
97  return CRx;
98 }
constexpr float energy() const
Definition: CaloRecHit.h:29
double getHcalRechitIso(const reco::SuperClusterRef clus, const double i, const double threshold, const double innerR=0.0)
Return the hcal rechit energy in a cone around the SC.
constexpr HcalDetId id() const
get the id
Definition: HBHERecHit.h:41
GlobalPoint getPosition(const DetId &id) const
Get the position of a given detector id.
Definition: CaloGeometry.cc:50
Definition: DetId.h:17
const HBHERecHitCollection * fHBHERecHits_
const CaloGeometry * geometry_
T eta() const
Definition: PV3DBase.h:73
size_type size() const
double HcalRechitIsoCalculator::getHcalRechitIso ( const reco::SuperClusterRef  clus,
const double  i,
const double  threshold,
const double  innerR = 0.0 
)

Return the hcal rechit energy in a cone around the SC.

Definition at line 36 of file HcalRechitIsoCalculator.cc.

References reco::deltaR2(), CaloRecHit::energy(), PVValHelper::eta, PV3DBase< T, PVType, FrameType >::eta(), and HBHERecHit::id().

39  {
40  if (!fHBHERecHits_) {
41  return -100;
42  }
43 
44  double TotalEt = 0;
45 
46  for (size_t index = 0; index < fHBHERecHits_->size(); index++) {
47  const HBHERecHit &rechit = (*fHBHERecHits_)[index];
48  const DetId &detid = rechit.id();
49  const GlobalPoint &hitpoint = geometry_->getPosition(detid);
50  double eta = hitpoint.eta();
51 
52  double dR2 = reco::deltaR2(*cluster, hitpoint);
53  // veto inner cone///////////////
54  if (dR2 < innerR * innerR)
55  continue;
57  if (dR2 < (x * x * 0.01)) {
58  double et = rechit.energy() / cosh(eta);
59  if (et < threshold)
60  et = 0;
61  TotalEt += et;
62  }
63  }
64 
65  return TotalEt;
66 }
constexpr float energy() const
Definition: CaloRecHit.h:29
constexpr HcalDetId id() const
get the id
Definition: HBHERecHit.h:41
GlobalPoint getPosition(const DetId &id) const
Get the position of a given detector id.
Definition: CaloGeometry.cc:50
Definition: DetId.h:17
constexpr auto deltaR2(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
Definition: deltaR.h:16
const HBHERecHitCollection * fHBHERecHits_
const CaloGeometry * geometry_
T eta() const
Definition: PV3DBase.h:73
size_type size() const

Member Data Documentation

const HBHERecHitCollection* HcalRechitIsoCalculator::fHBHERecHits_
private

Definition at line 38 of file HcalRechitIsoCalculator.h.

const HFRecHitCollection* HcalRechitIsoCalculator::fHFRecHits_
private

Definition at line 40 of file HcalRechitIsoCalculator.h.

const HORecHitCollection* HcalRechitIsoCalculator::fHORecHits_
private

Definition at line 39 of file HcalRechitIsoCalculator.h.

const CaloGeometry* HcalRechitIsoCalculator::geometry_
private

Definition at line 41 of file HcalRechitIsoCalculator.h.