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 Attributes
ElectronTkIsolation Class Reference

#include <ElectronTkIsolation.h>

Public Member Functions

 ElectronTkIsolation (double extRadius, double intRadius, double ptLow, double lip, double drb, const reco::TrackCollection *trackCollection, reco::TrackBase::Point beamPoint)
 
 ElectronTkIsolation (double extRadius, double intRadiusBarrel, double intRadiusEndcap, double stripBarrel, double stripEndcap, double ptLow, double lip, double drb, const reco::TrackCollection *trackCollection, reco::TrackBase::Point beamPoint)
 
 ElectronTkIsolation (double extRadius, double intRadiusBarrel, double intRadiusEndcap, double stripBarrel, double stripEndcap, double ptLow, double lip, double drb, const reco::TrackCollection *, reco::TrackBase::Point beamPoint, const std::string &)
 
std::pair< int, double > getIso (const reco::GsfElectron *) const
 
std::pair< int, double > getIso (const reco::Track *) const
 
int getNumberTracks (const reco::GsfElectron *) const
 
double getPtTracks (const reco::GsfElectron *) const
 
void setDzOption (const std::string &s)
 
 ~ElectronTkIsolation ()
 

Private Attributes

reco::TrackBase::Point beamPoint_
 
double drb_
 
int dzOption_
 
double extRadius_
 
double intRadiusBarrel_
 
double intRadiusEndcap_
 
double lip_
 
double ptLow_
 
double stripBarrel_
 
double stripEndcap_
 
const reco::TrackCollectiontrackCollection_
 

Detailed Description

Definition at line 27 of file ElectronTkIsolation.h.

Constructor & Destructor Documentation

ElectronTkIsolation::ElectronTkIsolation ( double  extRadius,
double  intRadius,
double  ptLow,
double  lip,
double  drb,
const reco::TrackCollection trackCollection,
reco::TrackBase::Point  beamPoint 
)
inline

Definition at line 31 of file ElectronTkIsolation.h.

References setDzOption().

37  :
38  extRadius_(extRadius),
39  intRadiusBarrel_(intRadius),
40  intRadiusEndcap_(intRadius),
41  stripBarrel_(0.0),
42  stripEndcap_(0.0),
43  ptLow_(ptLow),
44  lip_(lip),
45  drb_(drb),
47  beamPoint_(beamPoint) {
48 
49  setDzOption("vz");
50 
51  }
void setDzOption(const std::string &s)
const reco::TrackCollection * trackCollection_
reco::TrackBase::Point beamPoint_
ElectronTkIsolation::ElectronTkIsolation ( double  extRadius,
double  intRadiusBarrel,
double  intRadiusEndcap,
double  stripBarrel,
double  stripEndcap,
double  ptLow,
double  lip,
double  drb,
const reco::TrackCollection trackCollection,
reco::TrackBase::Point  beamPoint 
)
inline

Definition at line 53 of file ElectronTkIsolation.h.

References setDzOption().

62  :
63  extRadius_(extRadius),
64  intRadiusBarrel_(intRadiusBarrel),
65  intRadiusEndcap_(intRadiusEndcap),
66  stripBarrel_(stripBarrel),
67  stripEndcap_(stripEndcap),
68  ptLow_(ptLow),
69  lip_(lip),
70  drb_(drb),
72  beamPoint_(beamPoint) {
73 
74  setDzOption("vz");
75 
76  }
void setDzOption(const std::string &s)
const reco::TrackCollection * trackCollection_
reco::TrackBase::Point beamPoint_
ElectronTkIsolation::ElectronTkIsolation ( double  extRadius,
double  intRadiusBarrel,
double  intRadiusEndcap,
double  stripBarrel,
double  stripEndcap,
double  ptLow,
double  lip,
double  drb,
const reco::TrackCollection trackCollection,
reco::TrackBase::Point  beamPoint,
const std::string &  dzOptionString 
)

Definition at line 26 of file ElectronTkIsolation.cc.

References setDzOption().

36  :
37  extRadius_(extRadius),
38  intRadiusBarrel_(intRadiusBarrel),
39  intRadiusEndcap_(intRadiusEndcap),
40  stripBarrel_(stripBarrel),
41  stripEndcap_(stripEndcap),
42  ptLow_(ptLow),
43  lip_(lip),
44  drb_(drb),
46  beamPoint_(beamPoint)
47 {
48  setDzOption(dzOptionString);
49 }
void setDzOption(const std::string &s)
const reco::TrackCollection * trackCollection_
reco::TrackBase::Point beamPoint_
ElectronTkIsolation::~ElectronTkIsolation ( )

Definition at line 51 of file ElectronTkIsolation.cc.

52 {}

Member Function Documentation

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

Definition at line 54 of file ElectronTkIsolation.cc.

References reco::GsfElectron::gsfTrack().

Referenced by getNumberTracks(), getPtTracks(), and EgammaHLTElectronTrackIsolationProducers::produce().

54  {
55  return getIso(&(*(electron->gsfTrack())));
56 }
std::pair< int, double > getIso(const reco::GsfElectron *) const
virtual GsfTrackRef gsfTrack() const
reference to a GsfTrack
Definition: GsfElectron.h:183
std::pair< int, double > ElectronTkIsolation::getIso ( const reco::Track tmpTrack) const

Definition at line 59 of file ElectronTkIsolation.cc.

References beamPoint_, egammaisolation::EgammaTrackSelector::bs, counter, HLT_25ns14e33_v1_cff::DeltaR, drb_, egammaisolation::EgammaTrackSelector::dz, dzOption_, extRadius_, intRadiusBarrel_, intRadiusEndcap_, lip_, ptLow_, stripBarrel_, stripEndcap_, reco::TrackBase::vertex(), egammaisolation::EgammaTrackSelector::vtx, and egammaisolation::EgammaTrackSelector::vz.

