CMS 3D CMS Logo

Public Member Functions | Private Member Functions | Private Attributes

ElectronTkIsolation Class Reference

#include <ElectronTkIsolation.h>

List of all members.

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 &)
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::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().

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

{
}

Member Function Documentation

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

Definition at line 56 of file ElectronTkIsolation.cc.

References beamPoint_, egammaisolation::EgammaTrackSelector::bs, drb_, egammaisolation::EgammaTrackSelector::dz, dzOption_, extRadius_, reco::GsfElectron::gsfTrack(), intRadiusBarrel_, intRadiusEndcap_, lip_, ptLow_, stripBarrel_, stripEndcap_, egammaisolation::EgammaTrackSelector::vtx, and egammaisolation::EgammaTrackSelector::vz.

Referenced by getNumberTracks(), and getPtTracks().

{
  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 ) {

    math::XYZVector tmpTrackMomentumAtVtx = (*itrTr).momentum () ; 

    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;
}
int ElectronTkIsolation::getNumberTracks ( const reco::GsfElectron electron) const

Definition at line 113 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 119 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]

Member Data Documentation

Definition at line 117 of file ElectronTkIsolation.h.

Referenced by getIso().

double ElectronTkIsolation::drb_ [private]

Definition at line 115 of file ElectronTkIsolation.h.

Referenced by getIso().

Definition at line 119 of file ElectronTkIsolation.h.

Referenced by getIso(), and setDzOption().

Definition at line 108 of file ElectronTkIsolation.h.

Referenced by getIso().

Definition at line 109 of file ElectronTkIsolation.h.

Referenced by getIso().

Definition at line 110 of file ElectronTkIsolation.h.

Referenced by getIso().

double ElectronTkIsolation::lip_ [private]

Definition at line 114 of file ElectronTkIsolation.h.

Referenced by getIso().

double ElectronTkIsolation::ptLow_ [private]

Definition at line 113 of file ElectronTkIsolation.h.

Referenced by getIso().

Definition at line 111 of file ElectronTkIsolation.h.

Referenced by getIso().

Definition at line 112 of file ElectronTkIsolation.h.

Referenced by getIso().

Definition at line 116 of file ElectronTkIsolation.h.