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

In This Package:

beamer.py

Go to the documentation of this file.
00001 #!/usr/bin/env python
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     # Set up timerator
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     # move from face-RoC to PMT equator
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     #beam.Radius=10*units.cm
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                        #"GtHepMCDumper/GenDump" 
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     #modularPL.OutputLevel = 1
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         #"DsPhysConsEM",
00073         #"DsPhysConsElectroNu",
00074         #"DsPhysConsHadron",
00075         #"DsPhysConsIon"
00076         ]
00077     optical = app.property("GiGa.GiGaPhysListModular.DsPhysConsOptical")
00078     optical.UseScintillation = False
00079 
00080     giga = app.service("GiGa")
00081     #giga.OutputLevel = 1
00082     giga.PhysicsList = "GiGaPhysListModular"
00083 
00084     gggeo = app.service("GiGaGeo")
00085     #gggeo.OutputLevel = 1
00086     gggeo.XsizeOfWorldVolume = 2.4*units.kilometer
00087     gggeo.YsizeOfWorldVolume = 2.4*units.kilometer
00088     gggeo.ZsizeOfWorldVolume = 2.4*units.kilometer
00089 
00090     #giga.SteppingAction = "GiGaStepActionSequence"
00091     #stepseq = app.property("GiGa.GiGaStepActionSequence")
00092     #stepseq.Members = ["HistorianStepAction","UnObserverStepAction"]
00093 
00094     # Make Geant4 sing!
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     #ggin.OutputLevel = 1
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     # Class name to use is set in DetDesc xml's "sensdet" attribute.
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)
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

Generated on Mon Apr 11 20:53:23 2011 for DetSim by doxygen 1.4.7