The Gaudi Framework  v30r4 (9b837755)
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 883 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 907 of file Bindings.py.

907  dllname=None, factname=None):
908  global _gaudi
909  if _gaudi:
910  return
911  # Protection against multiple calls to exit() if the finalization fails
912  self.__dict__['_exit_called'] = False
913  # keep the Gaudi namespace around (so it is still available during atexit shutdown)...
914  self.__dict__['_gaudi_ns'] = Gaudi
915  try:
916  from GaudiKernel.Proxy.Configurable import expandvars
917  except ImportError:
918  # pass-through implementation if expandvars is not defined (AthenaCommon)
919  def expandvars(data): return data
920  if dllname and factname:
921  self.__dict__['_appmgr'] = gbl.Gaudi.createApplicationMgr(
922  dllname, factname)
923  elif dllname:
924  self.__dict__['_appmgr'] = gbl.Gaudi.createApplicationMgr(dllname)
925  else:
926  self.__dict__['_appmgr'] = gbl.Gaudi.createApplicationMgr()
927  self.__dict__['_svcloc'] = gbl.Gaudi.svcLocator()
928  self.__dict__['_algmgr'] = InterfaceCast(gbl.IAlgManager)(self._appmgr)
929  self.__dict__['_evtpro'] = InterfaceCast(
930  gbl.IEventProcessor)(self._appmgr)
931  self.__dict__['_svcmgr'] = InterfaceCast(gbl.ISvcManager)(self._appmgr)
932  self.__dict__['pyalgorithms'] = []
933  iService.__init__(self, 'ApplicationMgr', self._appmgr)
934  # ------python specific initialization-------------------------------------
935  if self.FSMState() < Gaudi.StateMachine.CONFIGURED: # Not yet configured
936  self.JobOptionsType = 'NONE'
937  if joboptions:
938  from GaudiKernel.ProcessJobOptions import importOptions
939  importOptions(joboptions)
940  # Ensure that the ConfigurableUser instances have been applied
941  import GaudiKernel.Proxy.Configurable
942  if hasattr(GaudiKernel.Proxy.Configurable, "applyConfigurableUsers"):
943  GaudiKernel.Proxy.Configurable.applyConfigurableUsers()
944  # This is the default and could be overridden with "selfopts"
945  self.OutputLevel = 3
946  selfprops = Configurable.allConfigurables.get('ApplicationMgr', {})
947  if selfprops:
948  selfprops = expandvars(selfprops.getValuedProperties())
949  for p, v in selfprops.items():
950  setattr(self, p, v)
951  for p, v in selfoptions.items():
952  setattr(self, p, v)
953  # Override job options
954  if outputlevel != -1:
955  self.OutputLevel = outputlevel
956  self.configure()
957  # ---MessageSvc------------------------------------------------------------
958  ms = self.service('MessageSvc')
959  if 'MessageSvc' in Configurable.allConfigurables:
960  msprops = Configurable.allConfigurables['MessageSvc']
961  ms = self.service('MessageSvc')
962  if hasattr(msprops, "getValuedProperties"):
963  msprops = expandvars(msprops.getValuedProperties())
964  for p, v in msprops.items():
965  setattr(ms, p, v)
966  if outputlevel != -1:
967  ms.OutputLevel = outputlevel
968  # ---JobOptions------------------------------------------------------------
969  self.__dict__['_optsvc'] = InterfaceCast(gbl.IJobOptionsSvc)(
970  Helper.service(self._svcloc, 'JobOptionsSvc'))
971  # ------Configurables initialization (part2)-------------------------------
972  mkStringProperty = gbl.GaudiPython.Helpers.mkStringProperty
973  for n in getNeededConfigurables():
974  c = Configurable.allConfigurables[n]
975  if n in ['ApplicationMgr', 'MessageSvc']:
976  continue # These are already done---
977  for p, v in c.getValuedProperties().items():
978  v = expandvars(v)
979  # Note: AthenaCommon.Configurable does not have Configurable.PropertyReference
980  if hasattr(Configurable, "PropertyReference") and type(v) == Configurable.PropertyReference:
981  # this is done in "getFullName", but the exception is ignored,
982  # so we do it again to get it
983  v = v.__resolve__()
984  if type(v) == str:
985  v = '"%s"' % v # need double quotes
986  elif type(v) == long:
987  v = '%d' % v # prevent pending 'L'
988  self._optsvc.addPropertyToCatalogue(
989  n, mkStringProperty(p, str(v)))
990  if hasattr(Configurable, "_configurationLocked"):
991  Configurable._configurationLocked = True
992 
993  # Ensure that the exit method is called when exiting from Python
994  import atexit
995  atexit.register(self.exit)
996 
997  # ---Hack to avoid bad interactions with the ROOT exit handler
998  # Look for an exit handler installed by ROOT
999  root_handler_installed = False
1000  for h in atexit._exithandlers:
1001  func = h[0]
1002  if hasattr(func, "__module__") and func.__module__ == "ROOT":
1003  root_handler_installed = True
1004  break
1005 
1006  # If the handler is not yet installed, let's install our private version
1007  # that detects that the ROOT exit handler is installed and add our own
1008  # after it to ensure it is called before.
1009  if not root_handler_installed:
1010  orig_register = atexit.register
1011 
1012  def register(func, *targs, **kargs):
1013  orig_register(func, *targs, **kargs)
1014  if hasattr(func, "__module__") and func.__module__ == "ROOT":
1015  orig_register(self.exit)
1016  # we do not need to remove out handler from the list because
1017  # it can be safely called more than once
1018  register.__doc__ = (orig_register.__doc__ +
1019  "\nNote: version hacked by GaudiPython to work " +
1020  "around a problem with the ROOT exit handler")
1021  atexit.register = register
1022 
getNeededConfigurables
Definition: Proxy.py:20
def service(self, name, interface=None)
Definition: Bindings.py:1029
def GaudiPython.Bindings.AppMgr.__del__ (   self)

