| 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 = 0
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         ggin = app.algorithm("GGInStream")
00053         ggin.OutputLevel = 1
00054         ggin.ExecuteOnce = True
00055         ggin.ConversionSvcName = "GiGaGeo"
00056         ggin.DataProviderSvcName = "DetectorDataSvc"
00057         ggin.StreamItems = [
00058             "/dd/Structure/Sites/far-rock"
00059             "/dd/Geometry/PMT/PmtSurfaces",
00060             #"/dd/Structure/pmt-box-array",
00061             ]
00062 
00063         seq.Members = [ "GiGaInputStream/GGInStream", "DsPushKine/PushKine", "DsPullEvent/PullEvent" ]
00064         push = app.algorithm("PushKine")
00065         push.Converter = "HepMCtoG4"
00066 
00067         giga.TrackingAction = "MyTrackAction"
00068         app.property("GiGa.MyTrackAction").MyProp="Frog blast the vent core!"
00069         giga.SteppingAction = "MyStepAction"
00070         app.property("GiGa.MyStepAction").MyProp="I'm out of ammo!"
00071         
00072 
00073 
00074 if '__main__' == __name__:
00075     import xmldetdesc,gentools,os
00076     loc = os.getenv('XMLDETDESCROOT')
00077     if not loc:
00078         raise RuntimeError,"Location of DetDesc XML file not specified"
00079     loc += "/DDDB/dayabay.xml"
00080     xddc = xmldetdesc.XmlDetDescConfig(loc=loc)
00081     tg = gentools.GenToolsConfig(volume="/dd/Geometry/Pool/lvFarPoolIWS")
00082     dsc = DetSimConfig()
00083     
00084     import gaudimodule as gm
00085     app = gm.AppMgr()
00086     app.EvtSel = "NONE"
00087     app.run(10)
00088     
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

Generated on Mon Apr 11 20:54:53 2011 for Historian by doxygen 1.4.7