9 #include <Math/VectorUtil.h> 26 InclusionRule intIncRule,
40 : extIncRule_(extIncRule),
42 intIncRule_(intIncRule),
47 caloGeometry_(*caloGeometry.product()),
48 hcalTopology_(*hcalTopology.product()),
49 hcalChStatus_(*hcalChStatus.product()),
50 hcalSevLvlComputer_(*hcalSevLvlComputer.product()),
51 towerMap_(*towerMap.product()) {
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,
89 : extIncRule_(extIncRule),
91 intIncRule_(intIncRule),
96 caloGeometry_(caloGeometry),
97 hcalTopology_(hcalTopology),
98 hcalChStatus_(hcalChStatus),
99 hcalSevLvlComputer_(hcalSevLvlComputer),
100 towerMap_(towerMap) {
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 &),
132 const int hd = hid.
depth(),
he = hid.ieta(),
hp = hid.iphi();
133 const int h1 = hd - 1;
134 double thresholdE = 0.;
139 if (include_or_exclude == 1 and (
he ==
ieta and
hp ==
iphi))
145 <<
" hit in subdet " << hid.subdet() <<
" has an unaccounted for depth of " << hd <<
"!!";
154 if (hcalCuts !=
nullptr) {
157 goodHBe = hid.subdet() ==
HcalBarrel and
hit.energy() > thresholdE;
158 goodHEe = hid.subdet() ==
HcalEndcap and
hit.energy() > thresholdE;
161 if (!(goodHBe
or goodHEe))
165 const float phitEta = phit.eta();
168 auto const dR2 =
deltaR2(pcluEta, pcluPhi, phitEta, phit.phi());
175 const uint32_t
flag =
hit.flags();
184 if (goodHB
or goodHE)
185 return hit.energy() *
scale(phitEta);
194 int include_or_exclude,
195 double (*
scale)(
const double &),
198 const float pcluEta = pclu.
eta();
199 const float pcluPhi = pclu.
phi();
double scaleToEt(const double &eta)
const CaloGeometry & caloGeometry_
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)
double goodHitEnergy(float pcluEta, float pcluPhi, const HBHERecHit &hit, int depth, int ieta, int iphi, int include_or_exclude, double(*scale)(const double &), const HcalPFCuts *hcalCuts) const
Geom::Phi< T > phi() const
bool recoveredRecHit(const DetId &myid, const uint32_t &myflag) const
Sin< T >::type sin(const T &t)
double scaleToE(const double &eta)
const HcalChannelQuality & hcalChStatus_
InclusionRule extIncRule_
const Item * getValues(DetId fId, bool throwOnFail=true) const
float noiseThreshold() const
ALPAKA_FN_ACC static ALPAKA_FN_INLINE float dR2(Position4 pos1, Position4 pos2)
const HBHERecHitCollection & mhbhe_
InclusionRule intIncRule_
HcalDetId idFront(const HcalDetId &id) 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::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
std::shared_ptr< const CaloCellGeometry > getGeometry(const DetId &id) const
Get the cell geometry of a given detector id.
uint32_t getValue() const
int getSeverityLevel(const DetId &myid, const uint32_t &myflag, const uint32_t &mystatus) const
const HcalTopology & hcalTopology_
const HcalSeverityLevelComputer & hcalSevLvlComputer_
double getHcalSum(const GlobalPoint &pclu, int depth, int ieta, int iphi, int include_or_exclude, double(*scale)(const double &), const HcalPFCuts *hcalCuts) const
Log< level::Warning, false > LogWarning
constexpr int depth() const
get the tower depth