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 | Private Attributes
ElectronSqPtTkIsolation Class Reference

#include <ElectronSqPtTkIsolation.h>

Public Member Functions

 ElectronSqPtTkIsolation (double extRadius, double intRadius, double ptLow, double lip, const reco::TrackCollection *)
 
int getNumberTracks (const reco::GsfElectron *) const
 
double getPtTracks (const reco::GsfElectron *) const
 
 ~ElectronSqPtTkIsolation ()
 

Private Member Functions

std::pair< int, double > getIso (const reco::GsfElectron *) const
 

Private Attributes

double extRadius_
 
double intRadius_
 
double lip_
 
double ptLow_
 
const reco::TrackCollectiontrackCollection_
 

Detailed Description

Definition at line 17 of file ElectronSqPtTkIsolation.h.

Constructor & Destructor Documentation

ElectronSqPtTkIsolation::ElectronSqPtTkIsolation ( double  extRadius,
double  intRadius,
double  ptLow,
double  lip,
const reco::TrackCollection trackCollection 
)

Definition at line 20 of file ElectronSqPtTkIsolation.cc.

24  :
25  extRadius_(extRadius),
26  intRadius_(intRadius),
27  ptLow_(ptLow),
28  lip_(lip),
30 {
31 }
tuple trackCollection
const reco::TrackCollection * trackCollection_
ElectronSqPtTkIsolation::~ElectronSqPtTkIsolation ( )

Definition at line 33 of file ElectronSqPtTkIsolation.cc.

34 {
35 }

Member Function Documentation

std::pair< int, double > ElectronSqPtTkIsolation::getIso ( const reco::GsfElectron electron) const
private

Definition at line 38 of file ElectronSqPtTkIsolation.cc.

References counter, HLT_FULL_cff::DeltaR, extRadius_, reco::GsfElectron::gsfTrack(), intRadius_, lip_, and ptLow_.

Referenced by getNumberTracks(), and getPtTracks().

39 {
40  int counter =0 ;
41  double ptSum =0.;
42  //Take the electron track
43  reco::GsfTrackRef tmpTrack = electron->gsfTrack() ;
44  math::XYZVector tmpElectronMomentumAtVtx = (*tmpTrack).momentum () ;
45 
46  for ( reco::TrackCollection::const_iterator itrTr = (*trackCollection_).begin() ;
47  itrTr != (*trackCollection_).end() ;
48  ++itrTr )
49  {
50  math::XYZVector tmpTrackMomentumAtVtx = (*itrTr).momentum () ;
51  double this_pt = (*itrTr).pt();
52  if ( this_pt < ptLow_ )
53  continue ;
54  if (fabs( (*itrTr).dz() - (*tmpTrack).dz() ) > lip_ )
55  continue ;
56  double dr = DeltaR(tmpTrackMomentumAtVtx,tmpElectronMomentumAtVtx) ;
57  if ( fabs(dr) < extRadius_ &&
58  fabs(dr) >= intRadius_ )
59  {
60  ++counter ;
61  ptSum += this_pt*this_pt; // sum of squared pT
62  }
63  }//end loop over tracks
64 
65  std::pair<int,double> retval;
66  retval.first = counter;
67  retval.second = ptSum;
68 
69  return retval;
70 }
XYZVectorD XYZVector
spatial vector with cartesian internal representation
Definition: Vector3D.h:30
static std::atomic< unsigned int > counter
virtual GsfTrackRef gsfTrack() const
reference to a GsfTrack
Definition: GsfElectron.h:183
int ElectronSqPtTkIsolation::getNumberTracks ( const reco::GsfElectron electron) const

Definition at line 73 of file ElectronSqPtTkIsolation.cc.

References getIso().

74 {
75  //counter for the tracks in the isolation cone
76  return getIso(electron).first ;
77 }
std::pair< int, double > getIso(const reco::GsfElectron *) const
double ElectronSqPtTkIsolation::getPtTracks ( const reco::GsfElectron electron) const

Definition at line 79 of file ElectronSqPtTkIsolation.cc.

References getIso().

Referenced by ElectronSqPtTkIsolationProducer::produce().

80 {
81  return getIso(electron).second ;
82 }
std::pair< int, double > getIso(const reco::GsfElectron *) const

Member Data Documentation

double ElectronSqPtTkIsolation::extRadius_
private

Definition at line 36 of file ElectronSqPtTkIsolation.h.

Referenced by getIso().

double ElectronSqPtTkIsolation::intRadius_
private

Definition at line 37 of file ElectronSqPtTkIsolation.h.

Referenced by getIso().

double ElectronSqPtTkIsolation::lip_
private

Definition at line 39 of file ElectronSqPtTkIsolation.h.

Referenced by getIso().

double ElectronSqPtTkIsolation::ptLow_
private

Definition at line 38 of file ElectronSqPtTkIsolation.h.

Referenced by getIso().

const reco::TrackCollection* ElectronSqPtTkIsolation::trackCollection_
private

Definition at line 41 of file ElectronSqPtTkIsolation.h.