Definition at line 1330 of file Bindings.py.

1330  def __del__(self):
1331  self.exit()

Member Function Documentation

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

Definition at line 884 of file Bindings.py.

884  def __new__(cls, *args, **kwargs):
885  global _gaudi
886  if not _gaudi:
887  newobj = object.__new__(cls)
888  cls.__init__(newobj, *args, **kwargs)
889  _gaudi = newobj
890  return _gaudi
891 
def __init__(self, name, ip=None)
Definition: Bindings.py:222
def __new__(cls, args, kwargs)
Definition: Bindings.py:884
def GaudiPython.Bindings.AppMgr.__reset__ (   self)

Definition at line 892 of file Bindings.py.

892  def __reset__(self):
893  global _gaudi
894  # Stop, Finalize and Terminate the current AppMgr
895  self.exit()
896  # release interfaces
897  self._evtpro.release()
898  self._svcloc.release()
899  self._appmgr.release()
900  # Reset the C++ globals
901  gbl.Gaudi.setInstance(makeNullPointer('ISvcLocator'))
902  gbl.Gaudi.setInstance(makeNullPointer('IAppMgrUI'))
903  # Reset the Python global
904  _gaudi = None
905 
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 1118 of file Bindings.py.

1118  def addAlgorithm(self, alg):
1119  """ Add an Algorithm to the list of Top algorithms. It can be either a instance of
1120  an Algorithm class or it name """
1121  if type(alg) is str:
1122  self.topAlg += [alg]
1123  else:
1124  self.pyalgorithms.append(alg)
1125  setOwnership(alg, 0)
1126  if self.targetFSMState() >= Gaudi.StateMachine.INITIALIZED:
1127  alg.sysInitialize()
1128  if self.targetFSMState() == Gaudi.StateMachine.RUNNING:
1129  alg.sysStart()
1130  self.topAlg += [alg.name()]
1131 
def addAlgorithm(self, alg)
Definition: Bindings.py:1118
def GaudiPython.Bindings.AppMgr.algorithm (   self,
  name,
  createIf = False 
)

