| The Gaudi Framework v32r1 (f65d50dc)

Public Member Functions | Public Attributes | Static Public Attributes | List of all members
GaudiPython.Bindings.AppMgr Class Reference
Inheritance diagram for GaudiPython.Bindings.AppMgr:
[legend]
Collaboration diagram for GaudiPython.Bindings.AppMgr:
[legend]

## Public Member Functions
def | __new__ (cls, *args, **kwargs)
def | __reset__ (self)
def | __init__ (self, outputlevel=-1, joboptions=None, selfoptions={}, dllname=None, factname=None)
def | state (self)
def | FSMState (self)
def | targetFSMState (self)
def | service (self, name, interface=None)
def | declSvcType (self, svcname, svctype)
def | createSvc (self, name)
def | services (self)
def | algorithm (self, name, createIf=False)
def | algorithms (self)
def | tool (self, name)
def | property (self, name)
def | datasvc (self, name)
def | evtsvc (self)
def | detsvc (self)
def | filerecordsvc (self)
def | evtsel (self)
def | histsvc (self, name='HistogramDataSvc')
def | ntuplesvc (self, name='NTupleSvc')
def | partsvc (self)
def | toolsvc (self, name='ToolSvc')
def | optSvc (self, name='JobOptionsSvc')
def | readOptions (self, file)
def | addAlgorithm (self, alg)
def | setAlgorithms (self, algs)
def | removeAlgorithm (self, alg)
def | printAlgsSequences (self)
def | config (self, **args)
def | configure (self)
def | start (self)
def | terminate (self)
def | run (self, n)
def | executeEvent (self)
def | execute (self)
def | runSelectedEvents (self, pfn, events)
def | exit (self)
def | __del__ (self)
Public Member Functions inherited from GaudiPython.Bindings.iService
def | __init__ (self, name, isvc=None)
def | retrieveInterface (self)
def | initialize (self)
def | stop (self)
def | finalize (self)
def | reinitialize (self)
def | restart (self)
def | isValid (self)
Public Member Functions inherited from GaudiPython.Bindings.iProperty
def | getInterface (self)
def | __call_interface_method__ (self, ifname, method, *args)
def | __setattr__ (self, name, value)
def | __getattr__ (self, name)
def | properties (self)
def | name (self)

## Public Attributes
| JobOptionsType
| OutputLevel
| topAlg

## Static Public Attributes
def | evtSvc = evtsvc
def | histSvc = histsvc
def | ntupleSvc = ntuplesvc
def | evtSel = evtsel
def | detSvc = detsvc
def | toolSvc = toolsvc
def | partSvc = partsvc

## Detailed Description

Definition at line 913 of file Bindings.py.

## Constructor & Destructor Documentation

## ◆ __init__()

def GaudiPython.Bindings.AppMgr.__init__ | ( |  | self,
|  |  | outputlevel = `-1`,
|  |  | joboptions = `None`,
|  |  | selfoptions = `{}`,
|  |  | dllname = `None`,
|  |  | factname = `None`
| ) |  |

Definition at line 936 of file Bindings.py.

