57def scenario_mult(scenario, chainPartInd):
58 """calculate the parameters needed to generate a hypo helper config AlgTool
59 starting from a the hypoScenario which appears in the chainname for
60 an MULT condition. The MULT condition is filtered"""
61
62 if not scenario.startswith('MULT'):
63 raise ValueError( f'routing error, module {__name__}: bad scenario {scenario}')
64
65 threshold_var = 'pt'
66 m = rgx_pt.match(scenario)
67 if m is None:
68 threshold_var = 'et'
69 m = rgx_et.match(scenario)
70 groupdict = m.groupdict()
71
72 condargs = []
74 groupdict['multlo'],
75 groupdict['multhi'])
76
77
78 condargs.append(('mult', vals))
79
80
81 repcondargs = [RepeatedConditionParams(tree_id = 1,
82 tree_pid=0,
83 chainPartInd=chainPartInd,
84 condargs=condargs)]
85
86
87 filterparams = None
88 condargs = get_conditionfilter_args_from_matchdict(groupdict,threshold_var)
89
90 if condargs:
91
92
93 repfiltargs = [RepeatedConditionParams(tree_id=1,
94 tree_pid=0,
95 condargs=condargs)]
96 filterparams = [FilterParams(typename='ConditionFilter',
97 args=repfiltargs)]
98 filterparam_inds = [0]
99
100 else:
101 filterparams = []
102 filterparam_inds = [-1]
103
104
105
106
107
108 treevec = make_treevec(repcondargs)
109 assert treevec == [0, 0]
110
111 assert len(repcondargs) == len(filterparam_inds)
112
113
114 helper_params = HelperConfigToolParams(treevec=treevec,
115 repcondargs=repcondargs,
116 filterparams=filterparams,
117 filterparam_inds=filterparam_inds)
118
119 return [helper_params]
120