/search.css" rel="stylesheet" type="text/css"/> /search.js">
00001 #!/usr/bin/env python 00002 00003 # To use this, place 'hookDebugger()' statement where you want to switch 00004 # into the debugger. Note that if you invoke this script as a command, i.e. 00005 # '$ ./RunTESDemo.py', the session will terminate so it is best it invoke 00006 # it as a python script, i.e. '$ python RunTESDemo.py'. 00007 00008 def hookDebugger(debugger='gdb'): 00009 """debugging helper, hooks debugger to running interpreter process 00010 """ 00011 import os 00012 pid = os.spawnvp(os.P_NOWAIT, 00013 debugger, [debugger, '-q', 'python', str(os.getpid())]) 00014 00015 # give debugger some time to attach to the python process 00016 import time 00017 time.sleep( 1 ) 00018 return 00019 00020 import GaudiPython as gp 00021 appMgr = gp.iService('ApplicationMgr') 00022 appMgr.SvcMapping = [ 'EvtDataSvc/EventDataArchiveSvc', 00023 'DybDataSvc/EventDataSvc', 00024 'MockEvtConversionSvc/EventPersistencySvc', 00025 'HistogramSvc/HistogramDataSvc', 00026 'MockEvtSelector/EventSelector' ] 00027 appMgr.Dlls += [ 'DybEventMgr' ] 00028 appMgr.TopAlg = [ 'TESDemoTrim', 00029 'TESDemoFill1', 00030 'TESDemoFill2', 00031 'TESDemoUse' ] 00032 appMgr.EvtMax = 20 00033 appMgr.EvtSel ="" 00034 00035 am = gp.AppMgr() 00036 00037 trimSvc = am.service('ArchiveTrimSvc') 00038 trimSvc.DefaultWindowSeconds = 0.0001 # not in system-of-units time! 00039 00040 fill1 = am.algorithm('TESDemoFill1') 00041 fill1.PositronPercentage = 20 00042 fill2 = am.algorithm('TESDemoFill2') 00043 fill2.NeutronPercentage = 40 00044 00045 am.initialize() 00046 am.run( am.EvtMax ) 00047 am.exit()