/search.css" rel="stylesheet" type="text/css"/> /search.js">
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

In This Package:

Public Member Functions
adgun::MyGenToolsConfig Class Reference

List of all members.

Public Member Functions

def __init__

Detailed Description

Definition at line 10 of file adgun.py.


Constructor & Destructor Documentation

def adgun::MyGenToolsConfig::__init__ (   self,
  volume 
)

Definition at line 11 of file adgun.py.

00012                              :
00013         from  GaudiPython import AppMgr
00014         from GaudiKernel import SystemOfUnits as units
00015         from math import sin, cos, pi
00016 
00017         app = AppMgr()
00018         app.TopAlg = []
00019 
00020         # Set up timerator
00021         import GaudiKernel.SystemOfUnits as units
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.Volume = volume
00028         poser.Mode = "Fixed"
00029         if hit_pmt_gap:
00030             angle=pi/24.0
00031             radius=0.0*units.meter
00032             poser.Position = [ radius*cos(angle),radius*sin(angle),0 ] # aim between columns 1 and 2
00033         else:
00034             poser.Position = [0,0,5.1/16.0*units.meter]
00035 
00036         poser.OutputLevel = 1
00037 
00038         # Set up gun
00039         gun = app.property("ToolSvc.GtGunGenTool")
00040         gun.OutputLevel = 1
00041         if particle == "opticalphoton":
00042             gun.ParticlesPerEvent = 10000
00043             gun.ParticleName = "opticalphoton"
00044             gun.Momentum = 2.5*units.eV
00045             gun.PolarizeMode = "Random"
00046         elif particle == "muon":
00047             gun.ParticlesPerEvent = 1
00048             gun.ParticleName = "mu-"
00049             gun.Momentum = 10*units.GeV
00050             pass
00051         else:
00052             gun.ParticlesPerEvent = 1
00053             gun.ParticleName = "mu-"
00054             gun.Momentum = 0.1*units.MeV
00055             pass
00056         gun.MomentumMode = "Fixed"
00057         gun.DirectionMode = "Fixed"
00058         pmt_column_number = 9
00059         if use_correct_pmt_angle:
00060             if hit_pmt_gap:
00061                 angle = (2*pmt_column_number)*pi/24.0;
00062             else:
00063                 angle = (2*pmt_column_number - 1)*pi/24.0;
00064             gun.Direction = [ cos(angle),sin(angle),0 ] # aim for PMT 
00065         else:
00066             if hit_pmt_gap:
00067                 angle=pi/24.0
00068                 gun.Direction = [ cos(angle),sin(angle),0 ] # aim between columns 1 and 2
00069             else:
00070                 gun.Direction = [ 1,0,0 ] # aim for PMT column1 on X-axis
00071         print 'gun.Direction=',gun.Direction
00072 
00073         trans = app.property("ToolSvc.GtTransformTool")
00074         trans.Volume = volume
00075 
00076         app.TopAlg += [ "GaudiSequencer/GenSeq" ]
00077         genseq = app.algorithm("GenSeq")
00078         genseq.Members = [ "GtGenerator/GenAlg" ]
00079 
00080         gen = app.algorithm("GenAlg")
00081         gen.OutputLevel = 1
00082         gen.GenTools = [ "GtGunGenTool", "GtPositionerTool", "GtTimeratorTool", "GtTransformTool" ]
00083         gen.GenName = "Bang Bang"
00084 
00085         if particle != "opticalphoton":
00086             print " GtDumper"
00087             genseq.Members += [ "GtHepMCDumper/GenDump" ]
00088             gendump = app.algorithm("GenDump")
00089             gendump.OutputLevel = 1
00090 
00091         app.ExtSvc += ["GiGa"]
00092 
00093         modularPL = app.property("GiGa.GiGaPhysListModular")
00094         modularPL.OutputLevel = 1
00095         modularPL.CutForElectron = 100*units.micrometer
00096         modularPL.CutForPositron = 100*units.micrometer
00097         modularPL.CutForGamma = 1*units.millimeter
00098         modularPL.PhysicsConstructors = [ 
00099             "DsPhysConsGeneral", 
00100             "DsPhysConsOptical",
00101             "DsPhysConsEM",
00102 #            "DsPhysConsElectroNu",
00103 #            "DsPhysConsHadron",
00104 #            "DsPhysConsIon"
00105             ]
00106         optical = app.property("GiGa.GiGaPhysListModular.DsPhysConsOptical")
00107         #optical.UseCerenkov = False
00108         #optical.UseScintillation = False
00109 
00110         giga = app.service("GiGa")
00111         giga.OutputLevel = 1
00112         giga.PhysicsList = "GiGaPhysListModular"
00113 
00114         gggeo = app.service("GiGaGeo")
00115         gggeo.OutputLevel = 1
00116         gggeo.XsizeOfWorldVolume = 2.4*units.kilometer
00117         gggeo.YsizeOfWorldVolume = 2.4*units.kilometer
00118         gggeo.ZsizeOfWorldVolume = 2.4*units.kilometer
00119 
00120 
00121         giga.SteppingAction = "GiGaStepActionSequence"
00122         stepseq = app.property("GiGa.GiGaStepActionSequence")
00123         stepseq.Members = ["HistorianStepAction","UnObserverStepAction"]
00124 
00125         historian = app.property("GiGa.GiGaStepActionSequence.HistorianStepAction")
00126 
00127         params = {
00128             'muonid':"(pdg==13 or pdg==-13)",
00129             'ows':"(MaterialName == '/dd/Materials/Water' and "+\
00130                 "Volume == '/dd/Structure/Pool/far-ows')",
00131             'iws':"(MaterialName == '/dd/Materials/Water' and "+\
00132                 "Volume == '/dd/Structure/Pool/far-iws')",
00133             'lso':"MaterialName == '/dd/Materials/LiquidScintillator'",
00134             'gds':"MaterialName == '/dd/Materials/GdDopedLS'"
00135             }
00136         unobs = app.property("GiGa.GiGaStepActionSequence.UnObserverStepAction")
00137         unobs.Stats=[
00138             ["MuonTrkLengthInOws","dx","%(muonid)s and %(ows)s"%params],
00139             ["MuonTrkLengthInIws", "dx", "%(muonid)s and %(iws)s"%params],
00140             ["MuonTrkLengthInLS", "dx", "%(muonid)s and %(lso)s"%params],
00141             ["MuonTrkLengthInGdLS","dx", "%(muonid)s and %(gds)s"%params]
00142             ]
00143 
00144 
00145 
00146         giga.StackingAction="DsOpStackAction"
00147         
00148         eds=app.service("EventDataSvc")
00149         eds.ForceLeaves=True
00150 
00151 
00152 
00153         # Make Geant4 sing!
00154         ggrm = app.property("GiGa.GiGaMgr")
00155         ggrm.Verbosity = 0
00156         event_ac_cmds = app.property("GiGa.GiGaEventActionCommand")
00157         event_ac_cmds.BeginOfEventCommands = [
00158             "/control/verbose 0",
00159             "/run/verbose 0",
00160             "/event/verbose 0",
00161             "/tracking/verbose 0",
00162             "/geometry/navigator/verbose 0"
00163             ]
00164         giga.EventAction = "GiGaEventActionCommand"
00165 
00166 
00167         app.TopAlg += [ "GaudiSequencer/SimSeq" ]
00168         simseq = app.algorithm("SimSeq")
00169         simseq.Members = [ "GiGaInputStream/GGInStream" ]
00170 
00171         ggin = app.algorithm("GGInStream")
00172         ggin.OutputLevel = 1
00173         ggin.ExecuteOnce = True
00174         ggin.ConversionSvcName = "GiGaGeo"
00175         ggin.DataProviderSvcName = "DetectorDataSvc"
00176         ggin.StreamItems = [ "/dd/Structure/Sites/far-rock",
00177                              "/dd/Geometry/AdDetails/AdSurfacesAll",
00178                              "/dd/Geometry/AdDetails/AdSurfacesFar",
00179                              "/dd/Geometry/PoolDetails/FarPoolSurfaces",
00180                              "/dd/Geometry/PoolDetails/PoolSurfacesAll",
00181                              ]
00182 
00183         simseq.Members += [ "DsPushKine/PushKine", "DsPullEvent/PullEvent" ]
00184         push = app.algorithm("PushKine")
00185         push.Converter = "HepMCtoG4"
00186 
00187         pull = app.algorithm("PullEvent")
00188         pull.OutputLevel = 1
00189 
00190         # Class name to use is set in DetDesc xml's "sensdet" attribute.
00191         pmtsd = app.property("GiGaGeo.DsPmtSensDet")
00192         pmtsd.OutputLevel = 2
00193 
00194         return


The documentation for this class was generated from the following file:
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

Generated on Fri May 16 2014 10:17:58 for DetSim by doxygen 1.7.4