12 from .D3PDObject
import D3PDObject
13 from AthenaConfiguration.ComponentFactory
import CompFactory
15 D3PD = CompFactory.D3PD
26 containerIndexName = '',
29 """Helper for setting up an association via an index.
31 parent: The parent D3PDobject or block.
32 assoctool: The class for the (single) association tool.
33 target: The label for the getter within which we look up the index,
34 or a list of such labels if multiple targets are desired.
35 prefix: Prefix to add to the contained variables, if any.
36 level: Level of detail for the block.
37 blockname: Name for the block.
38 allowMissing: If true, then it is not considered an error for the
39 target getter to fail to find the input objects.
40 nrowName: Name of the variable for the count of objects.
43 Extra arguments are passed to the association tool.
47 blockname = assoctool.__name__
49 def maker (name, prefix, object_name, **kw2):
52 this_target = kw2[
'target']
57 elif not isinstance(this_target, list):
58 this_target = [ this_target ]
60 assoc = assoctool (name +
'Assoc', **kw2)
68 Targets = this_target,
69 ContainerIndexName = containerIndexName,
70 AllowMissing = allowMissing)
71 filler.BlockFillers += [indexer]
74 obj = D3PDObject (maker, prefix)
75 parent.defineBlock (level, blockname, obj, **kw)