CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
PhotonTkIsolation Class Reference

#include <PhotonTkIsolation.h>

Public Member Functions

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

Private Member Functions

std::pair< int, double > getIso (const reco::Candidate *) const
 

Private Attributes

reco::TrackBase::Point beamPoint_
 
double drb_
 
int dzOption_
 
double etLow_
 
double extRadius_
 
double intRadiusBarrel_
 
double intRadiusEndcap_
 
double lip_
 
double stripBarrel_
 
double stripEndcap_
 
const reco::TrackCollectiontrackCollection_
 

Detailed Description

Definition at line 27 of file PhotonTkIsolation.h.

Constructor & Destructor Documentation

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

Definition at line 31 of file PhotonTkIsolation.h.

References setDzOption().

37  :
38  extRadius_(extRadius),
39  intRadiusBarrel_(intRadius),
40  intRadiusEndcap_(intRadius),
41  stripBarrel_(0.0),
42  stripEndcap_(0.0),
43  etLow_(etLow),
44  lip_(lip),
45  drb_(drb),
46  trackCollection_(trackCollection),
47  beamPoint_(beamPoint) {
48 
49  setDzOption("vz");
50 
51  }
void setDzOption(const std::string &s)
reco::TrackBase::Point beamPoint_
const reco::TrackCollection * trackCollection_
PhotonTkIsolation::PhotonTkIsolation ( double  extRadius,
double  intRadius,
double  strip,
double  etLow,
double  lip,
double  drb,
const reco::TrackCollection trackCollection,
reco::TrackBase::Point  beamPoint 
)
inline

Definition at line 53 of file PhotonTkIsolation.h.

References setDzOption().

60  :
61  extRadius_(extRadius),
62  intRadiusBarrel_(intRadius),
63  intRadiusEndcap_(intRadius),
66  etLow_(etLow),
67  lip_(lip),
68  drb_(drb),
69  trackCollection_(trackCollection),
70  beamPoint_(beamPoint) {
71 
72  setDzOption("vz");
73 
74  }
void setDzOption(const std::string &s)
void strip(std::string &input, const std::string &blanks=" \n\t")
Definition: stringTools.cc:16
reco::TrackBase::Point beamPoint_
const reco::TrackCollection * trackCollection_
PhotonTkIsolation::PhotonTkIsolation ( double  extRadius,
double  intRadiusBarrel,
double  intRadiusEndcap,
double  stripBarrel,
double  stripEndcap,
double  etLow,
double  lip,
double  drb,
const reco::TrackCollection trackCollection,
reco::TrackBase::Point  beamPoint 
)
inline

Definition at line 77 of file PhotonTkIsolation.h.

References setDzOption().

86  :
87  extRadius_(extRadius),
88  intRadiusBarrel_(intRadiusBarrel),
89  intRadiusEndcap_(intRadiusEndcap),
90  stripBarrel_(stripBarrel),
91  stripEndcap_(stripEndcap),
92  etLow_(etLow),
93  lip_(lip),
94  drb_(drb),
95  trackCollection_(trackCollection),
96  beamPoint_(beamPoint) {
97 
98  setDzOption("vz");
99 
100  }
void setDzOption(const std::string &s)
reco::TrackBase::Point beamPoint_
const reco::TrackCollection * trackCollection_
PhotonTkIsolation::PhotonTkIsolation ( double  extRadius,
double  intRadiusBarrel,
double  intRadiusEndcap,
double  stripBarrel,
double  stripEndcap,
double  etLow,
double  lip,
double  drb,
const reco::TrackCollection trackCollection,
reco::TrackBase::Point  beamPoint,
const std::string &  dzOptionString 
)

Definition at line 32 of file PhotonTkIsolation.cc.

References setDzOption().

42  :
43  extRadius_(extRadius),
44  intRadiusBarrel_(intRadiusBarrel),
45  intRadiusEndcap_(intRadiusEndcap),
46  stripBarrel_(stripBarrel),
47  stripEndcap_(stripEndcap),
48  etLow_(etLow),
49  lip_(lip),
50  drb_(drb),
51  trackCollection_(trackCollection),
52  beamPoint_(beamPoint)
53 {
54  setDzOption(dzOptionString);
55 }
void setDzOption(const std::string &s)
reco::TrackBase::Point beamPoint_
const reco::TrackCollection * trackCollection_
PhotonTkIsolation::~PhotonTkIsolation ( )

Definition at line 57 of file PhotonTkIsolation.cc.

58 {
59 }

Member Function Documentation

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

Definition at line 64 of file PhotonTkIsolation.cc.

References beamPoint_, egammaisolation::EgammaTrackSelector::bs, drb_, egammaisolation::EgammaTrackSelector::dz, dzOption_, reco::Candidate::eta(), etLow_, extRadius_, intRadiusBarrel_, intRadiusEndcap_, lip_, reco::Candidate::momentum(), stripBarrel_, stripEndcap_, trackCollection_, reco::Candidate::vertex(), egammaisolation::EgammaTrackSelector::vtx, and egammaisolation::EgammaTrackSelector::vz.

Referenced by getNumberTracks(), and getPtTracks().

65 {
66  int counter =0 ;
67  double ptSum =0.;
68 
69 
70  //Take the photon position
71  math::XYZVector mom= photon->momentum();
72  double photonEta = photon->eta();
73 
74  //loop over tracks
75  for(reco::TrackCollection::const_iterator trItr = trackCollection_->begin(); trItr != trackCollection_->end(); ++trItr){
76 
77  //check z-distance of vertex
78  double dzCut = 0;
79  switch( dzOption_ ) {
80  case egammaisolation::EgammaTrackSelector::dz : dzCut = fabs( (*trItr).dz() - photon->vertex().z() ); break;
81  case egammaisolation::EgammaTrackSelector::vz : dzCut = fabs( (*trItr).vz() - photon->vertex().z() ); break;
82  case egammaisolation::EgammaTrackSelector::bs : dzCut = fabs( (*trItr).dz(beamPoint_) - photon->vertex().z() ); break;
83  case egammaisolation::EgammaTrackSelector::vtx: dzCut = fabs( (*trItr).dz(photon->vertex())); break;
84  default : dzCut = fabs( (*trItr).vz() - photon->vertex().z() ); break;
85  }
86  if (dzCut > lip_ ) continue;
87 
88  math::XYZVector tmpTrackMomentumAtVtx = (*trItr).momentum () ;
89  double this_pt = (*trItr).pt();
90  if ( this_pt < etLow_ ) continue ;
91  if (fabs( (*trItr).dxy(beamPoint_) ) > drb_ ) continue;// only consider tracks from the main vertex
92  double dr = ROOT::Math::VectorUtil::DeltaR(tmpTrackMomentumAtVtx,mom) ;
93  double deta = (*trItr).eta() - photonEta ;
94  if (fabs(photonEta) < 1.479) {
95  if(fabs(dr) < extRadius_ && fabs(dr) >= intRadiusBarrel_ && fabs(deta) >= stripBarrel_)
96  {
97  ++counter;
98  ptSum += this_pt;
99  }
100  }
101  else {
102  if(fabs(dr) < extRadius_ && fabs(dr) >= intRadiusEndcap_ && fabs(deta) >= stripEndcap_)
103  {
104  ++counter;
105  ptSum += this_pt;
106  }
107  }
108 
109  }//end loop over tracks
110 
111  std::pair<int,double> retval;
112  retval.first = counter;
113  retval.second = ptSum;
114  return retval;
115 }
reco::TrackBase::Point beamPoint_
virtual Vector momentum() const =0
spatial momentum vector
const reco::TrackCollection * trackCollection_
virtual const Point & vertex() const =0
vertex position
XYZVectorD XYZVector
spatial vector with cartesian internal representation
Definition: Vector3D.h:31
virtual double eta() const =0
momentum pseudorapidity
int PhotonTkIsolation::getNumberTracks ( const reco::Candidate photon) const

Definition at line 117 of file PhotonTkIsolation.cc.

References getIso().

Referenced by PhotonIsolationCalculator::calculateTrackIso().

118 {
119  //counter for the tracks in the isolation cone
120  return getIso(photon).first ;
121 }
std::pair< int, double > getIso(const reco::Candidate *) const
double PhotonTkIsolation::getPtTracks ( const reco::Candidate photon) const

Definition at line 123 of file PhotonTkIsolation.cc.

References getIso().

Referenced by PhotonIsolationCalculator::calculateTrackIso().

124 {
125  return getIso(photon).second ;
126 }
std::pair< int, double > getIso(const reco::Candidate *) const
void PhotonTkIsolation::setDzOption ( const std::string &  s)
inline

Member Data Documentation

reco::TrackBase::Point PhotonTkIsolation::beamPoint_
private

Definition at line 143 of file PhotonTkIsolation.h.

Referenced by getIso().

double PhotonTkIsolation::drb_
private

Definition at line 140 of file PhotonTkIsolation.h.

Referenced by getIso().

int PhotonTkIsolation::dzOption_
private

Definition at line 145 of file PhotonTkIsolation.h.

Referenced by getIso(), and setDzOption().

double PhotonTkIsolation::etLow_
private

Definition at line 138 of file PhotonTkIsolation.h.

Referenced by getIso().

double PhotonTkIsolation::extRadius_
private

Definition at line 133 of file PhotonTkIsolation.h.

Referenced by getIso().

double PhotonTkIsolation::intRadiusBarrel_
private

Definition at line 134 of file PhotonTkIsolation.h.

Referenced by getIso().

double PhotonTkIsolation::intRadiusEndcap_
private

Definition at line 135 of file PhotonTkIsolation.h.

Referenced by getIso().

double PhotonTkIsolation::lip_
private

Definition at line 139 of file PhotonTkIsolation.h.

Referenced by getIso().

double PhotonTkIsolation::stripBarrel_
private

Definition at line 136 of file PhotonTkIsolation.h.

Referenced by getIso().

double PhotonTkIsolation::stripEndcap_
private

Definition at line 137 of file PhotonTkIsolation.h.

Referenced by getIso().

const reco::TrackCollection* PhotonTkIsolation::trackCollection_
private

Definition at line 142 of file PhotonTkIsolation.h.

Referenced by getIso().