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
Control
AthenaExamples
AthExBasics
src
WritexAOD.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
WritexAOD.h
"
6
7
StatusCode
WritexAOD::initialize
() {
8
9
// Initialise the data handles
10
ATH_CHECK
(
m_trackKey
.
initialize
());
11
ATH_CHECK
(
m_newKey
.
initialize
());
12
// Initialise the tool handles
13
ATH_CHECK
(
m_trackSelectionTool
.retrieve());
14
15
return
StatusCode::SUCCESS;
16
}
17
18
StatusCode
WritexAOD::execute
(
const
EventContext &ctx)
const
{
19
20
// Get the particle containers requested
21
// EventContext is for multi-threading
22
SG::ReadHandle<xAOD::TrackParticleContainer>
tracksIn{
m_trackKey
, ctx};
23
if
(!tracksIn.isValid()) {
24
ATH_MSG_ERROR
(
"Couldn't retrieve xAOD::TrackParticles with key: "
25
<<
m_trackKey
.
key
());
26
return
StatusCode::FAILURE;
27
}
28
29
// Create the new container
30
// Note the creation of the aux container, for the data payload, in addition
31
// to the object container
32
SG::WriteHandle<xAOD::TrackParticleContainer>
tracksOut{
m_newKey
, ctx};
33
ATH_CHECK
(
34
tracksOut.record(std::make_unique<xAOD::TrackParticleContainer>(),
35
std::make_unique<xAOD::TrackParticleAuxContainer>()));
36
37
// Loop over the tracks, select those passing selections, push a copy into the
38
// output container
39
for
(
const
xAOD::TrackParticle
*
track
: *tracksIn) {
40
if
(
m_trackSelectionTool
->accept(*
track
)) {
41
xAOD::TrackParticle
* newTrack = tracksOut->push_back (std::make_unique<xAOD::TrackParticle>());
42
*newTrack = *
track
;
43
}
44
}
45
46
return
StatusCode::SUCCESS;
47
}
WritexAOD::execute
virtual StatusCode execute(const EventContext &ctx) const override
Definition:
WritexAOD.cxx:18
SG::ReadHandle
Definition:
StoreGate/StoreGate/ReadHandle.h:67
WritexAOD::m_trackSelectionTool
ToolHandle< InDet::IInDetTrackSelectionTool > m_trackSelectionTool
Tool handle for the track selection tool */.
Definition:
WritexAOD.h:34
SG::VarHandleKey::key
const std::string & key() const
Return the StoreGate ID for the referenced object.
Definition:
AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:141
WritexAOD::m_newKey
SG::WriteHandleKey< xAOD::TrackParticleContainer > m_newKey
Read handle for the new track container **/.
Definition:
WritexAOD.h:32
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition:
AthMsgStreamMacros.h:33
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition:
PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
WritexAOD.h
ATH_CHECK
#define ATH_CHECK
Definition:
AthCheckMacros.h:40
SG::VarHandleKey::initialize
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
Definition:
AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:103
WritexAOD::m_trackKey
SG::ReadHandleKey< xAOD::TrackParticleContainer > m_trackKey
Read handle for the offline object container - set to tracks by default. **/.
Definition:
WritexAOD.h:30
WritexAOD::initialize
virtual StatusCode initialize() override
Definition:
WritexAOD.cxx:7
SG::WriteHandle
Definition:
StoreGate/StoreGate/WriteHandle.h:73
xAOD::track
@ track
Definition:
TrackingPrimitives.h:513
xAOD::TrackParticle_v1
Class describing a TrackParticle.
Definition:
TrackParticle_v1.h:43
Generated on Fri Apr 4 2025 21:23:14 for ATLAS Offline Software by
1.8.18