ATLAS Offline Software
Loading...
Searching...
No Matches
python.scenario_mult Namespace Reference

Functions

 get_conditionfilter_args_from_matchdict (groupdict, threshold_var)
 scenario_mult (scenario, chainPartInd)

Variables

str pattern_pt_threshold
str pattern_et_threshold
str pattern_common = r'(XX(?P<etalo>\d*)eta(?P<etahi>\d*))?'
str pattern_ptfull = pattern_pt_threshold + pattern_common
 rgx_pt = re.compile(pattern_ptfull)
str pattern_etfull = pattern_et_threshold + pattern_common
 rgx_et = re.compile(pattern_etfull)

Function Documentation

◆ get_conditionfilter_args_from_matchdict()

python.scenario_mult.get_conditionfilter_args_from_matchdict ( groupdict,
threshold_var )
 Extract the arguments used by the filter of the MULT condition
from the dictionary greated during ghe regex matching to the sceanario
string. THESE CHAINS HAS DEFAULT CONDITION FILTERING

Definition at line 26 of file scenario_mult.py.

26def get_conditionfilter_args_from_matchdict(groupdict, threshold_var):
27 """ Extract the arguments used by the filter of the MULT condition
28 from the dictionary greated during ghe regex matching to the sceanario
29 string. THESE CHAINS HAS DEFAULT CONDITION FILTERING"""
30
31 # care! if et no match, etlo and etahi are None.
32 # if et match, missing etlo, ethi = ''
33 # same for eta
34
35 if groupdict[threshold_var+'lo'] is None: # then default filtering for threshold_var
36 groupdict[threshold_var+'lo'] = ''
37 groupdict[threshold_var+'hi'] = '' # will be assigned default value
38
39 if groupdict['etalo'] is None: # then default filtering for eta
40 groupdict['etalo'] = '' # will be assigned default value
41 groupdict['etahi'] = ''
42
43 condargs = []
44 vals = defaults(threshold_var,
45 groupdict[threshold_var+'lo'],
46 groupdict[threshold_var+'hi'])
47 condargs.append((threshold_var, vals))
48
49 vals = defaults('eta',
50 groupdict['etalo'],
51 groupdict['etahi'])
52 condargs.append(('eta', vals))
53
54 return condargs
55
56

◆ scenario_mult()

python.scenario_mult.scenario_mult ( scenario,
chainPartInd )
calculate the parameters needed to generate a hypo helper config AlgTool
starting from a the hypoScenario which appears in the chainname for
an MULT condition. The MULT condition is filtered

Definition at line 57 of file scenario_mult.py.

57def scenario_mult(scenario, chainPartInd):
58 """calculate the parameters needed to generate a hypo helper config AlgTool
59 starting from a the hypoScenario which appears in the chainname for
60 an MULT condition. The MULT condition is filtered"""
61
62 if not scenario.startswith('MULT'):
63 raise ValueError( f'routing error, module {__name__}: bad scenario {scenario}')
64
65 threshold_var = 'pt'
66 m = rgx_pt.match(scenario)
67 if m is None:
68 threshold_var = 'et'
69 m = rgx_et.match(scenario)
70 groupdict = m.groupdict()
71
72 condargs = []
73 vals = defaults('mult',
74 groupdict['multlo'],
75 groupdict['multhi'])
76
77 # find the constructor arguments for each elemental condition
78 condargs.append(('mult', vals))
79
80 # treeVec is [0, 0] handle non-root nodes here
81 repcondargs = [RepeatedConditionParams(tree_id = 1,
82 tree_pid=0,
83 chainPartInd=chainPartInd,
84 condargs=condargs)]
85
86 # get the arguments needed for the MULT condition filter
87 filterparams = None
88 condargs = get_conditionfilter_args_from_matchdict(groupdict,threshold_var)
89
90 if condargs: # has default filterinf, so always True
91
92 # make repeated conditions that filter the MULT condition
93 repfiltargs = [RepeatedConditionParams(tree_id=1,
94 tree_pid=0,
95 condargs=condargs)]
96 filterparams = [FilterParams(typename='ConditionFilter',
97 args=repfiltargs)]
98 filterparam_inds = [0]
99
100 else:
101 filterparams = []
102 filterparam_inds = [-1] # no condition filter
103
104 # parameters to initalise the AlgTool that initialises the helper AlgTool
105
106 # treevec[i] gives the tree_id of the parent of the
107 # node with tree_id = i
108 treevec = make_treevec(repcondargs)
109 assert treevec == [0, 0]
110
111 assert len(repcondargs) == len(filterparam_inds)
112
113
114 helper_params = HelperConfigToolParams(treevec=treevec,
115 repcondargs=repcondargs,
116 filterparams=filterparams,
117 filterparam_inds=filterparam_inds)
118
119 return [helper_params] # a list with one entry per FastReduction tree
120

Variable Documentation

◆ pattern_common

str python.scenario_mult.pattern_common = r'(XX(?P<etalo>\d*)eta(?P<etahi>\d*))?'

Definition at line 18 of file scenario_mult.py.

◆ pattern_et_threshold

str python.scenario_mult.pattern_et_threshold
Initial value:
1= r'^MULT(?P<multlo>\d+)mult(?P<multhi>\d+)'\
2 r'(XX(?P<etlo>\d*)et(?P<ethi>\d*))?'

Definition at line 15 of file scenario_mult.py.

◆ pattern_etfull

str python.scenario_mult.pattern_etfull = pattern_et_threshold + pattern_common

Definition at line 23 of file scenario_mult.py.

◆ pattern_pt_threshold

str python.scenario_mult.pattern_pt_threshold
Initial value:
1= r'^MULT(?P<multlo>\d+)mult(?P<multhi>\d+)'\
2 r'(XX(?P<ptlo>\d*)pt(?P<pthi>\d*))?'

Definition at line 12 of file scenario_mult.py.

◆ pattern_ptfull

str python.scenario_mult.pattern_ptfull = pattern_pt_threshold + pattern_common

Definition at line 20 of file scenario_mult.py.

◆ rgx_et

python.scenario_mult.rgx_et = re.compile(pattern_etfull)

Definition at line 24 of file scenario_mult.py.

◆ rgx_pt

python.scenario_mult.rgx_pt = re.compile(pattern_ptfull)

Definition at line 21 of file scenario_mult.py.