CMS 3D CMS Logo

Public Member Functions | Private Attributes

PhotonTkIsolation Class Reference

#include <PhotonTkIsolation.h>

List of all members.

Public Member Functions

std::pair< int, float > getIso (const reco::Candidate *) const
 PhotonTkIsolation (float extRadius, float intRadius, float strip, float etLow, float lip, float drb, const reco::TrackCollection *trackCollection, reco::TrackBase::Point beamPoint)
 PhotonTkIsolation (float extRadius, float intRadiusBarrel, float intRadiusEndcap, float stripBarrel, float stripEndcap, float etLow, float lip, float drb, const reco::TrackCollection *trackCollection, reco::TrackBase::Point beamPoint)
 PhotonTkIsolation (float extRadius, float intRadiusBarrel, float intRadiusEndcap, float stripBarrel, float stripEndcap, float etLow, float lip, float drb, const reco::TrackCollection *, reco::TrackBase::Point beamPoint, const std::string &)
 PhotonTkIsolation (float extRadius, float intRadius, float etLow, float lip, float drb, const reco::TrackCollection *trackCollection, reco::TrackBase::Point beamPoint)
void setDzOption (const std::string &s)
 ~PhotonTkIsolation ()

Private Attributes

reco::TrackBase::Point beamPoint_
float drb_
int dzOption_
float etLow_
float extRadius2_
float intRadiusBarrel2_
float intRadiusEndcap2_
float lip_
float stripBarrel_
float stripEndcap_
const reco::TrackCollectiontrackCollection_

Detailed Description

Definition at line 25 of file PhotonTkIsolation.h.


Constructor & Destructor Documentation

PhotonTkIsolation::PhotonTkIsolation ( float  extRadius,
float  intRadius,
float  etLow,
float  lip,
float  drb,
const reco::TrackCollection trackCollection,
reco::TrackBase::Point  beamPoint 
) [inline]

Definition at line 29 of file PhotonTkIsolation.h.

References setDzOption().

                                                   :
    extRadius2_(extRadius*extRadius),
    intRadiusBarrel2_(intRadius*intRadius),
    intRadiusEndcap2_(intRadius*intRadius),
    stripBarrel_(0.0),
    stripEndcap_(0.0),
    etLow_(etLow),
    lip_(lip),
    drb_(drb),
    trackCollection_(trackCollection),
    beamPoint_(beamPoint) {
    
    setDzOption("vz");

  }
PhotonTkIsolation::PhotonTkIsolation ( float  extRadius,
float  intRadius,
float  strip,
float  etLow,
float  lip,
float  drb,
const reco::TrackCollection trackCollection,
reco::TrackBase::Point  beamPoint 
) [inline]

Definition at line 51 of file PhotonTkIsolation.h.

References setDzOption().

                                                   :
    extRadius2_(extRadius*extRadius),
    intRadiusBarrel2_(intRadius*intRadius),
    intRadiusEndcap2_(intRadius*intRadius),
    stripBarrel_(strip),
    stripEndcap_(strip),
    etLow_(etLow),
    lip_(lip),
    drb_(drb),
    trackCollection_(trackCollection),
    beamPoint_(beamPoint) {
    
    setDzOption("vz");
    
  }
PhotonTkIsolation::PhotonTkIsolation ( float  extRadius,
float  intRadiusBarrel,
float  intRadiusEndcap,
float  stripBarrel,
float  stripEndcap,
float  etLow,
float  lip,
float  drb,
const reco::TrackCollection trackCollection,
reco::TrackBase::Point  beamPoint 
) [inline]

Definition at line 75 of file PhotonTkIsolation.h.

References setDzOption().

                                                   :
    extRadius2_(extRadius*extRadius),
    intRadiusBarrel2_(intRadiusBarrel*intRadiusBarrel),
    intRadiusEndcap2_(intRadiusEndcap*intRadiusEndcap),
    stripBarrel_(stripBarrel),
    stripEndcap_(stripEndcap),
    etLow_(etLow),
    lip_(lip),
    drb_(drb),
    trackCollection_(trackCollection),
    beamPoint_(beamPoint) {
    
    setDzOption("vz");
    
  }
PhotonTkIsolation::PhotonTkIsolation ( float  extRadius,
float  intRadiusBarrel,
float  intRadiusEndcap,
float  stripBarrel,
float  stripEndcap,
float  etLow,
float  lip,
float  drb,
const reco::TrackCollection trackCollection,
reco::TrackBase::Point  beamPoint,
const std::string &  dzOptionString 
)

Definition at line 30 of file PhotonTkIsolation.cc.

