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 *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 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::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.

References setAlgosToReject(), and setDzOption().

Referenced by ElectronTkIsolation().

39  stripBarrel_(0.0),
40  stripEndcap_(0.0),
41  ptLow_(ptLow),
42  lip_(lip),
43  drb_(drb),
45  beamPoint_(beamPoint) {
47  setDzOption("vz");
48  }
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 50 of file ElectronTkIsolation.h.

References ElectronTkIsolation(), electronEcalRecHitIsolationLcone_cfi::extRadius, electronEcalRecHitIsolationLcone_cfi::intRadiusBarrel, electronEcalRecHitIsolationLcone_cfi::intRadiusEndcap, qcdUeDQM_cfi::lip, setAlgosToReject(), setDzOption(), AlCaHLTBitMon_QueryRunRegistry::string, electronTrackIsolationLcone_cfi::stripBarrel, electronTrackIsolationLcone_cfi::stripEndcap, and ~ElectronTkIsolation().

65  ptLow_(ptLow),
66  lip_(lip),
67  drb_(drb),
69  beamPoint_(beamPoint) {
71  setDzOption("vz");
72  }
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 25 of file ElectronTkIsolation.cc.

References setAlgosToReject(), and setDzOption().

41  ptLow_(ptLow),
42  lip_(lip),
43  drb_(drb),
45  beamPoint_(beamPoint) {
47  setDzOption(dzOptionString);
48 }
void setDzOption(const std::string &s)
const reco::TrackCollection * trackCollection_
reco::TrackBase::Point beamPoint_
ElectronTkIsolation::~ElectronTkIsolation ( )

Definition at line 50 of file ElectronTkIsolation.cc.

Referenced by ElectronTkIsolation().

50 {}

Member Function Documentation

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

Definition at line 52 of file ElectronTkIsolation.cc.

References reco::GsfElectron::gsfTrack().

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

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

Definition at line 57 of file ElectronTkIsolation.cc.

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.

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;
96  double intRadius = isBarrel ? intRadiusBarrel_ : intRadiusEndcap_;
97  double strip = isBarrel ? stripBarrel_ : stripEndcap_;
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 }
bool passAlgo(const reco::TrackBase &trk) const
const Point & vertex() const
reference point on the track. This method is DEPRECATED, please use referencePoint() instead ...
Definition: TrackBase.h:641
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
XYZVectorD XYZVector
spatial vector with cartesian internal representation
Definition: Vector3D.h:31
static std::atomic< unsigned int > counter
reco::TrackBase::Point beamPoint_
int ElectronTkIsolation::getNumberTracks ( const reco::GsfElectron electron) const

Definition at line 112 of file ElectronTkIsolation.cc.

References getIso().

Referenced by EgammaElectronTkNumIsolationProducer::produce(), and setDzOption().

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

Definition at line 117 of file ElectronTkIsolation.cc.

References getIso().

Referenced by EgammaElectronTkIsolationProducer::produce(), and setDzOption().

117 { return getIso(electron).second; }
std::pair< int, double > getIso(const reco::GsfElectron *) const
bool ElectronTkIsolation::passAlgo ( const reco::TrackBase trk) const
private

Definition at line 119 of file ElectronTkIsolation.cc.

References ecalcalib_dqm_sourceclient-live_cfg::algo, reco::TrackBase::algo(), and algosToReject_.

Referenced by getIso(), and setDzOption().

119  {
120  int algo = trk.algo();
121  bool rejAlgo = std::binary_search(algosToReject_.begin(), algosToReject_.end(), algo);
122  return rejAlgo == false;
123 }
TrackAlgorithm algo() const
Definition: TrackBase.h:526
std::vector< int > algosToReject_
void ElectronTkIsolation::setAlgosToReject ( )
private
void ElectronTkIsolation::setDzOption ( const std::string &  s)
inline

Member Data Documentation

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

Definition at line 120 of file ElectronTkIsolation.h.

Referenced by passAlgo(), and setAlgosToReject().

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

Definition at line 122 of file ElectronTkIsolation.h.

Referenced by getIso().

double ElectronTkIsolation::drb_
private

Definition at line 119 of file ElectronTkIsolation.h.

Referenced by getIso().

int ElectronTkIsolation::dzOption_
private

Definition at line 124 of file ElectronTkIsolation.h.

Referenced by getIso(), and setDzOption().

double ElectronTkIsolation::extRadius_
private

Definition at line 112 of file ElectronTkIsolation.h.

double ElectronTkIsolation::intRadiusBarrel_
private

Definition at line 113 of file ElectronTkIsolation.h.

Referenced by getIso().

double ElectronTkIsolation::intRadiusEndcap_
private

Definition at line 114 of file ElectronTkIsolation.h.

Referenced by getIso().

double ElectronTkIsolation::lip_
private

Definition at line 118 of file ElectronTkIsolation.h.

Referenced by getIso().

double ElectronTkIsolation::ptLow_
private

Definition at line 117 of file ElectronTkIsolation.h.

Referenced by getIso().

double ElectronTkIsolation::stripBarrel_
private

Definition at line 115 of file ElectronTkIsolation.h.

Referenced by getIso().

double ElectronTkIsolation::stripEndcap_
private

Definition at line 116 of file ElectronTkIsolation.h.

Referenced by getIso().

const reco::TrackCollection* ElectronTkIsolation::trackCollection_
private

Definition at line 121 of file ElectronTkIsolation.h.