Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
Main Page
Related Pages
Modules
Namespaces
Namespace List
Namespace Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Enumerations
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
z
Enumerator
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
:
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Enumerations
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Enumerator
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Properties
Related Functions
:
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
r
s
t
v
w
x
z
Files
File List
File Members
All
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
_
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Variables
$
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Enumerations
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
v
x
z
Enumerator
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Macros
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
GitLab
LXR
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Modules
Pages
Reconstruction
Jet
JetEDM
Root
TrackVertexAssociation.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 "
JetEDM/TrackVertexAssociation.h
"
6
namespace
jet
{
7
8
9
TrackVertexAssociation::TrackVertexAssociation
(
const
xAOD::TrackParticleContainer
* trkCont) :
10
m_trackContainer(trkCont) {
11
// Check if this is a view container, in which case we need to use the size of the owning container.
12
size_t
Ntracks = trkCont->
size
();
13
if
(Ntracks>0 && trkCont->
ownPolicy
() !=
SG::OWN_ELEMENTS
) {
14
Ntracks = trkCont->
front
()->container()->size_v();
15
}
16
m_vertex
.resize(Ntracks,
nullptr
);
17
}
18
19
void
TrackVertexAssociation::associate
(
const
xAOD::TrackParticle
* trk,
const
xAOD::Vertex
* vtx){
20
m_vertex
[ trk->
index
() ] = vtx;
21
}
22
23
const
xAOD::Vertex
*
TrackVertexAssociation::associatedVertex
(
const
xAOD::TrackParticle
* trk)
const
{
24
return
m_vertex
[trk->
index
()];
25
}
26
27
std::vector<const xAOD::TrackParticle*>
TrackVertexAssociation::associatedTracks
(
const
xAOD::Vertex
* vtx)
const
28
{
29
std::vector<const xAOD::TrackParticle*> tracks;
30
for
(
size_t
iTrack = 0; iTrack <
m_trackContainer
->
size
(); ++iTrack)
31
if
(
associatedVertex
(
m_trackContainer
->
at
(iTrack))->
index
() == vtx->
index
())
32
tracks.push_back(
m_trackContainer
->
at
(iTrack));
33
34
return
tracks;
35
}
36
37
38
}
jet::TrackVertexAssociation::TrackVertexAssociation
TrackVertexAssociation(const xAOD::TrackParticleContainer *trkCont=0)
Definition:
TrackVertexAssociation.cxx:9
jet::TrackVertexAssociation::m_trackContainer
const xAOD::TrackParticleContainer * m_trackContainer
Definition:
TrackVertexAssociation.h:42
jet
Definition:
JetCalibTools_PlotJESFactors.cxx:23
SG::OWN_ELEMENTS
@ OWN_ELEMENTS
this data object owns its elements
Definition:
OwnershipPolicy.h:17
DataVector::front
const T * front() const
Access the first element in the collection as an rvalue.
jet::TrackVertexAssociation::associatedTracks
std::vector< const xAOD::TrackParticle * > associatedTracks(const xAOD::Vertex *vtx) const
Definition:
TrackVertexAssociation.cxx:27
TrackVertexAssociation.h
SG::AuxElement::index
size_t index() const
Return the index of this element within its container.
jet::TrackVertexAssociation::associate
void associate(const xAOD::TrackParticle *trk, const xAOD::Vertex *vtx)
Definition:
TrackVertexAssociation.cxx:19
DataVector
Derived DataVector<T>.
Definition:
DataVector.h:794
jet::TrackVertexAssociation::associatedVertex
const xAOD::Vertex * associatedVertex(const xAOD::TrackParticle *trk) const
Definition:
TrackVertexAssociation.cxx:23
jet::TrackVertexAssociation::m_vertex
std::vector< const xAOD::Vertex * > m_vertex
Definition:
TrackVertexAssociation.h:41
xAOD::Vertex_v1
Class describing a Vertex.
Definition:
Vertex_v1.h:42
DataVector::ownPolicy
SG::OwnershipPolicy ownPolicy() const
Return the ownership policy setting for this container.
xAOD::TrackParticle_v1
Class describing a TrackParticle.
Definition:
TrackParticle_v1.h:43
DataVector::at
const T * at(size_type n) const
Access an element, as an rvalue.
DataVector::size
size_type size() const noexcept
Returns the number of elements in the collection.
Generated on Wed Apr 23 2025 21:21:32 for ATLAS Offline Software by
1.8.18