The Gaudi Framework  v36r1 (3e2fb5a8)
SuperAlgDynamicGraph.MySuperAlg Class Reference
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

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 26 of file SuperAlgDynamicGraph.py.

Constructor & Destructor Documentation

◆ __init__()

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

Definition at line 35 of file SuperAlgDynamicGraph.py.

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

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 51 of file SuperAlgDynamicGraph.py.

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

◆ UseHelloWorld() [1/2]

def SuperAlgDynamicGraph.MySuperAlg.UseHelloWorld (   self)

Definition at line 42 of file SuperAlgDynamicGraph.py.

42  def UseHelloWorld(self):
43  return self._hello_flag
44 

◆ UseHelloWorld() [2/2]

def SuperAlgDynamicGraph.MySuperAlg.UseHelloWorld (   self,
  value 
)

Definition at line 46 of file SuperAlgDynamicGraph.py.

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

Member Data Documentation

◆ _hello_flag

SuperAlgDynamicGraph.MySuperAlg._hello_flag
private

Definition at line 47 of file SuperAlgDynamicGraph.py.

◆ graph

SuperAlgDynamicGraph.MySuperAlg.graph

Definition at line 49 of file SuperAlgDynamicGraph.py.


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