936 def __init__(self,
937 outputlevel=-1,
938 joboptions=None,
939 selfoptions={},
940 dllname=None,
941 factname=None):
942 global _gaudi
943 if _gaudi:
944 return
945 # Protection against multiple calls to exit() if the finalization fails
946 self.__dict__['_exit_called'] = False
947 # keep the Gaudi namespace around (so it is still available during atexit shutdown)...
948 self.__dict__['_gaudi_ns'] = Gaudi
949 try:
950 from GaudiKernel.Proxy.Configurable import expandvars
951 except ImportError:
952 # pass-through implementation if expandvars is not defined (AthenaCommon)
953 def expandvars(data):
954 return data
955
956 if dllname and factname:
957 self.__dict__['_appmgr'] = gbl.Gaudi.createApplicationMgr(
958 dllname, factname)
959 elif dllname:
960 self.__dict__['_appmgr'] = gbl.Gaudi.createApplicationMgr(dllname)
961 else:
962 self.__dict__['_appmgr'] = gbl.Gaudi.createApplicationMgr()
963 self.__dict__['_svcloc'] = gbl.Gaudi.svcLocator()
964 self.__dict__['_algmgr'] = InterfaceCast(gbl.IAlgManager)(self._appmgr)
965 self.__dict__['_evtpro'] = InterfaceCast(gbl.IEventProcessor)(
966 self._appmgr)
967 self.__dict__['_svcmgr'] = InterfaceCast(gbl.ISvcManager)(self._appmgr)
968 self.__dict__['pyalgorithms'] = []
969 iService.__init__(self, 'ApplicationMgr', self._appmgr)
970 # ------python specific initialization-------------------------------------
971 if self.FSMState(
972 ) < Gaudi.StateMachine.CONFIGURED: # Not yet configured
973 self.JobOptionsType = 'NONE'
974 if joboptions:
975 from GaudiKernel.ProcessJobOptions import importOptions
976 importOptions(joboptions)
977 # Ensure that the ConfigurableUser instances have been applied
978 import GaudiKernel.Proxy.Configurable
979 if hasattr(GaudiKernel.Proxy.Configurable,
980 "applyConfigurableUsers"):
981 GaudiKernel.Proxy.Configurable.applyConfigurableUsers()
982 # This is the default and could be overridden with "selfopts"
983 self.OutputLevel = 3
984 selfprops = Configurable.allConfigurables.get('ApplicationMgr', {})
985 if selfprops:
986 selfprops = expandvars(selfprops.getValuedProperties())
987 for p, v in selfprops.items():
988 setattr(self, p, v)
989 for p, v in selfoptions.items():
990 setattr(self, p, v)
991 # Override job options
992 if outputlevel != -1:
993 self.OutputLevel = outputlevel
994 self.configure()
995 # ---MessageSvc------------------------------------------------------------
996 ms = self.service('MessageSvc')
997 if 'MessageSvc' in Configurable.allConfigurables:
998 msprops = Configurable.allConfigurables['MessageSvc']
999 ms = self.service('MessageSvc')
1000 if hasattr(msprops, "getValuedProperties"):
1001 msprops = expandvars(msprops.getValuedProperties())
1002 for p, v in msprops.items():
1003 setattr(ms, p, v)
1004 if outputlevel != -1:
1005 ms.OutputLevel = outputlevel
1006 # ---JobOptions------------------------------------------------------------
1007 self.__dict__['_optsvc'] = InterfaceCast(gbl.IJobOptionsSvc)(
1008 Helper.service(self._svcloc, 'JobOptionsSvc'))
1009 # ------Configurables initialization (part2)-------------------------------
1010 mkStringProperty = gbl.GaudiPython.Helpers.mkStringProperty
1011 for n in getNeededConfigurables():
1012 c = Configurable.allConfigurables[n]
1013 if n in ['ApplicationMgr', 'MessageSvc']:
1014 continue # These are already done---
1015 for p, v in c.getValuedProperties().items():
1016 v = expandvars(v)
1017 # Note: AthenaCommon.Configurable does not have Configurable.PropertyReference
1018 if hasattr(Configurable, "PropertyReference") and type(
1019 v) == Configurable.PropertyReference:
1020 # this is done in "getFullName", but the exception is ignored,
1021 # so we do it again to get it
1022 v = v.__resolve__()
1023 if type(v) == str:
1024 v = '"%s"' % v # need double quotes
1025 elif type(v) == long:
1026 v = '%d' % v # prevent pending 'L'
1027 self._optsvc.addPropertyToCatalogue(
1028 n, mkStringProperty(p, str(v)))
1029 if hasattr(Configurable, "_configurationLocked"):
1030 Configurable._configurationLocked = True
1031
1032 # Ensure that the exit method is called when exiting from Python
1033 import atexit
1034 atexit.register(self.exit)
1035
1036 # ---Hack to avoid bad interactions with the ROOT exit handler
1037 # Look for an exit handler installed by ROOT
1038 root_handler_installed = False
1039 for h in atexit._exithandlers:
1040 func = h[0]
1041 if hasattr(func, "__module__") and func.__module__ == "ROOT":
1042 root_handler_installed = True
1043 break
1044
1045 # If the handler is not yet installed, let's install our private version
1046 # that detects that the ROOT exit handler is installed and add our own
1047 # after it to ensure it is called before.
1048 if not root_handler_installed:
1049 orig_register = atexit.register
1050
1051 def register(func, *targs, **kargs):
1052 orig_register(func, *targs, **kargs)
1053 if hasattr(func, "__module__") and func.__module__ == "ROOT":
1054 orig_register(self.exit)
1055 # we do not need to remove out handler from the list because
1056 # it can be safely called more than once
1057
1058 register.__doc__ = (
1059 orig_register.__doc__ +
1060 "\nNote: version hacked by GaudiPython to work " +
1061 "around a problem with the ROOT exit handler")
1062 atexit.register = register
1063
GaudiKernel.Proxy.getNeededConfigurables
getNeededConfigurables
Definition: Proxy.py:21
addPropertyToCatalogue
bool PyHelper() addPropertyToCatalogue(IInterface *p, char *comp, char *name, char *value)
Definition: Bootstrap.cpp:245
GaudiKernel.ProcessJobOptions
Definition: ProcessJobOptions.py:1
gaudirun.type
type
Definition: gaudirun.py:142
GaudiKernel.ProcessJobOptions.importOptions
def importOptions(optsfile)
Definition: ProcessJobOptions.py:479
GaudiKernel.Configurable.expandvars
def expandvars(data)
Definition: Configurable.py:35

