CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
TrackIsoCalculator Class Reference

#include <TrackIsoCalculator.h>

Public Member Functions

double getBkgSubTrackIso (reco::Photon const &clus, const double i, const double threshold, const double innerDR=0)
 Return the background-subtracted tracker energy in a cone around the photon. More...
 
double getTrackIso (reco::Photon const &clus, const double i, const double threshold, const double innerDR=0)
 Return the tracker energy in a cone around the photon. More...
 
 TrackIsoCalculator (reco::TrackCollection const &trackCollection, std::string const &trackQuality)
 

Private Attributes

reco::TrackCollection const & recCollection_
 
std::string const & trackQuality_
 

Detailed Description

Definition at line 8 of file TrackIsoCalculator.h.

Constructor & Destructor Documentation

◆ TrackIsoCalculator()

TrackIsoCalculator::TrackIsoCalculator ( reco::TrackCollection const &  trackCollection,
std::string const &  trackQuality 
)

Member Function Documentation

◆ getBkgSubTrackIso()

double TrackIsoCalculator::getBkgSubTrackIso ( reco::Photon const &  clus,
const double  i,
const double  threshold,
const double  innerDR = 0 
)

Return the background-subtracted tracker energy in a cone around the photon.

Definition at line 36 of file TrackIsoCalculator.cc.

39  {
40  double SClusterEta = cluster.eta();
41  double totalPt = 0.0;
42 
43  for (auto const& recTrack : recCollection_) {
44  bool goodtrack = recTrack.quality(reco::TrackBase::qualityByName(trackQuality_));
45  if (!goodtrack)
46  continue;
47 
48  double pt = recTrack.pt();
49  if (std::abs(recTrack.eta() - SClusterEta) >= 0.1 * x)
50  continue;
51  if (reco::deltaR2(cluster, recTrack) < innerDR * innerDR)
52  continue;
53 
54  if (pt > threshold)
55  totalPt = totalPt + pt;
56  }
57 
58  double Tx = getTrackIso(cluster, x, threshold, innerDR);
59  double CTx = (Tx - totalPt / 40.0 * x) * (1 / (1 - x / 40.));
60 
61  return CTx;
62 }

References funct::abs(), reco::deltaR2(), reco::LeafCandidate::eta(), getTrackIso(), DiDispStaMuonMonitor_cfi::pt, reco::TrackBase::qualityByName(), recCollection_, remoteMonitoring_LED_IterMethod_cfg::threshold, trackQuality_, and x.

Referenced by photonIsolationHIProducer::produce().

◆ getTrackIso()

double TrackIsoCalculator::getTrackIso ( reco::Photon const &  clus,
const double  i,
const double  threshold,
const double  innerDR = 0 
)

Return the tracker energy in a cone around the photon.

Definition at line 12 of file TrackIsoCalculator.cc.

15  {
16  double totalPt = 0;
17 
18  for (auto const& recTrack : recCollection_) {
19  bool goodtrack = recTrack.quality(reco::TrackBase::qualityByName(trackQuality_));
20  if (!goodtrack)
21  continue;
22 
23  double pt = recTrack.pt();
24  double dR2 = reco::deltaR2(cluster, recTrack);
25  if (dR2 >= (0.01 * x * x))
26  continue;
27  if (dR2 < innerDR * innerDR)
28  continue;
29  if (pt > threshold)
30  totalPt = totalPt + pt;
31  }
32 
33  return totalPt;
34 }

References reco::deltaR2(), DiDispStaMuonMonitor_cfi::pt, reco::TrackBase::qualityByName(), recCollection_, remoteMonitoring_LED_IterMethod_cfg::threshold, trackQuality_, and x.

Referenced by getBkgSubTrackIso().

Member Data Documentation

◆ recCollection_

reco::TrackCollection const& TrackIsoCalculator::recCollection_
private

Definition at line 18 of file TrackIsoCalculator.h.

Referenced by getBkgSubTrackIso(), and getTrackIso().

◆ trackQuality_

std::string const& TrackIsoCalculator::trackQuality_
private

Definition at line 19 of file TrackIsoCalculator.h.

Referenced by getBkgSubTrackIso(), and getTrackIso().

StandaloneTrackMonitor_cfi.trackQuality
trackQuality
Definition: StandaloneTrackMonitor_cfi.py:11
DiDispStaMuonMonitor_cfi.pt
pt
Definition: DiDispStaMuonMonitor_cfi.py:39
TrackIsoCalculator::recCollection_
reco::TrackCollection const & recCollection_
Definition: TrackIsoCalculator.h:18
TrackIsoCalculator::trackQuality_
std::string const & trackQuality_
Definition: TrackIsoCalculator.h:19
DDAxes::x
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
reco::TrackBase::qualityByName
static TrackQuality qualityByName(const std::string &name)
Definition: TrackBase.cc:126
TrackIsoCalculator::getTrackIso
double getTrackIso(reco::Photon const &clus, const double i, const double threshold, const double innerDR=0)
Return the tracker energy in a cone around the photon.
Definition: TrackIsoCalculator.cc:12
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
remoteMonitoring_LED_IterMethod_cfg.threshold
threshold
Definition: remoteMonitoring_LED_IterMethod_cfg.py:430