65 GlobalVector mom(pos.x() - vtx.x(), pos.y() - vtx.y(), pos.z() - vtx.z());
85 for (reco::TrackCollection::const_iterator trItr = isoTracks->begin(); trItr != isoTracks->end(); ++trItr) {
86 GlobalPoint ivtx(trItr->vertex().x(), trItr->vertex().y(), trItr->vertex().z());
90 float pt = imom.perp();
96 dperp = ivtx.perp() - vtx.
perp();
97 dz = ivtx.z() - vtx.
z();
98 deta = imom.eta() - mom.
eta();
99 dphi = imom.phi() - mom.
phi();
105 deta = imom.
eta() - mom_temp.
eta();
106 dphi = imom.phi() - mom_temp.
phi();
110 dphi = dphi - 2 *
M_PI;
111 else if (dphi < -M_PI)
112 dphi = dphi + 2 *
M_PI;
114 float R =
sqrt(dphi * dphi + deta * deta);
135 fabs(deta) >= innerStrip) {
143 return (std::pair<int, float>(ntrack, ptSum));
155 std::vector<float> etaele;
156 std::vector<float> phiele;
161 for (reco::ElectronCollection::const_iterator iElectron = allEle->begin(); iElectron != allEle->end(); iElectron++) {
164 etaele.push_back(anothereletrackref->momentum().eta());
165 phiele.push_back(anothereletrackref->momentum().phi());
169 for (reco::TrackCollection::const_iterator trItr = isoTracks->begin(); trItr != isoTracks->end(); ++trItr) {
170 GlobalPoint ivtx(trItr->vertex().x(), trItr->vertex().y(), trItr->vertex().z());
174 float pt = imom.perp();
175 float dperp = ivtx.perp() - vtx.
perp();
176 float dz = ivtx.z() - vtx.
z();
177 float deta = imom.eta() - mom.
eta();
178 float dphi = imom.phi() - mom.
phi();
182 dphi = dphi - 2 *
M_PI;
183 else if (dphi < -M_PI)
184 dphi = dphi + 2 *
M_PI;
186 float R =
sqrt(dphi * dphi + deta * deta);
189 bool selected =
false;
190 bool passedconeveto =
true;
201 for (
unsigned int eleItr = 0; eleItr < etaele.size(); ++eleItr) {
202 deta = etaele[eleItr] - imom.eta();
203 dphi = phiele[eleItr] - imom.phi();
207 dphi = dphi - 2 *
M_PI;
208 else if (dphi < -M_PI)
209 dphi = dphi + 2 *
M_PI;
211 R =
sqrt(dphi * dphi + deta * deta);
213 passedconeveto =
false;
216 if (selected && passedconeveto) {
224 return (std::pair<int, float>(ntrack, ptSum));
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 Point & vertex() const override
vertex position (overwritten by PF...)
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