#
#       Example macro for adjusting the PMT concentrator reflectivities
#       There are three types of reflection which can be adjusted:
#
#           1) Reflectivity probability for s-polarised light
#           2) Reflectivity probability for p-polarised light
#           3) Reflectivity probability for diffuse reflections
#
#       testConcReflectivity.mac
#       Date:           05/04/2016
#       contact:        R P F Stainforth, Liverpool
#
/rat/physics_list/OmitMuonicProcesses true
/rat/physics_list/OmitHadronicProcesses true

# Ensure a small root file by condensing the MC tracks...
/rat/tracking/store condensed

# ...and make the simulation quick using the simple geometry.
/rat/db/set DETECTOR geo_file "geo/snoplus_water_simple.geo"
/rat/db/set GEO[av] add_neck_boss 0

# Scale the concentrator reflectivity probabilities 
# for s-, p- and diffuse-reflections by 50% (0.5), 70% (0.7) and 90% (0.9) respectively
/rat/db/set CONC_REFL_PARAMETERS[Optics0] reflection_s_probability_scaling 0.5
/rat/db/set CONC_REFL_PARAMETERS[Optics0] reflection_p_probability_scaling 0.7
/rat/db/set CONC_REFL_PARAMETERS[Optics0] diffuse_reflection_probability_scaling 0.9

/run/initialize

# BEGIN EVENT LOOP
/rat/proc frontend
/rat/proc trigger
/rat/proc eventbuilder
/rat/proc calibratePMT

/rat/proc count
/rat/procset update 20

/rat/proc outroot
/rat/procset file "testConcReflectivity.root"

# END EVENT LOOP

# Choose the photonbomb generator distributed throughout the inner AV region
/generator/add combo pbomb:fill:uniform
# Choose 5000 photons, each of 420nm per pulse
/generator/vtx/set 5000 420.0 0

# Originating in the centre
/generator/pos/set inner_av
/generator/rate/set 1

/rat/run/start 50
exit