CMS 3D CMS Logo

List of all members | Public Member Functions | Private 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 *, reco::TrackBase::Point beamPoint, const std::string &)
 
 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)
 
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 Member Functions

bool passAlgo (const reco::TrackBase &trk) const
 
void setAlgosToReject ()
 

Private Attributes

std::vector< int > algosToReject_
 
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 26 of file ElectronTkIsolation.h.

Constructor & Destructor Documentation

◆ ElectronTkIsolation() [1/3]

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

Definition at line 29 of file ElectronTkIsolation.h.

39  stripBarrel_(0.0),
40  stripEndcap_(0.0),
41  ptLow_(ptLow),
42  lip_(lip),
43  drb_(drb),
45  beamPoint_(beamPoint) {
47  setDzOption("vz");
48  }

References setAlgosToReject(), and setDzOption().

◆ ElectronTkIsolation() [2/3]

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 50 of file ElectronTkIsolation.h.

References setAlgosToReject(), and setDzOption().

◆ ElectronTkIsolation() [3/3]

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 25 of file ElectronTkIsolation.cc.

41  ptLow_(ptLow),
42  lip_(lip),
43  drb_(drb),
45  beamPoint_(beamPoint) {
47  setDzOption(dzOptionString);
48 }

References setAlgosToReject(), and setDzOption().

◆ ~ElectronTkIsolation()

ElectronTkIsolation::~ElectronTkIsolation ( )

Definition at line 50 of file ElectronTkIsolation.cc.

50 {}

Member Function Documentation

◆ getIso() [1/2]

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

Definition at line 52 of file ElectronTkIsolation.cc.

52  {
53  return getIso(&(*(electron->gsfTrack())));
54 }

References metsig::electron.

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

◆ getIso() [2/2]

std::pair< int, double > ElectronTkIsolation::getIso ( const reco::Track tmpTrack) const

Definition at line 57 of file ElectronTkIsolation.cc.

57  {
58  int counter = 0;
59  double ptSum = 0.;
60  //Take the electron track
61  //reco::GsfTrackRef tmpTrack = electron->gsfTrack() ;
62  math::XYZVector tmpElectronMomentumAtVtx = (*tmpTrack).momentum();
63  double tmpElectronEtaAtVertex = (*tmpTrack).eta();
64 
65  for (reco::TrackCollection::const_iterator itrTr = (*trackCollection_).begin(); itrTr != (*trackCollection_).end();
66  ++itrTr) {
67  double this_pt = (*itrTr).pt();
68  if (this_pt < ptLow_)
69  continue;
70 
71  double dzCut = 0;
72  switch (dzOption_) {
74  dzCut = fabs((*itrTr).dz() - (*tmpTrack).dz());
75  break;
77  dzCut = fabs((*itrTr).vz() - (*tmpTrack).vz());
78  break;
80  dzCut = fabs((*itrTr).dz(beamPoint_) - (*tmpTrack).dz(beamPoint_));
81  break;
83  dzCut = fabs((*itrTr).dz(tmpTrack->vertex()));
84  break;
85  default:
86  dzCut = fabs((*itrTr).vz() - (*tmpTrack).vz());
87  break;
88  }
89  if (dzCut > lip_)
90  continue;
91  if (fabs((*itrTr).dxy(beamPoint_)) > drb_)
92  continue;
93  double dr = ROOT::Math::VectorUtil::DeltaR(itrTr->momentum(), tmpElectronMomentumAtVtx);
94  double deta = (*itrTr).eta() - tmpElectronEtaAtVertex;
95  bool isBarrel = std::abs(tmpElectronEtaAtVertex) < 1.479;
98  if (dr < extRadius_ && dr >= intRadius && std::abs(deta) >= strip && passAlgo(*itrTr)) {
99  ++counter;
100  ptSum += this_pt;
101  }
102 
103  } //end loop over tracks
104 
105  std::pair<int, double> retval;
106  retval.first = counter;
107  retval.second = ptSum;
108 
109  return retval;
110 }

References funct::abs(), beamPoint_, egammaisolation::EgammaTrackSelector::bs, counter, electronAnalyzer_cfi::DeltaR, flavorHistoryFilter_cfi::dr, drb_, egammaisolation::EgammaTrackSelector::dz, TrackSplittingMonitor_cfi::dzCut, dzOption_, electronHcalTowerIsolationLcone_cfi::intRadius, intRadiusBarrel_, intRadiusEndcap_, PixelPluginsPhase0_cfi::isBarrel, lip_, passAlgo(), ptLow_, digitizers_cfi::strip, stripBarrel_, stripEndcap_, reco::TrackBase::vertex(), egammaisolation::EgammaTrackSelector::vtx, and egammaisolation::EgammaTrackSelector::vz.