References setDzOption().

                                                                       :
  extRadius2_(extRadius*extRadius),
  intRadiusBarrel2_(intRadiusBarrel*intRadiusBarrel),
  intRadiusEndcap2_(intRadiusEndcap*intRadiusEndcap),
  stripBarrel_(stripBarrel),
  stripEndcap_(stripEndcap),
  etLow_(etLow),
  lip_(lip),
  drb_(drb),
  trackCollection_(trackCollection),
  beamPoint_(beamPoint)
{
    setDzOption(dzOptionString);
}
PhotonTkIsolation::~PhotonTkIsolation ( )

Definition at line 65 of file PhotonTkIsolation.cc.

{
}

Member Function Documentation

std::pair< int, float > PhotonTkIsolation::getIso ( const reco::Candidate photon) const

Definition at line 72 of file PhotonTkIsolation.cc.

References beamPoint_, egammaisolation::EgammaTrackSelector::bs, Geom::deltaR2(), drb_, egammaisolation::EgammaTrackSelector::dz, dzOption_, reco::Candidate::eta(), etLow_, intRadiusBarrel2_, intRadiusEndcap2_, lip_, stripBarrel_, stripEndcap_, trackCollection_, reco::Candidate::vertex(), egammaisolation::EgammaTrackSelector::vtx, and egammaisolation::EgammaTrackSelector::vz.

Referenced by PhotonIsolationCalculator::calculateTrackIso().

{
  int counter  =0 ;
  float ptSum =0.;


  //Take the photon position
  float photonEta = photon->eta();

  //loop over tracks
  for(reco::TrackCollection::const_iterator trItr = trackCollection_->begin(); trItr != trackCollection_->end(); ++trItr){

    //check z-distance of vertex 
    float dzCut = 0;
    switch( dzOption_ ) {
        case egammaisolation::EgammaTrackSelector::dz : dzCut = fabs( (*trItr).dz() - photon->vertex().z() ); break;
        case egammaisolation::EgammaTrackSelector::vz : dzCut = fabs( (*trItr).vz() - photon->vertex().z() ); break;
        case egammaisolation::EgammaTrackSelector::bs : dzCut = fabs( (*trItr).dz(beamPoint_) - photon->vertex().z() ); break;
        case egammaisolation::EgammaTrackSelector::vtx: dzCut = fabs( (*trItr).dz(photon->vertex())); break;
        default : dzCut = fabs( (*trItr).vz() - photon->vertex().z() ); break;
    }
    if (dzCut > lip_ ) continue;

    float this_pt  = (*trItr).pt();
    if ( this_pt < etLow_ ) continue ;  
    if (fabs( (*trItr).dxy(beamPoint_) ) > drb_   ) continue;// only consider tracks from the main vertex 
    float dr2 = reco::deltaR2(*trItr,*photon) ;
    float deta = (*trItr).eta() - photonEta ;
    if (fabs(photonEta) < 1.479) {
        if(dr2 < extRadius2_ && dr2 >= intRadiusBarrel2_ && fabs(deta) >= stripBarrel_) 
        {
            ++counter;
            ptSum += this_pt;
        }
    }
    else {
        if(dr2 < extRadius2_ && dr2 >= intRadiusEndcap2_ && fabs(deta) >= stripEndcap_)
        {
            ++counter;
            ptSum += this_pt;
        }
    }

  }//end loop over tracks

  std::pair<int,float> retval;
  retval.first  = counter;
  retval.second = ptSum;  
  return retval;
}
void PhotonTkIsolation::setDzOption ( const std::string &  s)

Member Data Documentation

Definition at line 134 of file PhotonTkIsolation.h.

Referenced by getIso().

float PhotonTkIsolation::drb_ [private]

Definition at line 131 of file PhotonTkIsolation.h.

Referenced by getIso().

Definition at line 136 of file PhotonTkIsolation.h.

Referenced by getIso(), and setDzOption().

float PhotonTkIsolation::etLow_ [private]

Definition at line 129 of file PhotonTkIsolation.h.

Referenced by getIso().

Definition at line 124 of file PhotonTkIsolation.h.

Definition at line 125 of file PhotonTkIsolation.h.

Referenced by getIso().

Definition at line 126 of file PhotonTkIsolation.h.

Referenced by getIso().

float PhotonTkIsolation::lip_ [private]

Definition at line 130 of file PhotonTkIsolation.h.

Referenced by getIso().

Definition at line 127 of file PhotonTkIsolation.h.

Referenced by getIso().

Definition at line 128 of file PhotonTkIsolation.h.

Referenced by getIso().

Definition at line 133 of file PhotonTkIsolation.h.

Referenced by getIso().