9 from CommonGaudiConfigurables
import *
14 log = logging.getLogger(__name__)
16 _InstallRootLoggingHandler()
18 allConfigurables = Configurable.allConfigurables
22 log = logging.getLogger(
'PropertyProxy' )
23 log.debug(
"Read module info for %d configurables from %d genConfDb files",
25 if len(cfgDb.duplicates()) > 0:
26 log.warning(
"Found %d duplicates among the %d genConfDb files :",
27 len(cfgDb.duplicates()), nFiles )
28 log.warning(
"--------------------------------------------------" )
29 log.warning(
" -%s: %s - %s",
30 "<component name>",
"<module>",
"[ <duplicates> ]" )
31 log.warning(
"--------------------------------------------------" )
32 dups = cfgDb.duplicates()
33 for cfgName
in dups.keys():
34 log.warning(
" -%s: %s - %s",
36 cfgDb[cfgName][
'module'],
37 str([ d[
'module']
for d
in dups[cfgName]]) )
40 log.warning(
"Fix your cmt/requirements file !!" )
43 log.debug(
"No duplicates have been found: that's good !" )
53 local[conf] = confDbGetConfigurable(conf)
56 """Return a dictionary representing the configuration.
57 The dictionary contains one entry per configurable which is a dictionary
58 with one entry per property.
59 The optional argument "all" is used to decide if to include only values
60 different from the default or all of them.
64 catalog = allConfigurables
69 if n
not in conf_dict:
71 for p, v
in catalog[n].getDefaultProperties().items() :
75 if n
not in conf_dict:
77 for p, v
in catalog[n].getValuedProperties().items() :
80 keys = conf_dict.keys()
87 """Helper function to get a configurable with the given name regardless
89 If defaultType can be a class derived from configurable or a string. If not
90 specified, the tool name is used as type."""
91 if name
in allConfigurables:
92 return allConfigurables[name]
95 if defaultType
is None:
98 if type(defaultType)
is str:
100 if defaultType
in globals():
102 defaultType = globals()[defaultType]
106 defaultType = getattr(Configurables, defaultType)
107 return defaultType(name)
111 Replace the default main execution loop with the specified callable object.
113 @param runner: a callable that accepts an initialized instance of GaudiPython.AppMgr
114 and the number of events to process and returns a StatusCode or a boolean
119 gaudimain.mainLoop =
lambda _self, app, nevt: runner(app, nevt)
122 class GaudiPersistency(ConfigurableUser):
123 """Configurable to enable ROOT-based persistency.
125 Note: it requires Gaudi::RootCnvSvc (package RootCnv).
128 def __apply_configuration__(self):
129 """Apply low-level configuration"""
130 from Configurables
import (ApplicationMgr,
136 from Configurables
import (RootCnvSvc,
141 cnvSvcs = [ RootCnvSvc() ]
142 EventPersistencySvc().CnvServices += cnvSvcs
145 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.
def getNeededConfigurables()