CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 */
void setNLayers(unsigned int nLayers)
void setMinDeltaR(const float dr)
edm::Handle< HGCRecHitCollection > recHitsEE_
edm::Handle< HGCRecHitCollection > recHitsBH_
void setNRings(const size_t nrings)
void setRecHits(edm::Handle< HGCRecHitCollection > hitsEE, edm::Handle< HGCRecHitCollection > hitsFH, edm::Handle< HGCRecHitCollection > hitsBH)
fill - once per event
void setDeltaR(const float dr)
std::vector< unsigned int > ringasso_
const hgcal::RecHitTools * rechittools_
std::vector< std::pair< float, float > > hitEtaPhiCache_
constexpr int nLayers
Definition: Config.h:73
void setRecHitTools(const hgcal::RecHitTools *recHitTools)
void produceHGCalIso(const reco::CaloClusterPtr &seedCluster)
edm::Handle< HGCRecHitCollection > recHitsFH_
std::vector< float > isoringdeposits_
const float getIso(const unsigned int ring) const