00001
00002
00003 def gunGenerator2():
00004 import os
00005 loc = os.getenv('XMLDETDESCROOT')
00006 if not loc:
00007 raise RuntimeError,"Location of DetDesc XML file not specified"
00008 loc += "/DDDB/pmtbox.xml"
00009
00010 import xmldetdesc
00011 xddc = xmldetdesc.XmlDetDescConfig(loc=loc)
00012
00013
00014
00015 import GaudiPython as gm
00016 app = gm.AppMgr()
00017
00018
00019
00020
00021 gen = app.algorithm("gunGenerator2")
00022
00023
00024 gen.GenTools = [ "GtGunGenTool/Gun2Gen", "GtPositionerTool/Gun2Pos", "GtTimeratorTool/Gun2Tim" ]
00025 gen.GenName = "Bang Bang"
00026 gen.Location = "/Event/Gen/HepMCEvents"
00027
00028
00029
00030 from GaudiKernel import SystemOfUnits as units
00031
00032
00033
00034 app.property('ToolSvc.Gun2Gen').OutputLevel = 2
00035 app.property('ToolSvc.Gun2Gen').ParticleName = "opticalphoton"
00036 app.property('ToolSvc.Gun2Gen').MomentumMode = "Fixed"
00037 app.property('ToolSvc.Gun2Gen').Momentum = 3.5*units.eV
00038 app.property('ToolSvc.Gun2Gen').DirectionMode = "Fixed"
00039 app.property('ToolSvc.Gun2Gen').Direction = [ 0.0,0.0,-1.0 ]
00040
00041
00042
00043 app.property('ToolSvc.Gun2Pos').OutputLevel = 2
00044 app.property('ToolSvc.Gun2Pos').Volume = "/dd/Structure/steel-2/water-2"
00045 app.property('ToolSvc.Gun2Pos').Strategy = "FullVolume"
00046 app.property('ToolSvc.Gun2Pos').Mode = "Uniform"
00047 app.property('ToolSvc.Gun2Pos').Spread = 10*units.cm
00048 app.property('ToolSvc.Gun2Pos').Position = [0,0,0]
00049
00050
00051 app.property('ToolSvc.Gun2Tim').LifeTime = int(5*units.ns)
00052
00053
00054 return