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++){
88 for (CaloSubdetectorGeometry::DetIdSet::const_iterator
i = chosen.begin ();
i != chosen.end (); ++
i){
92 float eta = cell->etaPos();
93 float phi = cell->phiPos();
94 float etaDiff = eta - etaclus;
99 if(fabs(etaclus) < 1.479) {
104 if ((etaDiff*etaDiff + phiDiff*phiDiff) < 0.00030276*r2)
107 if (fabs(etaDiff) < 0.00864*fabs(sinh(eta))*
etaSlice_)
111 if ((etaDiff*etaDiff + phiDiff*phiDiff) < (0.000037325*(cosh(2*eta)-1)*r2))
117 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)
165 float et = energy*
std::sqrt(cell->getPosition().perp2()/cell->getPosition().mag2());
191 theCaloPosition.y () ,
192 theCaloPosition.z () );
193 double etaclus = pclu.
eta();
194 double phiclus = pclu.phi();
197 std::vector< std::pair<DetId, float> >::const_iterator rhIt;
200 for(
int subdetnr=0; subdetnr<=1 ; subdetnr++){
203 for (CaloSubdetectorGeometry::DetIdSet::const_iterator
i = chosen.begin ();
i!= chosen.end ();++
i){
208 double eta = position.
eta();
209 double phi = position.
phi();
210 double etaDiff = eta - etaclus;
215 if( fabs(etaclus) < 1.479 ) {
216 if ( fabs(etaDiff) < 0.0174*
etaSlice_)
continue;
218 if ((etaDiff*etaDiff + phiDiff*phiDiff) < 0.00030276*r2)
continue;
220 if ( fabs(etaDiff) < 0.00864*fabs(sinh(eta))*
etaSlice_)
continue;
222 if ((etaDiff*etaDiff + phiDiff*phiDiff) < (0.000037325*(cosh(2*eta)-1)*r2))
continue;
225 if ( fabs(etaDiff) <
etaSlice_)
continue;
226 if ( etaDiff*etaDiff + phiDiff*phiDiff < r2)
continue;
233 bool isClustered =
false;
235 for(rhIt = (*bcIt)->hitsAndFractions().begin();rhIt != (*bcIt)->hitsAndFractions().end(); ++rhIt) {
236 if( rhIt->first == *
i ) isClustered =
true;
237 if( isClustered )
break;
239 if( isClustered )
break;
242 if(isClustered)
continue;
267 double et = energy*position.
perp()/position.
mag();
269 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_
CaloRecHitMetaCollectionV * caloHits_
const DetId & detid() const
Geom::Phi< T > phi() const
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 >, CaloRecHitMetaCollectionV *, const EcalSeverityLevelAlgo *, DetId::Detector detector)
const EcalRecHitCollection * ecalBarHits_
double deltaPhi(double phi1, double phi2)
XYZPointD XYZPoint
point in space with cartesian internal representation
T const * product() const
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.
EcalSeverityLevel::SeverityLevel severityLevel(const DetId &id, const EcalRecHitCollection &rhs) const
Evaluate status from id.
CaloCluster_iterator clustersEnd() const
last iterator over BasicCluster constituents