Definition at line 1046 of file Bindings.py.

1046  def algorithm(self, name, createIf=False):
1047  alg = Helper.algorithm(self._algmgr, name, createIf)
1048  if not alg:
1049  return iAlgorithm(name, alg)
1050  else:
1051  return iAlgorithm(alg.name(), alg)
1052 
def algorithm(self, name, createIf=False)
Definition: Bindings.py:1046
def GaudiPython.Bindings.AppMgr.algorithms (   self)

Definition at line 1053 of file Bindings.py.

1053  def algorithms(self):
1054  l = self._algmgr.getAlgorithms()
1055  return [a.name() for a in l]
1056 
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 1181 of file Bindings.py.

1181  def config(self, **args):
1182  """
1183  Simple utility to perform the configuration of Gaudi application.
1184  It reads the set of input job-options files, and set few
1185  additional parameters 'options' through the usage of temporary *.opts file
1186  Usage:
1187  gaudi.config( files = [ '$GAUSSOPTS/Gauss.opts' ,
1188  '$DECFILESROOT/options/10022_010.0GeV.opts' ] ,
1189  options = [ 'EventSelector.PrintFreq = 5 ' ] )
1190  """
1191  files = args.get('files', [])
1192  for file in files:
1193  sc = self.readOptions(file)
1194  if sc.isFailure():
1195  raise RuntimeError, ' Unable to read file "' + file + '" '
1196  options = args.get('options', None)
1197  if options:
1198  import tempfile
1199  tmpfilename = tempfile.mktemp()
1200  tmpfile = open(tmpfilename, 'w')
1201  tmpfile.write('#pragma print on \n')
1202  tmpfile.write('/// File "' + tmpfilename +
1203  '" generated by GaudiPython \n\n')
1204  for opt in options:
1205  if type(options) is dict:
1206  tmpfile.write(' \t ' + opt + ' = ' +
1207  options[opt] + ' ; // added by GaudiPython \n')
1208  else:
1209  tmpfile.write(
1210  ' \t ' + opt + ' ; // added by GaudiPython \n')
1211  tmpfile.write('/// End of file "' + tmpfilename +
1212  '" generated by GaudiPython \n\n')
1213  tmpfile.close()
1214  sc = self.readOptions(tmpfilename)
1215  if sc.isFailure():
1216  raise RuntimeError, ' Unable to read file "' + tmpfilename + '" '
1217  os.remove(tmpfilename)
1218  # We need to make sure that the options are taken by the ApplicationMgr
1219  # The state is already configured, so we need to do something....
1220  if self.FSMState() != Gaudi.StateMachine.OFFLINE:
1221 
1222  # get job-options-service, @see class iJobOptSvc
1223  jos = self.optSvc()
1224 
1225  # list of all libraries
1226  _dlls = jos.getProperty(self.name(), 'DLLs')
1227  # take care about libraries : APPEND if not done yet
1228  if _dlls:
1229  libs = [l for l in _dlls if not l in self.DLLs]
1230  if libs:
1231  self.DLLs += libs
1232 
1233  # all external services
1234  _svcs = jos.getProperty(self.name(), 'ExtSvc')
1235  # take care about services : APPEND if not done yet
1236  if _svcs:
1237  svcs = [s for s in _svcs if not s in self.ExtSvc]
1238  if svcs:
1239  self.ExtSvc += svcs
1240 
1241  # get all properties
1242  props = jos.getProperties(self.name())
1243  # finally treat all other properties (presumably scalar properties)
1244  for key in props:
1245  if 'DLLS' == key or 'EXTSVC' == key:
1246  continue
1247  self.__setattr__(key, props[key])
1248  return SUCCESS # RETURN
1249 
def config(self, args)
Definition: Bindings.py:1181
def optSvc(self, name='JobOptionsSvc')
Definition: Bindings.py:1111
def readOptions(self, file)
Definition: Bindings.py:1115
def __setattr__(self, name, value)
Definition: Bindings.py:249
def GaudiPython.Bindings.AppMgr.configure (   self)

