/search.css" rel="stylesheet" type="text/css"/> /search.js">
00001 #!/usr/bin/env python 00002 00003 def gunGenerator(volume): 00004 00005 00006 import GaudiPython as gm 00007 app = gm.AppMgr() 00008 #msg = self.app.service("MessageSvc") 00009 #msg.OutputLevel = 1 00010 00011 #processor 00012 gen = app.algorithm("gunGenerator") 00013 #gen.OutputLevel = 2 00014 #gen.GenTools = [ "GtHepEvtGenTool", "GtPositionerTool", "GtTimeratorTool" ] 00015 gen.GenTools = [ "GtGunGenTool/GunGen", "GtPositionerTool/GunPos", "GtTimeratorTool/GunTim" ] 00016 gen.GenName = "Bang Bang" 00017 gen.Location = "/Event/Gen/HepMCEvents" # this is default anyways 00018 # 00019 from GaudiKernel import SystemOfUnits as units 00020 00021 00022 # Set up gun 00023 app.property('ToolSvc.GunGen').OutputLevel = 0 00024 app.property('ToolSvc.GunGen').Volume=volume 00025 ##app.property('ToolSvc.GunGen').ParticleName = "mu+" 00026 app.property('ToolSvc.GunGen').ParticleName = "opticalphoton" 00027 app.property('ToolSvc.GunGen').ParticlesPerEvent = 100 00028 00029 app.property('ToolSvc.GunGen').MomentumMode = "Fixed" 00030 app.property('ToolSvc.GunGen').Momentum = 2.5*units.eV 00031 app.property('ToolSvc.GunGen').DirectionMode = "Fixed" 00032 from math import sin, cos, pi 00033 pmt_column_number = 9 00034 angle = (2*pmt_column_number - 1)*pi/24.0; 00035 app.property('ToolSvc.GunGen').Direction = [ cos(angle),sin(angle),0 ] 00036 00037 # Set up positioner 00038 #print " Creating poser" 00039 app.property('ToolSvc.GunPos').OutputLevel = 2 00040 # app.property('ToolSvc.GunPos').Volume = "/dd/Structure/steel-2/water-2" 00041 app.property('ToolSvc.GunPos').Volume = volume 00042 app.property('ToolSvc.GunPos').Strategy = "FullVolume" # also "AvoidDaughters" and "Surface" 00043 app.property('ToolSvc.GunPos').Mode = "Uniform" 00044 app.property('ToolSvc.GunPos').Spread = 10*units.cm 00045 app.property('ToolSvc.GunPos').Position = [0,0,5.0/16.0*units.meter] 00046 00047 # Set up timerator 00048 app.property('ToolSvc.GunTim').LifeTime = int(5*units.ns) 00049 00050 00051 return