The Gaudi Framework  master (594c33fa)
SuperAlgDynamicGraph.MySuperAlg Class Reference

Job options file. More...

Inheritance diagram for SuperAlgDynamicGraph.MySuperAlg:
Collaboration diagram for SuperAlgDynamicGraph.MySuperAlg:

Public Member Functions

def __init__ (self, *args, **kwargs)
 
def UseHelloWorld (self)
 
def UseHelloWorld (self, value)
 
- Public Member Functions inherited from GaudiKernel.Configurable.SuperAlgorithm
def __new__ (cls, name=None, **kwargs)
 
def __init__ (self, name=None, **kwargs)
 
def name (self)
 
def getType (cls)
 
def properties (self)
 
def isApplicable (self)
 
def getGaudiType (cls)
 
def __repr__ (self)
 
def __setattr__ (self, name, value)
 
- Public Member Functions inherited from GaudiConfig.ControlFlow.ControlFlowNode
def __and__ (self, rhs)
 
def __or__ (self, rhs)
 
def __invert__ (self)
 
def __rshift__ (self, rhs)
 
def visitNode (self, visitor)
 
def __eq__ (self, other)
 
def __hash__ (self)
 
def getFullName (self)
 

Public Attributes

 graph
 
- Public Attributes inherited from GaudiKernel.Configurable.SuperAlgorithm
 graph
 

Private Member Functions

def _initGraph (self)
 

Private Attributes

 _hello_flag
 

Detailed Description

Job options file.

Example implementation of a SuperAlgorithm specialization with behaviour
depending on a property.

In this case the boolean option UseHelloWorld defines if the HelloWorld
instance has to be used or not.

Definition at line 24 of file SuperAlgDynamicGraph.py.

Constructor & Destructor Documentation

◆ __init__()

def SuperAlgDynamicGraph.MySuperAlg.__init__ (   self,
args,
**  kwargs 
)

Definition at line 33 of file SuperAlgDynamicGraph.py.

33  def __init__(self, *args, **kwargs):
34  # preset the internal flag bypassing __setattr__
35  self.__dict__["_hello_flag"] = kwargs.pop("UseHelloWorld", True)
36  super(MySuperAlg, self).__init__(*args, **kwargs)
37 

Member Function Documentation

◆ _initGraph()

def SuperAlgDynamicGraph.MySuperAlg._initGraph (   self)
private
Prepare the graph represented by the SuperAlgorithm.

Reimplemented from GaudiKernel.Configurable.SuperAlgorithm.

Definition at line 49 of file SuperAlgDynamicGraph.py.

49  def _initGraph(self):
50  """
51  Prepare the graph represented by the SuperAlgorithm.
52  """
53  from Configurables import Gaudi__TestSuite__EventCounter as EventCounter
54  from Configurables import Gaudi__TestSuite__Prescaler as Prescaler
55  from Configurables import HelloWorld
56 
57  p = self._makeAlg(Prescaler, name="Prescaler", PercentPass=50.0)
58  h = self._makeAlg(HelloWorld, name="HW")
59  c = self._makeAlg(EventCounter, name="Counter")
60  # the actual graph depends on the UseHelloWorld flag
61  return (p & h & c) if self.UseHelloWorld else (p & c)
62 
63 

◆ UseHelloWorld() [1/2]

def SuperAlgDynamicGraph.MySuperAlg.UseHelloWorld (   self)

Definition at line 40 of file SuperAlgDynamicGraph.py.

40  def UseHelloWorld(self):
41  return self._hello_flag
42 

◆ UseHelloWorld() [2/2]

def SuperAlgDynamicGraph.MySuperAlg.UseHelloWorld (   self,
  value 
)

Definition at line 44 of file SuperAlgDynamicGraph.py.

44  def UseHelloWorld(self, value):
45  self._hello_flag = value
46  # re-generate the graph (which takes into account the flag)
47  self.graph = self._initGraph()
48 

Member Data Documentation

◆ _hello_flag

SuperAlgDynamicGraph.MySuperAlg._hello_flag
private

Definition at line 45 of file SuperAlgDynamicGraph.py.

◆ graph

SuperAlgDynamicGraph.MySuperAlg.graph

Definition at line 47 of file SuperAlgDynamicGraph.py.


The documentation for this class was generated from the following file:
SuperAlgDynamicGraph.UseHelloWorld
UseHelloWorld
Definition: SuperAlgDynamicGraph.py:68