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