Definition at line 1250 of file Bindings.py.

1250  def configure(self):
1251  return self._appmgr.configure()
1252 
def GaudiPython.Bindings.AppMgr.createSvc (   self,
  name 
)

Definition at line 1039 of file Bindings.py.

1039  def createSvc(self, name):
1040  return Helper.service(self._svcloc, name, True)
1041 
def createSvc(self, name)
Definition: Bindings.py:1039
def GaudiPython.Bindings.AppMgr.datasvc (   self,
  name 
)

Definition at line 1068 of file Bindings.py.

1068  def datasvc(self, name):
1069  if self.state() == Gaudi.StateMachine.CONFIGURED:
1070  self.initialize()
1071  svc = Helper.service(self._svcloc, name)
1072  return iDataSvc(name, svc)
1073 
def datasvc(self, name)
Definition: Bindings.py:1068
def GaudiPython.Bindings.AppMgr.declSvcType (   self,
  svcname,
  svctype 
)

Definition at line 1036 of file Bindings.py.

1036  def declSvcType(self, svcname, svctype):
1037  self._svcmgr.declareSvcType(svcname, svctype)
1038 
def declSvcType(self, svcname, svctype)
Definition: Bindings.py:1036
def GaudiPython.Bindings.AppMgr.detsvc (   self)

Definition at line 1077 of file Bindings.py.

1077  def detsvc(self):
1078  return self.datasvc('DetectorDataSvc')
1079 
def datasvc(self, name)
Definition: Bindings.py:1068
def GaudiPython.Bindings.AppMgr.evtsel (   self)

Definition at line 1083 of file Bindings.py.

1083  def evtsel(self):
1084  if self.state() == Gaudi.StateMachine.CONFIGURED:
1085  self.initialize()
1086  if not hasattr(self, '_evtsel'):
1087  self.__dict__['_evtsel'] = iEventSelector()
1088  return self._evtsel
1089 
def GaudiPython.Bindings.AppMgr.evtsvc (   self)

Definition at line 1074 of file Bindings.py.

1074  def evtsvc(self):
1075  return self.datasvc('EventDataSvc')
1076 
def datasvc(self, name)
Definition: Bindings.py:1068
def GaudiPython.Bindings.AppMgr.execute (   self)

Definition at line 1273 of file Bindings.py.

1273  def execute(self):
1274  return self._evtpro.executeEvent()
1275 
def GaudiPython.Bindings.AppMgr.executeEvent (   self)

Definition at line 1270 of file Bindings.py.

1270  def executeEvent(self):
1271  return self._evtpro.executeEvent()
1272 
def GaudiPython.Bindings.AppMgr.exit (   self)

Definition at line 1316 of file Bindings.py.

1316  def exit(self):
1317  # Protection against multiple calls to exit() if the finalization fails
1318  if not self._exit_called:
1319  self.__dict__['_exit_called'] = True
1320  Gaudi = self._gaudi_ns
1321  if self.FSMState() == Gaudi.StateMachine.RUNNING:
1322  self._appmgr.stop().ignore()
1323  if self.FSMState() == Gaudi.StateMachine.INITIALIZED:
1324  self._appmgr.finalize().ignore()
1325  if self.FSMState() == Gaudi.StateMachine.CONFIGURED:
1326  self._appmgr.terminate()
1327  return SUCCESS
def GaudiPython.Bindings.AppMgr.filerecordsvc (   self)

Definition at line 1080 of file Bindings.py.