## ◆ __del__()

def GaudiPython.Bindings.AppMgr.__del__ | ( |  | self | ) |

Definition at line 1378 of file Bindings.py.

1378 def __del__(self):
1379 self.exit()
1380

## Member Function Documentation

## ◆ __new__()

def GaudiPython.Bindings.AppMgr.__new__ | ( |  | cls,
|  | * | args,
|  | ** | kwargs
| ) |  |

Definition at line 914 of file Bindings.py.

914 def __new__(cls, *args, **kwargs):
915 global _gaudi
916 if not _gaudi:
917 newobj = object.__new__(cls)
918 cls.__init__(newobj, *args, **kwargs)
919 _gaudi = newobj
920 return _gaudi
921

## ◆ __reset__()

def GaudiPython.Bindings.AppMgr.__reset__ | ( |  | self | ) |

Definition at line 922 of file Bindings.py.

922 def __reset__(self):
923 global _gaudi
924 # Stop, Finalize and Terminate the current AppMgr
925 self.exit()
926 # release interfaces
927 self._evtpro.release()
928 self._svcloc.release()
929 self._appmgr.release()
930 # Reset the C++ globals
931 gbl.Gaudi.setInstance(makeNullPointer('ISvcLocator'))
932 gbl.Gaudi.setInstance(makeNullPointer('IAppMgrUI'))
933 # Reset the Python global
934 _gaudi = None
935
GaudiPython.Bindings.makeNullPointer
makeNullPointer
Definition: Bindings.py:86

## ◆ addAlgorithm()

def GaudiPython.Bindings.AppMgr.addAlgorithm | ( |  | self,
|  |  | alg
| ) |  |

    Add an Algorithm to the list of Top algorithms. It can be either a instance of
        an Algorithm class or it name

Definition at line 1162 of file Bindings.py.

1162 def addAlgorithm(self, alg):
1163 """ Add an Algorithm to the list of Top algorithms. It can be either a instance of
1164 an Algorithm class or it name """
1165 if type(alg) is str:
1166 self.topAlg += [alg]
1167 else:
1168 self.pyalgorithms.append(alg)
1169 setOwnership(alg, 0)
1170 if self.targetFSMState() >= Gaudi.StateMachine.INITIALIZED:
1171 alg.sysInitialize()
1172 if self.targetFSMState() == Gaudi.StateMachine.RUNNING:
1173 alg.sysStart()
1174 self.topAlg += [alg.name()]
1175
gaudirun.type
type
Definition: gaudirun.py:142
GaudiPython.Bindings.setOwnership
setOwnership
Definition: Bindings.py:87

## ◆ algorithm()

def GaudiPython.Bindings.AppMgr.algorithm | ( |  | self,
|  |  | name,
|  |  | createIf = `False`
| ) |  |

Definition at line 1090 of file Bindings.py.

1090 def algorithm(self, name, createIf=False):
1091 alg = Helper.algorithm(self._algmgr, name, createIf)
1092 if not alg:
1093 return iAlgorithm(name, alg)
1094 else:
1095 return iAlgorithm(alg.name(), alg)
1096
GaudiPython.GaudiAlgs.iAlgorithm
iAlgorithm
Definition: GaudiAlgs.py:54

