14 #include <Math/VectorUtil.h>
25 using namespace ROOT::Math::VectorUtil ;
32 extRadius_(extRadius),
33 intRadius_(intRadius),
36 towercollection_(towercollection)
54 double candEta=sc->
eta();
55 double candPhi=sc->
phi();
64 std::vector<CaloTowerDetId>::const_iterator itcheck=
find(detIdToExclude->begin(),detIdToExclude->end(),trItr->id());
65 if (itcheck != detIdToExclude->end())
71 case AllDepths: this_pt = trItr->hadEt();
break;
72 case Depth1: this_pt = trItr->ietaAbs()<18 || trItr->ietaAbs()>29 ? trItr->hadEt() : trItr->hadEnergyHeInnerLayer()*
sin(trItr->p4().theta());
break;
73 case Depth2: this_pt = trItr->hadEnergyHeOuterLayer()*
sin(trItr->p4().theta());
break;
74 default:
throw cms::Exception(
"Configuration Error") <<
"EgammaTowerIsolation: Depth " <<
depth_ <<
" not known. ";
break;
80 double towerEta=trItr->eta();
81 double towerPhi=trItr->phi();
83 if(towerPhi<0) towerPhi+=
twoPi;
84 if(candPhi<0) candPhi+=
twoPi;
85 double deltaPhi=fabs(towerPhi-candPhi);
86 if(deltaPhi>twoPi) deltaPhi-=
twoPi;
88 double deltaEta = towerEta - candEta;
90 double dr = deltaEta*deltaEta + deltaPhi*
deltaPhi;
93 { ptSum += this_pt ; }
109 double candEta=sc->
eta();
110 double candPhi=sc->
phi();
117 if( detIdToExclude ) {
118 std::vector<CaloTowerDetId>::const_iterator itcheck=
find(detIdToExclude->begin(),detIdToExclude->end(),trItr->id());
119 if (itcheck != detIdToExclude->end())
125 case AllDepths: this_e = trItr->hadEnergy();
break;
126 case Depth1: this_e = trItr->ietaAbs()<18 || trItr->ietaAbs()>29 ? trItr->hadEnergy() : trItr->hadEnergyHeInnerLayer();
break;
127 case Depth2: this_e = trItr->hadEnergyHeOuterLayer();
break;
128 default:
throw cms::Exception(
"Configuration Error") <<
"EgammaTowerIsolation: Depth " <<
depth_ <<
" not known. ";
break;
131 if ( this_e*
sin(trItr->p4().theta()) <
etLow_ )
134 double towerEta=trItr->eta();
135 double towerPhi=trItr->phi();
137 if(towerPhi<0) towerPhi+=
twoPi;
138 if(candPhi<0) candPhi+=
twoPi;
139 double deltaPhi=fabs(towerPhi-candPhi);
140 if(deltaPhi>twoPi) deltaPhi-=
twoPi;
142 double deltaEta = towerEta - candEta;
145 double dr = deltaEta*deltaEta + deltaPhi*
deltaPhi;
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 *)
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
double eta() const
pseudorapidity of cluster centroid
double getTowerEtSum(const reco::Candidate *, const std::vector< CaloTowerDetId > *detIdToExclude=0) const
const_iterator end() const
double getTowerESum(const reco::Candidate *, const std::vector< CaloTowerDetId > *detIdToExclude=0) const
const CaloTowerCollection * towercollection_
T get() const
get a component
double phi() const
azimuthal angle of cluster centroid
T const * get() const
Returns C++ pointer to the item.
const_iterator begin() const