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));
154 std::vector<float> etaele;
155 std::vector<float> phiele;
160 for (reco::ElectronCollection::const_iterator iElectron = allEle->begin(); iElectron != allEle->end(); iElectron++) {
162 etaele.push_back(anothereletrackref->momentum().eta());
163 phiele.push_back(anothereletrackref->momentum().phi());
166 for (reco::TrackCollection::const_iterator trItr = isoTracks->begin(); trItr != isoTracks->end(); ++trItr) {
167 GlobalPoint ivtx(trItr->vertex().x(), trItr->vertex().y(), trItr->vertex().z());
171 float pt = imom.perp();
172 float dperp = ivtx.perp() -
vtx.perp();
173 float dz = ivtx.z() -
vtx.z();
174 float deta = imom.eta() - mom.
eta();
175 float dphi = imom.phi() - mom.
phi();
179 dphi = dphi - 2 *
M_PI;
180 else if (dphi < -
M_PI)
181 dphi = dphi + 2 *
M_PI;
183 float R =
sqrt(dphi * dphi + deta * deta);
186 bool selected =
false;
187 bool passedconeveto =
true;
198 for (
unsigned int eleItr = 0; eleItr < etaele.size(); ++eleItr) {
199 deta = etaele[eleItr] - imom.eta();
200 dphi = phiele[eleItr] - imom.phi();
204 dphi = dphi - 2 *
M_PI;
205 else if (dphi < -
M_PI)
206 dphi = dphi + 2 *
M_PI;
208 R =
sqrt(dphi * dphi + deta * deta);
210 passedconeveto =
false;
213 if (selected && passedconeveto) {
221 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...)
bool isElectron(const Candidate &part)
const Point & vertex() const
reference point on the track. This method is DEPRECATED, please use referencePoint() instead ...
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)
const Vector & momentum() const
track momentum vector
virtual reco::SuperClusterRef superCluster() const
reference to a SuperCluster
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
Global3DVector GlobalVector