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 edm::Event &iEvent, const edm::EventSetup &iSetup, 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 edm::Event iEvent,
const edm::EventSetup iSetup,
const edm::Handle< HBHERecHitCollection hbhe,
const edm::Handle< HFRecHitCollection hfLabel,
const edm::Handle< HORecHitCollection hoLabel 
)

Definition at line 16 of file HcalRechitIsoCalculator.cc.

20  {
21  if (hf.isValid())
22  fHFRecHits_ = hf.product();
23  else
24  fHFRecHits_ = nullptr;
25 
26  if (ho.isValid())
27  fHORecHits_ = ho.product();
28  else
29  fHORecHits_ = nullptr;
30 
31  if (hbhe.isValid())
32  fHBHERecHits_ = hbhe.product();
33  else
34  fHBHERecHits_ = nullptr;
35 
36  ESHandle<CaloGeometry> geometryHandle;
37  iSetup.get<CaloGeometryRecord>().get(geometryHandle);
38  if (geometryHandle.isValid())
39  geometry_ = geometryHandle.product();
40  else
41  geometry_ = nullptr;
42 }

References edm::EventSetup::get(), edm::get(), photonIsolationHIProducer_cfi::hbhe, photonIsolationHIProducer_cfi::hf, photonIsolationHIProducer_cfi::ho, edm::ESHandleBase::isValid(), and edm::ESHandle< T >::product().

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 76 of file HcalRechitIsoCalculator.cc.

79  {
80  if (!fHBHERecHits_) {
81  return -100;
82  }
83 
84  double SClusterEta = cluster->eta();
85  double TotalEt = 0;
86 
87  for (size_t index = 0; index < fHBHERecHits_->size(); index++) {
88  const HBHERecHit &rechit = (*fHBHERecHits_)[index];
89  const DetId &detid = rechit.id();
90  const GlobalPoint &hitpoint = geometry_->getPosition(detid);
91  double eta = hitpoint.eta();
92  double dEta = fabs(eta - SClusterEta);
93 
94  if (dEta < x * 0.1) {
95  double et = rechit.energy() / cosh(eta);
96  if (et < threshold)
97  et = 0;
98  TotalEt += et;
99  }
100  }
101 
102  double Rx = getHcalRechitIso(cluster, x, threshold, innerR);
103  double CRx = (Rx - TotalEt * (0.01 * x * x - innerR * innerR) / (2 * 2 * 0.1 * x)) * (1 / (1 - x / 40.));
104 
105  return CRx;
106 }

References HLT_2018_cff::dEta, CaloRecHit::energy(), EgHLTOffHistBins_cfi::et, PVValHelper::eta, PV3DBase< T, PVType, FrameType >::eta(), HBHERecHit::id(), and remoteMonitoring_LED_IterMethod_cfg::threshold.

Referenced by photonIsolationHIProducer::produce().

◆ 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 44 of file HcalRechitIsoCalculator.cc.

47  {
48  if (!fHBHERecHits_) {
49  return -100;
50  }
51 
52  double TotalEt = 0;
53 
54  for (size_t index = 0; index < fHBHERecHits_->size(); index++) {
55  const HBHERecHit &rechit = (*fHBHERecHits_)[index];
56  const DetId &detid = rechit.id();
57  const GlobalPoint &hitpoint = geometry_->getPosition(detid);
58  double eta = hitpoint.eta();
59 
60  double dR2 = reco::deltaR2(*cluster, hitpoint);
61  // veto inner cone///////////////
62  if (dR2 < innerR * innerR)
63  continue;
65  if (dR2 < (x * x * 0.01)) {
66  double et = rechit.energy() / cosh(eta);
67  if (et < threshold)
68  et = 0;
69  TotalEt += et;
70  }
71  }
72 
73  return TotalEt;
74 }

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

Member Data Documentation

◆ fHBHERecHits_

const HBHERecHitCollection* HcalRechitIsoCalculator::fHBHERecHits_
private

Definition at line 39 of file HcalRechitIsoCalculator.h.

◆ fHFRecHits_

const HFRecHitCollection* HcalRechitIsoCalculator::fHFRecHits_
private

Definition at line 41 of file HcalRechitIsoCalculator.h.

◆ fHORecHits_

const HORecHitCollection* HcalRechitIsoCalculator::fHORecHits_
private

Definition at line 40 of file HcalRechitIsoCalculator.h.

◆ geometry_

const CaloGeometry* HcalRechitIsoCalculator::geometry_
private

Definition at line 42 of file HcalRechitIsoCalculator.h.

edm::ESHandle::product
T const * product() const
Definition: ESHandle.h:86
CaloRecHit::energy
constexpr float energy() const
Definition: CaloRecHit.h:29
CaloGeometry::getPosition
GlobalPoint getPosition(const DetId &id) const
Get the position of a given detector id.
Definition: CaloGeometry.cc:50
CaloGeometryRecord
Definition: CaloGeometryRecord.h:30
HBHERecHit
Definition: HBHERecHit.h:13
HcalRechitIsoCalculator::getHcalRechitIso
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.
Definition: HcalRechitIsoCalculator.cc:44
edm::SortedCollection::size
size_type size() const
Definition: SortedCollection.h:215
HcalRechitIsoCalculator::geometry_
const CaloGeometry * geometry_
Definition: HcalRechitIsoCalculator.h:42
DDAxes::x
HLT_2018_cff.dEta
dEta
Definition: HLT_2018_cff.py:12289
DetId
Definition: DetId.h:17
photonIsolationHIProducer_cfi.hf
hf
Definition: photonIsolationHIProducer_cfi.py:9
edm::EventSetup::get
T get() const
Definition: EventSetup.h:73
PVValHelper::eta
Definition: PVValidationHelpers.h:69
HcalRechitIsoCalculator::fHBHERecHits_
const HBHERecHitCollection * fHBHERecHits_
Definition: HcalRechitIsoCalculator.h:39
edm::ESHandle< CaloGeometry >
HcalRechitIsoCalculator::fHORecHits_
const HORecHitCollection * fHORecHits_
Definition: HcalRechitIsoCalculator.h:40
Point3DBase< float, GlobalTag >
reco::deltaR2
constexpr auto deltaR2(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
Definition: deltaR.h:16
PV3DBase::eta
T eta() const
Definition: PV3DBase.h:73
HcalRechitIsoCalculator::fHFRecHits_
const HFRecHitCollection * fHFRecHits_
Definition: HcalRechitIsoCalculator.h:41
photonIsolationHIProducer_cfi.ho
ho
Definition: photonIsolationHIProducer_cfi.py:10
EgHLTOffHistBins_cfi.et
et
Definition: EgHLTOffHistBins_cfi.py:8
get
#define get
edm::ESHandleBase::isValid
bool isValid() const
Definition: ESHandle.h:44
photonIsolationHIProducer_cfi.hbhe
hbhe
Definition: photonIsolationHIProducer_cfi.py:8
AlignmentPI::index
index
Definition: AlignmentPayloadInspectorHelper.h:46
HBHERecHit::id
constexpr HcalDetId id() const
get the id
Definition: HBHERecHit.h:39
remoteMonitoring_LED_IterMethod_cfg.threshold
threshold
Definition: remoteMonitoring_LED_IterMethod_cfg.py:426