67 GlobalVector mom(pos.x()-vtx.x(),pos.y()-vtx.y(),pos.z()-vtx.z());
91 for(reco::TrackCollection::const_iterator trItr = isoTracks->begin(); trItr != isoTracks->end(); ++trItr){
93 GlobalPoint ivtx(trItr->vertex().x(),trItr->vertex().y(),trItr->vertex().z());
97 float pt = imom.
perp();
103 dperp = ivtx.perp()-vtx.
perp();
104 dz = ivtx.z()-vtx.
z();
105 deta = imom.eta()-mom.
eta();
106 dphi = imom.phi()-mom.
phi();
112 deta = imom.
eta()-mom_temp.
eta();
113 dphi = imom.phi()-mom_temp.
phi();
116 if (dphi>
M_PI) dphi = dphi - 2*
M_PI;
117 else if (dphi<-M_PI) dphi = dphi + 2*
M_PI;
119 float R =
sqrt( dphi*dphi + deta*deta );
141 fabs(deta) >=innerStrip) {
149 return (std::pair<int,float>(ntrack,ptSum));
161 std::vector<float> etaele;
162 std::vector<float> phiele;
167 for (reco::ElectronCollection::const_iterator iElectron = allEle->begin(); iElectron != allEle->end(); iElectron++){
170 etaele.push_back(anothereletrackref->momentum().eta());
171 phiele.push_back(anothereletrackref->momentum().phi());
175 for(reco::TrackCollection::const_iterator trItr = isoTracks->begin(); trItr != isoTracks->end(); ++trItr){
177 GlobalPoint ivtx(trItr->vertex().x(),trItr->vertex().y(),trItr->vertex().z());
181 float pt = imom.
perp();
182 float dperp = ivtx.perp()-vtx.
perp();
183 float dz = ivtx.z()-vtx.
z();
184 float deta = imom.eta()-mom.
eta();
185 float dphi = imom.phi()-mom.
phi();
188 if (dphi>
M_PI) dphi = dphi - 2*
M_PI;
189 else if (dphi<-M_PI) dphi = dphi + 2*
M_PI;
191 float R =
sqrt( dphi*dphi + deta*deta );
195 bool passedconeveto=
true;
204 fabs(deta) >=innerStrip) selected=
true;
207 for(
unsigned int eleItr = 0; eleItr < etaele.size(); ++eleItr){
209 deta = etaele[eleItr] - imom.eta();
210 dphi = phiele[eleItr] - imom.phi();
213 if (dphi>M_PI) dphi = dphi - 2*
M_PI;
214 else if (dphi<-M_PI) dphi = dphi + 2*
M_PI;
216 R =
sqrt( dphi*dphi + deta*deta );
220 if (selected && passedconeveto) {
229 return (std::pair<int,float>(ntrack,ptSum));
const Vector & momentum() const
track momentum vector
virtual const Point & vertex() const
vertex position
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
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)
const Point & vertex() const
reference point on the track. This method is DEPRECATED, please use referencePoint() instead ...
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