CMS 3D CMS Logo

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 *, reco::TrackBase::Point beamPoint, const std::string &)
 
 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)
 
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 22 of file PhotonTkIsolation.h.

Constructor & Destructor Documentation

◆ PhotonTkIsolation() [1/4]

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

Definition at line 25 of file PhotonTkIsolation.h.

35  stripBarrel_(0.0),
36  stripEndcap_(0.0),
37  etLow_(etLow),
38  lip_(lip),
39  drb_(drb),
41  beamPoint_(beamPoint) {
42  setDzOption("vz");
43  }

References setDzOption().

◆ PhotonTkIsolation() [2/4]

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 45 of file PhotonTkIsolation.h.

58  etLow_(etLow),
59  lip_(lip),
60  drb_(drb),
62  beamPoint_(beamPoint) {
63  setDzOption("vz");
64  }

References setDzOption().

◆ PhotonTkIsolation() [3/4]

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 66 of file PhotonTkIsolation.h.

References setDzOption().

◆ PhotonTkIsolation() [4/4]

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 29 of file PhotonTkIsolation.cc.

References setDzOption().

◆ ~PhotonTkIsolation()

PhotonTkIsolation::~PhotonTkIsolation ( )

Definition at line 66 of file PhotonTkIsolation.cc.

66 {}

Member Function Documentation

◆ getIso()

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

Definition at line 69 of file PhotonTkIsolation.cc.

69  {
70  int counter = 0;
71  float ptSum = 0.;
72 
73  //Take the photon position
74  float photonEta = photon->eta();
75 
76  //loop over tracks
77  for (reco::TrackCollection::const_iterator trItr = trackCollection_->begin(); trItr != trackCollection_->end();
78  ++trItr) {
79  //check z-distance of vertex
80  float dzCut = 0;
81  switch (dzOption_) {
83  dzCut = fabs((*trItr).dz() - photon->vertex().z());
84  break;
86  dzCut = fabs((*trItr).vz() - photon->vertex().z());
87  break;
89  dzCut = fabs((*trItr).dz(beamPoint_) - photon->vertex().z());
90  break;
92  dzCut = fabs((*trItr).dz(photon->vertex()));
93  break;
94  default:
95  dzCut = fabs((*trItr).vz() - photon->vertex().z());
96  break;
97  }
98  if (dzCut > lip_)
99  continue;
100 
101  float this_pt = (*trItr).pt();
102  if (this_pt < etLow_)
103  continue;
104  if (fabs((*trItr).dxy(beamPoint_)) > drb_)
105  continue; // only consider tracks from the main vertex
106  float dr2 = reco::deltaR2(*trItr, *photon);
107  float deta = (*trItr).eta() - photonEta;
108  if (fabs(photonEta) < 1.479) {
109  if (dr2 < extRadius2_ && dr2 >= intRadiusBarrel2_ && fabs(deta) >= stripBarrel_) {
110  ++counter;
111  ptSum += this_pt;
112  }
113  } else {
114  if (dr2 < extRadius2_ && dr2 >= intRadiusEndcap2_ && fabs(deta) >= stripEndcap_) {
115  ++counter;
116  ptSum += this_pt;
117  }
118  }
119 
120  } //end loop over tracks
121 
122  std::pair<int, float> retval;
123  retval.first = counter;
124  retval.second = ptSum;
125  return retval;
126 }

References beamPoint_, egammaisolation::EgammaTrackSelector::bs, counter, reco::deltaR2(), drb_, egammaisolation::EgammaTrackSelector::dz, TrackSplittingMonitor_cfi::dzCut, dzOption_, etLow_, intRadiusBarrel2_, intRadiusEndcap2_, lip_, muons2muons_cfi::photon, HLTObjectMonitor_cfi::photonEta, stripBarrel_, stripEndcap_, trackCollection_, egammaisolation::EgammaTrackSelector::vtx, and egammaisolation::EgammaTrackSelector::vz.

Referenced by PhotonIsolationCalculator::calculateTrackIso().

◆ setDzOption()

void PhotonTkIsolation::setDzOption ( const std::string &  s)

Member Data Documentation

◆ beamPoint_

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

Definition at line 120 of file PhotonTkIsolation.h.

Referenced by getIso().

◆ drb_

float PhotonTkIsolation::drb_
private

Definition at line 117 of file PhotonTkIsolation.h.

Referenced by getIso().

◆ dzOption_

int PhotonTkIsolation::dzOption_
private

Definition at line 122 of file PhotonTkIsolation.h.

Referenced by getIso(), and setDzOption().

◆ etLow_

float PhotonTkIsolation::etLow_
private

Definition at line 115 of file PhotonTkIsolation.h.

Referenced by getIso().

◆ extRadius2_

float PhotonTkIsolation::extRadius2_
private

Definition at line 110 of file PhotonTkIsolation.h.

◆ intRadiusBarrel2_

float PhotonTkIsolation::intRadiusBarrel2_
private

Definition at line 111 of file PhotonTkIsolation.h.

Referenced by getIso().

◆ intRadiusEndcap2_

float PhotonTkIsolation::intRadiusEndcap2_
private

Definition at line 112 of file PhotonTkIsolation.h.

Referenced by getIso().

◆ lip_

float PhotonTkIsolation::lip_
private

Definition at line 116 of file PhotonTkIsolation.h.

Referenced by getIso().

◆ stripBarrel_

float PhotonTkIsolation::stripBarrel_
private

Definition at line 113 of file PhotonTkIsolation.h.

Referenced by getIso().

◆ stripEndcap_

float PhotonTkIsolation::stripEndcap_
private

Definition at line 114 of file PhotonTkIsolation.h.

Referenced by getIso().

◆ trackCollection_

const reco::TrackCollection* PhotonTkIsolation::trackCollection_
private

Definition at line 119 of file PhotonTkIsolation.h.

Referenced by getIso().

PhotonTkIsolation::setDzOption
void setDzOption(const std::string &s)
Definition: PhotonTkIsolation.cc:53
muons2muons_cfi.photon
photon
Definition: muons2muons_cfi.py:28
counter
Definition: counter.py:1
PhotonTkIsolation::intRadiusBarrel2_
float intRadiusBarrel2_
Definition: PhotonTkIsolation.h:111
PhotonTkIsolation::etLow_
float etLow_
Definition: PhotonTkIsolation.h:115
electronTrackIsolationLcone_cfi.stripEndcap
stripEndcap
Definition: electronTrackIsolationLcone_cfi.py:9
PhotonTkIsolation::beamPoint_
reco::TrackBase::Point beamPoint_
Definition: PhotonTkIsolation.h:120
digitizers_cfi.strip
strip
Definition: digitizers_cfi.py:19
electronEcalRecHitIsolationLcone_cfi.extRadius
extRadius
Definition: electronEcalRecHitIsolationLcone_cfi.py:18
electronEcalRecHitIsolationLcone_cfi.intRadiusBarrel
intRadiusBarrel
Definition: electronEcalRecHitIsolationLcone_cfi.py:15
PhotonTkIsolation::lip_
float lip_
Definition: PhotonTkIsolation.h:116
egammaisolation::EgammaTrackSelector::vz
Definition: EgammaTrackSelector.h:20
egammaisolation::EgammaTrackSelector::vtx
Definition: EgammaTrackSelector.h:20
egammaisolation::EgammaTrackSelector::bs
Definition: EgammaTrackSelector.h:20
HLTObjectMonitor_cfi.photonEta
photonEta
Definition: HLTObjectMonitor_cfi.py:62
PhotonTkIsolation::stripBarrel_
float stripBarrel_
Definition: PhotonTkIsolation.h:113
PhotonTkIsolation::trackCollection_
const reco::TrackCollection * trackCollection_
Definition: PhotonTkIsolation.h:119
qcdUeDQM_cfi.lip
lip
Definition: qcdUeDQM_cfi.py:25
alignCSCRings.s
s
Definition: alignCSCRings.py:92
TrackSplittingMonitor_cfi.dzCut
dzCut
Definition: TrackSplittingMonitor_cfi.py:20
egammaisolation::EgammaTrackSelector::dz
Definition: EgammaTrackSelector.h:20
PhotonTkIsolation::extRadius2_
float extRadius2_
Definition: PhotonTkIsolation.h:110
electronTrackIsolationLcone_cfi.stripBarrel
stripBarrel
Definition: electronTrackIsolationLcone_cfi.py:8
duplicaterechits_cfi.trackCollection
trackCollection
Definition: duplicaterechits_cfi.py:4
reco::deltaR2
constexpr auto deltaR2(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
Definition: deltaR.h:16
PhotonTkIsolation::stripEndcap_
float stripEndcap_
Definition: PhotonTkIsolation.h:114
counter
static std::atomic< unsigned int > counter
Definition: SharedResourceNames.cc:15
electronEcalRecHitIsolationLcone_cfi.intRadiusEndcap
intRadiusEndcap
Definition: electronEcalRecHitIsolationLcone_cfi.py:16
PhotonTkIsolation::intRadiusEndcap2_
float intRadiusEndcap2_
Definition: PhotonTkIsolation.h:112
electronHcalTowerIsolationLcone_cfi.intRadius
intRadius
Definition: electronHcalTowerIsolationLcone_cfi.py:5
PhotonTkIsolation::dzOption_
int dzOption_
Definition: PhotonTkIsolation.h:122
PhotonTkIsolation::drb_
float drb_
Definition: PhotonTkIsolation.h:117