CMS 3D CMS Logo

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::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, photonIsolationHIProducer_cfi::hbhe, photonIsolationHIProducer_cfi::hf, and photonIsolationHIProducer_cfi::ho.

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 }
const HBHERecHitCollection * fHBHERecHits_
const CaloGeometry * geometry_
const HORecHitCollection * fHORecHits_
const HFRecHitCollection * fHFRecHits_

Member Function Documentation

◆ getBkgSubHcalRechitIso()

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 HLT_2023v12_cff::dEta, CaloRecHit::energy(), EgHLTOffHistBins_cfi::et, PVValHelper::eta, PV3DBase< T, PVType, FrameType >::eta(), HBHERecHit::id(), remoteMonitoring_LASER_era2018_cfg::threshold, and x.

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 }
size_type size() const
T eta() const
Definition: PV3DBase.h:73
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 float energy() const
Definition: CaloRecHit.h:29
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_
constexpr HcalDetId id() const
get the id
Definition: HBHERecHit.h:41
const CaloGeometry * geometry_

◆ getHcalRechitIso()

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(), EgHLTOffHistBins_cfi::et, PVValHelper::eta, PV3DBase< T, PVType, FrameType >::eta(), HBHERecHit::id(), remoteMonitoring_LASER_era2018_cfg::threshold, and x.

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 }
size_type size() const
T eta() const
Definition: PV3DBase.h:73
constexpr float energy() const
Definition: CaloRecHit.h:29
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_
constexpr HcalDetId id() const
get the id
Definition: HBHERecHit.h:41
const CaloGeometry * geometry_

Member Data Documentation

◆ fHBHERecHits_

const HBHERecHitCollection* HcalRechitIsoCalculator::fHBHERecHits_
private

Definition at line 38 of file HcalRechitIsoCalculator.h.

◆ fHFRecHits_

const HFRecHitCollection* HcalRechitIsoCalculator::fHFRecHits_
private

Definition at line 40 of file HcalRechitIsoCalculator.h.

◆ fHORecHits_

const HORecHitCollection* HcalRechitIsoCalculator::fHORecHits_
private

Definition at line 39 of file HcalRechitIsoCalculator.h.

◆ geometry_

const CaloGeometry* HcalRechitIsoCalculator::geometry_
private

Definition at line 41 of file HcalRechitIsoCalculator.h.