00001
00002
00003 from GaudiPython import AppMgr
00004 from GaudiKernel import SystemOfUnits as units
00005
00006 import os,sys
00007
00008 print "\tBuilding detector\n"
00009 import xmldetdesc
00010 xmldetdesc.config()
00011
00012 from GaudiPython import AppMgr
00013 app = AppMgr()
00014 app.TopAlg = []
00015 app.EvtSel = "NONE"
00016
00017 eds=app.service("EventDataSvc")
00018 eds.ForceLeaves=True
00019
00020 volume = "/dd/Structure/Pool/far-iws"
00021
00022
00023
00024 tim = app.property("ToolSvc.GtTimeratorTool")
00025 tim.LifeTime = int(1*units.second)
00026
00027
00028 trans = app.property("ToolSvc.GtTransformTool")
00029 trans.Volume = volume
00030 trans.Offset=[0., 0., -0.418*units.meter]
00031
00032
00033 hep = app.property("ToolSvc.GtHepEvtGenTool")
00034
00035 hep.HepEvtDataSource="/mnt/scratch/02/dayabay/kevin/NuWa-trunk/dybgaudi/Generators/Muon/Linux-i686/Muon.exe -n 1000 -s DYB -music_dir /mnt/scratch/02/dayabay/kevin/NuWa-trunk/dybgaudi/Generators/Muon/data|"
00036
00037
00038 app.TopAlg += [ "GaudiSequencer/GenSeq" ]
00039 genseq = app.algorithm("GenSeq")
00040 genseq.Members = [ "GtGenerator/GenAlg", "GtHepMCDumper/GenDump" ]
00041
00042
00043 gen = app.algorithm("GenAlg")
00044
00045 gen.GenTools = [ "GtHepEvtGenTool", "GtTimeratorTool", "GtTransformTool" ]
00046 gen.GenName = "Test Bang"
00047 gen.Location = "/Event/Gen/GenHeader"
00048
00049
00050 app.ExtSvc += ["GiGa"]
00051
00052 modularPL = app.property("GiGa.GiGaPhysListModular")
00053
00054 modularPL.CutForElectron = 100*units.micrometer
00055 modularPL.CutForPositron = 100*units.micrometer
00056 modularPL.CutForGamma = 1*units.millimeter
00057 modularPL.PhysicsConstructors = [
00058 "DsPhysConsGeneral",
00059 "DsPhysConsOptical",
00060 "DsPhysConsEM",
00061 "DsPhysConsElectroNu",
00062 "DsPhysConsHadron",
00063 "DsPhysConsIon"
00064 ]
00065 optical = app.property("GiGa.GiGaPhysListModular.DsPhysConsOptical")
00066 optical.CerenPhotonScaleWeight=3.0
00067 optical.ScintPhotonScaleWeight=3.0
00068 optical.UseScintillation = False
00069
00070 giga = app.service("GiGa")
00071
00072 giga.PhysicsList = "GiGaPhysListModular"
00073
00074 gggeo = app.service("GiGaGeo")
00075
00076 gggeo.XsizeOfWorldVolume = 2.4*units.kilometer
00077 gggeo.YsizeOfWorldVolume = 2.4*units.kilometer
00078 gggeo.ZsizeOfWorldVolume = 2.4*units.kilometer
00079
00080
00081 giga.SteppingAction = "GiGaStepActionSequence"
00082 stepseq = app.property("GiGa.GiGaStepActionSequence")
00083 stepseq.Members = ["HistorianStepAction","UnObserverStepAction"]
00084
00085 app.property("GiGa.GiGaStepActionSequence.UnObserverStepAction").Stats=[
00086 ["trkLeng_ows","dx","MaterialName == '/dd/Materials/Water' and Volume == '/dd/Pool/lvFarPoolOWS'"],
00087 ["trkLeng_iws","dx","MaterialName == '/dd/Materials/Water' and Volume == '/dd/Pool/lvFarPoolIWS'"]
00088 ]
00089
00090
00091 ggrm = app.property("GiGa.GiGaMgr")
00092 ggrm.Verbosity = 9
00093 event_ac_cmds = app.property("GiGa.GiGaEventActionCommand")
00094 verbosity_cmds = [
00095 "/control/verbose 2",
00096 "/run/verbose 1",
00097 "/event/verbose 2",
00098 "/tracking/verbose 2",
00099 "/geometry/navigator/verbose 2"
00100 ]
00101 quiet_cmds = [
00102 "/control/verbose 1",
00103 "/run/verbose 1",
00104 "/event/verbose 1",
00105 "/tracking/verbose 1",
00106 "/geometry/navigator/verbose 1"
00107 ]
00108 event_ac_cmds.BeginOfEventCommands = quiet_cmds
00109 giga.EventAction = "GiGaEventActionCommand"
00110
00111
00112 app.TopAlg += [ "GaudiSequencer/SimSeq" ]
00113 simseq = app.algorithm("SimSeq")
00114 simseq.Members = [ "GiGaInputStream/GGInStream" ]
00115
00116 ggin = app.algorithm("GGInStream")
00117
00118 ggin.ExecuteOnce = True
00119 ggin.ConversionSvcName = "GiGaGeo"
00120 ggin.DataProviderSvcName = "DetectorDataSvc"
00121
00122 ggin.StreamItems = [ "/dd/Structure/Sites/far-rock", ]
00123
00124 simseq.Members += [ "DsPushKine/PushKine", "DsPullEvent/PullEvent" ]
00125 push = app.algorithm("PushKine")
00126 push.Converter = "HepMCtoG4"
00127
00128
00129 pmtsd = app.property("GiGaGeo.DsPmtSensDet")
00130 pmtsd.OutputLevel = 1
00131
00132
00133 histsvc = app.service("THistSvc")
00134 histsvc.Output =["file1 DATAFILE='simvali.root' OPT='RECREATE' TYP='ROOT' "]
00135
00136
00137
00138 app.TopAlg += ["DetSimVali/vHalg"]
00139 sh = app.algorithm("vHalg")
00140
00141
00142 app.run(1)
00143