65def scenario_dipz(scenario, chainPartInd):
66 """calculate the parameters needed to generate a hypo helper config AlgTool
67 starting from a the hypoScenario which appears in the chainname for
68 a DIPZ mlpl condition. """
69
70 assert scenario.startswith('Z'),\
71 'routing error, module %s: bad scenario %s' % (__name__, scenario)
72
73 m = rgx_pattern.match(scenario)
74
75 assert m is not None, \
76 'scenario_dipz.py - regex part %s does not match scenario %s' % (
77 pattern_dipz, scenario)
78
79 groupdict = m.groupdict()
80
81
82
83 repcondargs = []
84 filterparams = []
85 filterparam_inds = []
86
87
88
89
90 condargs_kin = get_kin_args_from_matchdict(groupdict)
91 chooseN = float(get_mult_args_from_matchdict(groupdict)[0][1]['min'])
92 condargs = get_dipz_mlpl_from_matchdict(groupdict, str(chooseN))
93
94
95 repcondargs.append(RepeatedConditionParams(tree_id=2,
96 tree_pid=1,
97 multiplicity=1,
98 chainPartInd=chainPartInd,
99 condargs=condargs))
100 filterparam_inds.append(-1)
101
102
103 repcondargs.append(RepeatedConditionParams(tree_id=1,
104 tree_pid=0,
105 multiplicity=int(chooseN),
106 chainPartInd=chainPartInd,
107 condargs=condargs_kin))
108 filterparam_inds.append(-1)
109
110
111
112 treevec = make_treevec(repcondargs)
113 assert treevec == [0, 0, 1]
114
115 assert len(repcondargs) == len(filterparam_inds)
116
117
118 helper_params = HelperConfigToolParams(treevec=treevec,
119 repcondargs=repcondargs,
120 filterparams=filterparams,
121 filterparam_inds=filterparam_inds)
122
123 return [helper_params]
124