## ◆ algorithms()

def GaudiPython.Bindings.AppMgr.algorithms | ( |  | self | ) |

Definition at line 1097 of file Bindings.py.

1097 def algorithms(self):
1098 l = self._algmgr.getAlgorithms()
1099 return [a.name() for a in l]
1100

## ◆ config()

def GaudiPython.Bindings.AppMgr.config | ( |  | self,
|  | ** | args
| ) |  |

    Simple utility to perform the configuration of Gaudi application.
    It reads the set of input job-options files, and set few
    additional parameters 'options' through the usage of temporary *.opts file
    Usage:
    gaudi.config( files   = [ '$GAUSSOPTS/Gauss.opts'                     ,
                      '$DECFILESROOT/options/10022_010.0GeV.opts' ] ,
          options = [ 'EventSelector.PrintFreq   =   5  '         ] )

Definition at line 1227 of file Bindings.py.

1227 def config(self, **args):
1228 """
1229 Simple utility to perform the configuration of Gaudi application.
1230 It reads the set of input job-options files, and set few
1231 additional parameters 'options' through the usage of temporary *.opts file
1232 Usage:
1233 gaudi.config( files = [ '$GAUSSOPTS/Gauss.opts' ,
1234 '$DECFILESROOT/options/10022_010.0GeV.opts' ] ,
1235 options = [ 'EventSelector.PrintFreq = 5 ' ] )
1236 """
1237 files = args.get('files', [])
1238 for file in files:
1239 sc = self.readOptions(file)
1240 if sc.isFailure():
1241 raise RuntimeError(' Unable to read file "' + file + '" ')
1242 options = args.get('options', None)
1243 if options:
1244 import tempfile
1245 tmpfilename = tempfile.mktemp()
1246 tmpfile = open(tmpfilename, 'w')
1247 tmpfile.write('#pragma print on \n')
1248 tmpfile.write('/// File "' + tmpfilename +
1249 '" generated by GaudiPython \n\n')
1250 for opt in options:
1251 if type(options) is dict:
1252 tmpfile.write(' \t ' + opt + ' = ' + options[opt] +
1253 ' ; // added by GaudiPython \n')
1254 else:
1255 tmpfile.write(' \t ' + opt +
1256 ' ; // added by GaudiPython \n')
1257 tmpfile.write('/// End of file "' + tmpfilename +
1258 '" generated by GaudiPython \n\n')
1259 tmpfile.close()
1260 sc = self.readOptions(tmpfilename)
1261 if sc.isFailure():
1262 raise RuntimeError(' Unable to read file "' + tmpfilename +
1263 '" ')
1264 os.remove(tmpfilename)
1265 # We need to make sure that the options are taken by the ApplicationMgr
1266 # The state is already configured, so we need to do something....
1267 if self.FSMState() != Gaudi.StateMachine.OFFLINE:
1268
1269 # get job-options-service, @see class iJobOptSvc
1270 jos = self.optSvc()
1271
1272 # list of all libraries
1273 _dlls = jos.getProperty(self.name(), 'DLLs')
1274 # take care about libraries : APPEND if not done yet
1275 if _dlls:
1276 libs = [l for l in _dlls if not l in self.DLLs]
1277 if libs:
1278 self.DLLs += libs
1279
1280 # all external services
1281 _svcs = jos.getProperty(self.name(), 'ExtSvc')
1282 # take care about services : APPEND if not done yet
1283 if _svcs:
1284 svcs = [s for s in _svcs if not s in self.ExtSvc]
1285 if svcs:
1286 self.ExtSvc += svcs
1287
1288 # get all properties
1289 props = jos.getProperties(self.name())
1290 # finally treat all other properties (presumably scalar properties)
1291 for key in props:
1292 if 'DLLS' == key or 'EXTSVC' == key:
1293 continue
1294 self.__setattr__(key, props[key])
1295 return SUCCESS # RETURN
1296
prepareBenchmark.config
def config
Definition: prepareBenchmark.py:33
gaudirun.type
type
Definition: gaudirun.py:142

## ◆ configure()

