test
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 Attributes
PhotonTkIsolation Class Reference

#include <PhotonTkIsolation.h>

Public Member Functions

std::pair< int, float > getIso (const reco::Candidate *) const
 
 PhotonTkIsolation (float extRadius, float intRadius, float etLow, float lip, float drb, const reco::TrackCollection *trackCollection, reco::TrackBase::Point beamPoint)
 
 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 &)
 
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().

35  :
36  extRadius2_(extRadius*extRadius),
37  intRadiusBarrel2_(intRadius*intRadius),
38  intRadiusEndcap2_(intRadius*intRadius),
39  stripBarrel_(0.0),
40  stripEndcap_(0.0),
41  etLow_(etLow),
42  lip_(lip),
43  drb_(drb),
45  beamPoint_(beamPoint) {
46 
47  setDzOption("vz");
48 
49  }
void setDzOption(const std::string &s)
reco::TrackBase::Point beamPoint_
const reco::TrackCollection * trackCollection_
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().

58  :
59  extRadius2_(extRadius*extRadius),
60  intRadiusBarrel2_(intRadius*intRadius),
61  intRadiusEndcap2_(intRadius*intRadius),
62  stripBarrel_(strip),
63  stripEndcap_(strip),
64  etLow_(etLow),
65  lip_(lip),
66  drb_(drb),
68  beamPoint_(beamPoint) {
69 
70  setDzOption("vz");
71 
72  }
void setDzOption(const std::string &s)
reco::TrackBase::Point beamPoint_
const reco::TrackCollection * trackCollection_
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().

84  :
85  extRadius2_(extRadius*extRadius),
86  intRadiusBarrel2_(intRadiusBarrel*intRadiusBarrel),
87  intRadiusEndcap2_(intRadiusEndcap*intRadiusEndcap),
88  stripBarrel_(stripBarrel),
89  stripEndcap_(stripEndcap),
90  etLow_(etLow),
91  lip_(lip),
92  drb_(drb),
94  beamPoint_(beamPoint) {
95 
96  setDzOption("vz");
97 
98  }
void setDzOption(const std::string &s)
reco::TrackBase::Point beamPoint_
const reco::TrackCollection * trackCollection_
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().

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

Definition at line 65 of file PhotonTkIsolation.cc.

66 {
67 }

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, counter, reco::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().

73 {
74  int counter =0 ;
75  float ptSum =0.;
76 
77 
78  //Take the photon position
79  float photonEta = photon->eta();
80 
81  //loop over tracks
82  for(reco::TrackCollection::const_iterator trItr = trackCollection_->begin(); trItr != trackCollection_->end(); ++trItr){
83 
84  //check z-distance of vertex
85  float dzCut = 0;
86  switch( dzOption_ ) {
87  case egammaisolation::EgammaTrackSelector::dz : dzCut = fabs( (*trItr).dz() - photon->vertex().z() ); break;
88  case egammaisolation::EgammaTrackSelector::vz : dzCut = fabs( (*trItr).vz() - photon->vertex().z() ); break;
89  case egammaisolation::EgammaTrackSelector::bs : dzCut = fabs( (*trItr).dz(beamPoint_) - photon->vertex().z() ); break;
90  case egammaisolation::EgammaTrackSelector::vtx: dzCut = fabs( (*trItr).dz(photon->vertex())); break;
91  default : dzCut = fabs( (*trItr).vz() - photon->vertex().z() ); break;
92  }
93  if (dzCut > lip_ ) continue;
94 
95  float this_pt = (*trItr).pt();
96  if ( this_pt < etLow_ ) continue ;
97  if (fabs( (*trItr).dxy(beamPoint_) ) > drb_ ) continue;// only consider tracks from the main vertex
98  float dr2 = reco::deltaR2(*trItr,*photon) ;
99  float deta = (*trItr).eta() - photonEta ;
100  if (fabs(photonEta) < 1.479) {
101  if(dr2 < extRadius2_ && dr2 >= intRadiusBarrel2_ && fabs(deta) >= stripBarrel_)
102  {
103  ++counter;
104  ptSum += this_pt;
105  }
106  }
107  else {
108  if(dr2 < extRadius2_ && dr2 >= intRadiusEndcap2_ && fabs(deta) >= stripEndcap_)
109  {
110  ++counter;
111  ptSum += this_pt;
112  }
113  }
114 
115  }//end loop over tracks
116 
117  std::pair<int,float> retval;
118  retval.first = counter;
119  retval.second = ptSum;
120  return retval;
121 }
reco::TrackBase::Point beamPoint_
const reco::TrackCollection * trackCollection_
virtual const Point & vertex() const =0
vertex position
T1 deltaR2(T1 eta1, T2 phi1, T3 eta2, T4 phi2)
Definition: deltaR.h:36
static std::atomic< unsigned int > counter
virtual double eta() const =0
momentum pseudorapidity
void PhotonTkIsolation::setDzOption ( const std::string &  s)

Member Data Documentation

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

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

int PhotonTkIsolation::dzOption_
private

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

float PhotonTkIsolation::extRadius2_
private

Definition at line 124 of file PhotonTkIsolation.h.

float PhotonTkIsolation::intRadiusBarrel2_
private

Definition at line 125 of file PhotonTkIsolation.h.

Referenced by getIso().

float PhotonTkIsolation::intRadiusEndcap2_
private

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

float PhotonTkIsolation::stripBarrel_
private

Definition at line 127 of file PhotonTkIsolation.h.

Referenced by getIso().

float PhotonTkIsolation::stripEndcap_
private

Definition at line 128 of file PhotonTkIsolation.h.

Referenced by getIso().

const reco::TrackCollection* PhotonTkIsolation::trackCollection_
private

Definition at line 133 of file PhotonTkIsolation.h.

Referenced by getIso().