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_full =
r'^HTZ(?P<htlo>\d+)XX(?P<N>\d+)c(?P<ptlo>\d*)'
11 rgx_pattern = re.compile(pattern_full)
14 """ Get kinematic cuts on jets for HT+DIPZ MLPL hypo """
16 if not groupdict[
'ptlo']:
17 groupdict[
'ptlo'] =
'20'
18 groupdict[
'pthi'] =
''
24 condargs.append((
'pt', vals))
29 condargs.append((
'eta', vals))
34 """Get jet multiplicity for HT+DIPZ MLPL hypo """
36 if not groupdict[
'N']:
37 raise ValueError(
'DIPZ scenario requires a pre-defined jet multiplicity.')
41 vals =
defaults(
'dipz_njet', lo = groupdict[
'N'], hi = groupdict[
'N'])
42 condargs.append((
'dipz_njet', vals))
47 """Get DIPz WP, capacity (njets) and decorator names"""
53 vals[
'decName_z']=
'dipz20231122_z'
54 vals[
'decName_sigma']=
'dipz20231122_negLogSigma2'
55 vals[
'capacity']=
str(njets)
57 condargs.append((
'htdipz', vals))
63 """calculate the parameters needed to generate a hypo helper config AlgTool
64 starting from a the hypoScenario which appears in the chainname for
65 a DIPZ MLPL + HT condition. """
67 assert scenario.startswith(
'HTZ'),\
68 'routing error, module %s: bad scenario %s' % (__name__, scenario)
70 m = rgx_pattern.match(scenario)
72 assert m
is not None, \
73 'scenario_htdipz.py - regex part %s does not match scenario %s' % (
74 pattern_full, scenario)
76 groupdict = m.groupdict()
92 repcondargs.append(RepeatedConditionParams(tree_id=2,
95 chainPartInd=chainPartInd,
96 condargs=condargsHTZ))
97 filterparam_inds.append(-1)
100 repcondargs.append(RepeatedConditionParams(tree_id=1,
102 multiplicity=
int(chooseN),
103 chainPartInd=chainPartInd,
104 condargs=condargs_kin))
105 filterparam_inds.append(-1)
110 assert treevec == [0, 0, 1]
112 assert len(repcondargs) == len(filterparam_inds)
115 helper_params = HelperConfigToolParams(treevec=treevec,
116 repcondargs=repcondargs,
117 filterparams=filterparams,
118 filterparam_inds=filterparam_inds)
119 return [helper_params]