def GaudiPython.Bindings.AppMgr.configure | ( |  | self | ) |

Definition at line 1297 of file Bindings.py.

1297 def configure(self):
1298 return self._appmgr.configure()
1299

## ◆ createSvc()

def GaudiPython.Bindings.AppMgr.createSvc | ( |  | self,
|  |  | name
| ) |  |

Definition at line 1083 of file Bindings.py.

1083 def createSvc(self, name):
1084 return Helper.service(self._svcloc, name, True)
1085

## ◆ datasvc()

def GaudiPython.Bindings.AppMgr.datasvc | ( |  | self,
|  |  | name
| ) |  |

Definition at line 1112 of file Bindings.py.

1112 def datasvc(self, name):
1113 if self.state() == Gaudi.StateMachine.CONFIGURED:
1114 self.initialize()
1115 svc = Helper.service(self._svcloc, name)
1116 return iDataSvc(name, svc)
1117

## ◆ declSvcType()

def GaudiPython.Bindings.AppMgr.declSvcType | ( |  | self,
|  |  | svcname,
|  |  | svctype
| ) |  |

Definition at line 1080 of file Bindings.py.

1080 def declSvcType(self, svcname, svctype):
1081 self._svcmgr.declareSvcType(svcname, svctype)
1082

## ◆ detsvc()

def GaudiPython.Bindings.AppMgr.detsvc | ( |  | self | ) |

Definition at line 1121 of file Bindings.py.

1121 def detsvc(self):
1122 return self.datasvc('DetectorDataSvc')
1123

## ◆ evtsel()

def GaudiPython.Bindings.AppMgr.evtsel | ( |  | self | ) |

Definition at line 1127 of file Bindings.py.

1127 def evtsel(self):
1128 if self.state() == Gaudi.StateMachine.CONFIGURED:
1129 self.initialize()
1130 if not hasattr(self, '_evtsel'):
1131 self.__dict__['_evtsel'] = iEventSelector()
1132 return self._evtsel
1133

## ◆ evtsvc()

def GaudiPython.Bindings.AppMgr.evtsvc | ( |  | self | ) |

Definition at line 1118 of file Bindings.py.

1118 def evtsvc(self):
1119 return self.datasvc('EventDataSvc')
1120

## ◆ execute()

def GaudiPython.Bindings.AppMgr.execute | ( |  | self | ) |

Definition at line 1320 of file Bindings.py.

1320 def execute(self):
1321 return self._evtpro.executeEvent()
1322

## ◆ executeEvent()

def GaudiPython.Bindings.AppMgr.executeEvent | ( |  | self | ) |

Definition at line 1317 of file Bindings.py.

1317 def executeEvent(self):
1318 return self._evtpro.executeEvent()
1319

## ◆ exit()

def GaudiPython.Bindings.AppMgr.exit | ( |  | self | ) |

Definition at line 1363 of file Bindings.py.

1363 def exit(self):
1364 # Protection against multiple calls to exit() if the finalization fails
1365 if not self._exit_called:
1366 self.__dict__['_exit_called'] = True
1367 Gaudi = self._gaudi_ns
1368 if self.FSMState() == Gaudi.StateMachine.RUNNING:
1369 self._appmgr.stop().ignore()
1370 if self.FSMState() == Gaudi.StateMachine.INITIALIZED:
1371 self._appmgr.finalize().ignore()
1372 if self.FSMState() == Gaudi.StateMachine.CONFIGURED:
1373 self._appmgr.terminate()
1374 return SUCCESS
1375

## ◆ filerecordsvc()

def GaudiPython.Bindings.AppMgr.filerecordsvc | ( |  | self | ) |

Definition at line 1124 of file Bindings.py.

1124 def filerecordsvc(self):
1125 return self.datasvc('FileRecordDataSvc')
1126

## ◆ FSMState()

def GaudiPython.Bindings.AppMgr.FSMState | ( |  | self | ) |

Definition at line 1067 of file Bindings.py.

1067 def FSMState(self):
1068 return self._isvc.FSMState()
1069

## ◆ histsvc()

def GaudiPython.Bindings.AppMgr.histsvc | ( |  | self,
|  |  | name = `'HistogramDataSvc'`
| ) |  |

Definition at line 1134 of file Bindings.py.

