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

Functions

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

Variables

str pattern_pt_threshold
str pattern_et_threshold
str pattern_common
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_ht.get_conditionfilter_args_from_matchdict ( groupdict,
threshold_var )
 Extract the arguments used by the filter of the HT condition
from the dictionary created during the regex matching to the scenario
string. THESE CHAINS HAS DEFAULT CONDITION FILTERING

Definition at line 27 of file scenario_ht.py.

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

◆ scenario_ht()

python.scenario_ht.scenario_ht ( 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 HT condition. The HT condition is filtered

Definition at line 64 of file scenario_ht.py.

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

Variable Documentation

◆ pattern_common

str python.scenario_ht.pattern_common
Initial value:
1= r'(XX(?P<etalo>\d*)eta(?P<etahi>\d*))?'\
2 r'(XX(?P<jvtlo>\d*)jvt)?(XX(?P<veto>veto))?$'

Definition at line 18 of file scenario_ht.py.

◆ pattern_et_threshold

str python.scenario_ht.pattern_et_threshold
Initial value:
1= r'^HT(?P<htlo>\d+)'\
2 r'(XX(?P<etlo>\d*)et(?P<ethi>\d*))?'

Definition at line 15 of file scenario_ht.py.

◆ pattern_etfull

str python.scenario_ht.pattern_etfull = pattern_et_threshold + pattern_common

Definition at line 24 of file scenario_ht.py.

◆ pattern_pt_threshold

str python.scenario_ht.pattern_pt_threshold
Initial value:
1= r'^HT(?P<htlo>\d+)'\
2 r'(XX(?P<ptlo>\d*)pt(?P<pthi>\d*))?'

Definition at line 12 of file scenario_ht.py.

◆ pattern_ptfull

str python.scenario_ht.pattern_ptfull = pattern_pt_threshold + pattern_common

Definition at line 21 of file scenario_ht.py.

◆ rgx_et

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

Definition at line 25 of file scenario_ht.py.

◆ rgx_pt

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

Definition at line 22 of file scenario_ht.py.