ATLAS Offline Software
scenario_fbdjshared.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
2 
3 from TrigHLTJetHypo.RepeatedConditionParams import RepeatedConditionParams
4 from TrigHLTJetHypo.HelperConfigToolParams import HelperConfigToolParams
5 from TrigHLTJetHypo.ConditionDefaults import defaults
6 from TrigHLTJetHypo.make_treevec import make_treevec
7 
8 
9 def scenario_fbdjshared(scenario, chainPartInd):
10  """produce a list with two HelperToolConfigTool instances
11  This list will initialise a Gaudi ToolArray
12 
13  This scenario has no arguments - it is illustrative only
14 
15  The tree vector 0 is [0, 0, 0]
16  pos 0: root; pos 1 backward jet; pos 2 forward jet;
17 
18  The tree vector 0 is [0, 0, 1, 1]
19  pos 0: root; pos 1 dijet; pos 2 dijet j0; pos 3 dijet j1;
20 
21  There is a Repeated Condition configurer for each position
22 
23  No conditions are filtered"""
24 
25  assert scenario.startswith('FBDJSHARED'),\
26  'routing error, module %s: bad scenario %s' % (__name__, scenario)
27 
28 
29  # list for the repeatedCondition parameters
30  repcondargs = []
31 
32  # find the constructor arguments for each elemental condition
33  condargs = []
34 
35  # backward jet
36  vals = defaults('et', lo='50')
37  condargs.append(('et', vals))
38 
39  vals = defaults('neta', lo='-500')
40  condargs.append(('neta', vals))
41 
42  repcondargs.append(RepeatedConditionParams(tree_id = 1,
43  tree_pid=0,
44  chainPartInd=chainPartInd,
45  condargs=condargs))
46 
47  # forward jet
48  condargs = []
49 
50  vals = defaults('et', lo='50')
51  condargs.append(('et', vals))
52 
53  vals = defaults('peta', hi='500')
54  condargs.append(('peta', vals))
55 
56  repcondargs.append(RepeatedConditionParams(tree_id = 2,
57  tree_pid=0,
58  chainPartInd=chainPartInd,
59  condargs=condargs))
60 
61 
62  # make pass through filter params for each condition in the tree.
63  nconds = len(repcondargs)
64  filterparams = []
65  filterparam_inds = [-1 for i in range(nconds)]
66 
67  # treevec[i] gives the tree_id of the parent of the
68  # node with tree_id = i
69  treevec = make_treevec(repcondargs)
70  assert treevec == [0, 0, 0]
71 
72  helperparams = HelperConfigToolParams(treevec=treevec,
73  repcondargs=repcondargs,
74  filterparams=filterparams,
75  filterparam_inds=filterparam_inds)
76  helperparamslist = [helperparams]
77 
78 
80 
81  # Conditions for the dijet
82  repcondargs = []
83  condargs = []
84  vals = defaults('djmass', lo='34')
85  condargs.append(('djmass', vals))
86 
87  vals = defaults('djdphi', lo='260')
88  condargs.append(('djdphi', vals))
89 
90 
91  repcondargs.append(RepeatedConditionParams(tree_id = 1,
92  tree_pid=0,
93  chainPartInd=-1,
94  condargs=condargs))
95 
96 
97 
98  # Conditions for the dijet j1
99  condargs = []
100  vals = defaults('et', lo='10')
101  condargs.append(('et', vals))
102 
103  vals = defaults('eta', lo='0', hi='490')
104  condargs.append(('eta', vals))
105 
106  repcondargs.append(RepeatedConditionParams(tree_id = 2,
107  tree_pid=1,
108  chainPartInd=chainPartInd,
109  condargs=condargs))
110 
111 
112  # Conditions for the dijet j2
113  condargs = []
114  vals = defaults('et', lo='20')
115  condargs.append(('et', vals))
116 
117  vals = defaults('eta', lo='0', hi='490')
118  condargs.append(('eta', vals))
119 
120  repcondargs.append(RepeatedConditionParams(tree_id = 3,
121  tree_pid=1,
122  chainPartInd=chainPartInd,
123  condargs=condargs))
124 
125 
126  # make pass through filter params for each condition in the tree.
127  nconds = len(repcondargs)
128  filterparams = []
129  filterparam_inds = [-1 for i in range(nconds)]
130 
131  # parameters to initalise the AlgTool that initialises the helper AlgTool
132 
133  # treevec[i] gives the tree_id of the parent of the
134  # node with tree_id = i
135  treevec = make_treevec(repcondargs)
136  assert treevec == [0, 0, 1, 1]
137 
138  helperparams = HelperConfigToolParams(treevec=treevec,
139  repcondargs=repcondargs,
140  filterparams=filterparams,
141  filterparam_inds=filterparam_inds)
142 
143  # a list is one entry per FastReduction tree
144 
145  assert len(repcondargs) == len(filterparam_inds)
146 
147  helperparamslist.append(helperparams)
148  return helperparamslist
python.scenario_fbdjshared.scenario_fbdjshared
def scenario_fbdjshared(scenario, chainPartInd)
Definition: scenario_fbdjshared.py:9
plotBeamSpotVxVal.range
range
Definition: plotBeamSpotVxVal.py:195
Base_Fragment.defaults
dictionary defaults
This includes now the top quark, the leptons and the bosons.
Definition: GeneratorFilters/share/common/Base_Fragment.py:79
python.make_treevec.make_treevec
def make_treevec(repcondargs)
Definition: make_treevec.py:3