The Gaudi Framework
master (991ff291)
Loading...
Searching...
No Matches
CommonGaudiConfigurables.py
Go to the documentation of this file.
1
13
"""
14
This module would scan all known Gaudi configurable modules for
15
'Configurable' classes and fill __all__ such that it can be imported
16
by any module requiring it.
17
"""
18
19
from
GaudiKernel.Configurable
import
Configurable
20
from
GaudiKernel.ConfigurableMeta
import
ConfigurableMeta
21
22
__all__ = []
23
24
packages = [
25
"GaudiCoreSvc"
,
26
"GaudiCommonSvc"
,
27
"GaudiSvc"
,
28
"GaudiAud"
,
29
"RootHistCnv"
,
30
"GaudiUtils"
,
31
"RootCnv"
,
32
]
33
34
# --Loop open all listed packages and populate __all__ with the names and
35
# the local scope with the Configurable classes
36
for
package
in
packages:
37
try
:
38
mod = __import__(
39
"%s.%sConf"
% (package, package), globals(), locals(), [
"%sConf"
% package]
40
)
41
for
nam
in
dir(mod):
42
cls = getattr(mod, nam)
43
if
type(cls)
is
ConfigurableMeta
and
issubclass(cls, Configurable):
44
globals()[nam] = cls
45
__all__.append(nam)
46
except
ImportError:
47
# ignore the configurables from missing packages.
48
pass
49
50
# --Fix some of the name idiosyncrasies in Gaudi
51
aliases = {
52
"EventDataSvc"
:
"EvtDataSvc"
,
53
"DetectorDataSvc"
:
"DetDataSvc"
,
54
"HistogramDataSvc"
:
"HistogramSvc"
,
55
"HbookHistSvc"
:
"HbookCnv__PersSvc"
,
56
"RootHistSvc"
:
"RootHistCnv__PersSvc"
,
57
"EventPersistencySvc"
:
"EvtPersistencySvc"
,
58
"DetectorPersistencySvc"
:
"DetPersistencySvc"
,
59
"HistogramPersistencySvc"
:
"HistogramPersistencySvc"
,
60
"FileRecordPersistencySvc"
:
"PersistencySvc"
,
61
"FileCatalog"
:
"Gaudi__MultiFileCatalog"
,
62
"IODataManager"
:
"Gaudi__IODataManager"
,
63
"RootCnvSvc"
:
"Gaudi__RootCnvSvc"
,
64
"RootEvtSelector"
:
"Gaudi__RootEvtSelector"
,
65
}
66
67
_gbl = globals()
# optimization
68
69
# do the aliasing only if the original is available
70
aliases = {new: _gbl[old]
for
new, old
in
aliases.items()
if
old
in
_gbl}
71
72
# change the default name
73
for
new
in
aliases:
74
aliases[new].DefaultedName = new
75
# update globals and __all__
76
_gbl.update(aliases)
77
__all__.extend(aliases)
78
# remove temporaries
79
del _gbl
80
try
:
81
del new
# only available if len(aliases)>0
82
except
NameError:
83
pass
GaudiKernel.Configurable
Definition
Configurable.py:1
GaudiKernel.ConfigurableMeta
Definition
ConfigurableMeta.py:1
Gaudi
python
Gaudi
CommonGaudiConfigurables.py
Generated on Tue May 26 2026 09:59:31 for The Gaudi Framework by
1.13.1