00001
00002
00003 class MyGenToolsConfig:
00004 def __init__(self,volume):
00005 from GaudiPython import AppMgr
00006 from GaudiKernel import SystemOfUnits as units
00007
00008 app = AppMgr()
00009 app.TopAlg = []
00010
00011
00012 import GaudiKernel.SystemOfUnits as units
00013 tim = app.property("ToolSvc.GtTimeratorTool")
00014 tim.LifeTime = int(1*units.second)
00015
00016
00017 poser = app.property("ToolSvc.GtPositionerTool")
00018 poser.Volume = volume
00019 poser.Mode = "Fixed"
00020 poser.Position = [0,0,5.0/16.0*units.meter]
00021 poser.OutputLevel = 7
00022
00023
00024 gun = app.property("ToolSvc.GtGunGenTool")
00025 gun.OutputLevel = 7
00026 gun.Volume = volume
00027 gun.ParticlesPerEvent = 1
00028 gun.ParticleName = "opticalphoton"
00029 gun.Momentum = 2.5*units.eV
00030
00031
00032 gun.MomentumMode = "Fixed"
00033 gun.DirectionMode = "Fixed"
00034 from math import sin, cos, pi
00035 pmt_column_number = 9
00036 angle = (2*pmt_column_number - 1)*pi/24.0;
00037 gun.Direction = [ cos(angle),sin(angle),0 ]
00038 print 'gun.Direction=',gun.Direction
00039
00040 app.TopAlg += [ "GaudiSequencer/GenSeq" ]
00041 genseq = app.algorithm("GenSeq")
00042 genseq.Members = [ "GtGenerator/GenAlg", "GtHepMCDumper/GenDump" ]
00043
00044
00045 gen = app.algorithm("GenAlg")
00046 gen.OutputLevel = 7
00047 gen.GenTools = [ "GtGunGenTool", "GtPositionerTool", "GtTimeratorTool" ]
00048 gen.GenName = "Bang Bang"
00049 gen.Location = "/Event/Gen/HepMCEvents"
00050
00051
00052 gendump = app.algorithm("GenDump")
00053 gendump.Location = "/Event/Gen/HepMCEvents"
00054
00055 return
00056
00057 if '__main__' == __name__:
00058
00059 from GaudiPython import AppMgr
00060
00061 app = AppMgr()
00062 app.EvtSel = "NONE"
00063
00064 gtc = MyGenToolsConfig(volume="/dd/Structure/AD/la-oil2")
00065
00066
00067 app.TopAlg += [ "GiGaInputStream/GGInStream" ]
00068 from GGInStream import *
00069 GGInStream()
00070
00071 app.TopAlg += [ "DetSimProc/DetSim" ]
00072 from DetSimProc import *
00073 DetSim()
00074
00075
00076
00077 app.run(2)
00078