1080  def filerecordsvc(self):
1081  return self.datasvc('FileRecordDataSvc')
1082 
def datasvc(self, name)
Definition: Bindings.py:1068
def GaudiPython.Bindings.AppMgr.FSMState (   self)

Definition at line 1025 of file Bindings.py.

1025  def FSMState(self): return self._isvc.FSMState()
1026 
def GaudiPython.Bindings.AppMgr.histsvc (   self,
  name = 'HistogramDataSvc' 
)

Definition at line 1090 of file Bindings.py.

1090  def histsvc(self, name='HistogramDataSvc'):
1091  svc = Helper.service(self._svcloc, name)
1092  return iHistogramSvc(name, svc)
1093 
def histsvc(self, name='HistogramDataSvc')
Definition: Bindings.py:1090
def GaudiPython.Bindings.AppMgr.ntuplesvc (   self,
  name = 'NTupleSvc' 
)

Definition at line 1094 of file Bindings.py.

1094  def ntuplesvc(self, name='NTupleSvc'):
1095  if name not in self.ExtSvc:
1096  self.ExtSvc += [name]
1097 # if self.HistogramPersistency == 'NONE' : self.HistogramPersistency = 'ROOT'
1098  svc = Helper.service(self._svcloc, name, True)
1099  return iNTupleSvc(name, svc)
1100 
def ntuplesvc(self, name='NTupleSvc')
Definition: Bindings.py:1094
def GaudiPython.Bindings.AppMgr.optSvc (   self,
  name = 'JobOptionsSvc' 
)

Definition at line 1111 of file Bindings.py.

1111  def optSvc(self, name='JobOptionsSvc'):
1112  svc = Helper.service(self._svcloc, name, True)
1113  return iJobOptSvc(name, svc)
1114 
def optSvc(self, name='JobOptionsSvc')
Definition: Bindings.py:1111
def GaudiPython.Bindings.AppMgr.partsvc (   self)

Definition at line 1101 of file Bindings.py.

1101  def partsvc(self):
1102  if self.FSMState() == Gaudi.StateMachine.CONFIGURED:
1103  self.initialize()
1104  svc = Helper.service(self._svcloc, 'ParticlePropertySvc')
1105  return InterfaceCast(gbl.IParticlePropertySvc)(svc)
1106 
def GaudiPython.Bindings.AppMgr.printAlgsSequences (   self)
Print the sequence of Algorithms.

Definition at line 1162 of file Bindings.py.

1163  """
1164  Print the sequence of Algorithms.
1165  """
1166  def printAlgo(algName, appMgr, prefix=' '):
1167  print prefix + algName
1168  alg = appMgr.algorithm(algName.split("/")[-1])
1169  prop = alg.properties()
1170  if prop.has_key("Members"):
1171  subs = prop["Members"].value()
1172  for i in subs:
1173  printAlgo(i.strip('"'), appMgr, prefix + " ")
1174  mp = self.properties()
1175  prefix = 'ApplicationMgr SUCCESS '
1176  print prefix + "****************************** Algorithm Sequence ****************************"
1177  for i in mp["TopAlg"].value():
1178  printAlgo(i, self, prefix)
1179  print prefix + "******************************************************************************"
1180 
def GaudiPython.Bindings.AppMgr.property (   self,
  name 
)

Definition at line 1060 of file Bindings.py.

1060  def property(self, name):
1061  if name in self.algorithms():
1062  return self.algorithm(name)
1063  elif name in self.services():
1064  return self.service(name)
1065  else:
1066  return iProperty(name)
1067 
def service(self, name, interface=None)
Definition: Bindings.py:1029
def algorithm(self, name, createIf=False)
Definition: Bindings.py:1046
def property(self, name)
Definition: Bindings.py:1060
def GaudiPython.Bindings.AppMgr.readOptions (   self,
  file 
)

Definition at line 1115 of file Bindings.py.

