Public Member Functions | |
def | __init__ |
configure gun generator
Definition at line 8 of file gun.py.
def Stage::gun::gun::__init__ | ( | self, | ||
stage = 'null' , |
||||
name = 'gun' , |
||||
volume = '/dd/Structure/DayaBay' , |
||||
start_time = 0 | ||||
) |
Definition at line 11 of file gun.py.
00017 : 00018 00019 # set up Gnrtr itself 00020 from Gnrtr.GnrtrConf import Gnrtr 00021 gnrtr = Gnrtr(name); 00022 00023 gnrtr.GenTools = [ "GtGunGenTool/"+name+"Gen", 00024 "GtPositionerTool/"+name+"Pos", 00025 "GtTimeratorTool/"+name+"Tim", 00026 "GtTransformTool/"+name+"Tra"] 00027 00028 gnrtr.ThisStageName = "Kinematic" 00029 gnrtr.TimeStamp = start_time 00030 00031 if stage != 'null': 00032 stage.KinematicSequence.Members.append(gnrtr) 00033 00034 # set up each tools 00035 from GaudiKernel import SystemOfUnits as units 00036 from GenTools.GenToolsConf import GtPositionerTool, GtTransformTool, GtTimeratorTool 00037 00038 # generator 00039 from GenTools.GenToolsConf import GtGunGenTool 00040 gun = GtGunGenTool(name+"Gen") 00041 gun.ParticlesPerEvent = 1000 00042 gun.ParticleName = "opticalphoton" 00043 gun.Momentum = 2*units.eV 00044 gun.MomentumMode = "Fixed" 00045 gun.MomentumSpread = 0*units.eV 00046 gun.DirectionMode = "Fixed" 00047 gun.Direction = [ 2.52361587010091171, 00048 -0.129228715901263058, 00049 -3.46788066267345130 ] 00050 gun.DirectionSpread = 0 00051 00052 # Set up positioner 00053 pos=GtPositionerTool(name+'Pos',Volume=volume) 00054 pos.Strategy = "FullVolume" # also "AvoidDaughters" and "Surface" 00055 #pos.Mode = "Uniform" 00056 #pos.Mode = "Fixed" 00057 pos.Mode = "Smeared" 00058 pos.Spread = 5*units.mm 00059 pos.Position = [-411762.29689663457*units.mm, 00060 817680.94560857571*units.mm, 00061 -1890.6120407181961*units.mm] 00062 #pos.Position = [-411763.29689663457*units.mm, 00063 # 817680.94560857571*units.mm, 00064 # -1889.6120407181961*units.mm] 00065 00066 # Set up timerator 00067 tim=GtTimeratorTool(name+'Tim') 00068 tim.LifeTime = int(30000000*units.ns) 00069 00070 # transform 00071 tra=GtTransformTool(name+'Tra',Volume=volume) 00072 pass