| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

In This Package:

muon.py

Go to the documentation of this file.
00001 #!/usr/bin/env python
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 
00018 volume = "/dd/Structure/AD/far-oil2"
00019 
00020 
00021 # Set up timerator
00022 tim = app.property("ToolSvc.GtTimeratorTool")
00023 tim.LifeTime = int(1*units.second)
00024 
00025 # Set up positioner
00026 poser = app.property("ToolSvc.GtPositionerTool")
00027 #poser.OutputLevel = 1
00028 poser.Strategy = "FullVolume"
00029 poser.Volume = volume
00030 poser.Mode = "Fixed"
00031 #poser.Mode = "Smeared"
00032 #poser.Spread = 1*units.meter
00033 poser.Position = [0,10,0.0*units.meter]
00034 
00035 # Set up gun
00036 gun = app.property("ToolSvc.GtGunGenTool")
00037 #gun.OutputLevel = 1
00038 gun.Volume = volume
00039 gun.ParticlesPerEvent = 1
00040 gun.ParticleName = "mu+"
00041 gun.Momentum = 10*units.GeV
00042 gun.MomentumMode = "Fixed"
00043 #gun.MomentumSpread = 10*units.GeV
00044 gun.DirectionMode = "Fixed"
00045 
00046 gun.Direction = [ -1,0,0 ] # aim for PMT 
00047 print 'gun.Direction=',gun.Direction
00048 
00049 app.TopAlg += [ "GaudiSequencer/GenSeq" ]
00050 genseq = app.algorithm("GenSeq")
00051 genseq.Members = [ "GtGenerator/GenAlg", "GtHepMCDumper/GenDump" ]
00052 
00053 trans = app.property("ToolSvc.GtTransformTool")
00054 trans.Volume = volume
00055 
00056 
00057 gen = app.algorithm("GenAlg")
00058 #gen.OutputLevel = 1
00059 gen.GenTools = [ "GtGunGenTool", "GtPositionerTool", "GtTimeratorTool", "GtTransformTool" ]
00060 gen.GenName = "Bang Bang"
00061 
00062 #print " GtDumper"
00063 gendump = app.algorithm("GenDump")
00064 
00065 app.ExtSvc += ["GiGa"]
00066 
00067 modularPL = app.property("GiGa.GiGaPhysListModular")
00068 #modularPL.OutputLevel = 1
00069 modularPL.CutForElectron = 100*units.micrometer
00070 modularPL.CutForPositron = 100*units.micrometer
00071 modularPL.CutForGamma = 1*units.millimeter
00072 modularPL.PhysicsConstructors = [ 
00073     "DsPhysConsGeneral", 
00074     "DsPhysConsOptical" 
00075     ]
00076 
00077 giga = app.service("GiGa")
00078 #giga.OutputLevel = 1
00079 giga.PhysicsList = "GiGaPhysListModular"
00080 
00081 gggeo = app.service("GiGaGeo")
00082 #gggeo.OutputLevel = 1
00083 gggeo.XsizeOfWorldVolume = 2.4*units.kilometer
00084 gggeo.YsizeOfWorldVolume = 2.4*units.kilometer
00085 gggeo.ZsizeOfWorldVolume = 2.4*units.kilometer
00086 
00087 
00088 giga.SteppingAction = "GiGaStepActionSequence"
00089 stepseq = app.property("GiGa.GiGaStepActionSequence")
00090 stepseq.Members = ["HistorianStepAction","UnObserverStepAction"]
00091 
00092 app.property("GiGa.GiGaStepActionSequence.UnObserverStepAction").Stats=[
00093     ["MuonTrkLengthInOws","dx","(pdg==13 or pdg==-13) and (MaterialName == '/dd/Materials/Water' and (Volume == '/dd/Structure/Pool/far-ows' or Volume == '/dd/Structure/Pool/db-ows'))"],
00094     ["MuonTrkLengthInIws", "dx", " (pdg==13 or pdg==-13) and ((Volume == '/dd/Structure/Pool/far-iws' or Volume == '/dd/Structure/Pool/db-iws') and MaterialName == '/dd/Materials/Water')"],
00095     ["MuonTrkLengthInLS", "dx", "(pdg==13 or pdg==-13) and MaterialName == '/dd/Materials/LiquidScintillator'"],
00096     ["MuonTrkLengthInGdLS","dx", "(pdg==13 or pdg==-13) and MaterialName == '/dd/Materials/GdDopedLS'"]
00097     ]
00098 
00099 
00100 # Make Geant4 sing!
00101 ggrm = app.property("GiGa.GiGaMgr")
00102 ggrm.Verbosity = 0
00103 event_ac_cmds = app.property("GiGa.GiGaEventActionCommand")
00104 verbosity_cmds = [
00105     "/control/verbose 2",
00106     "/run/verbose 1",
00107     "/event/verbose 2",
00108     "/tracking/verbose 2",
00109     "/geometry/navigator/verbose 2"
00110     ]
00111 quiet_cmds = [
00112     "/control/verbose 1",
00113     "/run/verbose 1",
00114     "/event/verbose 1",
00115     "/tracking/verbose 1",
00116     "/geometry/navigator/verbose 1"
00117     ]
00118 event_ac_cmds.BeginOfEventCommands = quiet_cmds
00119 giga.EventAction = "GiGaEventActionCommand"
00120 
00121 
00122 app.TopAlg += [ "GaudiSequencer/SimSeq" ]
00123 simseq = app.algorithm("SimSeq")
00124 simseq.Members = [ "GiGaInputStream/GGInStream" ]
00125 
00126 ggin = app.algorithm("GGInStream")
00127 #ggin.OutputLevel = 1
00128 ggin.ExecuteOnce = True
00129 ggin.ConversionSvcName = "GiGaGeo"
00130 ggin.DataProviderSvcName = "DetectorDataSvc"
00131 #ggin.StreamItems = [ "/dd/Structure/DayaBay", ]
00132 ggin.StreamItems = [ "/dd/Structure/Sites/far-rock", ]
00133 
00134 simseq.Members += [ "DsPushKine/PushKine", "DsPullEvent/PullEvent" ]
00135 push = app.algorithm("PushKine")
00136 push.Converter = "HepMCtoG4"
00137 
00138 # Class name to use is set in DetDesc xml's "sensdet" attribute.
00139 pmtsd = app.property("GiGaGeo.DsPmtSensDet")
00140 pmtsd.OutputLevel = 1
00141 
00142 histsvc = app.service("THistSvc")
00143 histsvc.Output =["file1 DATAFILE='simvali1.root' OPT='RECREATE' TYP='ROOT' "]
00144 
00145 # Add the GenHist algorithm
00146 #app.TopAlg += ["ValiNTuple/vHalg"]
00147 app.TopAlg += ["DetSimVali/dHalg"]
00148 sh = app.algorithm("dHalg")
00149 sh.Volume=volume
00150 
00151     
00152 app.run(1)
00153     
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

Generated on Mon Apr 11 20:56:26 2011 for DetSimValidation by doxygen 1.4.7