1115  def readOptions(self, file):
1116  return self._optsvc.readOptions(file)
1117 
def readOptions(self, file)
Definition: Bindings.py:1115
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 1150 of file Bindings.py.

1150  def removeAlgorithm(self, alg):
1151  """ Remove an Algorithm to the list of Top algorithms. It can be either a instance of
1152  an Algorithm class or it name """
1153  tmp = self.topAlg
1154  if type(alg) is str:
1155  tmp.remove(alg)
1156  else:
1157  tmp.remove(alg.name())
1158  self.pyalgorithms.remove(alg)
1159  setOwnership(alg, 1)
1160  self.topAlg = tmp
1161 
def removeAlgorithm(self, alg)
Definition: Bindings.py:1150
def GaudiPython.Bindings.AppMgr.run (   self,
  n 
)

Definition at line 1259 of file Bindings.py.

1259  def run(self, n):
1260  if self.FSMState() == Gaudi.StateMachine.CONFIGURED:
1261  sc = self.initialize()
1262  if sc.isFailure() or self.ReturnCode != 0:
1263  return sc
1264  if self.FSMState() == Gaudi.StateMachine.INITIALIZED:
1265  sc = self.start()
1266  if sc.isFailure() or self.ReturnCode != 0:
1267  return sc
1268  return self._evtpro.executeRun(n)
1269 
def GaudiPython.Bindings.AppMgr.runSelectedEvents (   self,
  pfn,
  events 
)

Definition at line 1276 of file Bindings.py.

1276  def runSelectedEvents(self, pfn, events):
1277  if self.FSMState() == Gaudi.StateMachine.CONFIGURED:
1278  sc = self.initialize()
1279  if sc.isFailure():
1280  return sc
1281  if self.FSMState() == Gaudi.StateMachine.INITIALIZED:
1282  sc = self.start()
1283  if sc.isFailure():
1284  return sc
1285  # --- Access a number of services ----
1286  if not hasattr(self, '_perssvc'):
1287  self.__dict__['_perssvc'] = self.service(
1288  'EventPersistencySvc', 'IAddressCreator')
1289  if not hasattr(self, '_filecat'):
1290  self.__dict__['_filecat'] = self.service(
1291  'FileCatalog', 'Gaudi::IFileCatalog')
1292  if not hasattr(self, '_evtmgr'):
1293  self.__dict__['_evtmgr'] = self.service(
1294  'EventDataSvc', 'IDataManagerSvc')
1295  # --- Get FID from PFN and number of events in file
1296  if pfn.find('PFN:') == 0:
1297  pfn = pfn[4:]
1298  fid, maxevt = _getFIDandEvents(pfn)
1299  # --- Add FID into catalog if needed ---
1300  if not self._filecat.existsFID(fid):
1301  self._filecat.registerPFN(fid, pfn, '')
1302  # --- Loop over events
1303  if type(events) is not list:
1304  events = (events,)
1305  for evt in events:
1306  # --- Create POOL Address from Generic Address
1307  gadd = gbl.GenericAddress(0x02, 1, fid, '/Event', 0, evt)
1308  oadd = makeNullPointer('IOpaqueAddress')
1309  self._perssvc.createAddress(
1310  gadd.svcType(), gadd.clID(), gadd.par(), gadd.ipar(), oadd)
1311  # --- Clear TES, set root and run all algorithms
1312  self._evtmgr.clearStore()
1313  self._evtmgr.setRoot('/Event', oadd)
1314  self._evtpro.executeEvent()
1315 
def runSelectedEvents(self, pfn, events)
Definition: Bindings.py:1276
def _getFIDandEvents(pfn)
Definition: Bindings.py:1343
def service(self, name, interface=None)
Definition: Bindings.py:1029
def GaudiPython.Bindings.AppMgr.service (   self,
  name,
  interface = None 
)

Definition at line 1029 of file Bindings.py.

