|
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 208 of file MenuComponents.py.
◆ __init__()
def MenuComponents.ComboHypoNode.__init__ |
( |
|
self, |
|
|
|
name, |
|
|
|
comboHypoCfg |
|
) |
| |
Definition at line 210 of file MenuComponents.py.
210 def __init__(self, name, comboHypoCfg):
211 self.prop1 =
"MultiplicitiesMap"
212 self.prop2 =
"LegToInputCollectionMap"
213 self.comboHypoCfg = comboHypoCfg
214 self.acc = self.create( name )
215 thealgs= self.acc.getEventAlgos()
217 log.error(
"ComboHypoNode: Combo alg %s not found", name)
218 if len(thealgs) != 1:
219 log.error(
"ComboHypoNode: Combo alg %s len is %d",name, len(thealgs))
222 log.debug(
"ComboHypoNode init: Alg %s", name)
223 AlgNode.__init__(self, Alg,
'HypoInputDecisions',
'HypoOutputDecisions')
227 setattr(self.Alg, self.prop1, {})
228 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 254 of file MenuComponents.py.
254 def addChain(self, chainDict):
255 chainName = chainDict[
'chainName']
256 chainMult = chainDict[
'chainMultiplicities']
257 legsToInputCollections = self.mapRawInputsToInputsIndex()
258 if len(chainMult) != len(legsToInputCollections):
259 log.error(
"ComboHypoNode for Alg:{} with addChain for:{} Chain multiplicity:{} Per leg input collection index:{}."
260 .
format(self.Alg.name, chainName, tuple(chainMult), tuple(legsToInputCollections)))
261 log.error(
"The size of the multiplicies vector must be the same size as the per leg input collection vector.")
262 log.error(
"The ComboHypo needs to know which input DecisionContainers contain the DecisionObjects to be used for each leg.")
263 log.error(
"Check why ComboHypoNode.addInput(...) was not called exactly once per leg.")
264 raise Exception(
"[createDataFlow] Error in ComboHypoNode.addChain. Cannot proceed.")
266 cval1 = getattr(self.Alg, self.prop1)
267 cval2 = getattr(self.Alg, self.prop2)
268 if type(cval1)
is dict
or isinstance(cval1, GaudiConfig2.semantics._DictHelper):
269 if chainName
in cval1.keys():
270 log.error(
"ERROR in configuration: ComboAlg %s has already been configured for chain %s", self.Alg.name, chainName)
271 raise Exception(
"[createDataFlow] Error in ComboHypoNode.addChain. Cannot proceed.")
273 cval1[chainName] = chainMult
274 cval2[chainName] = legsToInputCollections
276 cval1 = {chainName : chainMult}
277 cval2 = {chainName : legsToInputCollections}
279 setattr(self.Alg, self.prop1, cval1)
280 setattr(self.Alg, self.prop2, cval2)
◆ addDefaultOutput()
def MenuComponents.AlgNode.addDefaultOutput |
( |
|
self | ) |
|
|
inherited |
Definition at line 60 of file MenuComponents.py.
60 def addDefaultOutput(self):
61 if self.outputProp !=
'':
62 self.addOutput((
"%s_%s"%(self.Alg.
getName(),self.outputProp)))
◆ addInput()
def MenuComponents.AlgNode.addInput |
( |
|
self, |
|
|
|
name |
|
) |
| |
|
inherited |
Reimplemented from MenuComponents.Node.
Definition at line 104 of file MenuComponents.py.
105 inputs = self.readInputList()
107 log.debug(
"Input DH not added in %s: %s already set!", self.Alg.
getName(), name)
109 if self.inputProp !=
'':
110 self.setPar(self.inputProp, name)
112 log.debug(
"no InputProp set for input of %s", self.Alg.
getName())
113 Node.addInput(self, name)
114 return len(self.readInputList())
◆ addOutput()
def MenuComponents.AlgNode.addOutput |
( |
|
self, |
|
|
|
name |
|
) |
| |
|
inherited |
Reimplemented from MenuComponents.Node.
Reimplemented in MenuComponents.HypoAlgNode.
Definition at line 88 of file MenuComponents.py.
88 def addOutput(self, name):
89 outputs = self.readOutputList()
91 log.debug(
"Output DH not added in %s: %s already set!", self.Alg.
getName(), name)
93 if self.outputProp !=
'':
94 self.setPar(self.outputProp, name)
96 log.debug(
"no outputProp set for output of %s", self.Alg.
getName())
97 Node.addOutput(self, name)
◆ create()
def MenuComponents.ComboHypoNode.create |
( |
|
self, |
|
|
|
name |
|
) |
| |
Definition at line 233 of file MenuComponents.py.
233 def create (self, name):
234 log.debug(
"ComboHypoNode.create %s",name)
235 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 288 of file MenuComponents.py.
288 def createComboHypoTools(self, flags, chainDict, comboToolConfs):
289 """Create the ComboHypoTools and add them to the main alg"""
290 if not len(comboToolConfs):
292 confs = [ HypoToolConf( tool )
for tool
in comboToolConfs ]
293 log.debug(
"ComboHypoNode.createComboHypoTools for chain %s, Alg %s with %d tools", chainDict[
"chainName"],self.Alg.
getName(), len(comboToolConfs))
295 log.debug(
"ComboHypoNode.createComboHypoTools adding %s", conf)
296 tools = self.Alg.ComboHypoTools
297 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 79 of file MenuComponents.py.
79 def getPar(self, prop):
80 return getattr(self.Alg, prop)
◆ mapRawInputsToInputsIndex()
def MenuComponents.ComboHypoNode.mapRawInputsToInputsIndex |
( |
|
self | ) |
|
Definition at line 246 of file MenuComponents.py.
246 def mapRawInputsToInputsIndex(self):
248 theInputs = self.readInputList()
249 for rawInput
in self.inputs:
250 mapping.append( theInputs.index(rawInput) )
◆ readInputList()
def MenuComponents.AlgNode.readInputList |
( |
|
self | ) |
|
|
inherited |
Definition at line 116 of file MenuComponents.py.
116 def readInputList(self):
117 cval = self.getPar(self.inputProp)
118 return (cval
if isinstance(cval, MutableSequence)
else
119 ([
str(cval)]
if cval
else []))
◆ readOutputList()
def MenuComponents.AlgNode.readOutputList |
( |
|
self | ) |
|
|
inherited |
Definition at line 99 of file MenuComponents.py.
99 def readOutputList(self):
100 cval = self.getPar(self.outputProp)
101 return (cval
if isinstance(cval, MutableSequence)
else
102 ([
str(cval)]
if cval
else []))
◆ resetInput()
def MenuComponents.AlgNode.resetInput |
( |
|
self | ) |
|
|
inherited |
◆ resetOutput()
def MenuComponents.AlgNode.resetOutput |
( |
|
self | ) |
|
|
inherited |
Definition at line 82 of file MenuComponents.py.
82 def resetOutput(self):
83 self.resetPar(self.outputProp)
◆ resetPar()
def MenuComponents.AlgNode.resetPar |
( |
|
self, |
|
|
|
prop |
|
) |
| |
|
inherited |
Definition at line 72 of file MenuComponents.py.
72 def resetPar(self, prop):
73 cval = getattr(self.Alg, prop)
74 if isinstance(cval, MutableSequence):
75 return setattr(self.Alg, prop, [])
77 return setattr(self.Alg, prop,
"")
◆ setPar()
def MenuComponents.AlgNode.setPar |
( |
|
self, |
|
|
|
propname, |
|
|
|
value |
|
) |
| |
|
inherited |
Definition at line 64 of file MenuComponents.py.
64 def setPar(self, propname, value):
65 cval = getattr( self.Alg, propname)
66 if isinstance(cval, MutableSequence):
68 return setattr(self.Alg, propname, cval)
70 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: