#include <PhysicsTools/PatUtils/interface/TrackerIsolationPt.h>
Public Member Functions | |
float | calculate (const Muon &theMuon, const edm::View< reco::Track > &theTracks, float isoConeMuon=0.3) const |
float | calculate (const Electron &theElectron, const edm::View< reco::Track > &theTracks, float isoConeElectron=0.3) const |
calculate the TrackIsoPt for the lepton object | |
TrackerIsolationPt () | |
constructor | |
virtual | ~TrackerIsolationPt () |
destructor | |
Private Member Functions | |
float | calculate (const reco::Track &theTrack, const edm::View< reco::Track > &theTracks, float isoCone) const |
calculate the TrackIsoPt for the lepton's track |
TrackerIsolationPt calculates a tracker isolation pt in a cone around the lepton's direction, without doing track extrapolation
Definition at line 31 of file TrackerIsolationPt.h.
TrackerIsolationPt::TrackerIsolationPt | ( | ) |
TrackerIsolationPt::~TrackerIsolationPt | ( | ) | [virtual] |
float TrackerIsolationPt::calculate | ( | const reco::Track & | theTrack, | |
const edm::View< reco::Track > & | theTracks, | |||
float | isoCone | |||
) | const [private] |
calculate the TrackIsoPt for the lepton's track
Definition at line 39 of file TrackerIsolationPt.cc.
References edm::View< T >::begin(), edm::View< T >::end(), reco::TrackBase::p(), reco::TrackBase::px(), reco::TrackBase::py(), reco::TrackBase::pz(), and track.
00039 { 00040 // initialize some variables 00041 float isoPtLepton = 0; 00042 const reco::Track * closestTrackDRPt = 0, * closestTrackDR = 0; 00043 float closestDRPt = 10000, closestDR = 10000; 00044 // use all these pointless vector conversions because the momenta from tracks 00045 // are completely unusable; bah, these math-vectors are worthless! 00046 HepLorentzVector lepton(theTrack.px(), theTrack.py(), theTrack.pz(), theTrack.p()); 00047 for (edm::View<reco::Track>::const_iterator itTrack = theTracks.begin(); itTrack != theTracks.end(); itTrack++) { 00048 HepLorentzVector track(itTrack->px(), itTrack->py(), itTrack->pz(), itTrack->p()); 00049 float dR = lepton.deltaR(track); 00050 if (dR < isoCone) { 00051 isoPtLepton += track.perp(); 00052 // find the closest matching track 00053 // FIXME: we could association by hits or chi2 to match 00054 float pRatio = track.perp()/lepton.perp(); 00055 if (dR < closestDRPt && pRatio > 0.5 && pRatio < 1.5) { 00056 closestDRPt = dR; 00057 closestTrackDRPt = &*itTrack; 00058 } 00059 if (dR < closestDR) { 00060 closestDR = dR; 00061 closestTrackDR = &*itTrack; 00062 } 00063 } 00064 } 00065 if (closestTrackDRPt) { 00066 GlobalVector closestTrackVector(closestTrackDRPt->px(), closestTrackDRPt->py(), closestTrackDRPt->pz()); 00067 isoPtLepton -= closestTrackVector.perp(); 00068 } else if (closestTrackDR) { 00069 GlobalVector closestTrackVector(closestTrackDR->px(), closestTrackDR->py(), closestTrackDR->pz()); 00070 isoPtLepton -= closestTrackVector.perp(); 00071 } 00072 // back to normal sum - S.L. 30/10/2007 00073 if (isoPtLepton<0) isoPtLepton = 0; 00074 // isoPtLepton <= 0.01 ? isoPtLepton = -1 : isoPtLepton = log(isoPtLepton); 00075 return isoPtLepton; 00076 }
float TrackerIsolationPt::calculate | ( | const Muon & | theMuon, | |
const edm::View< reco::Track > & | theTracks, | |||
float | isoConeMuon = 0.3 | |||
) | const |
Definition at line 34 of file TrackerIsolationPt.cc.
References calculate(), and pat::Muon::track().
float TrackerIsolationPt::calculate | ( | const Electron & | theElectron, | |
const edm::View< reco::Track > & | theTracks, | |||
float | isoConeElectron = 0.3 | |||
) | const |
calculate the TrackIsoPt for the lepton object
Definition at line 30 of file TrackerIsolationPt.cc.
References pat::Electron::gsfTrack().
Referenced by calculate(), and pat::LeptonJetIsolationAngle::calculate().