13 #include <Math/VectorUtil.h>
41 extRadius_(extRadius),
42 intRadius_(intRadius),
46 theCaloGeom_(theCaloGeom) ,
49 useNumCrystals_(
false),
50 vetoClustered_(
false),
77 theCaloPosition.y () ,
78 theCaloPosition.z () );
79 float etaclus = pclu.
eta();
80 float phiclus = pclu.phi();
83 std::vector< std::pair<DetId, float> >::const_iterator rhIt;
85 for(
int subdetnr=0; subdetnr<=1 ; subdetnr++){
89 for (CaloSubdetectorGeometry::DetIdSet::const_iterator
i = chosen.begin ();
i != chosen.end (); ++
i){
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)
125 bool isClustered =
false;
127 for(rhIt = (*bcIt)->hitsAndFractions().begin();rhIt != (*bcIt)->hitsAndFractions().end(); ++rhIt) {
128 if(rhIt->first == *
i)
166 float et = energy*
std::sqrt(cell->getPosition().perp2()/cell->getPosition().mag2());
192 theCaloPosition.y () ,
193 theCaloPosition.z () );
194 double etaclus = pclu.
eta();
195 double phiclus = pclu.phi();
198 std::vector< std::pair<DetId, float> >::const_iterator rhIt;
201 for(
int subdetnr=0; subdetnr<=1 ; subdetnr++){
204 for (CaloSubdetectorGeometry::DetIdSet::const_iterator
i = chosen.begin ();
i!= chosen.end ();++
i){
209 double eta = position.
eta();
210 double phi = position.
phi();
211 double etaDiff = eta - etaclus;
213 double energy = j->energy();
216 if( fabs(etaclus) < 1.479 ) {
217 if ( fabs(etaDiff) < 0.0174*
etaSlice_)
continue;
219 if ((etaDiff*etaDiff + phiDiff*phiDiff) < 0.00030276*r2)
continue;
221 if ( fabs(etaDiff) < 0.00864*fabs(sinh(eta))*
etaSlice_)
continue;
223 if ((etaDiff*etaDiff + phiDiff*phiDiff) < (0.000037325*(cosh(2*eta)-1)*r2))
continue;
226 if ( fabs(etaDiff) <
etaSlice_)
continue;
227 if ( etaDiff*etaDiff + phiDiff*phiDiff < r2)
continue;
234 bool isClustered =
false;
236 for(rhIt = (*bcIt)->hitsAndFractions().begin();rhIt != (*bcIt)->hitsAndFractions().end(); ++rhIt) {
237 if( rhIt->first == *
i ) isClustered =
true;
238 if( isClustered )
break;
240 if( isClustered )
break;
243 if(isClustered)
continue;
268 double et = energy*position.
perp()/position.
mag();
270 if(returnEt) energySum+=et;
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)
static int position[TOTALCHAMBERS][3]
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)
const EcalRecHitCollection * ecalBarHits_
const_iterator end() const
double deltaPhi(double phi1, double phi2)
XYZPointD XYZPoint
point in space with cartesian internal representation
T const * product() const
iterator find(key_type k)
CaloCluster_iterator clustersBegin() const
fist iterator over BasicCluster constituents
T get() const
get a component
const EcalSeverityLevelAlgo * sevLevel_
volatile std::atomic< bool > shutdown_flag false
double energySum(const DataFrame &df, int fs, int ls)
T const * get() const
Returns C++ pointer to the item.
const EcalRecHitCollection & caloHits_
CaloCluster_iterator clustersEnd() const
last iterator over BasicCluster constituents