ATLAS Offline Software
Loading...
Searching...
No Matches
MenuComponents.AlgNode Class Reference
Inheritance diagram for MenuComponents.AlgNode:
Collaboration diagram for MenuComponents.AlgNode:

Public Member Functions

 __init__ (self, Alg, inputProp, outputProp)
 setPar (self, propname, value)
 addOutput (self, name)
 readOutputList (self)
 addInput (self, name)
 readInputList (self)
 __repr__ (self)
 getOutputList (self)
 getInputList (self)

Public Attributes

 outputProp = outputProp
 inputProp = inputProp
tuple name = ("%sNode")%( Alg.getName() )
 Alg = Alg
list inputs = []
list outputs = []

Detailed Description

Node class that represent an algorithm: sets R/W handles (as unique input/output) and properties as parameters  
Automatically de-duplicates input ReadHandles upon repeated calls to addInput.

Definition at line 49 of file MenuComponents.py.

Constructor & Destructor Documentation

◆ __init__()

MenuComponents.AlgNode.__init__ ( self,
Alg,
inputProp,
outputProp )

Definition at line 52 of file MenuComponents.py.

52 def __init__(self, Alg, inputProp, outputProp):
53 Node.__init__(self, Alg)
54 self.outputProp = outputProp
55 self.inputProp = inputProp
56

Member Function Documentation

◆ __repr__()

MenuComponents.AlgNode.__repr__ ( self)

Definition at line 98 of file MenuComponents.py.

98 def __repr__(self):
99 return "Alg::%s [%s] -> [%s]"%(self.Alg.getName(), ' '.join(map(str, self.getInputList())), ' '.join(map(str, self.getOutputList())))
100
101
STL class.

◆ addInput()

MenuComponents.AlgNode.addInput ( self,
name )

Reimplemented from MenuComponents.Node.

Definition at line 81 of file MenuComponents.py.

81 def addInput(self, name):
82 inputs = self.readInputList()
83 if name in inputs:
84 log.debug("Input DH not added in %s: %s already set!", self.Alg.getName(), name)
85 else:
86 if self.inputProp != '':
87 self.setPar(self.inputProp, name)
88 else:
89 log.debug("no InputProp set for input of %s", self.Alg.getName())
90 Node.addInput(self, name)
91 return len(self.readInputList())
92

◆ addOutput()

MenuComponents.AlgNode.addOutput ( self,
name )

Reimplemented from MenuComponents.Node.

Reimplemented in MenuComponents.HypoAlgNode.

Definition at line 65 of file MenuComponents.py.

65 def addOutput(self, name):
66 outputs = self.readOutputList()
67 if name in outputs:
68 log.debug("Output DH not added in %s: %s already set!", self.Alg.getName(), name)
69 else:
70 if self.outputProp != '':
71 self.setPar(self.outputProp, name)
72 else:
73 log.debug("no outputProp set for output of %s", self.Alg.getName())
74 Node.addOutput(self, name)
75

◆ getInputList()

MenuComponents.Node.getInputList ( self)
inherited

Definition at line 42 of file MenuComponents.py.

42 def getInputList(self):
43 return self.inputs
44

◆ getOutputList()

MenuComponents.Node.getOutputList ( self)
inherited

Definition at line 39 of file MenuComponents.py.

39 def getOutputList(self):
40 return self.outputs
41

◆ readInputList()

MenuComponents.AlgNode.readInputList ( self)

Definition at line 93 of file MenuComponents.py.

93 def readInputList(self):
94 cval = getattr(self.Alg, self.inputProp)
95 return (cval if isinstance(cval, MutableSequence) else
96 ([str(cval)] if cval else []))
97

◆ readOutputList()

MenuComponents.AlgNode.readOutputList ( self)

Definition at line 76 of file MenuComponents.py.

76 def readOutputList(self):
77 cval = getattr(self.Alg, self.outputProp)
78 return (cval if isinstance(cval, MutableSequence) else
79 ([str(cval)] if cval else []))
80

◆ setPar()

MenuComponents.AlgNode.setPar ( self,
propname,
value )

Definition at line 57 of file MenuComponents.py.

57 def setPar(self, propname, value):
58 cval = getattr( self.Alg, propname)
59 if isinstance(cval, MutableSequence):
60 cval.append(value)
61 return setattr(self.Alg, propname, cval)
62 else:
63 return setattr(self.Alg, propname, value)
64

Member Data Documentation

◆ Alg

MenuComponents.Node.Alg = Alg
inherited

Definition at line 29 of file MenuComponents.py.

◆ inputProp

MenuComponents.AlgNode.inputProp = inputProp

Definition at line 55 of file MenuComponents.py.

◆ inputs

list MenuComponents.Node.inputs = []
inherited

Definition at line 30 of file MenuComponents.py.

◆ name

tuple MenuComponents.Node.name = ("%sNode")%( Alg.getName() )
inherited

Definition at line 28 of file MenuComponents.py.

◆ outputProp

MenuComponents.AlgNode.outputProp = outputProp

Definition at line 54 of file MenuComponents.py.

◆ outputs

list MenuComponents.Node.outputs = []
inherited

Definition at line 31 of file MenuComponents.py.


The documentation for this class was generated from the following file: