ATLAS Offline Software
Loading...
Searching...
No Matches
Reconstruction
Jet
JetSubStructureUtils
Root
Charge.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
JetSubStructureUtils/Charge.h
"
6
#include "
xAODTracking/TrackParticle.h
"
7
8
using namespace
std
;
9
using namespace
JetSubStructureUtils
;
10
11
double
Charge::result
(
const
xAOD::Jet
&
jet
)
const
12
{
13
vector<const xAOD::TrackParticle*> tracks;
14
bool
retval =
jet
.getAssociatedObjects(
"GhostTrack"
, tracks);
15
if
(!retval) {
16
return
-999;
17
}
18
19
double
charge
= 0;
20
for
(
unsigned
int
i=0; i<tracks.size(); i++) {
21
charge
+= tracks[i]->charge() *
pow
(tracks[i]->pt(),
m_k
);
22
}
23
if
(
jet
.pt() == 0) {
24
return
-999;
25
}
26
else
{
27
charge
/=
pow
(
jet
.pt(),
m_k
);
28
}
29
30
return
charge
;
31
}
charge
double charge(const T &p)
Definition
AtlasPID.h:997
Charge.h
TrackParticle.h
pow
constexpr int pow(int base, int exp) noexcept
Definition
ap_fixedTest.cxx:15
JetSubStructureUtils::Charge::m_k
double m_k
Definition
Charge.h:15
JetSubStructureUtils::Charge::result
virtual double result(const xAOD::Jet &jet) const
Definition
Charge.cxx:11
JetSubStructureUtils
Definition
Angularity.h:10
jet
Definition
JetCalibTools_PlotJESFactors.cxx:23
std
STL namespace.
xAOD::Jet
Jet_v1 Jet
Definition of the current "jet version".
Definition
Event/xAOD/xAODJet/xAODJet/Jet.h:17
Generated on
for ATLAS Offline Software by
1.14.0