test
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.3 2008/02/28 14:54:24 llista Exp

Definition at line 30 of file TrackerIsolationPt.h.

Constructor & Destructor Documentation

TrackerIsolationPt::TrackerIsolationPt ( )

constructor

Definition at line 21 of file TrackerIsolationPt.cc.

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

destructor

Definition at line 25 of file TrackerIsolationPt.cc.

25  {
26 }

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 29 of file TrackerIsolationPt.cc.

References pat::Electron::gsfTrack().

Referenced by calculate(), and pat::LeptonJetIsolationAngle::calculate().

29  {
30  return this->calculate(*theElectron.gsfTrack(), theTracks, isoConeElectron);
31 }
reco::GsfTrackRef gsfTrack() const
override the reco::GsfElectron::gsfTrack method, to access the internal storage of the supercluster ...
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 33 of file TrackerIsolationPt.cc.

References calculate(), and pat::Muon::track().

33  {
34  return this->calculate(*theMuon.track(), theTracks, isoConeMuon);
35 }
reco::TrackRef track() const
reference to Track reconstructed in the tracker only (reimplemented from reco::Muon) ...
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 reco::Track theTrack,
const edm::View< reco::Track > &  theTracks,
float  isoCone 
) const
private

calculate the TrackIsoPt for the lepton's track

Definition at line 38 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().

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