ATLAS Offline Software
Functions | Variables
python.scenario_mult Namespace Reference

Functions

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

Variables

 pattern_pt_threshold
 
 pattern_et_threshold
 
 pattern_common
 
 pattern_ptfull
 
 rgx_pt
 
 pattern_etfull
 
 rgx_et
 

Function Documentation

◆ get_conditionfilter_args_from_matchdict()

def 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.

26 def 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()

def 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.

57 def 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

python.scenario_mult.pattern_common

Definition at line 18 of file scenario_mult.py.

◆ pattern_et_threshold

python.scenario_mult.pattern_et_threshold

Definition at line 15 of file scenario_mult.py.

◆ pattern_etfull

python.scenario_mult.pattern_etfull

Definition at line 23 of file scenario_mult.py.

◆ pattern_pt_threshold

python.scenario_mult.pattern_pt_threshold

Definition at line 12 of file scenario_mult.py.

◆ pattern_ptfull

python.scenario_mult.pattern_ptfull

Definition at line 20 of file scenario_mult.py.

◆ rgx_et

python.scenario_mult.rgx_et

Definition at line 24 of file scenario_mult.py.

◆ rgx_pt

python.scenario_mult.rgx_pt

Definition at line 21 of file scenario_mult.py.

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.scenario_mult.scenario_mult
def scenario_mult(scenario, chainPartInd)
Definition: scenario_mult.py:57
python.make_treevec.make_treevec
def make_treevec(repcondargs)
Definition: make_treevec.py:3
python.scenario_mult.get_conditionfilter_args_from_matchdict
def get_conditionfilter_args_from_matchdict(groupdict, threshold_var)
Definition: scenario_mult.py:26