1134 def histsvc(self, name='HistogramDataSvc'):
1135 svc = Helper.service(self._svcloc, name)
1136 return iHistogramSvc(name, svc)
1137

## ◆ ntuplesvc()

def GaudiPython.Bindings.AppMgr.ntuplesvc | ( |  | self,
|  |  | name = `'NTupleSvc'`
| ) |  |

Definition at line 1138 of file Bindings.py.

1138 def ntuplesvc(self, name='NTupleSvc'):
1139 if name not in self.ExtSvc:
1140 self.ExtSvc += [name]
1141 # if self.HistogramPersistency == 'NONE' : self.HistogramPersistency = 'ROOT'
1142 svc = Helper.service(self._svcloc, name, True)
1143 return iNTupleSvc(name, svc)
1144

## ◆ optSvc()

def GaudiPython.Bindings.AppMgr.optSvc | ( |  | self,
|  |  | name = `'JobOptionsSvc'`
| ) |  |

Definition at line 1155 of file Bindings.py.

1155 def optSvc(self, name='JobOptionsSvc'):
1156 svc = Helper.service(self._svcloc, name, True)
1157 return iJobOptSvc(name, svc)
1158

## ◆ partsvc()

def GaudiPython.Bindings.AppMgr.partsvc | ( |  | self | ) |

Definition at line 1145 of file Bindings.py.

1145 def partsvc(self):
1146 if self.FSMState() == Gaudi.StateMachine.CONFIGURED:
1147 self.initialize()
1148 svc = Helper.service(self._svcloc, 'ParticlePropertySvc')
1149 return InterfaceCast(gbl.IParticlePropertySvc)(svc)
1150

## ◆ printAlgsSequences()

def GaudiPython.Bindings.AppMgr.printAlgsSequences | ( |  | self | ) |

    Print the sequence of Algorithms.

Definition at line 1206 of file Bindings.py.

1206 def printAlgsSequences(self):
1207 """
1208 Print the sequence of Algorithms.
1209 """
1210
1211 def printAlgo(algName, appMgr, prefix=' '):
1212 print prefix + algName
1213 alg = appMgr.algorithm(algName.split("/")[-1])
1214 prop = alg.properties()
1215 if prop.has_key("Members"):
1216 subs = prop["Members"].value()
1217 for i in subs:
1218 printAlgo(i.strip('"'), appMgr, prefix + " ")
1219
1220 mp = self.properties()
1221 prefix = 'ApplicationMgr SUCCESS '
1222 print prefix + "****************************** Algorithm Sequence ****************************"
1223 for i in mp["TopAlg"].value():
1224 printAlgo(i, self, prefix)
1225 print prefix + "******************************************************************************"
1226

## ◆ property()

def GaudiPython.Bindings.AppMgr.property | ( |  | self,
|  |  | name
| ) |  |

Definition at line 1104 of file Bindings.py.

1104 def property(self, name):
1105 if name in self.algorithms():
1106 return self.algorithm(name)
1107 elif name in self.services():
1108 return self.service(name)
1109 else:
1110 return iProperty(name)
1111

## ◆ readOptions()

def GaudiPython.Bindings.AppMgr.readOptions | ( |  | self,
|  |  | file
| ) |  |

Definition at line 1159 of file Bindings.py.

1159 def readOptions(self, file):
1160 return self._optsvc.readOptions(file)
1161

## ◆ removeAlgorithm()

def GaudiPython.Bindings.AppMgr.removeAlgorithm | ( |  | self,
|  |  | alg
| ) |  |

    Remove an Algorithm to the list of Top algorithms. It can be either a instance of
        an Algorithm class or it name

Definition at line 1194 of file Bindings.py.

1194 def removeAlgorithm(self, alg):
1195 """ Remove an Algorithm to the list of Top algorithms. It can be either a instance of
1196 an Algorithm class or it name """
1197 tmp = self.topAlg
1198 if type(alg) is str:
1199 tmp.remove(alg)
1200 else:
1201 tmp.remove(alg.name())
1202 self.pyalgorithms.remove(alg)
1203 setOwnership(alg, 1)
1204 self.topAlg = tmp
1205
gaudirun.type
type
Definition: gaudirun.py:142
GaudiPython.Bindings.setOwnership
setOwnership
Definition: Bindings.py:87

