CMS 3D CMS Logo

HGCalIsoCalculator.h
Go to the documentation of this file.
1 /*
2  * PhotonIsoProducer.h
3  *
4  * Created on: 13 Oct 2017
5  * Author: jkiesele, ncsmith
6  */
7 
8 #ifndef RecoEgamma_EgammaTools_HGCalIsoCalculator_h
9 #define RecoEgamma_EgammaTools_HGCalIsoCalculator_h
10 
14 
15 /*
16  *
17  * This class calculates the energy around the photon/electron in DR=0.15 that is
18  * not associated to the seed cluster.
19  * The energy is summed in 5 rings (default) between HGCal layer 1 and 30
20  * This gives back 5 calorimeter isolation values.
21  * Only the first values should be significantly affected by pileup.
22  *
23  * Usage:
24  *
25  * PhotonHGCalIsoCalculator prod;
26  * prod.setRecHitTools(rechittools)
27  * prod.setRecHits(recHitsEEHandle,recHitsFHHandle,recHitsBHHandle)
28  *
29  * <optional>
30  * prod.setDeltaR(0.15)
31  * <optional>
32  * prod.setNRings(5)
33  * <optional>
34  * prod.setMinDeltaR(0)
35  *
36  * for p in photons
37  * prod.produceHGCalIso(p.superCluster()->seed())
38  * a=prod.getIso(0)
39  * b=prod.getIso(1)
40  * c=prod.getIso(2)
41  * d=prod.getIso(3)
42  * e=prod.getIso(4)
43  *
44  *
45  */
47 public:
49 
51 
52  void setDeltaR(const float dr) { dr2_ = dr * dr; }
53 
54  void setMinDeltaR(const float dr) { mindr2_ = dr * dr; }
55 
56  void setRecHitTools(const hgcal::RecHitTools* recHitTools) { rechittools_ = recHitTools; }
57 
58  void setNRings(const size_t nrings);
59 
60  void setNLayers(unsigned int nLayers) { nlayers_ = nLayers; }
61 
66 
67  void produceHGCalIso(const reco::CaloClusterPtr& seedCluster);
68 
69  const float getIso(const unsigned int ring) const;
70 
71 private:
72  std::vector<float> isoringdeposits_;
73  std::vector<unsigned int> ringasso_;
74 
75  float dr2_, mindr2_;
76 
81  std::vector<std::pair<float, float>> hitEtaPhiCache_;
82  bool debug_;
83  unsigned int nlayers_;
84 };
85 
86 #endif /* RecoEgamma_EgammaTools_HGCalIsoCalculator_h */
hgcal::RecHitTools
Definition: RecHitTools.h:23
HGCalIsoCalculator::ringasso_
std::vector< unsigned int > ringasso_
Definition: HGCalIsoCalculator.h:73
HGCalIsoCalculator::setRecHits
void setRecHits(edm::Handle< HGCRecHitCollection > hitsEE, edm::Handle< HGCRecHitCollection > hitsFH, edm::Handle< HGCRecHitCollection > hitsBH)
fill - once per event
Definition: HGCalIsoCalculator.cc:18
HGCalIsoCalculator::getIso
const float getIso(const unsigned int ring) const
Definition: HGCalIsoCalculator.cc:114
HGCalIsoCalculator::setMinDeltaR
void setMinDeltaR(const float dr)
Definition: HGCalIsoCalculator.h:54
HGCalIsoCalculator::HGCalIsoCalculator
HGCalIsoCalculator()
Definition: HGCalIsoCalculator.cc:11
edm::Handle
Definition: AssociativeIterator.h:50
HGCalIsoCalculator::rechittools_
const hgcal::RecHitTools * rechittools_
Definition: HGCalIsoCalculator.h:77
HGCalIsoCalculator
Definition: HGCalIsoCalculator.h:46
HGCalIsoCalculator::setDeltaR
void setDeltaR(const float dr)
Definition: HGCalIsoCalculator.h:52
HGCalIsoCalculator::recHitsFH_
edm::Handle< HGCRecHitCollection > recHitsFH_
Definition: HGCalIsoCalculator.h:79
CaloClusterFwd.h
HGCalIsoCalculator::mindr2_
float mindr2_
Definition: HGCalIsoCalculator.h:75
HGCalIsoCalculator::setNRings
void setNRings(const size_t nrings)
Definition: HGCalIsoCalculator.cc:96
MuonTCMETValueMapProducer_cff.nLayers
nLayers
Definition: MuonTCMETValueMapProducer_cff.py:38
HGCRecHitCollections.h
HGCalIsoCalculator::isoringdeposits_
std::vector< float > isoringdeposits_
Definition: HGCalIsoCalculator.h:72
HGCalIsoCalculator::debug_
bool debug_
Definition: HGCalIsoCalculator.h:82
HGCalIsoCalculator::hitEtaPhiCache_
std::vector< std::pair< float, float > > hitEtaPhiCache_
Definition: HGCalIsoCalculator.h:81
HGCalIsoCalculator::nlayers_
unsigned int nlayers_
Definition: HGCalIsoCalculator.h:83
HGCalIsoCalculator::dr2_
float dr2_
Definition: HGCalIsoCalculator.h:75
edm::Ptr< CaloCluster >
HGCalIsoCalculator::produceHGCalIso
void produceHGCalIso(const reco::CaloClusterPtr &seedCluster)
Definition: HGCalIsoCalculator.cc:48
flavorHistoryFilter_cfi.dr
dr
Definition: flavorHistoryFilter_cfi.py:37
relativeConstraints.ring
ring
Definition: relativeConstraints.py:68
HGCalIsoCalculator::setRecHitTools
void setRecHitTools(const hgcal::RecHitTools *recHitTools)
Definition: HGCalIsoCalculator.h:56
HGCalIsoCalculator::recHitsEE_
edm::Handle< HGCRecHitCollection > recHitsEE_
Definition: HGCalIsoCalculator.h:78
HGCalIsoCalculator::~HGCalIsoCalculator
~HGCalIsoCalculator()
Definition: HGCalIsoCalculator.cc:16
HGCalIsoCalculator::recHitsBH_
edm::Handle< HGCRecHitCollection > recHitsBH_
Definition: HGCalIsoCalculator.h:80
HGCalIsoCalculator::setNLayers
void setNLayers(unsigned int nLayers)
Definition: HGCalIsoCalculator.h:60
RecHitTools.h