ATLAS Offline Software
prefilter_maxmult.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
2 
3 from TrigHLTJetHypo.FastReductionAlgToolFactory import toolfactory
4 from TrigHLTJetHypo.ConditionDefaults import defaults
5 
6 from AthenaCommon.Logging import logging
7 from AthenaCommon.Constants import DEBUG
8 
9 import re
10 
11 logger = logging.getLogger( __name__)
12 logger.setLevel(DEBUG)
13 
14 pattern = r'^MAXMULT(?P<end>\d+)(?P<eta>[jacf]*)$'
15 rgx = re.compile(pattern)
16 
17 etaRangeAbbrev = {
18  "j":"0eta320", # default
19  "a":"0eta490",
20  "c":"0eta240",
21  "f":"320eta490"
22 }
23 
24 def prefilter_maxmult(pf_string):
25  """calculate the parameters needed to generate a MaxMultFilter config
26  AlgTool starting from the prefilter substring if it appears in the
27  chain dict"""
28 
29  assert pf_string.startswith('MAXMULT'),\
30  'routing error, module %s: bad prefilter %s' % (__name__, pf_string)
31 
32  m = rgx.match(pf_string)
33  groupdict = m.groupdict()
34 
35  vals = {}
36 
37  # eta region
38  eta_region = groupdict['eta']
39  if not eta_region: eta_region = 'j'
40  eta_sel = etaRangeAbbrev[eta_region]
41  lo, hi = eta_sel.split('eta')
42  vals = defaults('eta', lo=lo, hi=hi)
43 
44  # jet multiplicity
45  vals['end'] = int(groupdict['end'])
46  toolclass, name = toolfactory('MaxMultFilterConfigTool')
47  vals['name'] = name
48 
49  return toolclass(**vals)
50 
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
Constants
some useful constants -------------------------------------------------—
Base_Fragment.defaults
dictionary defaults
This includes now the top quark, the leptons and the bosons.
Definition: GeneratorFilters/share/common/Base_Fragment.py:79
python.prefilter_maxmult.prefilter_maxmult
def prefilter_maxmult(pf_string)
Definition: prefilter_maxmult.py:24
python.FastReductionAlgToolFactory.toolfactory
toolfactory
Definition: FastReductionAlgToolFactory.py:106