|
def | __init__ (self, name, comboHypoCfg) |
|
def | __del__ (self) |
|
def | create (self, name) |
|
def | mapRawInputsToInputsIndex (self) |
|
def | addChain (self, chainDict) |
|
def | getChains (self) |
|
def | createComboHypoTools (self, flags, chainDict, comboToolConfs) |
|
def | addDefaultOutput (self) |
|
def | setPar (self, propname, value) |
|
def | resetPar (self, prop) |
|
def | getPar (self, prop) |
|
def | resetOutput (self) |
|
def | resetInput (self) |
|
def | addOutput (self, name) |
|
def | readOutputList (self) |
|
def | addInput (self, name) |
|
def | readInputList (self) |
|
def | __repr__ (self) |
|
def | getOutputList (self) |
|
def | getInputList (self) |
|
AlgNode for Combo HypoAlgs
Definition at line 210 of file MenuComponents.py.
◆ __init__()
def MenuComponents.ComboHypoNode.__init__ |
( |
|
self, |
|
|
|
name, |
|
|
|
comboHypoCfg |
|
) |
| |
Definition at line 212 of file MenuComponents.py.
212 def __init__(self, name, comboHypoCfg):
213 self.prop1 =
"MultiplicitiesMap"
214 self.prop2 =
"LegToInputCollectionMap"
215 self.comboHypoCfg = comboHypoCfg
216 self.acc = self.create( name )
217 thealgs= self.acc.getEventAlgos()
219 log.error(
"ComboHypoNode: Combo alg %s not found", name)
220 if len(thealgs) != 1:
221 log.error(
"ComboHypoNode: Combo alg %s len is %d",name, len(thealgs))
224 log.debug(
"ComboHypoNode init: Alg %s", name)
225 AlgNode.__init__(self, Alg,
'HypoInputDecisions',
'HypoOutputDecisions')
229 setattr(self.Alg, self.prop1, {})
230 setattr(self.Alg, self.prop2, {})
◆ __del__()
def MenuComponents.ComboHypoNode.__del__ |
( |
|
self | ) |
|
◆ __repr__()
def MenuComponents.AlgNode.__repr__ |
( |
|
self | ) |
|
|
inherited |
◆ addChain()
def MenuComponents.ComboHypoNode.addChain |
( |
|
self, |
|
|
|
chainDict |
|
) |
| |
Definition at line 256 of file MenuComponents.py.
256 def addChain(self, chainDict):
257 chainName = chainDict[
'chainName']
258 chainMult = chainDict[
'chainMultiplicities']
259 legsToInputCollections = self.mapRawInputsToInputsIndex()
260 if len(chainMult) != len(legsToInputCollections):
261 log.error(
"ComboHypoNode for Alg:{} with addChain for:{} Chain multiplicity:{} Per leg input collection index:{}."
262 .
format(self.Alg.name, chainName, tuple(chainMult), tuple(legsToInputCollections)))
263 log.error(
"The size of the multiplicies vector must be the same size as the per leg input collection vector.")
264 log.error(
"The ComboHypo needs to know which input DecisionContainers contain the DecisionObjects to be used for each leg.")
265 log.error(
"Check why ComboHypoNode.addInput(...) was not called exactly once per leg.")
266 raise Exception(
"[createDataFlow] Error in ComboHypoNode.addChain. Cannot proceed.")
268 cval1 = getattr(self.Alg, self.prop1)
269 cval2 = getattr(self.Alg, self.prop2)
270 if type(cval1)
is dict
or isinstance(cval1, GaudiConfig2.semantics._DictHelper):
271 if chainName
in cval1.keys():
272 log.error(
"ERROR in configuration: ComboAlg %s has already been configured for chain %s", self.Alg.name, chainName)
273 raise Exception(
"[createDataFlow] Error in ComboHypoNode.addChain. Cannot proceed.")
275 cval1[chainName] = chainMult
276 cval2[chainName] = legsToInputCollections
278 cval1 = {chainName : chainMult}
279 cval2 = {chainName : legsToInputCollections}
281 setattr(self.Alg, self.prop1, cval1)
282 setattr(self.Alg, self.prop2, cval2)
◆ addDefaultOutput()
def MenuComponents.AlgNode.addDefaultOutput |
( |
|
self | ) |
|
|
inherited |
Definition at line 62 of file MenuComponents.py.
62 def addDefaultOutput(self):
63 if self.outputProp !=
'':
64 self.addOutput((
"%s_%s"%(self.Alg.
getName(),self.outputProp)))
◆ addInput()
def MenuComponents.AlgNode.addInput |
( |
|
self, |
|
|
|
name |
|
) |
| |
|
inherited |
Reimplemented from MenuComponents.Node.
Definition at line 106 of file MenuComponents.py.
107 inputs = self.readInputList()
109 log.debug(
"Input DH not added in %s: %s already set!", self.Alg.
getName(), name)
111 if self.inputProp !=
'':
112 self.setPar(self.inputProp, name)
114 log.debug(
"no InputProp set for input of %s", self.Alg.
getName())
115 Node.addInput(self, name)
116 return len(self.readInputList())
◆ addOutput()
def MenuComponents.AlgNode.addOutput |
( |
|
self, |
|
|
|
name |
|
) |
| |
|
inherited |
Reimplemented from MenuComponents.Node.
Reimplemented in MenuComponents.HypoAlgNode.
Definition at line 90 of file MenuComponents.py.
90 def addOutput(self, name):
91 outputs = self.readOutputList()
93 log.debug(
"Output DH not added in %s: %s already set!", self.Alg.
getName(), name)
95 if self.outputProp !=
'':
96 self.setPar(self.outputProp, name)
98 log.debug(
"no outputProp set for output of %s", self.Alg.
getName())
99 Node.addOutput(self, name)
◆ create()
def MenuComponents.ComboHypoNode.create |
( |
|
self, |
|
|
|
name |
|
) |
| |
Definition at line 235 of file MenuComponents.py.
235 def create (self, name):
236 log.debug(
"ComboHypoNode.create %s",name)
237 return self.comboHypoCfg(name=name)
◆ createComboHypoTools()
def MenuComponents.ComboHypoNode.createComboHypoTools |
( |
|
self, |
|
|
|
flags, |
|
|
|
chainDict, |
|
|
|
comboToolConfs |
|
) |
| |
Create the ComboHypoTools and add them to the main alg
Definition at line 290 of file MenuComponents.py.
290 def createComboHypoTools(self, flags, chainDict, comboToolConfs):
291 """Create the ComboHypoTools and add them to the main alg"""
292 if not len(comboToolConfs):
294 confs = [ HypoToolConf( tool )
for tool
in comboToolConfs ]
295 log.debug(
"ComboHypoNode.createComboHypoTools for chain %s, Alg %s with %d tools", chainDict[
"chainName"],self.Alg.
getName(), len(comboToolConfs))
297 log.debug(
"ComboHypoNode.createComboHypoTools adding %s", conf)
298 tools = self.Alg.ComboHypoTools
299 self.Alg.ComboHypoTools = tools + [ conf.confAndCreate( flags, chainDict ) ]
◆ getChains()
def MenuComponents.ComboHypoNode.getChains |
( |
|
self | ) |
|
◆ getInputList()
def MenuComponents.Node.getInputList |
( |
|
self | ) |
|
|
inherited |
◆ getOutputList()
def MenuComponents.Node.getOutputList |
( |
|
self | ) |
|
|
inherited |
◆ getPar()
def MenuComponents.AlgNode.getPar |
( |
|
self, |
|
|
|
prop |
|
) |
| |
|
inherited |
Definition at line 81 of file MenuComponents.py.
81 def getPar(self, prop):
82 return getattr(self.Alg, prop)
◆ mapRawInputsToInputsIndex()
def MenuComponents.ComboHypoNode.mapRawInputsToInputsIndex |
( |
|
self | ) |
|
Definition at line 248 of file MenuComponents.py.
248 def mapRawInputsToInputsIndex(self):
250 theInputs = self.readInputList()
251 for rawInput
in self.inputs:
252 mapping.append( theInputs.index(rawInput) )
◆ readInputList()
def MenuComponents.AlgNode.readInputList |
( |
|
self | ) |
|
|
inherited |
Definition at line 118 of file MenuComponents.py.
118 def readInputList(self):
119 cval = self.getPar(self.inputProp)
120 return (cval
if isinstance(cval, MutableSequence)
else
121 ([
str(cval)]
if cval
else []))
◆ readOutputList()
def MenuComponents.AlgNode.readOutputList |
( |
|
self | ) |
|
|
inherited |
Definition at line 101 of file MenuComponents.py.
101 def readOutputList(self):
102 cval = self.getPar(self.outputProp)
103 return (cval
if isinstance(cval, MutableSequence)
else
104 ([
str(cval)]
if cval
else []))
◆ resetInput()
def MenuComponents.AlgNode.resetInput |
( |
|
self | ) |
|
|
inherited |
◆ resetOutput()
def MenuComponents.AlgNode.resetOutput |
( |
|
self | ) |
|
|
inherited |
Definition at line 84 of file MenuComponents.py.
84 def resetOutput(self):
85 self.resetPar(self.outputProp)
◆ resetPar()
def MenuComponents.AlgNode.resetPar |
( |
|
self, |
|
|
|
prop |
|
) |
| |
|
inherited |
Definition at line 74 of file MenuComponents.py.
74 def resetPar(self, prop):
75 cval = getattr(self.Alg, prop)
76 if isinstance(cval, MutableSequence):
77 return setattr(self.Alg, prop, [])
79 return setattr(self.Alg, prop,
"")
◆ setPar()
def MenuComponents.AlgNode.setPar |
( |
|
self, |
|
|
|
propname, |
|
|
|
value |
|
) |
| |
|
inherited |
Definition at line 66 of file MenuComponents.py.
66 def setPar(self, propname, value):
67 cval = getattr( self.Alg, propname)
68 if isinstance(cval, MutableSequence):
70 return setattr(self.Alg, propname, cval)
72 return setattr(self.Alg, propname, value)
◆ acc
MenuComponents.ComboHypoNode.acc |
◆ Alg
◆ comboHypoCfg
MenuComponents.ComboHypoNode.comboHypoCfg |
◆ inputProp
MenuComponents.AlgNode.inputProp |
|
inherited |
◆ inputs
MenuComponents.Node.inputs |
|
inherited |
◆ name
◆ outputProp
MenuComponents.AlgNode.outputProp |
|
inherited |
◆ outputs
MenuComponents.Node.outputs |
|
inherited |
◆ prop1
MenuComponents.ComboHypoNode.prop1 |
◆ prop2
MenuComponents.ComboHypoNode.prop2 |
The documentation for this class was generated from the following file: