#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::Track *) const |
int | getNumberTracks (const reco::GsfElectron *) const |
double | getPtTracks (const reco::GsfElectron *) const |
void | setDzOption (const std::string &s) |
~ElectronTkIsolation () | |
Private Member Functions | |
std::pair< int, double > | getIso (const reco::GsfElectron *) const |
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::TrackCollection * | trackCollection_ |
Definition at line 27 of file ElectronTkIsolation.h.
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().
: extRadius_(extRadius), intRadiusBarrel_(intRadius), intRadiusEndcap_(intRadius), stripBarrel_(0.0), stripEndcap_(0.0), ptLow_(ptLow), lip_(lip), drb_(drb), trackCollection_(trackCollection), beamPoint_(beamPoint) { setDzOption("vz"); }
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().
: extRadius_(extRadius), intRadiusBarrel_(intRadiusBarrel), intRadiusEndcap_(intRadiusEndcap), stripBarrel_(stripBarrel), stripEndcap_(stripEndcap), ptLow_(ptLow), lip_(lip), drb_(drb), trackCollection_(trackCollection), beamPoint_(beamPoint) { setDzOption("vz"); }
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().
: extRadius_(extRadius), intRadiusBarrel_(intRadiusBarrel), intRadiusEndcap_(intRadiusEndcap), stripBarrel_(stripBarrel), stripEndcap_(stripEndcap), ptLow_(ptLow), lip_(lip), drb_(drb), trackCollection_(trackCollection), beamPoint_(beamPoint) { setDzOption(dzOptionString); }
ElectronTkIsolation::~ElectronTkIsolation | ( | ) |
Definition at line 51 of file ElectronTkIsolation.cc.
{}
std::pair< int, double > ElectronTkIsolation::getIso | ( | const reco::Track * | tmpTrack | ) | const |
Definition at line 59 of file ElectronTkIsolation.cc.
References beamPoint_, egammaisolation::EgammaTrackSelector::bs, drb_, egammaisolation::EgammaTrackSelector::dz, dzOption_, extRadius_, intRadiusBarrel_, intRadiusEndcap_, lip_, ptLow_, stripBarrel_, stripEndcap_, reco::TrackBase::vertex(), egammaisolation::EgammaTrackSelector::vtx, and egammaisolation::EgammaTrackSelector::vz.
Referenced by getIso(), getNumberTracks(), getPtTracks(), and EgammaHLTElectronTrackIsolationProducers::produce().
{ int counter =0 ; double ptSum =0.; //Take the electron track //reco::GsfTrackRef tmpTrack = electron->gsfTrack() ; math::XYZVector tmpElectronMomentumAtVtx = (*tmpTrack).momentum () ; double tmpElectronEtaAtVertex = (*tmpTrack).eta(); for ( reco::TrackCollection::const_iterator itrTr = (*trackCollection_).begin() ; itrTr != (*trackCollection_).end() ; ++itrTr ) { double this_pt = (*itrTr).pt(); if ( this_pt < ptLow_ ) continue; double dzCut = 0; switch( dzOption_ ) { case egammaisolation::EgammaTrackSelector::dz : dzCut = fabs( (*itrTr).dz() - (*tmpTrack).dz() ); break; case egammaisolation::EgammaTrackSelector::vz : dzCut = fabs( (*itrTr).vz() - (*tmpTrack).vz() ); break; case egammaisolation::EgammaTrackSelector::bs : dzCut = fabs( (*itrTr).dz(beamPoint_) - (*tmpTrack).dz(beamPoint_) ); break; case egammaisolation::EgammaTrackSelector::vtx: dzCut = fabs( (*itrTr).dz(tmpTrack->vertex()) ); break; default : dzCut = fabs( (*itrTr).vz() - (*tmpTrack).vz() ); break; } if (dzCut > lip_ ) continue; if (fabs( (*itrTr).dxy(beamPoint_) ) > drb_ ) continue; double dr = ROOT::Math::VectorUtil::DeltaR(itrTr->momentum(),tmpElectronMomentumAtVtx) ; double deta = (*itrTr).eta() - tmpElectronEtaAtVertex; if (fabs(tmpElectronEtaAtVertex) < 1.479) { if ( fabs(dr) < extRadius_ && fabs(dr) >= intRadiusBarrel_ && fabs(deta) >= stripBarrel_) { ++counter ; ptSum += this_pt; } } else { if ( fabs(dr) < extRadius_ && fabs(dr) >= intRadiusEndcap_ && fabs(deta) >= stripEndcap_) { ++counter ; ptSum += this_pt; } } }//end loop over tracks std::pair<int,double> retval; retval.first = counter; retval.second = ptSum; return retval; }
std::pair< int, double > ElectronTkIsolation::getIso | ( | const reco::GsfElectron * | electron | ) | const [private] |
Definition at line 54 of file ElectronTkIsolation.cc.
References getIso(), and reco::GsfElectron::gsfTrack().
int ElectronTkIsolation::getNumberTracks | ( | const reco::GsfElectron * | electron | ) | const |
Definition at line 114 of file ElectronTkIsolation.cc.
References getIso().
Referenced by EgammaElectronTkNumIsolationProducer::produce().
{ //counter for the tracks in the isolation cone return getIso(electron).first ; }
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().
{ return getIso(electron).second ; }
void ElectronTkIsolation::setDzOption | ( | const std::string & | s | ) | [inline] |
Definition at line 95 of file ElectronTkIsolation.h.
References egammaisolation::EgammaTrackSelector::bs, egammaisolation::EgammaTrackSelector::dz, dzOption_, egammaisolation::EgammaTrackSelector::vtx, and egammaisolation::EgammaTrackSelector::vz.
Referenced by ElectronTkIsolation().
{ if( ! s.compare("dz") ) dzOption_ = egammaisolation::EgammaTrackSelector::dz; else if( ! s.compare("vz") ) dzOption_ = egammaisolation::EgammaTrackSelector::vz; else if( ! s.compare("bs") ) dzOption_ = egammaisolation::EgammaTrackSelector::bs; else if( ! s.compare("vtx") )dzOption_ = egammaisolation::EgammaTrackSelector::vtx; else dzOption_ = egammaisolation::EgammaTrackSelector::dz; }
Definition at line 118 of file ElectronTkIsolation.h.
Referenced by getIso().
double ElectronTkIsolation::drb_ [private] |
Definition at line 116 of file ElectronTkIsolation.h.
Referenced by getIso().
int ElectronTkIsolation::dzOption_ [private] |
Definition at line 120 of file ElectronTkIsolation.h.
Referenced by getIso(), and setDzOption().
double ElectronTkIsolation::extRadius_ [private] |
Definition at line 109 of file ElectronTkIsolation.h.
Referenced by getIso().
double ElectronTkIsolation::intRadiusBarrel_ [private] |
Definition at line 110 of file ElectronTkIsolation.h.
Referenced by getIso().
double ElectronTkIsolation::intRadiusEndcap_ [private] |
Definition at line 111 of file ElectronTkIsolation.h.
Referenced by getIso().
double ElectronTkIsolation::lip_ [private] |
Definition at line 115 of file ElectronTkIsolation.h.
Referenced by getIso().
double ElectronTkIsolation::ptLow_ [private] |
Definition at line 114 of file ElectronTkIsolation.h.
Referenced by getIso().
double ElectronTkIsolation::stripBarrel_ [private] |
Definition at line 112 of file ElectronTkIsolation.h.
Referenced by getIso().
double ElectronTkIsolation::stripEndcap_ [private] |
Definition at line 113 of file ElectronTkIsolation.h.
Referenced by getIso().
const reco::TrackCollection* ElectronTkIsolation::trackCollection_ [private] |
Definition at line 117 of file ElectronTkIsolation.h.