/search.css" rel="stylesheet" type="text/css"/> /search.js">
00001 #!/usr/bin/env python 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 #msg = self.app.service("MessageSvc") 00018 #msg.OutputLevel = 1 00019 00020 #processor 00021 gen = app.algorithm("gunGenerator2") 00022 #gen.OutputLevel = 2 00023 #gen.GenTools = [ "GtHepEvtGenTool", "GtPositionerTool", "GtTimeratorTool" ] 00024 gen.GenTools = [ "GtGunGenTool/Gun2Gen", "GtPositionerTool/Gun2Pos", "GtTimeratorTool/Gun2Tim" ] 00025 gen.GenName = "Bang Bang" 00026 gen.Location = "/Event/Gen/HepMCEvents" # this is default anyways 00027 00028 00029 # 00030 from GaudiKernel import SystemOfUnits as units 00031 00032 00033 # Set up gun 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 # Set up positioner 00042 #print " Creating poser" 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" # also "AvoidDaughters" and "Surface" 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 # Set up timerator 00051 app.property('ToolSvc.Gun2Tim').LifeTime = int(5*units.ns) 00052 00053 00054 return