CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions
pat::TrackerIsolationPt Class Reference

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

#include "PhysicsTools/PatUtils/interface/TrackerIsolationPt.h"

Public Member Functions

float calculate (const Electron &theElectron, const edm::View< reco::Track > &theTracks, float isoConeElectron=0.3) const
 calculate the TrackIsoPt for the lepton object More...
 
float calculate (const Muon &theMuon, const edm::View< reco::Track > &theTracks, float isoConeMuon=0.3) const
 
 TrackerIsolationPt ()
 constructor More...
 
virtual ~TrackerIsolationPt ()
 destructor More...
 

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 More...
 

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.

22  {
23 }
TrackerIsolationPt::~TrackerIsolationPt ( )
virtual

destructor

Definition at line 26 of file TrackerIsolationPt.cc.

26  {
27 }

Member Function Documentation

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

30  {
31  return this->calculate(*theElectron.gsfTrack(), theTracks, isoConeElectron);
32 }
reco::GsfTrackRef gsfTrack() const
override the reco::GsfElectron::gsfTrack method, to access the internal storage of the supercluster ...
Definition: Electron.cc:131
float calculate(const Electron &theElectron, const edm::View< reco::Track > &theTracks, float isoConeElectron=0.3) const
calculate the TrackIsoPt for the lepton object
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().

34  {
35  return this->calculate(*theMuon.track(), theTracks, isoConeMuon);
36 }
float calculate(const Electron &theElectron, const edm::View< reco::Track > &theTracks, float isoConeElectron=0.3) const
calculate the TrackIsoPt for the lepton object
reco::TrackRef track() const
reference to Track reconstructed in the tracker only (reimplemented from reco::Muon) ...
Definition: Muon.cc:156
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(), PFRecoTauDiscriminationAgainstElectronDeadECAL_cfi::dR, edm::View< T >::end(), reco::TrackBase::p(), PV3DBase< T, PVType, FrameType >::perp(), reco::TrackBase::px(), reco::TrackBase::py(), and reco::TrackBase::pz().

39  {
40  // initialize some variables
41  float isoPtLepton = 0;
42  const reco::Track * closestTrackDRPt = 0, * closestTrackDR = 0;
43  float closestDRPt = 10000, closestDR = 10000;
44  // use all these pointless vector conversions because the momenta from tracks
45  // are completely unusable; bah, these math-vectors are worthless!
46  CLHEP::HepLorentzVector lepton(theTrack.px(), theTrack.py(), theTrack.pz(), theTrack.p());
47  for (edm::View<reco::Track>::const_iterator itTrack = theTracks.begin(); itTrack != theTracks.end(); itTrack++) {
48  CLHEP::HepLorentzVector track(itTrack->px(), itTrack->py(), itTrack->pz(), itTrack->p());
49  float dR = lepton.deltaR(track);
50  if (dR < isoCone) {
51  isoPtLepton += track.perp();
52  // find the closest matching track
53  // FIXME: we could association by hits or chi2 to match
54  float pRatio = track.perp()/lepton.perp();
55  if (dR < closestDRPt && pRatio > 0.5 && pRatio < 1.5) {
56  closestDRPt = dR;
57  closestTrackDRPt = &*itTrack;
58  }
59  if (dR < closestDR) {
60  closestDR = dR;
61  closestTrackDR = &*itTrack;
62  }
63  }
64  }
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();
71  }
72  // back to normal sum - S.L. 30/10/2007
73  if (isoPtLepton<0) isoPtLepton = 0;
74  // isoPtLepton <= 0.01 ? isoPtLepton = -1 : isoPtLepton = log(isoPtLepton);
75  return isoPtLepton;
76 }
double p() const
momentum vector magnitude
Definition: TrackBase.h:129
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
Definition: View.h:81
T perp() const
Definition: PV3DBase.h:71
double px() const
x coordinate of momentum vector
Definition: TrackBase.h:133
double pz() const
z coordinate of momentum vector
Definition: TrackBase.h:137
const_iterator begin() const
const_iterator end() const
double py() const
y coordinate of momentum vector
Definition: TrackBase.h:135