90 for(reco::TrackCollection::const_iterator trItr = isoTracks->begin(); trItr != isoTracks->end(); ++trItr){
92 GlobalPoint ivtx(trItr->vertex().x(),trItr->vertex().y(),trItr->vertex().z());
96 float pt = imom.perp();
102 dperp = ivtx.perp()-vtx.
perp();
103 dz = ivtx.z()-vtx.
z();
104 deta = imom.eta()-mom.
eta();
105 dphi = imom.phi()-mom.
phi();
111 deta = imom.
eta()-mom_temp.
eta();
112 dphi = imom.phi()-mom_temp.
phi();
115 if (dphi>
M_PI) dphi = dphi - 2*
M_PI;
116 else if (dphi<-M_PI) dphi = dphi + 2*
M_PI;
118 float R =
sqrt( dphi*dphi + deta*deta );
140 fabs(deta) >=innerStrip) {
148 return (std::pair<int,float>(ntrack,ptSum));
160 std::vector<float> etaele;
161 std::vector<float> phiele;
166 for (reco::ElectronCollection::const_iterator iElectron = allEle->begin(); iElectron != allEle->end(); iElectron++){
169 etaele.push_back(anothereletrackref->momentum().eta());
170 phiele.push_back(anothereletrackref->momentum().phi());
174 for(reco::TrackCollection::const_iterator trItr = isoTracks->begin(); trItr != isoTracks->end(); ++trItr){
176 GlobalPoint ivtx(trItr->vertex().x(),trItr->vertex().y(),trItr->vertex().z());
180 float pt = imom.perp();
181 float dperp = ivtx.perp()-vtx.
perp();
182 float dz = ivtx.z()-vtx.
z();
183 float deta = imom.eta()-mom.
eta();
184 float dphi = imom.phi()-mom.
phi();
187 if (dphi>
M_PI) dphi = dphi - 2*
M_PI;
188 else if (dphi<-M_PI) dphi = dphi + 2*
M_PI;
190 float R =
sqrt( dphi*dphi + deta*deta );
194 bool passedconeveto=
true;
203 fabs(deta) >=innerStrip) selected=
true;
206 for(
unsigned int eleItr = 0; eleItr < etaele.size(); ++eleItr){
208 deta = etaele[eleItr] - imom.eta();
209 dphi = phiele[eleItr] - imom.phi();
212 if (dphi>M_PI) dphi = dphi - 2*
M_PI;
213 else if (dphi<-M_PI) dphi = dphi + 2*
M_PI;
215 R =
sqrt( dphi*dphi + deta*deta );
219 if (selected && passedconeveto) {
228 return (std::pair<int,float>(ntrack,ptSum));
virtual const Point & vertex() const
vertex position (overwritten by PF...)
std::pair< int, float > electronIsolation(const reco::Track *const tr, const reco::TrackCollection *isoTracks)
Get number of tracks and Pt sum of tracks inside an isolation cone for electrons. ...
Geom::Phi< T > phi() const
Global3DPoint GlobalPoint
std::vector< Track > TrackCollection
collection of Tracks
const Vector & momentum() const
track momentum vector
const Point & vertex() const
reference point on the track. This method is DEPRECATED, please use referencePoint() instead ...
bool isElectron(const Candidate &part)
std::vector< Electron > ElectronCollection
collectin of Electron objects
std::pair< int, float > photonIsolation(const reco::RecoCandidate *const recocand, const reco::TrackCollection *isoTracks, bool useVertex)
std::pair< int, float > findIsoTracks(GlobalVector mom, GlobalPoint vtx, const reco::TrackCollection *isoTracks, bool isElectron, bool useVertex=true)
std::pair< int, float > findIsoTracksWithoutEle(GlobalVector mom, GlobalPoint vtx, const reco::ElectronCollection *allEle, const reco::TrackCollection *isoTracks)
math::XYZPoint Point
point in the space
math::XYZVector Vector
spatial vector
virtual reco::SuperClusterRef superCluster() const
reference to a SuperCluster
Global3DVector GlobalVector