#!/usr/bin/env python3
import argparse
parser = argparse.ArgumentParser(description='Visualise thermal neutrons hitting a boron slab.')
parser.add_argument("-b", "--boronthickness",type=float, dest="boronthickness_micron",
                    default=200.0,help="Boron Thickness in microns")
parser.add_argument("--novis",type=int, metavar='N', default=None,
                    help="Simulate N events without visualisation (for testing)")
opt = parser.parse_args()

import G4StdGeometries.GeoSlab as Geo
from Units import units
import G4Launcher

geo = Geo.create()
geo.material = 'G4_B'
geo.target_depth_cm = opt.boronthickness_micron * units.um / units.cm

launcher = G4Launcher()
launcher.setGeo(geo)
launcher.setParticleGun("neutron",0.025*units.eV,
                      (0,0,-1.0*units.mm),
                      (0,0,1))

launcher.setOutput("none")
launcher.setSeed(1117)
if opt.novis is not None:
    launcher.startSimulation(opt.novis)
else:
    launcher.setVis()
    launcher.startSession()
