CMS 3D CMS Logo

HcalRechitIsoCalculator.cc
Go to the documentation of this file.
2 
4 
8 
12 
13 using namespace edm;
14 using namespace reco;
15 
17  const edm::EventSetup &iSetup,
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 }
43 
45  const double x,
46  const double threshold,
47  const double innerR) {
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 }
75 
77  const double x,
78  const double threshold,
79  const double innerR) {
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 }
edm::ESHandle::product
T const * product() const
Definition: ESHandle.h:86
Handle.h
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: HcalRechitIsoCalculator.cc:16
MessageLogger.h
CaloRecHit::energy
constexpr float energy() const
Definition: CaloRecHit.h:29
BasicCluster.h
CaloGeometryRecord
Definition: CaloGeometryRecord.h:30
edm
HLT enums.
Definition: AlignableModifier.h:19
HcalRechitIsoCalculator.h
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
reco
fixed size matrix
Definition: AlignmentAlgorithmBase.h:45
edm::Handle
Definition: AssociativeIterator.h:50
HLT_2018_cff.dEta
dEta
Definition: HLT_2018_cff.py:12289
edm::Ref< SuperClusterCollection >
DetId
Definition: DetId.h:17
HcalRechitIsoCalculator::getBkgSubHcalRechitIso
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.
Definition: HcalRechitIsoCalculator.cc:76
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
edm::ESHandle< CaloGeometry >
Point3DBase< float, GlobalTag >
CaloGeometryRecord.h
CaloSubdetectorGeometry.h
reco::deltaR2
constexpr auto deltaR2(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
Definition: deltaR.h:16
edm::get
T const & get(Event const &event, InputTag const &tag) noexcept(false)
Definition: Event.h:669
PV3DBase::eta
T eta() const
Definition: PV3DBase.h:73
iEvent
int iEvent
Definition: GenABIO.cc:224
photonIsolationHIProducer_cfi.ho
ho
Definition: photonIsolationHIProducer_cfi.py:10
EgHLTOffHistBins_cfi.et
et
Definition: EgHLTOffHistBins_cfi.py:8
IdealGeometryRecord.h
edm::EventSetup
Definition: EventSetup.h:57
edm::ESHandleBase::isValid
bool isValid() const
Definition: ESHandle.h:44
photonIsolationHIProducer_cfi.hbhe
hbhe
Definition: photonIsolationHIProducer_cfi.py:8
SuperCluster.h
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
edm::Event
Definition: Event.h:73