## ◆ run()

def GaudiPython.Bindings.AppMgr.run | ( |  | self,
|  |  | n
| ) |  |

Definition at line 1306 of file Bindings.py.

1306 def run(self, n):
1307 if self.FSMState() == Gaudi.StateMachine.CONFIGURED:
1308 sc = self.initialize()
1309 if sc.isFailure() or self.ReturnCode != 0:
1310 return sc
1311 if self.FSMState() == Gaudi.StateMachine.INITIALIZED:
1312 sc = self.start()
1313 if sc.isFailure() or self.ReturnCode != 0:
1314 return sc
1315 return self._evtpro.executeRun(n)
1316
executeRun
return ep &&ep executeRun(maxevt).isSuccess()

## ◆ runSelectedEvents()

def GaudiPython.Bindings.AppMgr.runSelectedEvents | ( |  | self,
|  |  | pfn,
|  |  | events
| ) |  |

Definition at line 1323 of file Bindings.py.

1323 def runSelectedEvents(self, pfn, events):
1324 if self.FSMState() == Gaudi.StateMachine.CONFIGURED:
1325 sc = self.initialize()
1326 if sc.isFailure():
1327 return sc
1328 if self.FSMState() == Gaudi.StateMachine.INITIALIZED:
1329 sc = self.start()
1330 if sc.isFailure():
1331 return sc
1332 # --- Access a number of services ----
1333 if not hasattr(self, '_perssvc'):
1334 self.__dict__['_perssvc'] = self.service('EventPersistencySvc',
1335 'IAddressCreator')
1336 if not hasattr(self, '_filecat'):
1337 self.__dict__['_filecat'] = self.service('FileCatalog',
1338 'Gaudi::IFileCatalog')
1339 if not hasattr(self, '_evtmgr'):
1340 self.__dict__['_evtmgr'] = self.service('EventDataSvc',
1341 'IDataManagerSvc')
1342 # --- Get FID from PFN and number of events in file
1343 if pfn.find('PFN:') == 0:
1344 pfn = pfn[4:]
1345 fid, maxevt = _getFIDandEvents(pfn)
1346 # --- Add FID into catalog if needed ---
1347 if not self._filecat.existsFID(fid):
1348 self._filecat.registerPFN(fid, pfn, '')
1349 # --- Loop over events
1350 if type(events) is not list:
1351 events = (events, )
1352 for evt in events:
1353 # --- Create POOL Address from Generic Address
1354 gadd = gbl.GenericAddress(0x02, 1, fid, '/Event', 0, evt)
1355 oadd = makeNullPointer('IOpaqueAddress')
1356 self._perssvc.createAddress(gadd.svcType(), gadd.clID(),
1357 gadd.par(), gadd.ipar(), oadd)
1358 # --- Clear TES, set root and run all algorithms
1359 self._evtmgr.clearStore()
1360 self._evtmgr.setRoot('/Event', oadd)
1361 self._evtpro.executeEvent()
1362
GaudiPython.Bindings._getFIDandEvents
def _getFIDandEvents(pfn)
Definition: Bindings.py:1393
GaudiPython.Bindings.makeNullPointer
makeNullPointer
Definition: Bindings.py:86
gaudirun.type
type
Definition: gaudirun.py:142

## ◆ service()

def GaudiPython.Bindings.AppMgr.service | ( |  | self,
|  |  | name,
|  |  | interface = `None`
| ) |  |

Definition at line 1073 of file Bindings.py.

1073 def service(self, name, interface=None):
1074 svc = Helper.service(self._svcloc, name)
1075 if interface:
1076 return InterfaceCast(interface)(svc)
1077 else:
1078 return iService(name, svc)
1079

## ◆ services()

def GaudiPython.Bindings.AppMgr.services | ( |  | self | ) |

Definition at line 1086 of file Bindings.py.

1086 def services(self):
1087 l = self._svcloc.getServices()
1088 return [s.name() for s in l]
1089

## ◆ setAlgorithms()

def GaudiPython.Bindings.AppMgr.setAlgorithms | ( |  | self,
|  |  | algs
| ) |  |

    Set the list of Top Algorithms.
        It can be an individual of a list of algorithms names or instances

Definition at line 1176 of file Bindings.py.

