The Gaudi Framework  v31r0 (aeb156f0)
GaudiPython.Bindings.AppMgr Class Reference
Inheritance diagram for GaudiPython.Bindings.AppMgr:
Collaboration diagram for GaudiPython.Bindings.AppMgr:

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 start (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 __init__ (self, name, ip=None)
 
def getInterface (self)
 
def retrieveInterface (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

 evtSvc = evtsvc
 
 histSvc = histsvc
 
 ntupleSvc = ntuplesvc
 
 evtSel = evtsel
 
 detSvc = detsvc
 
 toolSvc = toolsvc
 
 partSvc = partsvc
 

Detailed Description

Definition at line 913 of file Bindings.py.

Constructor & Destructor Documentation

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

Definition at line 941 of file Bindings.py.

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 
getNeededConfigurables
Definition: Proxy.py:21
def service(self, name, interface=None)
Definition: Bindings.py:1073
def GaudiPython.Bindings.AppMgr.__del__ (   self)

Definition at line 1377 of file Bindings.py.

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

Member Function Documentation

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 
def __init__(self, name, ip=None)
Definition: Bindings.py:233
def __new__(cls, args, kwargs)
Definition: Bindings.py:914
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 
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 
def addAlgorithm(self, alg)
Definition: Bindings.py:1162
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 
def algorithm(self, name, createIf=False)
Definition: Bindings.py:1090
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 
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  os.remove(tmpfilename)
1264  # We need to make sure that the options are taken by the ApplicationMgr
1265  # The state is already configured, so we need to do something....
1266  if self.FSMState() != Gaudi.StateMachine.OFFLINE:
1267 
1268  # get job-options-service, @see class iJobOptSvc
1269  jos = self.optSvc()
1270 
1271  # list of all libraries
1272  _dlls = jos.getProperty(self.name(), 'DLLs')
1273  # take care about libraries : APPEND if not done yet
1274  if _dlls:
1275  libs = [l for l in _dlls if not l in self.DLLs]
1276  if libs:
1277  self.DLLs += libs
1278 
1279  # all external services
1280  _svcs = jos.getProperty(self.name(), 'ExtSvc')
1281  # take care about services : APPEND if not done yet
1282  if _svcs:
1283  svcs = [s for s in _svcs if not s in self.ExtSvc]
1284  if svcs:
1285  self.ExtSvc += svcs
1286 
1287  # get all properties
1288  props = jos.getProperties(self.name())
1289  # finally treat all other properties (presumably scalar properties)
1290  for key in props:
1291  if 'DLLS' == key or 'EXTSVC' == key:
1292  continue
1293  self.__setattr__(key, props[key])
1294  return SUCCESS # RETURN
1295 
def config(self, args)
Definition: Bindings.py:1227
def optSvc(self, name='JobOptionsSvc')
Definition: Bindings.py:1155
def readOptions(self, file)
Definition: Bindings.py:1159
def __setattr__(self, name, value)
Definition: Bindings.py:260
def GaudiPython.Bindings.AppMgr.configure (   self)

Definition at line 1296 of file Bindings.py.

1296  def configure(self):
1297  return self._appmgr.configure()
1298 
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 
def createSvc(self, name)
Definition: Bindings.py:1083
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 
def datasvc(self, name)
Definition: Bindings.py:1112
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 
def declSvcType(self, svcname, svctype)
Definition: Bindings.py:1080
def GaudiPython.Bindings.AppMgr.detsvc (   self)

Definition at line 1121 of file Bindings.py.

1121  def detsvc(self):
1122  return self.datasvc('DetectorDataSvc')
1123 
def datasvc(self, name)
Definition: Bindings.py:1112
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 
def GaudiPython.Bindings.AppMgr.evtsvc (   self)

Definition at line 1118 of file Bindings.py.

1118  def evtsvc(self):
1119  return self.datasvc('EventDataSvc')
1120 
def datasvc(self, name)
Definition: Bindings.py:1112
def GaudiPython.Bindings.AppMgr.execute (   self)

Definition at line 1319 of file Bindings.py.

1319  def execute(self):
1320  return self._evtpro.executeEvent()
1321 
def GaudiPython.Bindings.AppMgr.executeEvent (   self)

Definition at line 1316 of file Bindings.py.

1316  def executeEvent(self):
1317  return self._evtpro.executeEvent()
1318 
def GaudiPython.Bindings.AppMgr.exit (   self)

Definition at line 1362 of file Bindings.py.

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

Definition at line 1124 of file Bindings.py.

1124  def filerecordsvc(self):
1125  return self.datasvc('FileRecordDataSvc')
1126 
def datasvc(self, name)
Definition: Bindings.py:1112
def GaudiPython.Bindings.AppMgr.FSMState (   self)

Definition at line 1067 of file Bindings.py.

1067  def FSMState(self):
1068  return self._isvc.FSMState()
1069 
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 
def histsvc(self, name='HistogramDataSvc')
Definition: Bindings.py:1134
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 
def ntuplesvc(self, name='NTupleSvc')
Definition: Bindings.py:1138
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 
def optSvc(self, name='JobOptionsSvc')
Definition: Bindings.py:1155
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 
def GaudiPython.Bindings.AppMgr.printAlgsSequences (   self)
Print the sequence of Algorithms.

Definition at line 1206 of file Bindings.py.

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 
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 
def service(self, name, interface=None)
Definition: Bindings.py:1073
def algorithm(self, name, createIf=False)
Definition: Bindings.py:1090
def property(self, name)
Definition: Bindings.py:1104
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 
def readOptions(self, file)
Definition: Bindings.py:1159
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 
def removeAlgorithm(self, alg)
Definition: Bindings.py:1194
def GaudiPython.Bindings.AppMgr.run (   self,
  n 
)

Definition at line 1305 of file Bindings.py.

1305  def run(self, n):
1306  if self.FSMState() == Gaudi.StateMachine.CONFIGURED:
1307  sc = self.initialize()
1308  if sc.isFailure() or self.ReturnCode != 0:
1309  return sc
1310  if self.FSMState() == Gaudi.StateMachine.INITIALIZED:
1311  sc = self.start()
1312  if sc.isFailure() or self.ReturnCode != 0:
1313  return sc
1314  return self._evtpro.executeRun(n)
1315 
def GaudiPython.Bindings.AppMgr.runSelectedEvents (   self,
  pfn,
  events 
)

Definition at line 1322 of file Bindings.py.

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

Definition at line 1299 of file Bindings.py.

1299  def start(self):
1300  return self._appmgr.start()
1301 
def GaudiPython.Bindings.AppMgr.state (   self)

Definition at line 1064 of file Bindings.py.

1064  def state(self):
1065  return self._isvc.FSMState()
1066 
def GaudiPython.Bindings.AppMgr.targetFSMState (   self)

Definition at line 1070 of file Bindings.py.

1070  def targetFSMState(self):
1071  return self._isvc.targetFSMState()
1072 
def GaudiPython.Bindings.AppMgr.terminate (   self)

Definition at line 1302 of file Bindings.py.

1302  def terminate(self):
1303  return self._appmgr.terminate()
1304 
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 
def tool(self, name)
Definition: Bindings.py:1101
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 
def toolsvc(self, name='ToolSvc')
Definition: Bindings.py:1151

Member Data Documentation

GaudiPython.Bindings.AppMgr.detSvc = detsvc
static

Definition at line 1384 of file Bindings.py.

GaudiPython.Bindings.AppMgr.evtSel = evtsel
static

Definition at line 1383 of file Bindings.py.

GaudiPython.Bindings.AppMgr.evtSvc = evtsvc
static

Definition at line 1380 of file Bindings.py.

GaudiPython.Bindings.AppMgr.histSvc = histsvc
static

Definition at line 1381 of file Bindings.py.

GaudiPython.Bindings.AppMgr.JobOptionsType

Definition at line 973 of file Bindings.py.

GaudiPython.Bindings.AppMgr.ntupleSvc = ntuplesvc
static

Definition at line 1382 of file Bindings.py.

GaudiPython.Bindings.AppMgr.OutputLevel

Definition at line 983 of file Bindings.py.

GaudiPython.Bindings.AppMgr.partSvc = partsvc
static

Definition at line 1386 of file Bindings.py.

GaudiPython.Bindings.AppMgr.toolSvc = toolsvc
static

Definition at line 1385 of file Bindings.py.

GaudiPython.Bindings.AppMgr.topAlg

Definition at line 1192 of file Bindings.py.


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