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
10 pattern_dipz =
r'^Z(?P<WP>\d+)XX(?P<N>\d+)c(?P<ptlo>\d*)'
11 rgx_pattern = re.compile(pattern_dipz)
15 """ Get kinematic cuts on jets for DIPZ MLPL hypo """
17 if not groupdict[
'ptlo']:
18 groupdict[
'ptlo'] =
'20'
19 groupdict[
'pthi'] =
''
25 condargs.append((
'pt', vals))
30 condargs.append((
'eta', vals))
35 """Get jet multiplicity for DIPZ MLPL hypo """
37 if not groupdict[
'N']:
38 raise ValueError(
'DIPZ scenario requires a pre-defined jet multiplicity.')
42 vals =
defaults(
'dipz_njet', lo = groupdict[
'N'], hi = groupdict[
'N'])
43 condargs.append((
'dipz_njet', vals))
48 """Get DIPz WP, capacity (njets) and decorator names"""
50 if not groupdict[
'WP'] :
51 raise ValueError(
'DIPZ scenario requires a pre-defined working point cut on MLPL.')
55 vals =
defaults(
'dipz_mlpl', lo = groupdict[
'WP'])
56 vals[
'decName_z']=
'dipz20231122_z'
57 vals[
'decName_sigma']=
'dipz20231122_negLogSigma2'
58 vals[
'capacity']=njets
60 condargs.append((
'dipz_mlpl', vals))
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. """
70 assert scenario.startswith(
'Z'),\
71 'routing error, module %s: bad scenario %s' % (__name__, scenario)
73 m = rgx_pattern.match(scenario)
75 assert m
is not None, \
76 'scenario_dipz.py - regex part %s does not match scenario %s' % (
77 pattern_dipz, scenario)
79 groupdict = m.groupdict()
95 repcondargs.append(RepeatedConditionParams(tree_id=2,
98 chainPartInd=chainPartInd,
100 filterparam_inds.append(-1)
103 repcondargs.append(RepeatedConditionParams(tree_id=1,
105 multiplicity=
int(chooseN),
106 chainPartInd=chainPartInd,
107 condargs=condargs_kin))
108 filterparam_inds.append(-1)
113 assert treevec == [0, 0, 1]
115 assert len(repcondargs) == len(filterparam_inds)
118 helper_params = HelperConfigToolParams(treevec=treevec,
119 repcondargs=repcondargs,
120 filterparams=filterparams,
121 filterparam_inds=filterparam_inds)
123 return [helper_params]