Public Member Functions | |
def | __init__ |
Definition at line 3 of file adgun.py.
def adgun::MyGenToolsConfig::__init__ | ( | self, | ||
volume | ||||
) |
Definition at line 4 of file adgun.py.
00004 : 00005 from GaudiPython import AppMgr 00006 from GaudiKernel import SystemOfUnits as units 00007 00008 app = AppMgr() 00009 app.TopAlg = [] 00010 00011 # Set up timerator 00012 import GaudiKernel.SystemOfUnits as units 00013 tim = app.property("ToolSvc.GtTimeratorTool") 00014 tim.LifeTime = int(1*units.second) 00015 00016 # Set up positioner 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 # Set up gun 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 #gun.ParticleName = "mu+" 00031 #gun.Momentum = 10*units.GeV 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 ] # aim for PMT 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" # this is default anyways 00050 00051 #print " GtDumper" 00052 gendump = app.algorithm("GenDump") 00053 gendump.Location = "/Event/Gen/HepMCEvents" # this is default anyways. 00054 00055 00056 ####################################################################### 00057 app.ExtSvc += ["GiGa"] 00058 00059 modularPL = app.property("GiGa.GiGaPhysListModular") 00060 modularPL.OutputLevel = 0 00061 modularPL.CutForElectron = 100*units.micrometer 00062 modularPL.CutForPositron = 100*units.micrometer 00063 modularPL.CutForGamma = 1*units.millimeter 00064 modularPL.PhysicsConstructors = [ 00065 "DsPhysConsGeneral", 00066 "DsPhysConsOptical" 00067 ] 00068 00069 giga = app.service("GiGa") 00070 giga.OutputLevel = 0 00071 giga.PhysicsList = "GiGaPhysListModular" 00072 00073 gggeo = app.service("GiGaGeo") 00074 gggeo.OutputLevel = 0 00075 gggeo.XsizeOfWorldVolume = 2.4*units.kilometer 00076 gggeo.YsizeOfWorldVolume = 2.4*units.kilometer 00077 gggeo.ZsizeOfWorldVolume = 2.4*units.kilometer 00078 00079 # Make Geant4 sing! 00080 ggrm = app.property("GiGa.GiGaMgr") 00081 ggrm.Verbosity = 0 00082 event_ac_cmds = app.property("GiGa.GiGaEventActionCommand") 00083 event_ac_cmds.BeginOfEventCommands = [ 00084 "/control/verbose 0", 00085 "/run/verbose 0", 00086 "/event/verbose 0", 00087 "/tracking/verbose 0", 00088 "/geometry/navigator/verbose 0" 00089 ] 00090 giga.EventAction = "GiGaEventActionCommand" 00091 00092 00093 app.TopAlg += [ "GaudiSequencer/SimSeq" ] 00094 simseq = app.algorithm("SimSeq") 00095 simseq.Members = [ "GiGaInputStream/GGInStream" ] 00096 00097 ggin = app.algorithm("GGInStream") 00098 ggin.OutputLevel = 0 00099 ggin.ExecuteOnce = True 00100 ggin.ConversionSvcName = "GiGaGeo" 00101 ggin.DataProviderSvcName = "DetectorDataSvc" 00102 ggin.StreamItems = [ 00103 "/dd/Structure/Sites/la-rock", 00104 #"/dd/Structure/AD/far-ade3", 00105 ] 00106 00107 simseq.Members += [ "DetSimProc/DetSim" ] 00108 ds = app.algorithm("DetSim") 00109 ds.OutputLevel = 1 00110 ds.Converter = "HepMCtoG4" 00111 00112 # Class name to use is set in DetDesc xml's "sensdet" attribute. 00113 pmtsd = app.property("GiGaGeo.DsPmtSensDet") 00114 pmtsd.OutputLevel = 0 00115 00116 return 00117 if '__main__' == __name__: