10 #include "CLHEP/Vector/LorentzVector.h"
41 float isoPtLepton = 0;
42 const reco::Track * closestTrackDRPt = 0, * closestTrackDR = 0;
43 float closestDRPt = 10000, closestDR = 10000;
46 CLHEP::HepLorentzVector lepton(theTrack.
px(), theTrack.
py(), theTrack.
pz(), theTrack.
p());
48 CLHEP::HepLorentzVector track(itTrack->px(), itTrack->py(), itTrack->pz(), itTrack->p());
49 float dR = lepton.deltaR(track);
51 isoPtLepton += track.perp();
54 float pRatio = track.perp()/lepton.perp();
55 if (dR < closestDRPt && pRatio > 0.5 && pRatio < 1.5) {
57 closestTrackDRPt = &*itTrack;
61 closestTrackDR = &*itTrack;
65 if (closestTrackDRPt) {
66 GlobalVector closestTrackVector(closestTrackDRPt->
px(), closestTrackDRPt->
py(), closestTrackDRPt->
pz());
67 isoPtLepton -= closestTrackVector.
perp();
68 }
else if (closestTrackDR) {
69 GlobalVector closestTrackVector(closestTrackDR->px(), closestTrackDR->py(), closestTrackDR->pz());
70 isoPtLepton -= closestTrackVector.
perp();
73 if (isoPtLepton<0) isoPtLepton = 0;
double p() const
momentum vector magnitude
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
TrackerIsolationPt()
constructor
reco::GsfTrackRef gsfTrack() const
override the reco::GsfElectron::gsfTrack method, to access the internal storage of the supercluster ...
double px() const
x coordinate of momentum vector
virtual ~TrackerIsolationPt()
destructor
double pz() const
z coordinate of momentum vector
Analysis-level electron class.
float calculate(const Electron &theElectron, const edm::View< reco::Track > &theTracks, float isoConeElectron=0.3) const
calculate the TrackIsoPt for the lepton object
const_iterator begin() const
const_iterator end() const
Analysis-level muon class.
reco::TrackRef track() const
reference to Track reconstructed in the tracker only (reimplemented from reco::Muon) ...
double py() const
y coordinate of momentum vector