14 #include <Math/VectorUtil.h>
25 using namespace ROOT::Math::VectorUtil ;
32 extRadius_(extRadius),
33 intRadius_(intRadius),
36 towercollection_(towercollection)
55 double candEta=sc->
eta();
56 double candPhi=sc->
phi();
64 case AllDepths: this_pt = trItr->hadEt();
break;
65 case Depth1: this_pt = trItr->ietaAbs()<18 || trItr->ietaAbs()>29 ? trItr->hadEt() : trItr->hadEnergyHeInnerLayer()*
sin(trItr->p4().theta());
break;
66 case Depth2: this_pt = trItr->hadEnergyHeOuterLayer()*
sin(trItr->p4().theta());
break;
67 default:
throw cms::Exception(
"Configuration Error") <<
"EgammaTowerIsolation: Depth " <<
depth_ <<
" not known. ";
break;
73 double towerEta=trItr->eta();
74 double towerPhi=trItr->phi();
76 if(towerPhi<0) towerPhi+=
twoPi;
77 if(candPhi<0) candPhi+=
twoPi;
78 double deltaPhi=fabs(towerPhi-candPhi);
79 if(deltaPhi>twoPi) deltaPhi-=
twoPi;
81 double deltaEta = towerEta - candEta;
84 double dr = deltaEta*deltaEta + deltaPhi*
deltaPhi;
105 double candEta=sc->
eta();
106 double candPhi=sc->
phi();
114 case AllDepths: this_e = trItr->hadEnergy();
break;
115 case Depth1: this_e = trItr->ietaAbs()<18 || trItr->ietaAbs()>29 ? trItr->hadEnergy() : trItr->hadEnergyHeInnerLayer();
break;
116 case Depth2: this_e = trItr->hadEnergyHeOuterLayer();
break;
117 default:
throw cms::Exception(
"Configuration Error") <<
"EgammaTowerIsolation: Depth " <<
depth_ <<
" not known. ";
break;
120 if ( this_e*
sin(trItr->p4().theta()) <
etLow_ )
123 double towerEta=trItr->eta();
124 double towerPhi=trItr->phi();
126 if(towerPhi<0) towerPhi+=
twoPi;
127 if(candPhi<0) candPhi+=
twoPi;
128 double deltaPhi=fabs(towerPhi-candPhi);
129 if(deltaPhi>twoPi) deltaPhi-=
twoPi;
131 double deltaEta = towerEta - candEta;
134 double dr = deltaEta*deltaEta + deltaPhi*
deltaPhi;
const math::XYZPoint & position() const
cluster centroid position
double deltaPhi(float phi1, float phi2)
double getTowerESum(const reco::Candidate *) const
Sin< T >::type sin(const T &t)
std::vector< CaloTower >::const_iterator const_iterator
EgammaTowerIsolation(double extRadius, double intRadius, double etLow, signed int depth, const CaloTowerCollection *)
double eta() const
pseudorapidity of cluster centroid
const_iterator end() const
XYZPointD XYZPoint
point in space with cartesian internal representation
const CaloTowerCollection * towercollection_
T get() const
get a component
double phi() const
azimuthal angle of cluster centroid
double getTowerEtSum(const reco::Candidate *) const
T const * get() const
Returns C++ pointer to the item.
const_iterator begin() const