CMS 3D CMS Logo

EgammaHcalIsolation.h
Go to the documentation of this file.
1 #ifndef EgammaIsolationAlgos_EgammaHcalIsolation_h
2 #define EgammaIsolationAlgos_EgammaHcalIsolation_h
3 //*****************************************************************************
4 // File: EgammaHcalIsolation.h
5 // ----------------------------------------------------------------------------
6 // OrigAuth: Matthias Mozer
7 // Institute: IIHE-VUB
8 //=============================================================================
9 //*****************************************************************************
10 
11 //C++ includes
12 #include <array>
13 
14 //CMSSW includes
20 
23 
30 
33 
34 // sum helper functions
35 double scaleToE(const double &eta);
36 double scaleToEt(const double &eta);
37 
39 public:
41  using arrayHB = std::array<double, 4>;
42  using arrayHE = std::array<double, 7>;
43 
44  // constructors
46  double extRadius,
47  InclusionRule intIncRule,
48  double intRadius,
49  const arrayHB &eThresHB,
50  const arrayHB &etThresHB,
51  int maxSeverityHB,
52  const arrayHE &eThresHE,
53  const arrayHE &etThresHE,
54  int maxSeverityHE,
55  const HBHERecHitCollection &mhbhe,
56  edm::ESHandle<CaloGeometry> caloGeometry,
57  edm::ESHandle<HcalTopology> hcalTopology,
61 
63  double extRadius,
64  InclusionRule intIncRule,
65  double intRadius,
66  const arrayHB &eThresHB,
67  const arrayHB &etThresHB,
68  int maxSeverityHB,
69  const arrayHE &eThresHE,
70  const arrayHE &etThresHE,
71  int maxSeverityHE,
72  const HBHERecHitCollection &mhbhe,
73  const CaloGeometry &caloGeometry,
74  const HcalTopology &hcalTopology,
75  const HcalChannelQuality &hcalChStatus,
76  const HcalSeverityLevelComputer &hcalSevLvlComputer,
77  const CaloTowerConstituentsMap &towerMap);
78 
79  double getHcalESum(const reco::Candidate *c, int depth) const {
80  return getHcalESum(c->get<reco::SuperClusterRef>().get(), depth);
81  }
82  double getHcalEtSum(const reco::Candidate *c, int depth) const {
83  return getHcalEtSum(c->get<reco::SuperClusterRef>().get(), depth);
84  }
85  double getHcalESum(const reco::SuperCluster *sc, int depth) const { return getHcalESum(sc->position(), depth); }
86  double getHcalEtSum(const reco::SuperCluster *sc, int depth) const { return getHcalEtSum(sc->position(), depth); }
87  double getHcalESum(const math::XYZPoint &p, int depth) const {
88  return getHcalESum(GlobalPoint(p.x(), p.y(), p.z()), depth);
89  }
90  double getHcalEtSum(const math::XYZPoint &p, int depth) const {
91  return getHcalEtSum(GlobalPoint(p.x(), p.y(), p.z()), depth);
92  }
93  double getHcalESum(const GlobalPoint &pclu, int depth) const { return getHcalSum(pclu, depth, 0, 0, 0, &scaleToE); }
94  double getHcalEtSum(const GlobalPoint &pclu, int depth) const { return getHcalSum(pclu, depth, 0, 0, 0, &scaleToEt); }
95 
96  double getHcalESumBc(const reco::Candidate *c, int depth) const {
97  return getHcalESumBc(c->get<reco::SuperClusterRef>().get(), depth);
98  }
99  double getHcalEtSumBc(const reco::Candidate *c, int depth) const {
100  return getHcalEtSumBc(c->get<reco::SuperClusterRef>().get(), depth);
101  }
102  double getHcalESumBc(const reco::SuperCluster *sc, int depth) const {
103  const auto tower = egamma::towerOf(*(sc->seed()), towerMap_);
104 
106  return getHcalESumBc(sc->position(), depth, tower.ieta(), tower.iphi(), -1);
109  return getHcalESumBc(sc->position(), depth, tower.ieta(), tower.iphi(), 1);
110 
111  return getHcalESumBc(sc->position(), depth, tower.ieta(), tower.iphi(), 0);
112  }
113  double getHcalEtSumBc(const reco::SuperCluster *sc, int depth) const {
114  const auto tower = egamma::towerOf(*(sc->seed()), towerMap_);
115 
117  return getHcalEtSumBc(sc->position(), depth, tower.ieta(), tower.iphi(), -1);
120  return getHcalEtSumBc(sc->position(), depth, tower.ieta(), tower.iphi(), 1);
121 
122  return getHcalEtSumBc(sc->position(), depth, tower.ieta(), tower.iphi(), 0);
123  }
124  double getHcalESumBc(const math::XYZPoint &p, int depth, int ieta, int iphi, int include_or_exclude) const {
125  return getHcalESumBc(GlobalPoint(p.x(), p.y(), p.z()), depth, ieta, iphi, include_or_exclude);
126  }
127  double getHcalEtSumBc(const math::XYZPoint &p, int depth, int ieta, int iphi, int include_or_exclude) const {
128  return getHcalEtSumBc(GlobalPoint(p.x(), p.y(), p.z()), depth, ieta, iphi, include_or_exclude);
129  }
130  double getHcalESumBc(const GlobalPoint &pclu, int depth, int ieta, int iphi, int include_or_exclude) const {
131  return getHcalSum(pclu, depth, ieta, iphi, include_or_exclude, &scaleToE);
132  }
133  double getHcalEtSumBc(const GlobalPoint &pclu, int depth, int ieta, int iphi, int include_or_exclude) const {
134  return getHcalSum(pclu, depth, ieta, iphi, include_or_exclude, &scaleToEt);
135  }
136 
137 private:
138  double goodHitEnergy(float pcluEta,
139  float pcluPhi,
140  const HBHERecHit &hit,
141  int depth,
142  int ieta,
143  int iphi,
144  int include_or_exclude,
145  double (*scale)(const double &)) const;
146 
147  double getHcalSum(const GlobalPoint &pclu,
148  int depth,
149  int ieta,
150  int iphi,
151  int include_or_exclude,
152  double (*scale)(const double &)) const;
153 
155  double extRadius_;
157  double intRadius_;
158 
162 
166 
173 };
174 
175 #endif
const math::XYZPoint & position() const
cluster centroid position
Definition: CaloCluster.h:154
double getHcalEtSumBc(const math::XYZPoint &p, int depth, int ieta, int iphi, int include_or_exclude) const
double getHcalSum(const GlobalPoint &pclu, int depth, int ieta, int iphi, int include_or_exclude, double(*scale)(const double &)) const
double getHcalESum(const reco::Candidate *c, int depth) const
const CaloGeometry & caloGeometry_
double getHcalEtSum(const reco::SuperCluster *sc, int depth) const
EgammaHcalIsolation(InclusionRule extIncRule, double extRadius, InclusionRule intIncRule, double intRadius, const arrayHB &eThresHB, const arrayHB &etThresHB, int maxSeverityHB, const arrayHE &eThresHE, const arrayHE &etThresHE, int maxSeverityHE, const HBHERecHitCollection &mhbhe, edm::ESHandle< CaloGeometry > caloGeometry, edm::ESHandle< HcalTopology > hcalTopology, edm::ESHandle< HcalChannelQuality > hcalChStatus, edm::ESHandle< HcalSeverityLevelComputer > hcalSevLvlComputer, edm::ESHandle< CaloTowerConstituentsMap > towerMap)
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
double getHcalESum(const GlobalPoint &pclu, int depth) const
double goodHitEnergy(float pcluEta, float pcluPhi, const HBHERecHit &hit, int depth, int ieta, int iphi, int include_or_exclude, double(*scale)(const double &)) const
double getHcalESumBc(const reco::SuperCluster *sc, int depth) const
const HcalChannelQuality & hcalChStatus_
double getHcalESum(const reco::SuperCluster *sc, int depth) const
double getHcalEtSum(const math::XYZPoint &p, int depth) const
const HBHERecHitCollection & mhbhe_
double getHcalESumBc(const reco::Candidate *c, int depth) const
double getHcalEtSumBc(const reco::SuperCluster *sc, int depth) const
double getHcalEtSum(const GlobalPoint &pclu, int depth) const
CaloTowerDetId towerOf(reco::CaloCluster const &cluster, CaloTowerConstituentsMap const &towerMap)
double getHcalEtSum(const reco::Candidate *c, int depth) const
double getHcalESumBc(const GlobalPoint &pclu, int depth, int ieta, int iphi, int include_or_exclude) const
double getHcalEtSumBc(const reco::Candidate *c, int depth) const
double getHcalESum(const math::XYZPoint &p, int depth) const
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
const CaloTowerConstituentsMap & towerMap_
double scaleToEt(const double &eta)
double scaleToE(const double &eta)
const CaloClusterPtr & seed() const
seed BasicCluster
Definition: SuperCluster.h:79
T const * get() const
Returns C++ pointer to the item.
Definition: Ref.h:232
double getHcalESumBc(const math::XYZPoint &p, int depth, int ieta, int iphi, int include_or_exclude) const
const HcalTopology & hcalTopology_
const HcalSeverityLevelComputer & hcalSevLvlComputer_
std::array< double, 4 > arrayHB
double getHcalEtSumBc(const GlobalPoint &pclu, int depth, int ieta, int iphi, int include_or_exclude) const
std::array< double, 7 > arrayHE