The Gaudi Framework  v36r16 (ea80daf8)
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 25 of file SuperAlgDynamicGraph.py.

Constructor & Destructor Documentation

◆ __init__()

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

Definition at line 34 of file SuperAlgDynamicGraph.py.

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

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

50  def _initGraph(self):
51  """
52  Prepare the graph represented by the SuperAlgorithm.
53  """
54  from Configurables import EventCounter, HelloWorld, Prescaler
55 
56  p = self._makeAlg(Prescaler, PercentPass=50.0)
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 41 of file SuperAlgDynamicGraph.py.

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

◆ UseHelloWorld() [2/2]

def SuperAlgDynamicGraph.MySuperAlg.UseHelloWorld (   self,
  value 
)

Definition at line 45 of file SuperAlgDynamicGraph.py.

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

Member Data Documentation

◆ _hello_flag

SuperAlgDynamicGraph.MySuperAlg._hello_flag
private

Definition at line 46 of file SuperAlgDynamicGraph.py.

◆ graph

SuperAlgDynamicGraph.MySuperAlg.graph

Definition at line 48 of file SuperAlgDynamicGraph.py.


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