|
def | _set_conditions (self, node) |
|
def | _make_el_condition_tools (self, conf_dict) |
|
def | _make_filter_condition_tool (self, node) |
|
def | _make_compound_condition_tools (self, node) |
|
def | _mod_leaf (self, node) |
|
def | _fill_tree_map (self, node, tmap) |
|
def | _fill_conditions_map (self, node, cmap, fmap) |
|
def | _map_2_vec (self, amap) |
|
def | _check_scenarios (self, node) |
|
Visitor to set instantiated AlgTools to a jet hypo tree
Definition at line 21 of file ConditionsToolSetterFastReduction.py.
◆ __init__()
def python.ConditionsToolSetterFastReduction.ConditionsToolSetterFastReduction.__init__ |
( |
|
self, |
|
|
|
algToolFactory |
|
) |
| |
◆ _check_scenarios()
def python.ConditionsToolSetterFastReduction.ConditionsToolSetterFastReduction._check_scenarios |
( |
|
self, |
|
|
|
node |
|
) |
| |
|
private |
Definition at line 221 of file ConditionsToolSetterFastReduction.py.
221 def _check_scenarios(self, node):
224 'ConditionsToolSetter: illegal scenario: %s' % node.scenario)
226 for cn
in node.children:
227 self._check_scenarios(cn)
◆ _fill_conditions_map()
def python.ConditionsToolSetterFastReduction.ConditionsToolSetterFastReduction._fill_conditions_map |
( |
|
self, |
|
|
|
node, |
|
|
|
cmap, |
|
|
|
fmap |
|
) |
| |
|
private |
Definition at line 191 of file ConditionsToolSetterFastReduction.py.
191 def _fill_conditions_map(self, node, cmap, fmap):
194 assert (len(node.compound_condition_tools) == 1)
195 cmap[node.node_id] = node.compound_condition_tools[0]
197 fmap[node.node_id] = node.filter_condition_tool
201 cmap[node.node_id] = self.algToolFactory(
'repeated')
202 cmap[node.node_id].conditionMakers = [self.algToolFactory(
'all')]
203 cmap[node.node_id].multiplicity = 1
205 fmap[node.node_id] = self.algToolFactory(
'repeated')
206 fmap[node.node_id].conditionMakers = []
207 fmap[node.node_id].multiplicity = 1
210 for cn
in node.children:
211 self._fill_conditions_map(cn, cmap, fmap)
◆ _fill_tree_map()
def python.ConditionsToolSetterFastReduction.ConditionsToolSetterFastReduction._fill_tree_map |
( |
|
self, |
|
|
|
node, |
|
|
|
tmap |
|
) |
| |
|
private |
Definition at line 185 of file ConditionsToolSetterFastReduction.py.
185 def _fill_tree_map(self, node, tmap):
186 tmap[node.node_id] = node.parent_id
187 for cn
in node.children:
188 self._fill_tree_map(cn, tmap)
◆ _make_compound_condition_tools()
def python.ConditionsToolSetterFastReduction.ConditionsToolSetterFastReduction._make_compound_condition_tools |
( |
|
self, |
|
|
|
node |
|
) |
| |
|
private |
For each element of node.conf_attrs, construct a
ConditionContainer. Example for chain HLT_2j80_3j60_L1J15:
First leaf node has
conf_attrs [1]:
(defaultdict(<class 'dict'>, {
'et': {'min': '80000.0', 'max': 'inf'},
'eta': {'min': '0.0', 'max': '3.2'}}), 2)
Second leaf node has
conf_attrs [1]:
(defaultdict(<class 'dict'>, {'et': {'min': '60000.0', 'max': 'inf'},
'eta': {'min': '0.0', 'max': '3.2'}}), 3)
Definition at line 108 of file ConditionsToolSetterFastReduction.py.
108 def _make_compound_condition_tools(self, node):
109 """For each element of node.conf_attrs, construct a
110 ConditionContainer. Example for chain HLT_2j80_3j60_L1J15:
114 (defaultdict(<class 'dict'>, {
115 'et': {'min': '80000.0', 'max': 'inf'},
116 'eta': {'min': '0.0', 'max': '3.2'}}), 2)
120 (defaultdict(<class 'dict'>, {'et': {'min': '60000.0', 'max': 'inf'},
121 'eta': {'min': '0.0', 'max': '3.2'}}), 3)
127 outer_condition_tools = []
132 assert len(node.conf_attrs) == 1
133 mult = node.multiplicity
134 for i
in range(len(node.conf_attrs)):
135 c = node.conf_attrs[i]
138 if node.chainpartinds:
139 cpi = node.chainpartinds[i]
141 el_condition_tools = self._make_el_condition_tools(c)
144 condition_tool =self.algToolFactory(
'repeated')
150 condition_tool.chainPartInd =
int(cpi[len(
'leg'):])
152 condition_tool.conditionMakers = el_condition_tools
153 condition_tool.multiplicity = mult
155 outer_condition_tools.append(condition_tool)
157 return outer_condition_tools
◆ _make_el_condition_tools()
def python.ConditionsToolSetterFastReduction.ConditionsToolSetterFastReduction._make_el_condition_tools |
( |
|
self, |
|
|
|
conf_dict |
|
) |
| |
|
private |
conf_dict: a dict containing names of elemental conditions
and min, max valies. These will be used to instantiate
conditon building AlgTools, one for eac conditon
for 2j80_2j60, the dictionaries are:
{'et': {'min': '80000.0', 'max': 'inf'},
'eta': {'min': '0.0', 'max': '3.2'}}
and
{'et': {'min': '60000.0', 'max': 'inf'},
'eta': {'min': '0.0', 'max': '3.2'}})
Definition at line 45 of file ConditionsToolSetterFastReduction.py.
45 def _make_el_condition_tools(self, conf_dict):
46 """conf_dict: a dict containing names of elemental conditions
47 and min, max valies. These will be used to instantiate
48 conditon building AlgTools, one for eac conditon
50 for 2j80_2j60, the dictionaries are:
51 {'et': {'min': '80000.0', 'max': 'inf'},
52 'eta': {'min': '0.0', 'max': '3.2'}}
57 {'et': {'min': '60000.0', 'max': 'inf'},
58 'eta': {'min': '0.0', 'max': '3.2'}})
64 for k, v
in conf_dict.items():
68 condition_tool = self.algToolFactory(k)
69 for lim, val
in v.items():
70 setattr(condition_tool, lim, val)
74 if (k.startswith (
'mom')):
75 moment = k[len(
'mom'):]
76 if moment
in self.JetMoments:
77 condition_tool.moment = self.JetMoments[moment]
78 else:
raise RuntimeError(
'%s not supported' % (moment))
82 condition_tools.append(condition_tool)
84 return condition_tools
◆ _make_filter_condition_tool()
def python.ConditionsToolSetterFastReduction.ConditionsToolSetterFastReduction._make_filter_condition_tool |
( |
|
self, |
|
|
|
node |
|
) |
| |
|
private |
Condition filters use a list of CompoundCondition containing
single jet elemental conditions select a subset of the reco
jets to send to the a Condition
Definition at line 87 of file ConditionsToolSetterFastReduction.py.
87 def _make_filter_condition_tool(self, node):
89 """Condition filters use a list of CompoundCondition containing
90 single jet elemental conditions select a subset of the reco
91 jets to send to the a Condition"""
93 el_condition_tools = []
95 for fc
in node.filter_dicts:
98 el_condition_tools.extend(self._make_el_condition_tools(fc))
100 condition_tool = self.algToolFactory(
'repeated')
102 condition_tool.conditionMakers = el_condition_tools
103 condition_tool.multiplicity = 1
105 return condition_tool
◆ _map_2_vec()
def python.ConditionsToolSetterFastReduction.ConditionsToolSetterFastReduction._map_2_vec |
( |
|
self, |
|
|
|
amap |
|
) |
| |
|
private |
◆ _mod_leaf()
def python.ConditionsToolSetterFastReduction.ConditionsToolSetterFastReduction._mod_leaf |
( |
|
self, |
|
|
|
node |
|
) |
| |
|
private |
Add Condition tools to For a leaf node.
Definition at line 160 of file ConditionsToolSetterFastReduction.py.
160 def _mod_leaf(self, node):
161 """ Add Condition tools to For a leaf node."""
176 node.compound_condition_tools = self._make_compound_condition_tools(
179 node.filter_condition_tool = self._make_filter_condition_tool(
◆ _set_conditions()
def python.ConditionsToolSetterFastReduction.ConditionsToolSetterFastReduction._set_conditions |
( |
|
self, |
|
|
|
node |
|
) |
| |
|
private |
attach Conditions to leaf nodes
Definition at line 36 of file ConditionsToolSetterFastReduction.py.
36 def _set_conditions(self, node):
37 """attach Conditions to leaf nodes"""
41 for cn
in node.children:
42 self._set_conditions(cn)
◆ mod()
def python.ConditionsToolSetterFastReduction.ConditionsToolSetterFastReduction.mod |
( |
|
self, |
|
|
|
tree |
|
) |
| |
Entry point for this module.
Modifies a (usually compound) hypo tree node to
reduce it to form from whuch the treevector, and conditionsVector
These will be used to initialise FastReductionMatcher.
In particular: all leaf nodes will have a single ConmpoundCondition
All other nodes will be assigned an AcceptAll condition.
Definition at line 229 of file ConditionsToolSetterFastReduction.py.
230 """Entry point for this module.
231 Modifies a (usually compound) hypo tree node to
232 reduce it to form from whuch the treevector, and conditionsVector
233 These will be used to initialise FastReductionMatcher.
235 In particular: all leaf nodes will have a single ConmpoundCondition
236 All other nodes will be assigned an AcceptAll condition.
242 self._check_scenarios(tree)
245 self._set_conditions(tree)
249 self._fill_tree_map(tree, tree_map)
251 treeVec = self._map_2_vec(tree_map)
254 filterConditionsMap = {}
256 self._fill_conditions_map(tree, conditionsMap, filterConditionsMap)
260 self.conditionMakersVec = self._map_2_vec(conditionsMap)
261 filterConditionsVec = self._map_2_vec(filterConditionsMap)
264 config_tool = self.algToolFactory(
'fastreduction')
267 config_tool.conditionMakers = self.conditionMakersVec
268 config_tool.filtConditionsMakers = filterConditionsVec
269 config_tool.treeVector = treeVec
270 self.config_tool = config_tool
◆ report()
def python.ConditionsToolSetterFastReduction.ConditionsToolSetterFastReduction.report |
( |
|
self | ) |
|
◆ algToolFactory
python.ConditionsToolSetterFastReduction.ConditionsToolSetterFastReduction.algToolFactory |
◆ conditionMakers
python.ConditionsToolSetterFastReduction.ConditionsToolSetterFastReduction.conditionMakers |
◆ conditionMakersVec
python.ConditionsToolSetterFastReduction.ConditionsToolSetterFastReduction.conditionMakersVec |
◆ config_tool
python.ConditionsToolSetterFastReduction.ConditionsToolSetterFastReduction.config_tool |
◆ treeMap
python.ConditionsToolSetterFastReduction.ConditionsToolSetterFastReduction.treeMap |
The documentation for this class was generated from the following file: