8 from CommonGaudiConfigurables
import *
13 log = logging.getLogger(__name__)
15 _InstallRootLoggingHandler()
17 allConfigurables = Configurable.allConfigurables
21 log = logging.getLogger(
'PropertyProxy' )
22 log.debug(
"Read module info for %d configurables from %d genConfDb files",
24 if len(cfgDb.duplicates()) > 0:
25 log.warning(
"Found %d duplicates among the %d genConfDb files :",
26 len(cfgDb.duplicates()), nFiles )
27 log.warning(
"--------------------------------------------------" )
28 log.warning(
" -%s: %s - %s",
29 "<component name>",
"<module>",
"[ <duplicates> ]" )
30 log.warning(
"--------------------------------------------------" )
31 dups = cfgDb.duplicates()
32 for cfgName
in dups.keys():
33 log.warning(
" -%s: %s - %s",
35 cfgDb[cfgName][
'module'],
36 str([ d[
'module']
for d
in dups[cfgName]]) )
39 log.warning(
"Fix your cmt/requirements file !!" )
42 log.debug(
"No duplicates have been found: that's good !" )
52 local[conf] = confDbGetConfigurable(conf)
55 """Return a dictionary representing the configuration.
56 The dictionary contains one entry per configurable which is a dictionary
57 with one entry per property.
58 The optional argument "all" is used to decide if to include only values
59 different from the default or all of them.
63 catalog = allConfigurables
68 if n
not in conf_dict:
70 for p, v
in catalog[n].getDefaultProperties().items() :
74 if n
not in conf_dict:
76 for p, v
in catalog[n].getValuedProperties().items() :
79 keys = conf_dict.keys()
86 """Helper function to get a configurable with the given name regardless
88 If defaultType can be a class derived from configurable or a string. If not
89 specified, the tool name is used as type."""
90 if name
in allConfigurables:
91 return allConfigurables[name]
94 if defaultType
is None:
97 if type(defaultType)
is str:
99 if defaultType
in globals():
101 defaultType = globals()[defaultType]
105 defaultType = getattr(Configurables, defaultType)
106 return defaultType(name)
110 Replace the default main execution loop with the specified callable object.
112 @param runner: a callable that accepts an initialized instance of GaudiPython.AppMgr
113 and the number of events to process and returns a StatusCode or a boolean
118 gaudimain.mainLoop =
lambda _self, app, nevt: runner(app, nevt)
121 class GaudiPersistency(ConfigurableUser):
122 """Configurable to enable ROOT-based persistency.
124 Note: it requires Gaudi::RootCnvSvc (package RootCnv).
127 def __apply_configuration__(self):
128 """Apply low-level configuration"""
129 from Configurables
import (ApplicationMgr,
135 from Configurables
import (RootCnvSvc,
140 cnvSvcs = [ RootCnvSvc() ]
144 app.SvcOptMapping += [ FileCatalog(), IODataManager(),
def setCustomMainLoop(runner)
def loadConfigurableDb()
Helper function to load all ConfigurableDb files holding informations.
PersistencySvc class implementation definition.
A FileRecordDataSvc is the base class for event services.
The Application Manager class.
m_CSS m_DCS EventPersistencySvc
def getNeededConfigurables()