64def scenario_ht(scenario, chainPartInd):
65 """calculate the parameters needed to generate a hypo helper config AlgTool
66 starting from a the hypoScenario which appears in the chainname for
67 an HT condition. The HT condition is filtered"""
68
69 assert scenario.startswith('HT'),\
70 'routing error, module %s: bad scenario %s' % (__name__, scenario)
71
72 threshold_var = 'pt'
73 m = rgx_pt.match(scenario)
74 if m is None:
75 threshold_var = 'et'
76 m = rgx_et.match(scenario)
77 groupdict = m.groupdict()
78
79 condargs = []
81 groupdict['htlo'])
82
83
84 condargs.append(('ht', vals))
85
86
87 repcondargs = [RepeatedConditionParams(tree_id = 1,
88 tree_pid=0,
89 chainPartInd=chainPartInd,
90 condargs=condargs,
91 invert='veto' in scenario)]
92
93
94 filterparams = None
95 condargs = get_conditionfilter_args_from_matchdict(groupdict,threshold_var)
96
97 if condargs:
98
99
100 repfiltargs = [RepeatedConditionParams(tree_id=1,
101 tree_pid=0,
102 condargs=condargs)]
103 filterparams = [FilterParams(typename='ConditionFilter',
104 args=repfiltargs)]
105 filterparam_inds = [0]
106
107 else:
108 filterparams = []
109 filterparam_inds = [-1]
110
111
112
113
114
115 treevec = make_treevec(repcondargs)
116 assert treevec == [0, 0]
117
118 assert len(repcondargs) == len(filterparam_inds)
119
120
121 helper_params = HelperConfigToolParams(treevec=treevec,
122 repcondargs=repcondargs,
123 filterparams=filterparams,
124 filterparam_inds=filterparam_inds)
125
126 return [helper_params]
127