1029  def service(self, name, interface=None):
1030  svc = Helper.service(self._svcloc, name)
1031  if interface:
1032  return InterfaceCast(interface)(svc)
1033  else:
1034  return iService(name, svc)
1035 
def service(self, name, interface=None)
Definition: Bindings.py:1029
def GaudiPython.Bindings.AppMgr.services (   self)

Definition at line 1042 of file Bindings.py.

1042  def services(self):
1043  l = self._svcloc.getServices()
1044  return [s.name() for s in l]
1045 
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 1132 of file Bindings.py.

1132  def setAlgorithms(self, algs):
1133  """ Set the list of Top Algorithms.
1134  It can be an individual of a list of algorithms names or instances """
1135  if type(algs) is not list:
1136  algs = [algs]
1137  names = []
1138  for alg in algs:
1139  if type(alg) is str:
1140  names.append(alg)
1141  else:
1142  self.pyalgorithms.append(alg)
1143  if self.targetFSMState() >= Gaudi.StateMachine.INITIALIZED:
1144  alg.sysInitialize()
1145  if self.targetFSMState() == Gaudi.StateMachine.RUNNING:
1146  alg.sysStart()
1147  names.append(alg.name())
1148  self.topAlg = names
1149 
def setAlgorithms(self, algs)
Definition: Bindings.py:1132
def GaudiPython.Bindings.AppMgr.start (   self)

Definition at line 1253 of file Bindings.py.

1253  def start(self):
1254  return self._appmgr.start()
1255 
def GaudiPython.Bindings.AppMgr.state (   self)

Definition at line 1023 of file Bindings.py.

1023  def state(self): return self._isvc.FSMState()
1024 
def GaudiPython.Bindings.AppMgr.targetFSMState (   self)

Definition at line 1027 of file Bindings.py.

1027  def targetFSMState(self): return self._isvc.targetFSMState()
1028 
def GaudiPython.Bindings.AppMgr.terminate (   self)

Definition at line 1256 of file Bindings.py.

1256  def terminate(self):
1257  return self._appmgr.terminate()
1258 
def GaudiPython.Bindings.AppMgr.tool (   self,
  name 
)

Definition at line 1057 of file Bindings.py.

1057  def tool(self, name):
1058  return iAlgTool(name)
1059 
def tool(self, name)
Definition: Bindings.py:1057
def GaudiPython.Bindings.AppMgr.toolsvc (   self,
  name = 'ToolSvc' 
)

Definition at line 1107 of file Bindings.py.

1107  def toolsvc(self, name='ToolSvc'):
1108  svc = Helper.service(self._svcloc, name, True)
1109  return iToolSvc(name, svc)
1110 
def toolsvc(self, name='ToolSvc')
Definition: Bindings.py:1107

Member Data Documentation

GaudiPython.Bindings.AppMgr.detSvc = detsvc
static

Definition at line 1336 of file Bindings.py.

GaudiPython.Bindings.AppMgr.evtSel = evtsel
static

Definition at line 1335 of file Bindings.py.

GaudiPython.Bindings.AppMgr.evtSvc = evtsvc
static

Definition at line 1332 of file Bindings.py.

GaudiPython.Bindings.AppMgr.histSvc = histsvc
static

Definition at line 1333 of file Bindings.py.

GaudiPython.Bindings.AppMgr.JobOptionsType

Definition at line 936 of file Bindings.py.

GaudiPython.Bindings.AppMgr.ntupleSvc = ntuplesvc
static

Definition at line 1334 of file Bindings.py.

GaudiPython.Bindings.AppMgr.OutputLevel

Definition at line 945 of file Bindings.py.

GaudiPython.Bindings.AppMgr.partSvc = partsvc
static

Definition at line 1338 of file Bindings.py.

GaudiPython.Bindings.AppMgr.toolSvc = toolsvc
static

Definition at line 1337 of file Bindings.py.

GaudiPython.Bindings.AppMgr.topAlg

Definition at line 1148 of file Bindings.py.


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