ATLAS Offline Software
Public Member Functions | Public Attributes | List of all members
MenuComponents.AlgNode Class Reference
Inheritance diagram for MenuComponents.AlgNode:
Collaboration diagram for MenuComponents.AlgNode:

Public Member Functions

def __init__ (self, Alg, inputProp, outputProp)
 
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)
 

Public Attributes

 outputProp
 
 inputProp
 
 name
 
 Alg
 
 inputs
 
 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 52 of file MenuComponents.py.

Constructor & Destructor Documentation

◆ __init__()

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

Definition at line 55 of file MenuComponents.py.

55  def __init__(self, Alg, inputProp, outputProp):
56  Node.__init__(self, Alg)
57  self.outputProp = outputProp
58  self.inputProp = inputProp
59 

Member Function Documentation

◆ __repr__()

def MenuComponents.AlgNode.__repr__ (   self)

Reimplemented from MenuComponents.Node.

Reimplemented in MenuComponents.HypoAlgNode.

Definition at line 121 of file MenuComponents.py.

121  def __repr__(self):
122  return "Alg::%s [%s] -> [%s]"%(self.Alg.getName(), ' '.join(map(str, self.getInputList())), ' '.join(map(str, self.getOutputList())))
123 
124 

◆ addDefaultOutput()

def MenuComponents.AlgNode.addDefaultOutput (   self)

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)))
63 

◆ addInput()

def MenuComponents.AlgNode.addInput (   self,
  name 
)

Reimplemented from MenuComponents.Node.

Definition at line 104 of file MenuComponents.py.

104  def addInput(self, name):
105  inputs = self.readInputList()
106  if name in inputs:
107  log.debug("Input DH not added in %s: %s already set!", self.Alg.getName(), name)
108  else:
109  if self.inputProp != '':
110  self.setPar(self.inputProp, name)
111  else:
112  log.debug("no InputProp set for input of %s", self.Alg.getName())
113  Node.addInput(self, name)
114  return len(self.readInputList())
115 

◆ addOutput()

def MenuComponents.AlgNode.addOutput (   self,
  name 
)

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()
90  if name in outputs:
91  log.debug("Output DH not added in %s: %s already set!", self.Alg.getName(), name)
92  else:
93  if self.outputProp != '':
94  self.setPar(self.outputProp, name)
95  else:
96  log.debug("no outputProp set for output of %s", self.Alg.getName())
97  Node.addOutput(self, name)
98 

◆ getInputList()

def MenuComponents.Node.getInputList (   self)
inherited

Definition at line 45 of file MenuComponents.py.

45  def getInputList(self):
46  return self.inputs
47 

◆ getOutputList()

def MenuComponents.Node.getOutputList (   self)
inherited

Definition at line 42 of file MenuComponents.py.

42  def getOutputList(self):
43  return self.outputs
44 

◆ getPar()

def MenuComponents.AlgNode.getPar (   self,
  prop 
)

Definition at line 79 of file MenuComponents.py.

79  def getPar(self, prop):
80  return getattr(self.Alg, prop)
81 

◆ readInputList()

def MenuComponents.AlgNode.readInputList (   self)

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 []))
120 

◆ readOutputList()

def MenuComponents.AlgNode.readOutputList (   self)

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 []))
103 

◆ resetInput()

def MenuComponents.AlgNode.resetInput (   self)

Definition at line 85 of file MenuComponents.py.

85  def resetInput(self):
86  self.resetPar(self.inputProp)
87 

◆ resetOutput()

def MenuComponents.AlgNode.resetOutput (   self)

Definition at line 82 of file MenuComponents.py.

82  def resetOutput(self):
83  self.resetPar(self.outputProp)
84 

◆ resetPar()

def MenuComponents.AlgNode.resetPar (   self,
  prop 
)

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, [])
76  else:
77  return setattr(self.Alg, prop, "")
78 

◆ setPar()

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

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):
67  cval.append(value)
68  return setattr(self.Alg, propname, cval)
69  else:
70  return setattr(self.Alg, propname, value)
71 

Member Data Documentation

◆ Alg

MenuComponents.Node.Alg
inherited

Definition at line 32 of file MenuComponents.py.

◆ inputProp

MenuComponents.AlgNode.inputProp

Definition at line 58 of file MenuComponents.py.

◆ inputs

MenuComponents.Node.inputs
inherited

Definition at line 33 of file MenuComponents.py.

◆ name

MenuComponents.Node.name
inherited

Definition at line 31 of file MenuComponents.py.

◆ outputProp

MenuComponents.AlgNode.outputProp

Definition at line 57 of file MenuComponents.py.

◆ outputs

MenuComponents.Node.outputs
inherited

Definition at line 34 of file MenuComponents.py.


The documentation for this class was generated from the following file:
detail::addInput
void addInput(T &c, const Primitive &input, A a=defaultAccessor< T >)
Definition: PrimitiveHelpers.h:49
dumpTruth.getName
getName
Definition: dumpTruth.py:34
TCS::join
std::string join(const std::vector< std::string > &v, const char c=',')
Definition: Trigger/TrigT1/L1Topo/L1TopoCommon/Root/StringUtils.cxx:10
python.processes.powheg.ZZ.ZZ.__init__
def __init__(self, base_directory, **kwargs)
Constructor: all process options are set here.
Definition: ZZ.py:18
str
Definition: BTagTrackIpAccessor.cxx:11