CMS 3D CMS Logo

TrackIsoCalculator.cc
Go to the documentation of this file.
2 
4 
5 using namespace edm;
6 using namespace reco;
7 using namespace std;
8 
10  : recCollection_{trackCollection}, trackQuality_{trackQuality} {}
11 
13  const double x,
14  const double threshold,
15  const double innerDR) {
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 }
35 
37  const double x,
38  const double threshold,
39  const double innerDR) {
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 }
StandaloneTrackMonitor_cfi.trackQuality
trackQuality
Definition: StandaloneTrackMonitor_cfi.py:11
DiDispStaMuonMonitor_cfi.pt
pt
Definition: DiDispStaMuonMonitor_cfi.py:39
edm
HLT enums.
Definition: AlignableModifier.h:19
TrackIsoCalculator::recCollection_
reco::TrackCollection const & recCollection_
Definition: TrackIsoCalculator.h:18
TrackIsoCalculator::trackQuality_
std::string const & trackQuality_
Definition: TrackIsoCalculator.h:19
DDAxes::x
reco
fixed size matrix
Definition: AlignmentAlgorithmBase.h:45
TrackIsoCalculator::TrackIsoCalculator
TrackIsoCalculator(reco::TrackCollection const &trackCollection, std::string const &trackQuality)
Definition: TrackIsoCalculator.cc:9
deltaR.h
vertices_cff.x
x
Definition: vertices_cff.py:29
TrackIsoCalculator.h
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
duplicaterechits_cfi.trackCollection
trackCollection
Definition: duplicaterechits_cfi.py:4
reco::LeafCandidate::eta
double eta() const final
momentum pseudorapidity
Definition: LeafCandidate.h:152
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
reco::Photon
Definition: Photon.h:21
std
Definition: JetResolutionObject.h:76
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
TrackIsoCalculator::getBkgSubTrackIso
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.
Definition: TrackIsoCalculator.cc:36
remoteMonitoring_LED_IterMethod_cfg.threshold
threshold
Definition: remoteMonitoring_LED_IterMethod_cfg.py:426
reco::TrackCollection
std::vector< Track > TrackCollection
collection of Tracks
Definition: TrackFwd.h:14