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++){
86 if(
nullptr ==
subdet_[subdetnr] )
continue;
91 for (CaloSubdetectorGeometry::DetIdSet::const_iterator
i = chosen.begin ();
i != chosen.end (); ++
i){
95 float eta = cell->etaPos();
96 float phi = cell->phiPos();
97 float etaDiff = eta - etaclus;
99 float energy = j->energy();
102 if(fabs(etaclus) < 1.479) {
107 if ((etaDiff*etaDiff + phiDiff*phiDiff) < 0.00030276*r2)
110 if (fabs(etaDiff) < 0.00864*fabs(sinh(eta))*
etaSlice_)
114 if ((etaDiff*etaDiff + phiDiff*phiDiff) < (0.000037325*(cosh(2*eta)-1)*r2))
120 if (etaDiff*etaDiff + phiDiff*phiDiff < r2)
127 bool isClustered =
false;
129 for(rhIt = (*bcIt)->hitsAndFractions().begin();rhIt != (*bcIt)->hitsAndFractions().end(); ++rhIt) {
130 if(rhIt->first == *
i)
163 if (j->checkFlags(
flags_)) {
168 float et = energy*
std::sqrt(cell->getPosition().perp2()/cell->getPosition().mag2());
194 theCaloPosition.y () ,
195 theCaloPosition.z () );
196 double etaclus = pclu.
eta();
197 double phiclus = pclu.phi();
200 std::vector< std::pair<DetId, float> >::const_iterator rhIt;
203 for(
int subdetnr=0; subdetnr<=1 ; subdetnr++){
204 if(
nullptr ==
subdet_[subdetnr] )
continue;
207 for (CaloSubdetectorGeometry::DetIdSet::const_iterator
i = chosen.begin ();
i!= chosen.end ();++
i){
212 double eta = position.
eta();
213 double phi = position.
phi();
214 double etaDiff = eta - etaclus;
216 double energy = j->energy();
219 if( fabs(etaclus) < 1.479 ) {
220 if ( fabs(etaDiff) < 0.0174*
etaSlice_)
continue;
222 if ((etaDiff*etaDiff + phiDiff*phiDiff) < 0.00030276*r2)
continue;
224 if ( fabs(etaDiff) < 0.00864*fabs(sinh(eta))*
etaSlice_)
continue;
226 if ((etaDiff*etaDiff + phiDiff*phiDiff) < (0.000037325*(cosh(2*eta)-1)*r2))
continue;
229 if ( fabs(etaDiff) <
etaSlice_)
continue;
230 if ( etaDiff*etaDiff + phiDiff*phiDiff < r2)
continue;
237 bool isClustered =
false;
239 for(rhIt = (*bcIt)->hitsAndFractions().begin();rhIt != (*bcIt)->hitsAndFractions().end(); ++rhIt) {
240 if( rhIt->first == *
i ) isClustered =
true;
241 if( isClustered )
break;
243 if( isClustered )
break;
246 if(isClustered)
continue;
265 if (j->checkFlags(
flags_)) {
271 double et = energy*position.
perp()/position.
mag();
273 if(returnEt) energySum+=
et;
274 else energySum+=energy;
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
double deltaPhi(double phi1, double phi2)
XYZPointD XYZPoint
point in space with cartesian internal representation
et
define resolution functions of each parameter
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
std::shared_ptr< const CaloCellGeometry > getGeometry(const DetId &id) const
Get the cell geometry of a given detector id.
const EcalSeverityLevelAlgo * sevLevel_
double energySum(const DataFrame &df, int fs, int ls)
T const * product() const
const EcalRecHitCollection & caloHits_
CaloCluster_iterator clustersEnd() const
last iterator over BasicCluster constituents