|
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 20 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 220 of file ConditionsToolSetterFastReduction.py.
220 def _check_scenarios(self, node):
223 'ConditionsToolSetter: illegal scenario: %s' % node.scenario)
225 for cn
in node.children:
226 self._check_scenarios(cn)
◆ _fill_conditions_map()
def python.ConditionsToolSetterFastReduction.ConditionsToolSetterFastReduction._fill_conditions_map |
( |
|
self, |
|
|
|
node, |
|
|
|
cmap, |
|
|
|
fmap |
|
) |
| |
|
private |
Definition at line 190 of file ConditionsToolSetterFastReduction.py.
190 def _fill_conditions_map(self, node, cmap, fmap):
193 assert (len(node.compound_condition_tools) == 1)
194 cmap[node.node_id] = node.compound_condition_tools[0]
196 fmap[node.node_id] = node.filter_condition_tool
200 cmap[node.node_id] = self.algToolFactory(
'repeated')
201 cmap[node.node_id].conditionMakers = [self.algToolFactory(
'all')]
202 cmap[node.node_id].multiplicity = 1
204 fmap[node.node_id] = self.algToolFactory(
'repeated')
205 fmap[node.node_id].conditionMakers = []
206 fmap[node.node_id].multiplicity = 1
209 for cn
in node.children:
210 self._fill_conditions_map(cn, cmap, fmap)
◆ _fill_tree_map()
def python.ConditionsToolSetterFastReduction.ConditionsToolSetterFastReduction._fill_tree_map |
( |
|
self, |
|
|
|
node, |
|
|
|
tmap |
|
) |
| |
|
private |
Definition at line 184 of file ConditionsToolSetterFastReduction.py.
184 def _fill_tree_map(self, node, tmap):
185 tmap[node.node_id] = node.parent_id
186 for cn
in node.children:
187 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 107 of file ConditionsToolSetterFastReduction.py.
107 def _make_compound_condition_tools(self, node):
108 """For each element of node.conf_attrs, construct a
109 ConditionContainer. Example for chain HLT_2j80_3j60_L1J15:
113 (defaultdict(<class 'dict'>, {
114 'et': {'min': '80000.0', 'max': 'inf'},
115 'eta': {'min': '0.0', 'max': '3.2'}}), 2)
119 (defaultdict(<class 'dict'>, {'et': {'min': '60000.0', 'max': 'inf'},
120 'eta': {'min': '0.0', 'max': '3.2'}}), 3)
126 outer_condition_tools = []
131 assert len(node.conf_attrs) == 1
132 mult = node.multiplicity
133 for i
in range(len(node.conf_attrs)):
134 c = node.conf_attrs[i]
137 if node.chainpartinds:
138 cpi = node.chainpartinds[i]
140 el_condition_tools = self._make_el_condition_tools(c)
143 condition_tool =self.algToolFactory(
'repeated')
149 condition_tool.chainPartInd =
int(cpi[len(
'leg'):])
151 condition_tool.conditionMakers = el_condition_tools
152 condition_tool.multiplicity = mult
154 outer_condition_tools.append(condition_tool)
156 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 44 of file ConditionsToolSetterFastReduction.py.
44 def _make_el_condition_tools(self, conf_dict):
45 """conf_dict: a dict containing names of elemental conditions
46 and min, max valies. These will be used to instantiate
47 conditon building AlgTools, one for eac conditon
49 for 2j80_2j60, the dictionaries are:
50 {'et': {'min': '80000.0', 'max': 'inf'},
51 'eta': {'min': '0.0', 'max': '3.2'}}
56 {'et': {'min': '60000.0', 'max': 'inf'},
57 'eta': {'min': '0.0', 'max': '3.2'}})
63 for k, v
in conf_dict.items():
67 condition_tool = self.algToolFactory(k)
68 for lim, val
in v.items():
69 setattr(condition_tool, lim, val)
73 if (k.startswith (
'mom')):
74 moment = k[len(
'mom'):]
75 if moment
in self.JetMoments:
76 condition_tool.moment = self.JetMoments[moment]
77 else:
raise RuntimeError(
'%s not supported' % (moment))
81 condition_tools.append(condition_tool)
83 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 86 of file ConditionsToolSetterFastReduction.py.
86 def _make_filter_condition_tool(self, node):
88 """Condition filters use a list of CompoundCondition containing
89 single jet elemental conditions select a subset of the reco
90 jets to send to the a Condition"""
92 el_condition_tools = []
94 for fc
in node.filter_dicts:
97 el_condition_tools.extend(self._make_el_condition_tools(fc))
99 condition_tool = self.algToolFactory(
'repeated')
101 condition_tool.conditionMakers = el_condition_tools
102 condition_tool.multiplicity = 1
104 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 159 of file ConditionsToolSetterFastReduction.py.
159 def _mod_leaf(self, node):
160 """ Add Condition tools to For a leaf node."""
175 node.compound_condition_tools = self._make_compound_condition_tools(
178 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 35 of file ConditionsToolSetterFastReduction.py.
35 def _set_conditions(self, node):
36 """attach Conditions to leaf nodes"""
40 for cn
in node.children:
41 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 228 of file ConditionsToolSetterFastReduction.py.
229 """Entry point for this module.
230 Modifies a (usually compound) hypo tree node to
231 reduce it to form from whuch the treevector, and conditionsVector
232 These will be used to initialise FastReductionMatcher.
234 In particular: all leaf nodes will have a single ConmpoundCondition
235 All other nodes will be assigned an AcceptAll condition.
241 self._check_scenarios(tree)
244 self._set_conditions(tree)
248 self._fill_tree_map(tree, tree_map)
250 treeVec = self._map_2_vec(tree_map)
253 filterConditionsMap = {}
255 self._fill_conditions_map(tree, conditionsMap, filterConditionsMap)
259 self.conditionMakersVec = self._map_2_vec(conditionsMap)
260 filterConditionsVec = self._map_2_vec(filterConditionsMap)
263 config_tool = self.algToolFactory(
'fastreduction')
266 config_tool.conditionMakers = self.conditionMakersVec
267 config_tool.filtConditionsMakers = filterConditionsVec
268 config_tool.treeVector = treeVec
269 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: