ATLAS Offline Software
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',
29 
30 TruthParticleD3PDObject.defineBlock (0, 'TruthInfo',
32 
33 ProdVertexAssoc = SimpleAssociation \
34  (TruthParticleD3PDObject,
36  level = 1,
37  prefix = 'vx_',
38  blockname = 'ProdVert')
39 ProdVertexAssoc.defineBlock (
40  1, 'ProdVertPos',
42  Vars = ['x', 'y', 'z', 'barcode'])
43 
44 
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 
58  parent = TruthParticleD3PDObject,
59  prefix = 'parent_',
60  # target = '', # filled by hook
61  level = 0 )
62 ParentAssoc.defineHook(_TruthParticleAssocHook)
63 
python.TruthParticleParentAssociation.TruthParticleParentAssociation
def TruthParticleParentAssociation(parent, prefix='', target='', level=0, blockname=None, *args, **kw)
Definition: TruthParticleParentAssociation.py:18
D3PD::AuxDataFillerTool
Copy aux data to D3PD.
Definition: AuxDataFillerTool.h:35
D3PD::TruthParticleFillerTool
Definition: TruthParticleFillerTool.h:27
python.TruthParticleD3PDObject._TruthParticleAssocHook
def _TruthParticleAssocHook(c, flags, acc, *args, parent_prefix=None, **kw)
Definition: TruthParticleD3PDObject.py:51
D3PD::FourMomFillerTool
Block filler tool for a four-momentum.
Definition: FourMomFillerTool.h:56
D3PD::TruthParticleProdVertexAssociationTool
Associate from a TruthParticle to its GenVertex production vertex.
Definition: TruthParticleProdVertexAssociationTool.h:33
python.TruthParticleChildAssociation.TruthParticleChildAssociation
def TruthParticleChildAssociation(parent, prefix='', target='', level=0, blockname=None, *args, **kw)
Definition: TruthParticleChildAssociation.py:18