11 from .D3PDObject
import D3PDObject
12 from AthenaConfiguration.ComponentFactory
import CompFactory
14 D3PD = CompFactory.D3PD
24 containerIndexName = '',
27 """Helper for setting up an association via an index.
29 parent: The parent D3PDobject or block.
30 assoctool: The class for the (single) association tool.
31 target: The label for the getter within which we look up the index.
32 prefix: Prefix to add to the contained variables, if any.
33 level: Level of detail for the block.
34 blockname: Name for the block.
35 allowMissing: If true, then it is not considered an error for the
36 target getter to fail to find the input objects.
38 Extra arguments are passed to the association tool.
42 blockname = assoctool.__name__
44 def maker (name, prefix, object_name, **kw2):
47 this_target = kw2[
'target']
52 elif not isinstance(this_target, list):
53 this_target = [ this_target ]
55 assoc = assoctool (name +
'Assoc', **kw2)
57 (name, Prefix = prefix, Associator = assoc, Matched =
'')
60 Targets = this_target,
61 ContainerIndexName = containerIndexName,
62 AllowMissing = allowMissing)
63 filler.BlockFillers += [indexer]
67 obj = D3PDObject (maker, prefix)
68 parent.defineBlock (level, blockname, obj, **kw)