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

In This Package:

ranNearMuon.py

Go to the documentation of this file.
00001 #!/usr/bin/env python
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/db-ows"
00018 
00019 gen = app.algorithm("GenAlg")
00020 #gen.OutputLevel = 3
00021 
00022 gen.GenTools = [ "GtHepEvtGenTool", "GtTimeratorTool", "GtTransformTool" ]
00023 gen.GenName = "Test Bang"
00024 gen.Location = "/Event/Gen/GenHeader" # this is default anyways
00025 
00026 # Set up timerator
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] # 0.042m is half dead size
00033 
00034 
00035 # Set up gun
00036 hep = app.property("ToolSvc.GtHepEvtGenTool")
00037 #hep.OutputLevel=3
00038 hep.HepEvtDataSource="/mnt/scratch/02/dayabay/kevin/NuWa-trunk/dybkevin/Generators/Muon/Linux-i686/Muon.exe -n 1000 -s DYB -r Yes -music_dir /mnt/scratch/02/dayabay/kevin/NuWa-trunk/dybkevin/Generators/Muon/data/NewMuonGenerator/data|"
00039 
00040 app.TopAlg += [ "GaudiSequencer/GenSeq" ]
00041 genseq = app.algorithm("GenSeq")
00042 genseq.Members = [ "GtGenerator/GenAlg", "GtHepMCDumper/GenDump" ]
00043 
00044 
00045 print " GtDumper"
00046 gendump = app.algorithm("GenDump")
00047 gendump.Location = "/Event/Gen/GenHeader"  # this is default anyways.
00048 
00049 app.ExtSvc += ["GiGa"]
00050 
00051 modularPL = app.property("GiGa.GiGaPhysListModular")
00052 #modularPL.OutputLevel = 1
00053 modularPL.CutForElectron = 100*units.micrometer
00054 modularPL.CutForPositron = 100*units.micrometer
00055 modularPL.CutForGamma = 1*units.millimeter
00056 modularPL.PhysicsConstructors = [ 
00057     "DsPhysConsGeneral", 
00058     "DsPhysConsOptical", 
00059     "DsPhysConsEM",
00060     "DsPhysConsElectroNu",
00061     "DsPhysConsHadron",
00062     "DsPhysConsIon"
00063     ]
00064 optical = app.property("GiGa.GiGaPhysListModular.DsPhysConsOptical")
00065 optical.CerenPhotonScaleWeight=3.0
00066 optical.ScintPhotonScaleWeight=3.0
00067 optical.UseScintillation = False
00068 
00069 giga = app.service("GiGa")
00070 #giga.OutputLevel = 1
00071 giga.PhysicsList = "GiGaPhysListModular"
00072 
00073 
00074 #giga.StackingAction="DsOpStackAction"
00075 
00076 gggeo = app.service("GiGaGeo")
00077 #gggeo.OutputLevel = 1
00078 gggeo.XsizeOfWorldVolume = 2.4*units.kilometer
00079 gggeo.YsizeOfWorldVolume = 2.4*units.kilometer
00080 gggeo.ZsizeOfWorldVolume = 2.4*units.kilometer
00081 
00082 
00083 giga.SteppingAction = "GiGaStepActionSequence"
00084 stepseq = app.property("GiGa.GiGaStepActionSequence")
00085 stepseq.Members = ["HistorianStepAction","UnObserverStepAction"]
00086 
00087 
00088 TH2DE="TH2DE"       # TH2DE is the fastest
00089 #TH2DE="TouchableToDetectorElementFast"
00090 historian = app.property("GiGa.GiGaStepActionSequence.HistorianStepAction")
00091 historian.TouchableToDetelem = TH2DE
00092 historian.TrackSelection="pdg==13 or pdg==-13"
00093 #historian.VertexSelection="MaterialName == '/dd/Materials/GdDopedLS'"
00094 
00095 app.property("GiGa.GiGaStepActionSequence.UnObserverStepAction").Stats=[
00096     ["MuonTrkLengthInOws","dx","(pdg==13 or pdg==-13) and MaterialName == '/dd/Materials/OwsWater'"],
00097     ["MuonTrkLengthInIws", "dx", " (pdg==13 or pdg==-13) and MaterialName == '/dd/Materials/IwsWater'"],
00098     ["MuonTrkLengthInLS", "dx", "(pdg==13 or pdg==-13) and MaterialName == '/dd/Materials/LiquidScintillator'"],
00099     ["MuonTrkLengthInGdLS","dx", "(pdg==13 or pdg==-13) and MaterialName == '/dd/Materials/GdDopedLS'"],
00100     ["MuonStop", "dx", "(pdg==13 or pdg==-13) and (IsStopping>0)"],    
00101 
00102     ]
00103 
00104 
00105 eds=app.service("EventDataSvc")
00106 eds.ForceLeaves=True
00107 
00108 cor=app.service("CoordiSysSvc")
00109 cor.OutputLevel=6
00110 
00111 
00112 
00113 # Make Geant4 sing!
00114 ggrm = app.property("GiGa.GiGaMgr")
00115 #ggrm.Verbosity = 0
00116 event_ac_cmds = app.property("GiGa.GiGaEventActionCommand")
00117 verbosity_cmds = [
00118     "/control/verbose 2",
00119     "/run/verbose 1",
00120     "/event/verbose 2",
00121     "/tracking/verbose 2",
00122     "/geometry/navigator/verbose 2"
00123     ]
00124 quiet_cmds = [
00125     "/control/verbose 0",
00126     "/run/verbose 0",
00127     "/event/verbose 0",
00128     "/tracking/verbose 0",
00129     "/geometry/navigator/verbose 0"
00130     ]
00131 event_ac_cmds.BeginOfEventCommands = quiet_cmds
00132 giga.EventAction = "GiGaEventActionCommand"
00133 
00134 
00135 app.TopAlg += [ "GaudiSequencer/SimSeq" ]
00136 simseq = app.algorithm("SimSeq")
00137 simseq.Members = [ "GiGaInputStream/GGInStream" ]
00138 
00139 ggin = app.algorithm("GGInStream")
00140 #ggin.OutputLevel = 3
00141 ggin.ExecuteOnce = True
00142 ggin.ConversionSvcName = "GiGaGeo"
00143 ggin.DataProviderSvcName = "DetectorDataSvc"
00144 ggin.StreamItems = [ "/dd/Structure/Sites/db-rock",
00145                      "/dd/Geometry/AdDetails/AdSurfacesAll",
00146                      "/dd/Geometry/AdDetails/AdSurfacesNear",
00147                       "/dd/Geometry/PoolDetails/NearPoolSurfaces",
00148                      "/dd/Geometry/PoolDetails/PoolSurfacesAll",
00149                      ]
00150 
00151 
00152 
00153 simseq.Members += [ "DsPushKine/PushKine", "DsPullEvent/PullEvent" ]
00154 push = app.algorithm("PushKine")
00155 push.Converter = "HepMCtoG4"
00156 
00157 # Class name to use is set in DetDesc xml's "sensdet" attribute.
00158 pmtsd = app.property("GiGaGeo.DsPmtSensDet")
00159 #pmtsd.OutputLevel = 3
00160 
00161 
00162 histsvc = app.service("THistSvc")
00163 p1='/mnt/scratch/04/dayabay/kevin/FastTest/DB'+sys.argv[1]+'.root'
00164 outset="file1 DATAFILE='%s' OPT='RECREATE' TYP='ROOT' "%p1
00165 histsvc.Output =[outset]
00166 
00167 # Add the GenHist algorithm
00168 app.TopAlg += ["DetSimVali/vHalg"]
00169 vali = app.algorithm("vHalg")
00170 #vali.OutPutLevel=3
00171 vali.Volume=volume
00172 
00173 app.run(200)
00174     
| 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