The Gaudi Framework
v36r10 (fc05264c)
Configuration.py
Go to the documentation of this file.
1
11
"""
12
Module with the ConfigurablesUser for the common configuration in the examples.
13
14
@author Marco Clemencic <marco.clemencic@cern.ch>
15
"""
16
17
from
Gaudi.Configuration
import
INFO
18
from
GaudiKernel.Configurable
import
ConfigurableUser, SuperAlgorithm
19
20
21
class
GaudiExamplesCommonConf
(
ConfigurableUser
):
22
"""Enable common configuration for GaudiExamples tests."""
23
24
__slots__ = {
"OutputLevel"
: INFO,
"DummyEvents"
: -1}
25
26
def
__apply_configuration__
(self):
27
from
Configurables
import
ApplicationMgr, AuditorSvc, ChronoAuditor, MessageSvc
28
29
AuditorSvc
().Auditors.append(
ChronoAuditor
())
30
appmgr =
ApplicationMgr
()
31
self.
propagateProperties
(others=
MessageSvc
())
32
if
self.
getProp
(
"DummyEvents"
) >= 0:
33
appmgr.EvtMax = self.
getProp
(
"DummyEvents"
)
34
appmgr.EvtSel =
"NONE"
35
36
37
class
Gaudi_Test_MySuperAlg
(
SuperAlgorithm
):
38
"""
39
Example implementation of a SuperAlgorithm specialization.
40
"""
41
42
def
_initGraph
(self):
43
"""
44
Prepare the graph represented by the SuperAlgorithm.
45
"""
46
from
Configurables
import
EventCounter, HelloWorld, Prescaler
47
48
p = self.
_makeAlg
(Prescaler, PercentPass=50.0)
49
h = self.
_makeAlg
(HelloWorld, name=
"HW"
)
50
c = self.
_makeAlg
(EventCounter, name=
"Counter"
)
51
return
p & h & c
GaudiKernel.Configurable.ConfigurableUser
Definition:
Configurable.py:1347
GaudiKernel.Configurable.SuperAlgorithm
Definition:
Configurable.py:1842
GaudiExamples.Configuration.GaudiExamplesCommonConf
Definition:
Configuration.py:21
GaudiKernel.Configurable.ConfigurableUser.propagateProperties
def propagateProperties(self, names=None, others=None, force=True)
Definition:
Configurable.py:1503
GaudiKernel.Configurable.Configurable.getProp
def getProp(self, name)
Definition:
Configurable.py:773
AuditorSvc
Definition:
AuditorSvc.h:28
GaudiKernel.Configurable
Definition:
Configurable.py:1
Gaudi.Configuration
Definition:
Configuration.py:1
GaudiExamples.Configuration.Gaudi_Test_MySuperAlg
Definition:
Configuration.py:37
GaudiKernel.Configurable.SuperAlgorithm._makeAlg
def _makeAlg(self, typ, **kwargs)
Definition:
Configurable.py:1891
GaudiExamples.Configuration.GaudiExamplesCommonConf.__apply_configuration__
def __apply_configuration__(self)
Definition:
Configuration.py:26
GaudiExamples.Configuration.Gaudi_Test_MySuperAlg._initGraph
def _initGraph(self)
Definition:
Configuration.py:42
MessageSvc
Definition:
MessageSvc.h:40
ApplicationMgr
Definition:
ApplicationMgr.h:57
ChronoAuditor
Definition:
ChronoAuditor.h:24
GaudiExamples
python
GaudiExamples
Configuration.py
Generated on Tue Feb 14 2023 15:08:28 for The Gaudi Framework by
1.8.18