ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
PhysicsAnalysis
D3PDMaker
TruthD3PDMaker
python
TruthParticleD3PDObject.py
Go to the documentation of this file.
1
# Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
2
3
#
4
# @file TruthD3PDMaker/python/TruthParticleD3PDObject.py
5
# @author scott snyder <snyder@bnl.gov>
6
# @date Dec, 2009
7
# @brief Define D3PD object for a collection of TruthParticle's.
8
#
9
10
11
from
D3PDMakerCoreComps.D3PDObject
import
make_SGDataVector_D3PDObject
12
from
D3PDMakerCoreComps.SimpleAssociation
import
SimpleAssociation
13
from
TruthD3PDMaker.TruthParticleChildAssociation
import
TruthParticleChildAssociation
14
from
TruthD3PDMaker.TruthParticleParentAssociation
import
TruthParticleParentAssociation
15
from
D3PDMakerConfig.D3PDMakerFlags
import
D3PDMakerFlags
16
from
AthenaConfiguration.ComponentFactory
import
CompFactory
17
18
D3PD = CompFactory.D3PD
19
20
21
TruthParticleD3PDObject = make_SGDataVector_D3PDObject \
22
(
'DataVector<xAOD::TruthParticle_v1>'
,
23
D3PDMakerFlags.TruthParticlesSGKey,
24
'mc_'
,
25
'TruthParticleD3PDObject'
)
26
27
TruthParticleD3PDObject.defineBlock (0,
'TruthKin'
,
28
D3PD.FourMomFillerTool
)
29
30
TruthParticleD3PDObject.defineBlock (0,
'TruthInfo'
,
31
D3PD.TruthParticleFillerTool
)
32
33
ProdVertexAssoc = SimpleAssociation \
34
(TruthParticleD3PDObject,
35
D3PD.TruthParticleProdVertexAssociationTool
,
36
level = 1,
37
prefix =
'vx_'
,
38
blockname =
'ProdVert'
)
39
ProdVertexAssoc.defineBlock (
40
1,
'ProdVertPos'
,
41
D3PD.AuxDataFillerTool
,
42
Vars = [
'x'
,
'y'
,
'z'
,
'uid'
])
43
44
45
ChildAssoc = TruthParticleChildAssociation(
46
parent = TruthParticleD3PDObject,
47
prefix =
'child_'
,
48
# target = '', # filled by hook
49
level = 0 )
50
51
def
_TruthParticleAssocHook
(c, flags, acc, *args, parent_prefix = None, **kw):
52
indexer = c.BlockFillers[0]
53
indexer.Target = parent_prefix
54
return
55
ChildAssoc.defineHook(_TruthParticleAssocHook)
56
57
ParentAssoc = TruthParticleParentAssociation(
58
parent = TruthParticleD3PDObject,
59
prefix =
'parent_'
,
60
# target = '', # filled by hook
61
level = 0 )
62
ParentAssoc.defineHook(_TruthParticleAssocHook)
63
D3PD::AuxDataFillerTool
Copy aux data to D3PD.
Definition
AuxDataFillerTool.h:35
D3PD::FourMomFillerTool
Block filler tool for a four-momentum.
Definition
FourMomFillerTool.h:56
D3PD::TruthParticleFillerTool
Definition
TruthParticleFillerTool.h:26
D3PD::TruthParticleProdVertexAssociationTool
Associate from a TruthParticle to its GenVertex production vertex.
Definition
TruthParticleProdVertexAssociationTool.h:33
python.TruthParticleD3PDObject._TruthParticleAssocHook
_TruthParticleAssocHook(c, flags, acc, *args, parent_prefix=None, **kw)
Definition
TruthParticleD3PDObject.py:51
Generated on
for ATLAS Offline Software by
1.17.0