CMS 3D CMS Logo

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 16 of file ElectronSqPtTkIsolation.h.

Constructor & Destructor Documentation

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

Definition at line 23 of file ElectronSqPtTkIsolation.cc.

23 {}

Member Function Documentation

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

Definition at line 26 of file ElectronSqPtTkIsolation.cc.

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

Referenced by getNumberTracks(), and getPtTracks().

26  {
27  int counter = 0;
28  double ptSum = 0.;
29  //Take the electron track
30  reco::GsfTrackRef tmpTrack = electron->gsfTrack();
31  math::XYZVector tmpElectronMomentumAtVtx = (*tmpTrack).momentum();
32 
33  for (reco::TrackCollection::const_iterator itrTr = (*trackCollection_).begin(); itrTr != (*trackCollection_).end();
34  ++itrTr) {
35  math::XYZVector tmpTrackMomentumAtVtx = (*itrTr).momentum();
36  double this_pt = (*itrTr).pt();
37  if (this_pt < ptLow_)
38  continue;
39  if (fabs((*itrTr).dz() - (*tmpTrack).dz()) > lip_)
40  continue;
41  double dr = DeltaR(tmpTrackMomentumAtVtx, tmpElectronMomentumAtVtx);
42  if (fabs(dr) < extRadius_ && fabs(dr) >= intRadius_) {
43  ++counter;
44  ptSum += this_pt * this_pt; // sum of squared pT
45  }
46  } //end loop over tracks
47 
48  std::pair<int, double> retval;
49  retval.first = counter;
50  retval.second = ptSum;
51 
52  return retval;
53 }
GsfTrackRef gsfTrack() const override
reference to a GsfTrack
Definition: GsfElectron.h:156
XYZVectorD XYZVector
spatial vector with cartesian internal representation
Definition: Vector3D.h:31
static std::atomic< unsigned int > counter
int ElectronSqPtTkIsolation::getNumberTracks ( const reco::GsfElectron electron) const

Definition at line 55 of file ElectronSqPtTkIsolation.cc.

References getIso().

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

Definition at line 60 of file ElectronSqPtTkIsolation.cc.

References getIso().

Referenced by ElectronSqPtTkIsolationProducer::produce().

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

Member Data Documentation

double ElectronSqPtTkIsolation::extRadius_
private

Definition at line 29 of file ElectronSqPtTkIsolation.h.

Referenced by getIso().

double ElectronSqPtTkIsolation::intRadius_
private

Definition at line 30 of file ElectronSqPtTkIsolation.h.

Referenced by getIso().

double ElectronSqPtTkIsolation::lip_
private

Definition at line 32 of file ElectronSqPtTkIsolation.h.

Referenced by getIso().

double ElectronSqPtTkIsolation::ptLow_
private

Definition at line 31 of file ElectronSqPtTkIsolation.h.

Referenced by getIso().

const reco::TrackCollection* ElectronSqPtTkIsolation::trackCollection_
private

Definition at line 34 of file ElectronSqPtTkIsolation.h.