00001
00002 """Test out GtBeamerTool"""
00003
00004 from GaudiKernel import SystemOfUnits as units
00005
00006 def config_geom():
00007 print "\tConfiguring geometry...",
00008 import xmldetdesc
00009 xmldetdesc.config()
00010 print "done"
00011
00012 def config_kin(app):
00013
00014
00015
00016 import GaudiKernel.SystemOfUnits as units
00017 tim = app.property("ToolSvc.GtTimeratorTool")
00018 tim.LifeTime = int(1*units.second)
00019 tim.OutputLevel = 1
00020
00021 beam_ad = True
00022 beam = app.property("ToolSvc.GtBeamerTool")
00023 beam.OutputLevel = 1
00024 beam.Radius = 5*units.cm
00025 beam.ParticlesPerEvent = 10000
00026 beam.ParticleName = "opticalphoton"
00027 beam.Momentum = 2.5*units.eV
00028
00029 beam.TargetOffset = [0,0,100.0*units.mm]
00030 beam.SourceDirection = [0,0,-1.0]
00031 beam.SourceDistance = 2.0*units.meter
00032
00033
00034 beam.TargetOffset = [0, 0, 60*units.cm]
00035 beam.SourceDistance = 1.0*units.meter
00036
00037
00038 if beam_ad:
00039 beam.TargetElement = "/dd/Structure/AD/far-oil2/far-ad2-ring5-column1"
00040 else:
00041 beam.TargetElement = "/dd/Structure/Pool/far-iws/far-InnFin-wall9-id29"
00042 ang=0*units.degree
00043 pass
00044
00045
00046
00047 app.TopAlg += [ "GaudiSequencer/GenSeq" ]
00048 genseq = app.algorithm("GenSeq")
00049 genseq.Members = [ "GtGenerator/GenAlg",
00050
00051 ]
00052
00053 gen = app.algorithm("GenAlg")
00054 gen.OutputLevel = 1
00055 gen.GenTools = [ "GtBeamerTool", "GtTimeratorTool" ]
00056 gen.GenName = "Beam Beam"
00057
00058 return
00059
00060 def config_sim(app):
00061
00062 app.ExtSvc += ["GiGa"]
00063
00064 modularPL = app.property("GiGa.GiGaPhysListModular")
00065
00066 modularPL.CutForElectron = 100*units.micrometer
00067 modularPL.CutForPositron = 100*units.micrometer
00068 modularPL.CutForGamma = 1*units.millimeter
00069 modularPL.PhysicsConstructors = [
00070 "DsPhysConsGeneral",
00071 "DsPhysConsOptical",
00072
00073
00074
00075
00076 ]
00077 optical = app.property("GiGa.GiGaPhysListModular.DsPhysConsOptical")
00078 optical.UseScintillation = False
00079
00080 giga = app.service("GiGa")
00081
00082 giga.PhysicsList = "GiGaPhysListModular"
00083
00084 gggeo = app.service("GiGaGeo")
00085
00086 gggeo.XsizeOfWorldVolume = 2.4*units.kilometer
00087 gggeo.YsizeOfWorldVolume = 2.4*units.kilometer
00088 gggeo.ZsizeOfWorldVolume = 2.4*units.kilometer
00089
00090
00091
00092
00093
00094
00095 ggrm = app.property("GiGa.GiGaMgr")
00096 ggrm.Verbosity = 0
00097 event_ac_cmds = app.property("GiGa.GiGaEventActionCommand")
00098 event_ac_cmds.BeginOfEventCommands = [
00099 "/control/verbose 0",
00100 "/run/verbose 0",
00101 "/event/verbose 0",
00102 "/tracking/verbose 0",
00103 "/geometry/navigator/verbose 0"
00104 ]
00105 giga.EventAction = "GiGaEventActionCommand"
00106
00107 app.TopAlg += [ "GaudiSequencer/SimSeq" ]
00108 simseq = app.algorithm("SimSeq")
00109 simseq.Members = [ "GiGaInputStream/GGInStream" ]
00110
00111 ggin = app.algorithm("GGInStream")
00112
00113 ggin.ExecuteOnce = True
00114 ggin.ConversionSvcName = "GiGaGeo"
00115 ggin.DataProviderSvcName = "DetectorDataSvc"
00116 ggin.StreamItems = [ "/dd/Structure/Sites/far-rock",
00117 "/dd/Geometry/AdDetails/AdSurfacesAll",
00118 "/dd/Geometry/AdDetails/AdSurfacesFar",
00119 "/dd/Geometry/PoolDetails/FarPoolSurfaces",
00120 "/dd/Geometry/PoolDetails/PoolSurfacesAll",
00121 ]
00122
00123 simseq.Members += [ "DsPushKine/PushKine", "DsPullEvent/PullEvent" ]
00124 push = app.algorithm("PushKine")
00125 push.Converter = "HepMCtoG4"
00126
00127 pull = app.algorithm("PullEvent")
00128
00129
00130 pmtsd = app.property("GiGaGeo.DsPmtSensDet")
00131 pmtsd.OutputLevel = 1
00132 return
00133
00134
00135 config_geom()
00136
00137 from GaudiPython import AppMgr
00138
00139 app = AppMgr()
00140 app.TopAlg = []
00141
00142
00143 config_kin(app)
00144 config_sim(app)
00145
00146
00147 app.EvtSel = "NONE"
00148
00149
00150 app.run(1)