◆ getNumberTracks()

int ElectronTkIsolation::getNumberTracks ( const reco::GsfElectron electron) const

Definition at line 112 of file ElectronTkIsolation.cc.

112  {
113  //counter for the tracks in the isolation cone
114  return getIso(electron).first;
115 }

References metsig::electron, and getIso().

Referenced by EgammaElectronTkNumIsolationProducer::produce().

◆ getPtTracks()

double ElectronTkIsolation::getPtTracks ( const reco::GsfElectron electron) const

Definition at line 117 of file ElectronTkIsolation.cc.

117 { return getIso(electron).second; }

References metsig::electron, and getIso().

Referenced by EgammaElectronTkIsolationProducer::produce().

◆ passAlgo()

bool ElectronTkIsolation::passAlgo ( const reco::TrackBase trk) const
private

Definition at line 119 of file ElectronTkIsolation.cc.

119  {
120  int algo = trk.algo();
121  bool rejAlgo = std::binary_search(algosToReject_.begin(), algosToReject_.end(), algo);
122  return rejAlgo == false;
123 }

References reco::TrackBase::algo(), and algosToReject_.

Referenced by getIso().

◆ setAlgosToReject()

void ElectronTkIsolation::setAlgosToReject ( )
private

Definition at line 125 of file ElectronTkIsolation.cc.

125  {
127  std::sort(algosToReject_.begin(), algosToReject_.end());
128 }

References algosToReject_, and reco::TrackBase::jetCoreRegionalStep.

Referenced by ElectronTkIsolation().

◆ setDzOption()

void ElectronTkIsolation::setDzOption ( const std::string &  s)
inline

Member Data Documentation

◆ algosToReject_

std::vector<int> ElectronTkIsolation::algosToReject_
private

Definition at line 120 of file ElectronTkIsolation.h.

Referenced by passAlgo(), and setAlgosToReject().

◆ beamPoint_

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

Definition at line 122 of file ElectronTkIsolation.h.

Referenced by getIso().

◆ drb_

double ElectronTkIsolation::drb_
private

Definition at line 119 of file ElectronTkIsolation.h.

Referenced by getIso().

◆ dzOption_

int ElectronTkIsolation::dzOption_
private

Definition at line 124 of file ElectronTkIsolation.h.

Referenced by getIso(), and setDzOption().

◆ extRadius_

double ElectronTkIsolation::extRadius_
private

Definition at line 112 of file ElectronTkIsolation.h.

◆ intRadiusBarrel_

double ElectronTkIsolation::intRadiusBarrel_
private

Definition at line 113 of file ElectronTkIsolation.h.

Referenced by getIso().

◆ intRadiusEndcap_

double ElectronTkIsolation::intRadiusEndcap_
private

Definition at line 114 of file ElectronTkIsolation.h.

Referenced by getIso().

◆ lip_

double ElectronTkIsolation::lip_
private

Definition at line 118 of file ElectronTkIsolation.h.

Referenced by getIso().

◆ ptLow_

double ElectronTkIsolation::ptLow_
private

Definition at line 117 of file ElectronTkIsolation.h.

Referenced by getIso().

◆ stripBarrel_

double ElectronTkIsolation::stripBarrel_
private

Definition at line 115 of file ElectronTkIsolation.h.

Referenced by getIso().

◆ stripEndcap_

double ElectronTkIsolation::stripEndcap_
private

Definition at line 116 of file ElectronTkIsolation.h.

Referenced by getIso().

◆ trackCollection_

const reco::TrackCollection* ElectronTkIsolation::trackCollection_
private

Definition at line 121 of file ElectronTkIsolation.h.

