Skip to content
Snippets Groups Projects
Commit a20cf320 authored by Wouter Deconinck's avatar Wouter Deconinck
Browse files

Add FastPhysicsList and ShowerModel to npsim

parent 16d12a36
No related tags found
1 merge request!273Draft: Resolve "Support FastSim and GFlash"
......@@ -31,11 +31,11 @@ if __name__ == "__main__":
cerenkov.VerboseLevel = 0
cerenkov.enableUI()
seq.adopt(cerenkov)
ph = PhysicsList(kernel, 'Geant4OpticalPhotonPhysics/OpticalGammaPhys')
ph.addParticleConstructor('G4OpticalPhoton')
ph.VerboseLevel = 0
ph.enableUI()
seq.adopt(ph)
optical = PhysicsList(kernel, 'Geant4OpticalPhotonPhysics/OpticalGammaPhys')
optical.addParticleConstructor('G4OpticalPhoton')
optical.VerboseLevel = 0
optical.enableUI()
seq.adopt(optical)
return None
SIM.physics.setupUserPhysics(setupCerenkov)
......@@ -59,6 +59,34 @@ if __name__ == "__main__":
SIM.action.mapActions['PFRICH'] = 'Geant4OpticalTrackerAction'
SIM.action.mapActions['DIRC'] = 'Geant4OpticalTrackerAction'
# Fast simulation
def setupFastPhysics(kernel):
from DDG4 import PhysicsList
seq = kernel.physicsList()
fast = PhysicsList(kernel, 'Geant4FastPhysics/FastPhysicsList')
fast.EnabledParticles = ['e+', 'e-']
fast.BeVerbose = True
fast.enableUI()
seq.adopt(fast)
return None
from DDG4 import DetectorConstruction
model = DetectorConstruction(kernel, str('Geant4Par01EMShowerModel/ShowerModel'))
# Mandatory model parameters
model.RegionName = 'SiRegion'
model.Material = 'Silicon'
model.ApplicableParticles = ['e+', 'e-']
model.Etrigger = {'e+': 0.1 * GeV, 'e-': 0.1 * GeV}
model.Enable = True
# Energy boundaries are optional: Units are GeV
model.Emin = {'e+': 0.1 * GeV, 'e-': 0.1 * GeV}
model.Ekill = {'e+': 0.1 * MeV, 'e-': 0.1 * MeV}
model.enableUI()
seq.adopt(model)
return None
SIM.physics.setupUserPhysics(setupFastPhysics)
# Parse remaining options (command line and steering file override above)
SIM.parseOptions()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment