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

In This Package:

detsim.py

Go to the documentation of this file.
00001 #!/usr/bin/env python
00002 
00003 # This is an EXAMPLE of how to setup DetSim
00004 
00005 class DetSimConfig:
00006     def __init__(self):
00007         import GaudiPython as gm
00008         from GaudiKernel import SystemOfUnits as units
00009         app = gm.AppMgr()
00010         app.ExtSvc += ["GiGa"]
00011 
00012         # Connection to Geant4
00013         giga = app.service("GiGa")
00014         giga.OutputLevel = 1
00015 
00016         # Physics List
00017         modularPL = app.property("GiGa.GiGaPhysListModular")
00018         modularPL.OutputLevel = 1
00019         modularPL.CutForElectron = 100*units.micrometer
00020         modularPL.CutForPositron = 100*units.micrometer
00021         modularPL.CutForGamma = 1*units.millimeter
00022         modularPL.PhysicsConstructors = [ 
00023             "DsPhysConsGeneral", 
00024             "DsPhysConsOptical",
00025             #"DsPhysConsEM",
00026             #"DsPhysConsHadron",
00027             #"DsPhysConsXxx",
00028             ]
00029         giga.PhysicsList = "GiGaPhysListModular"
00030 
00031         gggeo = app.service("GiGaGeo")
00032         gggeo.OutputLevel = 1
00033 
00034         # Make Geant4 sing!
00035         ggrm = app.property("GiGa.GiGaMgr")
00036         ggrm.Verbosity = 9
00037         event_ac_cmds = app.property("GiGa.GiGaEventActionCommand")
00038         event_ac_cmds.BeginOfEventCommands = [
00039             "/control/verbose 2",
00040             "/run/verbose 1",
00041             "/event/verbose 2",
00042             "/tracking/verbose 2",
00043             "/geometry/navigator/verbose 2"
00044             ]
00045         giga.EventAction = "GiGaEventActionCommand"
00046 
00047 
00048         app.TopAlg += [ "GaudiSequencer/Simulation" ]
00049         seq = app.algorithm("Simulation")
00050         seq.Members = []
00051 
00052         seq.Members += [ "GiGaInputStream/GGInStream" ]
00053         ggin = app.algorithm("GGInStream")
00054         ggin.OutputLevel = 1
00055         ggin.ExecuteOnce = True
00056         ggin.ConversionSvcName = "GiGaGeo"
00057         ggin.DataProviderSvcName = "DetectorDataSvc"
00058         ggin.StreamItems = [
00059             "/dd/Structure/Sites/far-rock"
00060             "/dd/Geometry/PMT/PmtSurfaces",
00061             #"/dd/Structure/pmt-box-array",
00062             ]
00063 
00064         seq.Members += [ "DsPushKine/PushKine", "DsPullEvent/PullEvent" ]
00065         push = app.algorithm("PushKine")
00066         push.Converter = "HepMCtoG4"
00067 
00068         
00069 
00070 
00071 if '__main__' == __name__:
00072     import xmldetdesc,gentools,os
00073     loc = os.getenv('XMLDETDESCROOT')
00074     if not loc:
00075         raise RuntimeError,"Location of DetDesc XML file not specified"
00076     loc += "/DDDB/dayabay.xml"
00077     xddc = xmldetdesc.XmlDetDescConfig(loc=loc)
00078     tg = gentools.GenToolsConfig(volume="/dd/Geometry/Pool/lvFarPoolIWS")
00079     dsc = DetSimConfig()
00080     
00081     import gaudimodule as gm
00082     app = gm.AppMgr()
00083     app.EvtSel = "NONE"
00084     app.run(10)
00085     
| 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