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
8 from AthenaCommon.Logging
import logging
9 log = logging.getLogger(__name__)
13 all_elemental_keys = (
'etaRange',
'nnJvt',
'jvt',
'smc',
14 'threshold',
'momCuts',
'bsel',
'gntau',
'uht1tau',
15 'clrsel',
'pileuprm',
'timing',
'timeSig')
20 args = momCuts.split(separator)
28 elemental_keys = [k
for k
in all_elemental_keys
if k
in cp]
29 cp_elemental_args = {k : cp[k]
for k
in elemental_keys
if cp[k]}
33 for k, v
in cp_elemental_args.items():
34 if v ==
'nosmc': todelete.append(k)
36 for k
in todelete: del cp_elemental_args[k]
42 for k, v
in cp_elemental_args.items():
46 condargs.append((key, vals))
52 condargs.append((key, vals))
58 condargs.append((key, vals))
64 assert values[0]==
'',
'nnJvt condition takes only version post-argument'
65 assert values[1].startswith(
'v'),
'nnJvt condition expects version as post-argument'
67 version_to_name = dict(
74 'nnJvtName': version_to_name[values[1]]
77 condargs.append((key, vals))
82 assert values[1] ==
'',
'jvt condition takes only one argument, two were given'
85 condargs.append((key, vals))
92 condargs.append((key, vals))
99 condargs.append((key, vals))
103 values = v.split(key)
106 condargs.append((key, vals))
111 values = v.split(key)
112 assert values[1] ==
'',
'bgn1 condition takes only one argument, two were given'
126 assert (values[0]
in gn1_WPs.keys()),f
"The efficiency of the specified GN1 cut \'{v}\' can not be found in the WP dictionary. Please add or remove the WP from the GN1 WP dictionary."
128 lo = gn1_WPs[values[0]]
134 'namePb':
'fastGN120230331_pb',
135 'namePc':
'fastGN120230331_pc',
136 'namePu':
'fastGN120230331_pu',
137 'nameValid':
'TracksForMinimalJetTag_isValid'
140 condargs.append((k, vals))
144 elif 'bgntwoxt' in v:
146 values = v.split(key)
147 assert values[1] ==
'',
'bgntwoxt condition takes only one argument, two were given'
162 assert (values[0]
in gn2xt_WPs.keys()),f
"The efficiency of the specified gn2xt cut \'{v}\' can not be found in the WP dictionary. Please add or remove the WP from the gn2xt WP dictionary."
164 lo = gn2xt_WPs[values[0]]
169 'namePb':
'GN2XTrig_phbb',
170 'namePc':
'GN2XTrig_ptop',
171 'namePu':
'GN2XTrig_pqcd',
173 condargs.append((k, vals))
178 values = v.split(key)
179 assert values[1] ==
'',
'bgntwox condition takes only one argument, two were given'
190 assert (values[0]
in gn2x_WPs.keys()),f
"The efficiency of the specified gn2x cut \'{v}\' can not be found in the WP dictionary. Please add or remove the WP from the gn2x WP dictionary."
192 lo = gn2x_WPs[values[0]]
197 'namePb':
'GN2Xv01_phbb',
198 'namePc':
'GN2Xv01_ptop',
199 'namePu':
'GN2Xv01_pqcd',
201 condargs.append((k, vals))
205 values = v.split(key)
206 assert values[1] ==
'',
'bgn2 condition takes only one argument, two were given'
220 assert (values[0]
in gn2_WPs.keys()),f
"The efficiency of the specified GN2 cut \'{v}\' can not be found in the WP dictionary. Please add or remove the WP from the GN2 WP dictionary."
222 lo = gn2_WPs[values[0]]
228 'namePb':
'fastGN220240122_pb',
229 'namePc':
'fastGN220240122_pc',
230 'namePu':
'fastGN220240122_pu',
231 'nameValid':
'TracksForMinimalJetTag_isValid'
234 condargs.append((k, vals))
238 values = v.split(key)
239 assert values[1] ==
'',
'bdips condition takes only one argument, two were given'
254 assert (values[0]
in dips_WPs.keys()),f
"The efficiency of the specified dips cut \'{v}\' can not be found in the WP dictionary. Please add or remove the WP from the dips WP dictionary."
256 lo = dips_WPs[values[0]]
261 'namePb':
'fastDips_pb',
262 'namePc':
'fastDips_pc',
263 'namePu':
'fastDips_pu',
264 'nameValid':
'TracksForMinimalJetTag_isValid'
266 condargs.append((k, vals))
269 raise ValueError(f
'btagger {v} not supported')
276 assert values[1] ==
'' ,
'gntau condition takes only one argument, two were given'
286 assert (values[0]
in gntau_WPs.keys()),f
"The efficiency of the specified gntau cut \'{v}\' can not be found in the WP dictionary. Please add or remove the WP from the gntau WP dictionary."
288 lo = gntau_WPs[values[0]]
292 'namePtau':
'fastGNTau20240216_ptau',
293 'namePu':
'fastGNTau20240216_pu',
294 'nameValid':
'TracksForMinimalJetTag_isValid'
296 condargs.append((k, vals))
298 log.info(
"Adding HLT preselection: gntau %s", values[0])
303 assert values[1] ==
'' ,
'uht1tau condition takes only one argument, two were given'
314 assert (values[0]
in uht1tau_WPs.keys()),f
"The efficiency of the specified uht1tau cut \'{v}\' can not be found in the WP dictionary. Please add or remove the WP from the gntau WP dictionary."
316 lo = uht1tau_WPs[values[0]]
320 'namePtau':
'fastUHT120250605_ptau',
321 'namePu':
'fastUHT120250605_pu',
322 'nameValid':
'TracksForMinimalJetTag_isValid'
324 condargs.append((k, vals))
326 log.info(
"Adding HLT preselection: uht1tau %s", values[0])
330 from TrigHLTJetHypo.FastReductionAlgToolFactory
import jetMoments
335 for moment
in jetMoments:
337 key=
'mom{}'.
format(moment)
338 lo, hi = cutstr.split(key)
340 vals[
"moment"] = jetMoments[moment]
341 condargs.append((key, vals))
343 for moment
in jetMoments:
345 key=
'mom{}'.
format(moment)
346 lo, hi = v.split(key)
348 vals[
"moment"] = jetMoments[moment]
349 condargs.append((key, vals))
353 values = v.split(key)
355 lo=values[0].
replace(
"n",
"-",1)
357 hi=values[1].
replace(
"n",
"-",1)
359 condargs.append((key, vals))
365 """build two lists of RepeatedConditionConfig objects
366 one list contains the Conditions to be used by FastReducer,
367 and the other Contains the conditions used to filter the Condition.
368 Each list has one entry per chain part"""
370 assert chain_parts,
'routing error, module %s: no chain parts' % __name__
374 filterparam_inds = []
385 for cp
in chain_parts:
393 multiplicity =
int(cp[
'multiplicity'])
394 chainPartInd = cp[
'chainPartIndex']
397 filterparam_inds.append(-1)
401 clique = clique_list.index(condargs)
404 clique_list.append(condargs)
405 clique = len(clique_list)-1
407 repcondargs.append(RepeatedConditionParams(tree_id = ncp,
410 chainPartInd=chainPartInd,
411 multiplicity=multiplicity,
418 assert treevec == [0
for i
in range(len(chain_parts) + 1)]
420 assert len(repcondargs) == len(filterparam_inds)
421 helper_params = HelperConfigToolParams(treevec=treevec,
422 repcondargs=repcondargs,
423 filterparams=filterparams,
424 filterparam_inds=filterparam_inds)
426 return [helper_params]