The Gaudi Framework  master (82fdf313)
Loading...
Searching...
No Matches
SuperAlgDynamicGraph.MySuperAlg Class Reference

Job options file. More...

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

Public Member Functions

 __init__ (self, *args, **kwargs)
 
 UseHelloWorld (self)
 
 UseHelloWorld (self, value)
 
- Public Member Functions inherited from GaudiKernel.Configurable.SuperAlgorithm
 __new__ (cls, name=None, **kwargs)
 
 __init__ (self, name=None, **kwargs)
 
 name (self)
 
 getType (cls)
 
 properties (self)
 
 isApplicable (self)
 
 getGaudiType (cls)
 
 __repr__ (self)
 
 __setattr__ (self, name, value)
 

Protected Member Functions

 _initGraph (self)
 
- Protected Member Functions inherited from GaudiKernel.Configurable.SuperAlgorithm
 _makeAlg (self, typ, **kwargs)
 
 _visitSubNodes (self, visitor)
 

Protected Attributes

 _hello_flag = value
 
- Protected Attributes inherited from GaudiKernel.Configurable.SuperAlgorithm
 _name = name or self.getType()
 

Additional Inherited Members

- Public Attributes inherited from GaudiKernel.Configurable.SuperAlgorithm
 graph = self._initGraph()
 
 name
 

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__()

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

SuperAlgDynamicGraph.MySuperAlg._initGraph ( self)
protected
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]

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]

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 = value
protected

Definition at line 45 of file SuperAlgDynamicGraph.py.


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