CMS 3D CMS Logo

pat::TrackerIsolationPt Class Reference

Calculates a lepton's tracker isolation pt. More...

#include <PhysicsTools/PatUtils/interface/TrackerIsolationPt.h>

List of all members.

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


Detailed Description

Calculates a lepton's tracker isolation pt.

TrackerIsolationPt calculates a tracker isolation pt in a cone around the lepton's direction, without doing track extrapolation

Author:
Steven Lowette
Version:
Id
TrackerIsolationPt.h,v 1.4 2008/03/05 14:51:03 fronga Exp

Definition at line 31 of file TrackerIsolationPt.h.


Constructor & Destructor Documentation

TrackerIsolationPt::TrackerIsolationPt (  ) 

constructor

Definition at line 22 of file TrackerIsolationPt.cc.

00022                                        {
00023 }

TrackerIsolationPt::~TrackerIsolationPt (  )  [virtual]

destructor

Definition at line 26 of file TrackerIsolationPt.cc.

00026                                         {
00027 }


Member Function Documentation

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().

00034                                                                                                                        {
00035   return this->calculate(*theMuon.track(), theTracks, isoConeMuon);
00036 }

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().

00030                                                                                                                                    {
00031   return this->calculate(*theElectron.gsfTrack(), theTracks, isoConeElectron);
00032 }


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:49:45 2009 for CMSSW by  doxygen 1.5.4