9 #include <Math/VectorUtil.h>
26 InclusionRule intIncRule,
29 const arrayHB &etThresHB,
32 const arrayHE &etThresHE,
40 : extIncRule_(extIncRule),
41 extRadius_(extRadius * extRadius),
42 intIncRule_(intIncRule),
43 intRadius_(intRadius * intRadius),
44 maxSeverityHB_(maxSeverityHB),
45 maxSeverityHE_(maxSeverityHE),
47 caloGeometry_(*caloGeometry.product()),
48 hcalTopology_(*hcalTopology.product()),
49 hcalChStatus_(*hcalChStatus.product()),
50 hcalSevLvlComputer_(*hcalSevLvlComputer.product()),
51 towerMap_(*towerMap.product()) {
53 etThresHB_ = etThresHB;
55 etThresHE_ = etThresHE;
58 if (extIncRule_ == InclusionRule::isBehindClusterSeed and intIncRule_ == InclusionRule::withinConeAroundCluster) {
61 }
else if (extIncRule_ == InclusionRule::withinConeAroundCluster and
62 intIncRule_ == InclusionRule::isBehindClusterSeed) {
64 }
else if (extIncRule_ == InclusionRule::isBehindClusterSeed and intIncRule_ == InclusionRule::isBehindClusterSeed) {
66 <<
" external and internal rechit inclusion rules can't both be isBehindClusterSeed."
67 <<
" Setting both to withinConeAroundCluster!";
68 extIncRule_ = InclusionRule::withinConeAroundCluster;
69 intIncRule_ = InclusionRule::withinConeAroundCluster;
75 InclusionRule intIncRule,
77 const arrayHB &eThresHB,
78 const arrayHB &etThresHB,
80 const arrayHE &eThresHE,
81 const arrayHE &etThresHE,
89 : extIncRule_(extIncRule),
90 extRadius_(extRadius * extRadius),
91 intIncRule_(intIncRule),
92 intRadius_(intRadius * intRadius),
93 maxSeverityHB_(maxSeverityHB),
94 maxSeverityHE_(maxSeverityHE),
96 caloGeometry_(caloGeometry),
97 hcalTopology_(hcalTopology),
98 hcalChStatus_(hcalChStatus),
99 hcalSevLvlComputer_(hcalSevLvlComputer),
100 towerMap_(towerMap) {
102 etThresHB_ = etThresHB;
104 etThresHE_ = etThresHE;
107 if (extIncRule_ == InclusionRule::isBehindClusterSeed and intIncRule_ == InclusionRule::withinConeAroundCluster) {
110 }
else if (extIncRule_ == InclusionRule::withinConeAroundCluster and
111 intIncRule_ == InclusionRule::isBehindClusterSeed) {
113 }
else if (extIncRule_ == InclusionRule::isBehindClusterSeed and intIncRule_ == InclusionRule::isBehindClusterSeed) {
115 <<
" external and internal rechit inclusion rules can't both be isBehindClusterSeed."
116 <<
" Setting both to withinConeAroundCluster!";
117 extIncRule_ = InclusionRule::withinConeAroundCluster;
118 intIncRule_ = InclusionRule::withinConeAroundCluster;
128 int include_or_exclude,
129 double (*
scale)(
const double &))
const {
131 const int hd = hid.
depth(),
he = hid.ieta(), hp = hid.iphi();
132 const int h1 = hd - 1;
134 if (include_or_exclude == -1 and (
he != ieta
or hp != iphi))
137 if (include_or_exclude == 1 and (
he == ieta and hp == iphi))
143 <<
" hit in subdet " << hid.subdet() <<
" has an unaccounted for depth of " << hd <<
"!!";
145 const bool right_depth = (depth == 0
or hd ==
depth);
151 if (!(goodHBe
or goodHEe))
155 const float phitEta = phit.eta();
158 auto const dR2 =
deltaR2(pcluEta, pcluPhi, phitEta, phit.phi());
165 const uint32_t flag = hit.
flags();
174 if (goodHB
or goodHE)
184 int include_or_exclude,
185 double (*
scale)(
const double &))
const {
187 const float pcluEta = pclu.
eta();
188 const float pcluPhi = pclu.
phi();
189 for (
const auto &hit :
mhbhe_)
190 sum +=
goodHitEnergy(pcluEta, pcluPhi, hit, depth, ieta, iphi, include_or_exclude,
scale);
constexpr float energy() const
const CaloGeometry & caloGeometry_
double getHcalSum(const GlobalPoint &pclu, int depth, int ieta, int iphi, int include_or_exclude, double(*scale)(const double &)) const
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventIDconst &, edm::Timestampconst & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
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)
constexpr const DetId & detid() const
Sin< T >::type sin(const T &t)
Geom::Phi< T > phi() const
const Item * getValues(DetId fId, bool throwOnFail=true) const
Exp< T >::type exp(const T &t)
const HcalChannelQuality & hcalChStatus_
InclusionRule extIncRule_
double goodHitEnergy(float pcluEta, float pcluPhi, const HBHERecHit &hit, int depth, int ieta, int iphi, int include_or_exclude, double(*scale)(const double &)) const
const HBHERecHitCollection & mhbhe_
InclusionRule intIncRule_
bool recoveredRecHit(const DetId &myid, const uint32_t &myflag) const
constexpr auto deltaR2(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
int getSeverityLevel(const DetId &myid, const uint32_t &myflag, const uint32_t &mystatus) const
double scaleToEt(const double &eta)
double scaleToE(const double &eta)
std::shared_ptr< const CaloCellGeometry > getGeometry(const DetId &id) const
Get the cell geometry of a given detector id.
const HcalTopology & hcalTopology_
HcalDetId idFront(const HcalDetId &id) const
const HcalSeverityLevelComputer & hcalSevLvlComputer_
constexpr int depth() const
get the tower depth
Log< level::Warning, false > LogWarning
uint32_t getValue() const
constexpr uint32_t flags() const