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 double etaclus = pclu.
eta();
80 double 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 double eta = position.
eta();
93 double phi = position.
phi();
94 double etaDiff = eta - etaclus;
99 if(fabs(etaclus) < 1.479) {
102 if (
sqrt(etaDiff*etaDiff + phiDiff*phiDiff) < 0.0174*intRadius_)
105 if (fabs(etaDiff) < 0.00864*fabs(sinh(eta))*
etaSlice_)
107 if (
sqrt(etaDiff*etaDiff + phiDiff*phiDiff) < 0.00864*fabs(sinh(eta))*intRadius_)
113 if (etaDiff*etaDiff + phiDiff*phiDiff < r2)
120 bool isClustered =
false;
122 for(rhIt = (*bcIt)->hitsAndFractions().begin();rhIt != (*bcIt)->hitsAndFractions().end(); ++rhIt) {
123 if(rhIt->first == *
i)
163 double et = energy*position.
perp()/position.
mag();
189 theCaloPosition.y () ,
190 theCaloPosition.z () );
191 double etaclus = pclu.
eta();
192 double phiclus = pclu.phi();
195 std::vector< std::pair<DetId, float> >::const_iterator rhIt;
198 for(
int subdetnr=0; subdetnr<=1 ; subdetnr++){
201 for (CaloSubdetectorGeometry::DetIdSet::const_iterator
i = chosen.begin ();
i!= chosen.end ();++
i){
206 double eta = position.
eta();
207 double phi = position.
phi();
208 double etaDiff = eta - etaclus;
213 if( fabs(etaclus) < 1.479 ) {
214 if ( fabs(etaDiff) < 0.0174*
etaSlice_)
continue;
215 if (
sqrt(etaDiff*etaDiff + phiDiff*phiDiff) < 0.0174*intRadius_)
continue;
217 if ( fabs(etaDiff) < 0.00864*fabs(sinh(eta))*
etaSlice_)
continue;
218 if (
sqrt(etaDiff*etaDiff + phiDiff*phiDiff) < 0.00864*fabs(sinh(eta))*intRadius_)
continue;
221 if ( fabs(etaDiff) <
etaSlice_)
continue;
222 if ( etaDiff*etaDiff + phiDiff*phiDiff < r2)
continue;
229 bool isClustered =
false;
231 for(rhIt = (*bcIt)->hitsAndFractions().begin();rhIt != (*bcIt)->hitsAndFractions().end(); ++rhIt) {
232 if( rhIt->first == *
i ) isClustered =
true;
233 if( isClustered )
break;
235 if( isClustered )
break;
238 if(isClustered)
continue;
264 double et = energy*position.
perp()/position.
mag();
266 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_
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_
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