13 #include <Math/VectorUtil.h>
42 extRadius_(extRadius),
43 intRadius_(intRadius),
47 theCaloGeom_(theCaloGeom),
50 useNumCrystals_(
false),
51 vetoClustered_(
false),
52 ecalBarHits_(nullptr),
73 GlobalPoint pclu(theCaloPosition.x(), theCaloPosition.y(), theCaloPosition.z());
74 float etaclus = pclu.
eta();
75 float phiclus = pclu.phi();
78 std::vector<std::pair<DetId, float> >::const_iterator rhIt;
80 for (
int subdetnr = 0; subdetnr <= 1; subdetnr++) {
81 if (
nullptr ==
subdet_[subdetnr])
88 for (CaloSubdetectorGeometry::DetIdSet::const_iterator
i = chosen.begin();
i != chosen.end();
93 float eta = cell->etaPos();
94 float phi = cell->phiPos();
95 float etaDiff = eta - etaclus;
97 float energy = j->energy();
100 if (fabs(etaclus) < 1.479) {
105 if ((etaDiff * etaDiff + phiDiff * phiDiff) < 0.00030276 * r2)
108 if (fabs(etaDiff) < 0.00864 * fabs(sinh(eta)) *
etaSlice_)
112 if ((etaDiff * etaDiff + phiDiff * phiDiff) < (0.000037325 * (cosh(2 * eta) - 1) * r2))
118 if (etaDiff * etaDiff + phiDiff * phiDiff < r2)
124 bool isClustered =
false;
126 for (rhIt = (*bcIt)->hitsAndFractions().begin(); rhIt != (*bcIt)->hitsAndFractions().end(); ++rhIt) {
127 if (rhIt->first == *
i)
143 std::vector<int>::const_iterator sit =
156 if (j->checkFlags(
flags_)) {
161 float et = energy *
std::sqrt(cell->getPosition().perp2() / cell->getPosition().mag2());
183 GlobalPoint pclu(theCaloPosition.x(), theCaloPosition.y(), theCaloPosition.z());
184 double etaclus = pclu.
eta();
185 double phiclus = pclu.phi();
188 std::vector<std::pair<DetId, float> >::const_iterator rhIt;
190 for (
int subdetnr = 0; subdetnr <= 1; subdetnr++) {
191 if (
nullptr ==
subdet_[subdetnr])
196 for (CaloSubdetectorGeometry::DetIdSet::const_iterator
i = chosen.begin();
i != chosen.end();
202 double eta = position.
eta();
203 double phi = position.
phi();
204 double etaDiff = eta - etaclus;
206 double energy = j->energy();
209 if (fabs(etaclus) < 1.479) {
213 if ((etaDiff * etaDiff + phiDiff * phiDiff) < 0.00030276 * r2)
216 if (fabs(etaDiff) < 0.00864 * fabs(sinh(eta)) *
etaSlice_)
219 if ((etaDiff * etaDiff + phiDiff * phiDiff) < (0.000037325 * (cosh(2 * eta) - 1) * r2))
225 if (etaDiff * etaDiff + phiDiff * phiDiff < r2)
232 bool isClustered =
false;
234 for (rhIt = (*bcIt)->hitsAndFractions().begin(); rhIt != (*bcIt)->hitsAndFractions().end(); ++rhIt) {
235 if (rhIt->first == *
i)
249 std::vector<int>::const_iterator sit =
262 if (j->checkFlags(
flags_)) {
267 double et = energy * position.
perp() / position.
mag();
constexpr double deltaPhi(double phi1, double phi2)
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
const math::XYZPoint & position() const
cluster centroid position
std::set< DetId > DetIdSet
const CaloSubdetectorGeometry * subdet_[2]
edm::ESHandle< CaloGeometry > theCaloGeom_
std::vector< int > flags_
EcalSeverityLevel::SeverityLevel severityLevel(const DetId &id) const
Evaluate status from id use channelStatus from DB.
Geom::Phi< T > phi() const
std::vector< EcalRecHit >::const_iterator const_iterator
std::vector< int > severitiesexcl_
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
double getSum_(const reco::Candidate *, bool returnEt) const
virtual DetIdSet getCells(const GlobalPoint &r, double dR) const
Get a list of all cells within a dR of the given cell.
EgammaRecHitIsolation(double extRadius, double intRadius, double etaSlice, double etLow, double eLow, edm::ESHandle< CaloGeometry >, const EcalRecHitCollection &, const EcalSeverityLevelAlgo *, DetId::Detector detector)
T const * get() const
Returns C++ pointer to the item.
const EcalRecHitCollection * ecalBarHits_
const_iterator end() const
XYZPointD XYZPoint
point in space with cartesian internal representation
T const * product() const
iterator find(key_type k)
static int position[264][3]
CaloCluster_iterator clustersBegin() const
fist iterator over BasicCluster constituents
T get() const
get a component
const EcalSeverityLevelAlgo * sevLevel_
double energySum(const DataFrame &df, int fs, int ls)
const EcalRecHitCollection & caloHits_
CaloCluster_iterator clustersEnd() const
last iterator over BasicCluster constituents