counter
Definition: counter.py:1
ElectronTkIsolation::intRadiusBarrel_
double intRadiusBarrel_
Definition: ElectronTkIsolation.h:113
ElectronTkIsolation::extRadius_
double extRadius_
Definition: ElectronTkIsolation.h:112
electronTrackIsolationLcone_cfi.stripEndcap
stripEndcap
Definition: electronTrackIsolationLcone_cfi.py:9
egammaisolation::EgammaTrackSelector::dz
Definition: EgammaTrackSelector.h:20
digitizers_cfi.strip
strip
Definition: digitizers_cfi.py:19
electronEcalRecHitIsolationLcone_cfi.extRadius
extRadius
Definition: electronEcalRecHitIsolationLcone_cfi.py:18
electronEcalRecHitIsolationLcone_cfi.intRadiusBarrel
intRadiusBarrel
Definition: electronEcalRecHitIsolationLcone_cfi.py:15
egammaisolation::EgammaTrackSelector::bs
Definition: EgammaTrackSelector.h:20
egammaisolation::EgammaTrackSelector::vz
Definition: EgammaTrackSelector.h:20
qcdUeDQM_cfi.lip
lip
Definition: qcdUeDQM_cfi.py:25
cmsdt::algo
algo
Definition: constants.h:164
alignCSCRings.s
s
Definition: alignCSCRings.py:92
reco::TrackBase::jetCoreRegionalStep
Definition: TrackBase.h:101
ElectronTkIsolation::lip_
double lip_
Definition: ElectronTkIsolation.h:118
TrackSplittingMonitor_cfi.dzCut
dzCut
Definition: TrackSplittingMonitor_cfi.py:20
ElectronTkIsolation::algosToReject_
std::vector< int > algosToReject_
Definition: ElectronTkIsolation.h:120
metsig::electron
Definition: SignAlgoResolutions.h:48
ElectronTkIsolation::stripEndcap_
double stripEndcap_
Definition: ElectronTkIsolation.h:116
PixelPluginsPhase0_cfi.isBarrel
isBarrel
Definition: PixelPluginsPhase0_cfi.py:17
ElectronTkIsolation::stripBarrel_
double stripBarrel_
Definition: ElectronTkIsolation.h:115
electronTrackIsolationLcone_cfi.stripBarrel
stripBarrel
Definition: electronTrackIsolationLcone_cfi.py:8
ElectronTkIsolation::setAlgosToReject
void setAlgosToReject()
Definition: ElectronTkIsolation.cc:125
duplicaterechits_cfi.trackCollection
trackCollection
Definition: duplicaterechits_cfi.py:4
ElectronTkIsolation::intRadiusEndcap_
double intRadiusEndcap_
Definition: ElectronTkIsolation.h:114
math::XYZVector
XYZVectorD XYZVector
spatial vector with cartesian internal representation
Definition: Vector3D.h:31
egammaisolation::EgammaTrackSelector::vtx
Definition: EgammaTrackSelector.h:20
counter
static std::atomic< unsigned int > counter
Definition: SharedResourceNames.cc:15
ElectronTkIsolation::dzOption_
int dzOption_
Definition: ElectronTkIsolation.h:124
electronAnalyzer_cfi.DeltaR
DeltaR
Definition: electronAnalyzer_cfi.py:33
ElectronTkIsolation::getIso
std::pair< int, double > getIso(const reco::GsfElectron *) const
Definition: ElectronTkIsolation.cc:52
reco::TrackBase::vertex
const Point & vertex() const
reference point on the track. This method is DEPRECATED, please use referencePoint() instead
Definition: TrackBase.h:647
electronEcalRecHitIsolationLcone_cfi.intRadiusEndcap
intRadiusEndcap
Definition: electronEcalRecHitIsolationLcone_cfi.py:16
ElectronTkIsolation::trackCollection_
const reco::TrackCollection * trackCollection_
Definition: ElectronTkIsolation.h:121
reco::TrackBase::algo
TrackAlgorithm algo() const
Definition: TrackBase.h:532
ElectronTkIsolation::ptLow_
double ptLow_
Definition: ElectronTkIsolation.h:117
ElectronTkIsolation::setDzOption
void setDzOption(const std::string &s)
Definition: ElectronTkIsolation.h:91
ElectronTkIsolation::drb_
double drb_
Definition: ElectronTkIsolation.h:119
electronHcalTowerIsolationLcone_cfi.intRadius
intRadius
Definition: electronHcalTowerIsolationLcone_cfi.py:5
flavorHistoryFilter_cfi.dr
dr
Definition: flavorHistoryFilter_cfi.py:37
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
ElectronTkIsolation::passAlgo
bool passAlgo(const reco::TrackBase &trk) const
Definition: ElectronTkIsolation.cc:119
ElectronTkIsolation::beamPoint_
reco::TrackBase::Point beamPoint_
Definition: ElectronTkIsolation.h:122