3 from __future__
import absolute_import, unicode_literals
8 from DDG4
import OutputLevel
as Output
9 from g4units
import keV, GeV, mm, ns, MeV
10 from pprint
import pprint
13 os.environ[
'G4UI_USE_TCSH'] =
"1"
15 description = kernel.detectorDescription()
16 kernel.loadGeometry(str(
"file:" +
"GenericRICH_example.xml"))
20 geant4.printDetectors()
22 rootoutput = geant4.setupROOTOutput(
'RootOutput',
'derp_' + time.strftime(
'%Y-%m-%d_%H-%M'), mc_truth=
True)
23 rootoutput.HandleMCTruth =
True
25 geant4.setupUI(
'tcsh',vis=
False,macro=
'macro/gps.mac')
26 geant4.setupTrackingField()
32 kernel.generatorAction().adopt(gen)
36 gun.Uses =
'G4ParticleGun'
38 kernel.generatorAction().adopt(gun)
50 kernel.generatorAction().adopt(gen)
55 kernel.generatorAction().adopt(gen)
59 kernel.generatorAction().adopt(part)
61 part.SaveProcesses = [
'Decay']
62 part.MinimalKineticEnergy = 100 * MeV
73 f2 =
DDG4.Filter(kernel,
'ParticleRejectFilter/OpticalPhotonRejector')
74 f2.particle =
'opticalphoton'
75 f3 =
DDG4.Filter(kernel,
'ParticleSelectFilter/OpticalPhotonSelector')
76 f3.particle =
'opticalphoton'
82 kernel.registerGlobalFilter(f2)
83 kernel.registerGlobalFilter(f3)
86 seq, act = geant4.setupDetector(
'ForwardRICH',
'PhotoMultiplierSDAction')
89 phys = geant4.setupPhysics(
'QGSP_BERT')
90 geant4.addPhysics(str(
'Geant4PhysicsList/Myphysics'))
93 ph =
DDG4.PhysicsList(kernel,
'Geant4OpticalPhotonPhysics/OpticalPhotonPhys')
99 ph.MaxNumPhotonsPerStep = 10
100 ph.MaxBetaChangePerStep = 10.0
101 ph.TrackSecondariesFirst =
True
115 if __name__ ==
"__main__":