CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups 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 20 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 23 of file PhotonTkIsolation.h.

References setDzOption().

30  : extRadius2_(extRadius * extRadius),
31  intRadiusBarrel2_(intRadius * intRadius),
32  intRadiusEndcap2_(intRadius * intRadius),
33  stripBarrel_(0.0),
34  stripEndcap_(0.0),
35  etLow_(etLow),
36  lip_(lip),
37  drb_(drb),
39  beamPoint_(beamPoint) {
40  setDzOption("vz");
41  }
void setDzOption(const std::string &s)
reco::TrackBase::Point beamPoint_
const reco::TrackCollection * trackCollection_
tuple 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 43 of file PhotonTkIsolation.h.

References setDzOption().

51  : extRadius2_(extRadius * extRadius),
52  intRadiusBarrel2_(intRadius * intRadius),
53  intRadiusEndcap2_(intRadius * intRadius),
56  etLow_(etLow),
57  lip_(lip),
58  drb_(drb),
60  beamPoint_(beamPoint) {
61  setDzOption("vz");
62  }
void setDzOption(const std::string &s)
reco::TrackBase::Point beamPoint_
const reco::TrackCollection * trackCollection_
tuple 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 64 of file PhotonTkIsolation.h.

References setDzOption().

74  : extRadius2_(extRadius * extRadius),
75  intRadiusBarrel2_(intRadiusBarrel * intRadiusBarrel),
76  intRadiusEndcap2_(intRadiusEndcap * intRadiusEndcap),
77  stripBarrel_(stripBarrel),
78  stripEndcap_(stripEndcap),
79  etLow_(etLow),
80  lip_(lip),
81  drb_(drb),
83  beamPoint_(beamPoint) {
84  setDzOption("vz");
85  }
void setDzOption(const std::string &s)
reco::TrackBase::Point beamPoint_
const reco::TrackCollection * trackCollection_
tuple 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 12 of file PhotonTkIsolation.cc.

References setDzOption().

23  : extRadius2_(extRadius * extRadius),
24  intRadiusBarrel2_(intRadiusBarrel * intRadiusBarrel),
25  intRadiusEndcap2_(intRadiusEndcap * intRadiusEndcap),
26  stripBarrel_(stripBarrel),
27  stripEndcap_(stripEndcap),
28  etLow_(etLow),
29  lip_(lip),
30  drb_(drb),
32  beamPoint_(beamPoint) {
33  setDzOption(dzOptionString);
34 }
void setDzOption(const std::string &s)
reco::TrackBase::Point beamPoint_
const reco::TrackCollection * trackCollection_
tuple trackCollection
PhotonTkIsolation::~PhotonTkIsolation ( )

Definition at line 49 of file PhotonTkIsolation.cc.

49 {}

Member Function Documentation

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

Definition at line 52 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(), EgammaPhotonTkNumIsolationProducer::produce(), and EgammaPhotonTkIsolationProducer::produce().

52  {
53  int counter = 0;
54  float ptSum = 0.;
55 
56  //Take the photon position
57  float photonEta = photon->eta();
58 
59  //loop over tracks
60  for (reco::TrackCollection::const_iterator trItr = trackCollection_->begin(); trItr != trackCollection_->end();
61  ++trItr) {
62  //check z-distance of vertex
63  float dzCut = 0;
64  switch (dzOption_) {
66  dzCut = fabs((*trItr).dz() - photon->vertex().z());
67  break;
69  dzCut = fabs((*trItr).vz() - photon->vertex().z());
70  break;
72  dzCut = fabs((*trItr).dz(beamPoint_) - photon->vertex().z());
73  break;
75  dzCut = fabs((*trItr).dz(photon->vertex()));
76  break;
77  default:
78  dzCut = fabs((*trItr).vz() - photon->vertex().z());
79  break;
80  }
81  if (dzCut > lip_)
82  continue;
83 
84  float this_pt = (*trItr).pt();
85  if (this_pt < etLow_)
86  continue;
87  if (fabs((*trItr).dxy(beamPoint_)) > drb_)
88  continue; // only consider tracks from the main vertex
89  float dr2 = reco::deltaR2(*trItr, *photon);
90  float deta = (*trItr).eta() - photonEta;
91  if (fabs(photonEta) < 1.479) {
92  if (dr2 < extRadius2_ && dr2 >= intRadiusBarrel2_ && fabs(deta) >= stripBarrel_) {
93  ++counter;
94  ptSum += this_pt;
95  }
96  } else {
97  if (dr2 < extRadius2_ && dr2 >= intRadiusEndcap2_ && fabs(deta) >= stripEndcap_) {
98  ++counter;
99  ptSum += this_pt;
100  }
101  }
102 
103  } //end loop over tracks
104 
105  std::pair<int, float> retval;
106  retval.first = counter;
107  retval.second = ptSum;
108  return retval;
109 }
reco::TrackBase::Point beamPoint_
const reco::TrackCollection * trackCollection_
virtual const Point & vertex() const =0
vertex position
constexpr auto deltaR2(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
Definition: deltaR.h:16
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 118 of file PhotonTkIsolation.h.

Referenced by getIso().

float PhotonTkIsolation::drb_
private

Definition at line 115 of file PhotonTkIsolation.h.

Referenced by getIso().

int PhotonTkIsolation::dzOption_
private

Definition at line 120 of file PhotonTkIsolation.h.

Referenced by getIso(), and setDzOption().

float PhotonTkIsolation::etLow_
private

Definition at line 113 of file PhotonTkIsolation.h.

Referenced by getIso().

float PhotonTkIsolation::extRadius2_
private

Definition at line 108 of file PhotonTkIsolation.h.

float PhotonTkIsolation::intRadiusBarrel2_
private

Definition at line 109 of file PhotonTkIsolation.h.

Referenced by getIso().

float PhotonTkIsolation::intRadiusEndcap2_
private

Definition at line 110 of file PhotonTkIsolation.h.

Referenced by getIso().

float PhotonTkIsolation::lip_
private

Definition at line 114 of file PhotonTkIsolation.h.

Referenced by getIso().

float PhotonTkIsolation::stripBarrel_
private

Definition at line 111 of file PhotonTkIsolation.h.

Referenced by getIso().

float PhotonTkIsolation::stripEndcap_
private

Definition at line 112 of file PhotonTkIsolation.h.

Referenced by getIso().

const reco::TrackCollection* PhotonTkIsolation::trackCollection_
private

Definition at line 117 of file PhotonTkIsolation.h.

Referenced by getIso().