9 #include "CLHEP/Vector/LorentzVector.h"
29 float isoConeElectron)
const {
35 float isoConeMuon)
const {
42 float isoCone)
const {
44 float isoPtLepton = 0;
45 const reco::Track *closestTrackDRPt =
nullptr, *closestTrackDR =
nullptr;
46 float closestDRPt = 10000, closestDR = 10000;
49 CLHEP::HepLorentzVector lepton(theTrack.
px(), theTrack.
py(), theTrack.
pz(), theTrack.
p());
51 CLHEP::HepLorentzVector
track(itTrack->px(), itTrack->py(), itTrack->pz(), itTrack->p());
52 float dR = lepton.deltaR(
track);
54 isoPtLepton +=
track.perp();
57 float pRatio =
track.perp() / lepton.perp();
58 if (dR < closestDRPt && pRatio > 0.5 && pRatio < 1.5) {
60 closestTrackDRPt = &*itTrack;
64 closestTrackDR = &*itTrack;
68 if (closestTrackDRPt) {
69 GlobalVector closestTrackVector(closestTrackDRPt->
px(), closestTrackDRPt->
py(), closestTrackDRPt->
pz());
70 isoPtLepton -= closestTrackVector.
perp();
71 }
else if (closestTrackDR) {
72 GlobalVector closestTrackVector(closestTrackDR->px(), closestTrackDR->py(), closestTrackDR->pz());
73 isoPtLepton -= closestTrackVector.
perp();