ATLAS Offline Software
Loading...
Searching...
No Matches
DRIndexMultiAssociation.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 EventCommonD3PDMaker/python/DRIndexMultiAssociation.py
5# @author scott snyder <snyder@bnl.gov>
6# @author Ryan Reece <ryan.reece@cern.ch>
7# @date Dec, 2009
8# @brief Helper for setting up an association to objects within a DR cone,
9# represented by indices.
10#
11
12
13from D3PDMakerCoreComps.D3PDObject import D3PDObject
14from AthenaConfiguration.ComponentFactory import CompFactory
15
16D3PD = CompFactory.D3PD
17
18
19def DRIndexMultiAssociation (parent,
20 type_name,
21 default_sgkey,
22 default_drcut,
23 prefix = '',
24 target = '',
25 level = 0,
26 blockname = None,
27 *args, **kw):
28 """Helper for setting up an association to objects within a DR cone,
29 represented by indices.
30"""
31
32
33 if blockname is None:
34 blockname = prefix + 'DRIndexMultiAssoc'
35
36 def maker (name, prefix, object_name,
37 sgkey = default_sgkey,
38 getter = None,
39 assoc = None,
40 drcut = default_drcut):
41
42 if not getter:
44 (name + '_Getter',
45 TypeName = type_name,
46 SGKey = sgkey)
47 if not assoc:
48 assoc = D3PD.DRConeAssociationTool (name + 'Assoc',
49 Getter = getter,
50 DRCut = drcut)
51
53 (name,
54 Prefix = prefix,
55 Associator = assoc,
56 NrowName = '')
57 indexer = D3PD.IndexFillerTool \
58 (name + 'Index',
59 Target = target)
60 filler.BlockFillers += [indexer]
61 return filler
62
63
64 obj = D3PDObject (maker, prefix)
65 parent.defineBlock (level, blockname, obj)
66 return obj
Represent a multiple association by containment inside vectors.
Associate all particles within a DR cut.
Fill an index of an object within a container.
Getter tool to retrieve DataVector/List collections from StoreGate.