60 {
61  int counter =0 ;
62  double ptSum =0.;
63  //Take the electron track
64  //reco::GsfTrackRef tmpTrack = electron->gsfTrack() ;
65  math::XYZVector tmpElectronMomentumAtVtx = (*tmpTrack).momentum () ;
66  double tmpElectronEtaAtVertex = (*tmpTrack).eta();
67 
68 
69  for ( reco::TrackCollection::const_iterator itrTr = (*trackCollection_).begin() ;
70  itrTr != (*trackCollection_).end() ;
71  ++itrTr ) {
72 
73  double this_pt = (*itrTr).pt();
74  if ( this_pt < ptLow_ ) continue;
75 
76 
77  double dzCut = 0;
78  switch( dzOption_ ) {
79  case egammaisolation::EgammaTrackSelector::dz : dzCut = fabs( (*itrTr).dz() - (*tmpTrack).dz() ); break;
80  case egammaisolation::EgammaTrackSelector::vz : dzCut = fabs( (*itrTr).vz() - (*tmpTrack).vz() ); break;
81  case egammaisolation::EgammaTrackSelector::bs : dzCut = fabs( (*itrTr).dz(beamPoint_) - (*tmpTrack).dz(beamPoint_) ); break;
82  case egammaisolation::EgammaTrackSelector::vtx: dzCut = fabs( (*itrTr).dz(tmpTrack->vertex()) ); break;
83  default : dzCut = fabs( (*itrTr).vz() - (*tmpTrack).vz() ); break;
84  }
85  if (dzCut > lip_ ) continue;
86  if (fabs( (*itrTr).dxy(beamPoint_) ) > drb_ ) continue;
87  double dr = ROOT::Math::VectorUtil::DeltaR(itrTr->momentum(),tmpElectronMomentumAtVtx) ;
88  double deta = (*itrTr).eta() - tmpElectronEtaAtVertex;
89  if (fabs(tmpElectronEtaAtVertex) < 1.479) {
90  if ( fabs(dr) < extRadius_ && fabs(dr) >= intRadiusBarrel_ && fabs(deta) >= stripBarrel_)
91  {
92  ++counter ;
93  ptSum += this_pt;
94  }
95  }
96  else {
97  if ( fabs(dr) < extRadius_ && fabs(dr) >= intRadiusEndcap_ && fabs(deta) >= stripEndcap_)
98  {
99  ++counter ;
100  ptSum += this_pt;
101  }
102  }
103 
104  }//end loop over tracks
105 
106  std::pair<int,double> retval;
107  retval.first = counter;
108  retval.second = ptSum;
109 
110  return retval;
111 }
const Point & vertex() const
reference point on the track. This method is DEPRECATED, please use referencePoint() instead ...
Definition: TrackBase.h:650
XYZVectorD XYZVector
spatial vector with cartesian internal representation
Definition: Vector3D.h:30
static std::atomic< unsigned int > counter
reco::TrackBase::Point beamPoint_
int ElectronTkIsolation::getNumberTracks ( const reco::GsfElectron electron) const

Definition at line 114 of file ElectronTkIsolation.cc.

References getIso().

Referenced by EgammaElectronTkNumIsolationProducer::produce().

115 {
116  //counter for the tracks in the isolation cone
117  return getIso(electron).first ;
118 }
std::pair< int, double > getIso(const reco::GsfElectron *) const
double ElectronTkIsolation::getPtTracks ( const reco::GsfElectron electron) const

Definition at line 120 of file ElectronTkIsolation.cc.

References getIso().

Referenced by GsfElectronAlgo::createElectron(), and EgammaElectronTkIsolationProducer::produce().

121 {
122  return getIso(electron).second ;
123 }
std::pair< int, double > getIso(const reco::GsfElectron *) const
void ElectronTkIsolation::setDzOption ( const std::string &  s)
inline

Member Data Documentation

reco::TrackBase::Point ElectronTkIsolation::beamPoint_
private

Definition at line 119 of file ElectronTkIsolation.h.

Referenced by getIso().

double ElectronTkIsolation::drb_
private

Definition at line 117 of file ElectronTkIsolation.h.

Referenced by getIso().

int ElectronTkIsolation::dzOption_
private

Definition at line 121 of file ElectronTkIsolation.h.

Referenced by getIso(), and setDzOption().

double ElectronTkIsolation::extRadius_
private

Definition at line 110 of file ElectronTkIsolation.h.

Referenced by getIso().

double ElectronTkIsolation::intRadiusBarrel_
private

Definition at line 111 of file ElectronTkIsolation.h.

Referenced by getIso().

double ElectronTkIsolation::intRadiusEndcap_
private

Definition at line 112 of file ElectronTkIsolation.h.

Referenced by getIso().

double ElectronTkIsolation::lip_
private

Definition at line 116 of file ElectronTkIsolation.h.

Referenced by getIso().

double ElectronTkIsolation::ptLow_
private

Definition at line 115 of file ElectronTkIsolation.h.

Referenced by getIso().

double ElectronTkIsolation::stripBarrel_
private

Definition at line 113 of file ElectronTkIsolation.h.

Referenced by getIso().

double ElectronTkIsolation::stripEndcap_
private

Definition at line 114 of file ElectronTkIsolation.h.

Referenced by getIso().

const reco::TrackCollection* ElectronTkIsolation::trackCollection_
private

Definition at line 118 of file ElectronTkIsolation.h.