ATLAS Offline Software
ContainedMultiAssociation.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 D3PDMakerCoreComps/python/ContainedMultiAssociation.py
5 # @author scott snyder <snyder@bnl.gov>
6 # @date Aug, 2009
7 # @brief Helper for setting up an association to a set of contained objects.
8 #
9 
10 
11 from .D3PDObject import D3PDObject
12 from AthenaConfiguration.ComponentFactory import CompFactory
13 
14 D3PD = CompFactory.D3PD
15 
16 
18  assoctool,
19  prefix = '',
20  level = 0,
21  blockname = None,
22  **kw):
23  """Helper for setting up an association to a set of contained objects.
24 
25  parent: The parent D3PDobject or block.
26  assoctool: The class for the (single) association tool.
27  prefix: Prefix to add to the contained variables, if any.
28  level: Level of detail for the block.
29  blockname: Name for the block.
30 
31  Extra arguments are passed to the association tool.
32 """
33  if blockname is None:
34  blockname = assoctool.__name__
35 
36  def maker (name, prefix, object_name, **kw2):
37  assoc = assoctool (name + 'Assoc', **kw2)
39  (name, Prefix = prefix, Associator = assoc)
40 
41  obj = D3PDObject (maker, prefix)
42  parent.defineBlock (level, blockname, obj, **kw)
43  return obj
D3PD::ContainedMultiAssociationFillerTool
Represent a multiple association by containment.
Definition: ContainedMultiAssociationFillerTool.h:58
python.ContainedMultiAssociation.ContainedMultiAssociation
def ContainedMultiAssociation(parent, assoctool, prefix='', level=0, blockname=None, **kw)
Definition: ContainedMultiAssociation.py:17