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
11 pattern =
r'^FBDJNOSHARED'\
12 r'(?P<j1etlo>\d*)et(?P<j1ethi>\d*)XX'\
13 r'(?P<j2etlo>\d*)et(?P<j2ethi>\d*)XX'\
14 r'(?P<masslo>\d*)mass(?P<masshi>\d*)XX'\
15 r'(?P<fbetlo>\d*)fbet(?P<fbethi>\d*)$'
17 rgx = re.compile(pattern)
20 """get the elemental condition args (cuts) for the backward and forward
24 vals =
defaults(
'et', lo=groupdict[
'fbetlo'], hi=groupdict[
'fbethi'])
25 condargs.append((
'et', vals))
29 condargs.append((
'neta', vals))
32 condargs.append((
'peta', vals))
38 """get the elemental condition args (cuts) for the backward and forward
43 lo=groupdict[
'masslo'],
44 hi=groupdict[
'masshi'])
46 condargs.append((
'djmass', vals))
49 condargs.append((
'djdphi', vals))
56 """get arguments for each of the jets that make up the dijet"""
58 assert jstr
in (
'j1',
'j2')
61 vals =
defaults(
'et', lo=groupdict[jstr+
'etlo'], hi=groupdict[jstr+
'ethi'])
62 condargs.append((
'et', vals))
64 vals =
defaults(
'eta', lo=
'0', hi=
'490')
65 condargs.append((
'eta', vals))
71 """produce a list with one element containing a HelperToolConfigTool.
72 This list will inialise a Gaudi ToolArray
74 The tree vector is [0, 0, 0, 0, 3, 3]
75 pos 0: root; pos 1 backward jet; pos 2 forward jet; pos 3: dijet;
76 pos 4: dijet j1; pos 5: dijet jet 2
78 There is a Repeated Condition configurer for each position
80 No conditions are filtered"""
82 assert scenario.startswith(
'FBDJNOSHARED'),\
83 'routing error, module %s: bad scenario %s' % (__name__, scenario)
85 m = rgx.match(scenario)
86 groupdict = m.groupdict()
97 repcondargs.append(RepeatedConditionParams(tree_id = 1,
99 chainPartInd=chainPartInd,
105 repcondargs.append(RepeatedConditionParams(tree_id = 2,
107 chainPartInd=chainPartInd,
113 repcondargs.append(RepeatedConditionParams(tree_id = 3,
120 repcondargs.append(RepeatedConditionParams(tree_id = 4,
122 chainPartInd=chainPartInd,
128 repcondargs.append(RepeatedConditionParams(tree_id = 5,
130 chainPartInd=chainPartInd,
135 nconds = len(repcondargs)
137 filterparam_inds = [-1
for i
in range(nconds)]
145 assert treevec == [0, 0, 0, 0, 3, 3]
147 helper_params = HelperConfigToolParams(treevec=treevec,
148 repcondargs=repcondargs,
149 filterparams=filterparams,
150 filterparam_inds=filterparam_inds)
152 assert len(repcondargs) == len(filterparam_inds)
154 return [helper_params]