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

32  stripBarrel_(0.0),
33  stripEndcap_(0.0),
34  ptLow_(ptLow),
35  lip_(lip),
36  drb_(drb),
38  beamPoint_(beamPoint) {
40  setDzOption("vz");
41  }

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

30  ptLow_(ptLow),
31  lip_(lip),
32  drb_(drb),
34  beamPoint_(beamPoint) {
36  setDzOption(dzOptionString);
37 }

References setAlgosToReject(), and setDzOption().

◆ ~ElectronTkIsolation()

ElectronTkIsolation::~ElectronTkIsolation ( )

Definition at line 39 of file ElectronTkIsolation.cc.

39 {}

Member Function Documentation

◆ getIso() [1/2]

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

Definition at line 41 of file ElectronTkIsolation.cc.

41  {
42  return getIso(&(*(electron->gsfTrack())));
43 }

References HPSPFTauProducerPuppi_cfi::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 46 of file ElectronTkIsolation.cc.

46  {
47  int counter = 0;
48  double ptSum = 0.;
49  //Take the electron track
50  math::XYZVector tmpElectronMomentumAtVtx = (*tmpTrack).momentum();
51  double tmpElectronEtaAtVertex = (*tmpTrack).eta();
52 
53  for (reco::TrackCollection::const_iterator itrTr = (*trackCollection_).begin(); itrTr != (*trackCollection_).end();
54  ++itrTr) {
55  double this_pt = (*itrTr).pt();
56  if (this_pt < ptLow_)
57  continue;
58 
59  double dzCut = 0;
60  switch (dzOption_) {
62  dzCut = fabs((*itrTr).dz() - (*tmpTrack).dz());
63  break;
65  dzCut = fabs((*itrTr).vz() - (*tmpTrack).vz());
66  break;
68  dzCut = fabs((*itrTr).dz(beamPoint_) - (*tmpTrack).dz(beamPoint_));
69  break;
71  dzCut = fabs((*itrTr).dz(tmpTrack->vertex()));
72  break;
73  default:
74  dzCut = fabs((*itrTr).vz() - (*tmpTrack).vz());
75  break;
76  }
77  if (dzCut > lip_)
78  continue;
79  if (fabs((*itrTr).dxy(beamPoint_)) > drb_)
80  continue;
81  double dr = ROOT::Math::VectorUtil::DeltaR(itrTr->momentum(), tmpElectronMomentumAtVtx);
82  double deta = (*itrTr).eta() - tmpElectronEtaAtVertex;
83  bool isBarrel = std::abs(tmpElectronEtaAtVertex) < 1.479;
86  if (dr < extRadius_ && dr >= intRadius && std::abs(deta) >= strip && passAlgo(*itrTr)) {
87  ++counter;
88  ptSum += this_pt;
89  }
90 
91  } //end loop over tracks
92 
93  std::pair<int, double> retval;
94  retval.first = counter;
95  retval.second = ptSum;
96 
97  return retval;
98 }

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

100  {
101  //counter for the tracks in the isolation cone
102  return getIso(electron).first;
103 }

References HPSPFTauProducerPuppi_cfi::electron, and getIso().

◆ getPtTracks()

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

Definition at line 105 of file ElectronTkIsolation.cc.

105 { return getIso(electron).second; }

References HPSPFTauProducerPuppi_cfi::electron, and getIso().

Referenced by EgammaElectronTkIsolationProducer::produce().

◆ passAlgo()

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

Definition at line 107 of file ElectronTkIsolation.cc.

107  {
108  int algo = trk.algo();
109  bool rejAlgo = std::binary_search(algosToReject_.begin(), algosToReject_.end(), algo);
110  return rejAlgo == false;
111 }

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

Referenced by getIso().

◆ setAlgosToReject()

void ElectronTkIsolation::setAlgosToReject ( )
private

◆ setDzOption()

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

Member Data Documentation

◆ algosToReject_

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

Definition at line 113 of file ElectronTkIsolation.h.

Referenced by passAlgo(), and setAlgosToReject().

◆ beamPoint_

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

Definition at line 115 of file ElectronTkIsolation.h.

Referenced by getIso().

◆ drb_

double ElectronTkIsolation::drb_
private

Definition at line 112 of file ElectronTkIsolation.h.

Referenced by getIso().

◆ dzOption_

int ElectronTkIsolation::dzOption_
private

Definition at line 117 of file ElectronTkIsolation.h.

Referenced by getIso(), and setDzOption().

◆ extRadius_

double ElectronTkIsolation::extRadius_
private

Definition at line 105 of file ElectronTkIsolation.h.

◆ intRadiusBarrel_

double ElectronTkIsolation::intRadiusBarrel_
private

Definition at line 106 of file ElectronTkIsolation.h.

Referenced by getIso().

◆ intRadiusEndcap_

double ElectronTkIsolation::intRadiusEndcap_
private

Definition at line 107 of file ElectronTkIsolation.h.

Referenced by getIso().

◆ lip_

double ElectronTkIsolation::lip_
private

Definition at line 111 of file ElectronTkIsolation.h.

Referenced by getIso().

◆ ptLow_

double ElectronTkIsolation::ptLow_
private

Definition at line 110 of file ElectronTkIsolation.h.

Referenced by getIso().

◆ stripBarrel_