1176 def setAlgorithms(self, algs):
1177 """ Set the list of Top Algorithms.
1178 It can be an individual of a list of algorithms names or instances """
1179 if type(algs) is not list:
1180 algs = [algs]
1181 names = []
1182 for alg in algs:
1183 if type(alg) is str:
1184 names.append(alg)
1185 else:
1186 self.pyalgorithms.append(alg)
1187 if self.targetFSMState() >= Gaudi.StateMachine.INITIALIZED:
1188 alg.sysInitialize()
1189 if self.targetFSMState() == Gaudi.StateMachine.RUNNING:
1190 alg.sysStart()
1191 names.append(alg.name())
1192 self.topAlg = names
1193
gaudirun.type
type
Definition: gaudirun.py:142

## ◆ start()

def GaudiPython.Bindings.AppMgr.start | ( |  | self | ) |

Reimplemented from GaudiPython.Bindings.iService.

Definition at line 1300 of file Bindings.py.

1300 def start(self):
1301 return self._appmgr.start()
1302
IOTest.start
def start
Definition: IOTest.py:97

## ◆ state()

def GaudiPython.Bindings.AppMgr.state | ( |  | self | ) |

Definition at line 1064 of file Bindings.py.

1064 def state(self):
1065 return self._isvc.FSMState()
1066
compareRootHistos.state
def state
Definition: compareRootHistos.py:455

## ◆ targetFSMState()

def GaudiPython.Bindings.AppMgr.targetFSMState | ( |  | self | ) |

Definition at line 1070 of file Bindings.py.

1070 def targetFSMState(self):
1071 return self._isvc.targetFSMState()
1072

## ◆ terminate()

def GaudiPython.Bindings.AppMgr.terminate | ( |  | self | ) |

Definition at line 1303 of file Bindings.py.

1303 def terminate(self):
1304 return self._appmgr.terminate()
1305

## ◆ tool()

def GaudiPython.Bindings.AppMgr.tool | ( |  | self,
|  |  | name
| ) |  |

Definition at line 1101 of file Bindings.py.

1101 def tool(self, name):
1102 return iAlgTool(name)
1103
GaudiPython.GaudiAlgs.iAlgTool
iAlgTool
Definition: GaudiAlgs.py:55

## ◆ toolsvc()

def GaudiPython.Bindings.AppMgr.toolsvc | ( |  | self,
|  |  | name = `'ToolSvc'`
| ) |  |

Definition at line 1151 of file Bindings.py.

1151 def toolsvc(self, name='ToolSvc'):
1152 svc = Helper.service(self._svcloc, name, True)
1153 return iToolSvc(name, svc)
1154

## Member Data Documentation

## ◆ detSvc

def GaudiPython.Bindings.AppMgr.detSvc = detsvc
| static

Definition at line 1385 of file Bindings.py.

## ◆ evtSel

def GaudiPython.Bindings.AppMgr.evtSel = evtsel
| static

Definition at line 1384 of file Bindings.py.

## ◆ evtSvc

def GaudiPython.Bindings.AppMgr.evtSvc = evtsvc
| static

Definition at line 1381 of file Bindings.py.

## ◆ histSvc

def GaudiPython.Bindings.AppMgr.histSvc = histsvc
| static

Definition at line 1382 of file Bindings.py.

## ◆ JobOptionsType

GaudiPython.Bindings.AppMgr.JobOptionsType

Definition at line 968 of file Bindings.py.

## ◆ ntupleSvc

def GaudiPython.Bindings.AppMgr.ntupleSvc = ntuplesvc
| static

Definition at line 1383 of file Bindings.py.

## ◆ OutputLevel

GaudiPython.Bindings.AppMgr.OutputLevel

Definition at line 978 of file Bindings.py.

## ◆ partSvc

def GaudiPython.Bindings.AppMgr.partSvc = partsvc
| static

Definition at line 1387 of file Bindings.py.

## ◆ toolSvc

def GaudiPython.Bindings.AppMgr.toolSvc = toolsvc
| static

Definition at line 1386 of file Bindings.py.

## ◆ topAlg

GaudiPython.Bindings.AppMgr.topAlg

Definition at line 1192 of file Bindings.py.

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

- GaudiPython/python/GaudiPython/Bindings.py