double ElectronTkIsolation::stripBarrel_
private

Definition at line 108 of file ElectronTkIsolation.h.

Referenced by getIso().

◆ stripEndcap_

double ElectronTkIsolation::stripEndcap_
private

Definition at line 109 of file ElectronTkIsolation.h.

Referenced by getIso().

◆ trackCollection_

const reco::TrackCollection* ElectronTkIsolation::trackCollection_
private

Definition at line 114 of file ElectronTkIsolation.h.

egammaisolation::EgammaTrackSelector::vz
Definition: EgammaTrackSelector.h:20
counter
Definition: counter.py:1
egammaisolation::EgammaTrackSelector::vtx
Definition: EgammaTrackSelector.h:20
ElectronTkIsolation::intRadiusBarrel_
double intRadiusBarrel_
Definition: ElectronTkIsolation.h:106
ElectronTkIsolation::extRadius_
double extRadius_
Definition: ElectronTkIsolation.h:105
electronTrackIsolationLcone_cfi.stripEndcap
stripEndcap
Definition: electronTrackIsolationLcone_cfi.py:9
digitizers_cfi.strip
strip
Definition: digitizers_cfi.py:19
electronEcalRecHitIsolationLcone_cfi.extRadius
extRadius
Definition: electronEcalRecHitIsolationLcone_cfi.py:16
electronEcalRecHitIsolationLcone_cfi.intRadiusBarrel
intRadiusBarrel
Definition: electronEcalRecHitIsolationLcone_cfi.py:13
qcdUeDQM_cfi.lip
lip
Definition: qcdUeDQM_cfi.py:25
cmsdt::algo
algo
Definition: constants.h:171
alignCSCRings.s
s
Definition: alignCSCRings.py:92
reco::TrackBase::jetCoreRegionalStep
Definition: TrackBase.h:101
ElectronTkIsolation::lip_
double lip_
Definition: ElectronTkIsolation.h:111
TrackSplittingMonitor_cfi.dzCut
dzCut
Definition: TrackSplittingMonitor_cfi.py:20
ElectronTkIsolation::algosToReject_
std::vector< int > algosToReject_
Definition: ElectronTkIsolation.h:113
ElectronTkIsolation::stripEndcap_
double stripEndcap_
Definition: ElectronTkIsolation.h:109
egammaisolation::EgammaTrackSelector::dz
Definition: EgammaTrackSelector.h:20
PixelPluginsPhase0_cfi.isBarrel
isBarrel
Definition: PixelPluginsPhase0_cfi.py:17
ElectronTkIsolation::stripBarrel_
double stripBarrel_
Definition: ElectronTkIsolation.h:108
electronTrackIsolationLcone_cfi.stripBarrel
stripBarrel
Definition: electronTrackIsolationLcone_cfi.py:8
ElectronTkIsolation::setAlgosToReject
void setAlgosToReject()
Definition: ElectronTkIsolation.cc:113
duplicaterechits_cfi.trackCollection
trackCollection
Definition: duplicaterechits_cfi.py:4
jetUpdater_cfi.sort
sort
Definition: jetUpdater_cfi.py:29
ElectronTkIsolation::intRadiusEndcap_
double intRadiusEndcap_
Definition: ElectronTkIsolation.h:107
math::XYZVector
XYZVectorD XYZVector
spatial vector with cartesian internal representation
Definition: Vector3D.h:31
counter
static std::atomic< unsigned int > counter
Definition: SharedResourceNames.cc:18
ElectronTkIsolation::dzOption_
int dzOption_
Definition: ElectronTkIsolation.h:117
electronAnalyzer_cfi.DeltaR
DeltaR
Definition: electronAnalyzer_cfi.py:33
HPSPFTauProducerPuppi_cfi.electron
electron
Definition: HPSPFTauProducerPuppi_cfi.py:13
ElectronTkIsolation::getIso
std::pair< int, double > getIso(const reco::GsfElectron *) const
Definition: ElectronTkIsolation.cc:41
reco::TrackBase::vertex
const Point & vertex() const
reference point on the track. This method is DEPRECATED, please use referencePoint() instead
Definition: TrackBase.h:676
electronEcalRecHitIsolationLcone_cfi.intRadiusEndcap
intRadiusEndcap
Definition: electronEcalRecHitIsolationLcone_cfi.py:14
ElectronTkIsolation::trackCollection_
const reco::TrackCollection * trackCollection_
Definition: ElectronTkIsolation.h:114
reco::TrackBase::algo
TrackAlgorithm algo() const
Definition: TrackBase.h:547
ElectronTkIsolation::ptLow_
double ptLow_
Definition: ElectronTkIsolation.h:110
ElectronTkIsolation::setDzOption
void setDzOption(const std::string &s)
Definition: ElectronTkIsolation.h:84
ElectronTkIsolation::drb_
double drb_
Definition: ElectronTkIsolation.h:112
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
egammaisolation::EgammaTrackSelector::bs
Definition: EgammaTrackSelector.h:20
ElectronTkIsolation::passAlgo
bool passAlgo(const reco::TrackBase &trk) const
Definition: ElectronTkIsolation.cc:107
ElectronTkIsolation::beamPoint_
reco::TrackBase::Point beamPoint_
Definition: ElectronTkIsolation.h:115