# File: soc.mac
# Brief: This simulates laserball data and produces a soc file.
#
# Date: 2014-05-29
# Contact: P G Jones,
# Revisions:
# 2014-05-29 : P Jones, added header info.
#
# This macro simulates a laserball, runs the peak finding and socFitter and
# then saves it all to a SOC file for testing.
/rat/physics_list/OmitMuonicProcesses true
/rat/physics_list/OmitHadronicProcesses true
# To use simulated external asynch trigger
/rat/db/set DAQ_RUN_LEVEL trigger_mask 32768
/rat/db/set DAQ_RUN_LEVEL trigger_enable 35967
/rat/db/set LASERBALL_SIMULATION intensity 10000
# Position is not an integer -> make sure there's a "."
/rat/db/set LASERBALL_SIMULATION position [0.0, 0.0, 0.0]
/rat/db/set LASERBALL_SIMULATION dye_name "BIS-MSB"
/rat/db/set LASERBALL_SIMULATION lb_id "OCT03"
/rat/db/set LASERBALL_SIMULATION angle_mode "FLAT"
/run/initialize
# BEGIN EVENT LOOP
/rat/proc frontend
/rat/proc trigger
/rat/proc eventbuilder
/rat/proc calibratePMT
/rat/proc/if trigTypeSelector
/rat/procset trigType "EXTASY"
/rat/proc count
/rat/procset update 10
/rat/proc socdata
/rat/proc/endif
/rat/proc socpeakfind
/rat/proc socfitter
/rat/procset method "socPositionTimeChiSquared"
/rat/procset optimiser "minuit"
/rat/procset selector "null"
# Changing fitter name
/rat/procset name "socfit"
/rat/proc outsoc
/rat/procset file "soc.root"
# END EVENT LOOP
# Choose the laserball generator from fixed point, uniform in time
/generator/add combo vertexlaserball:poslaserball:poisson
# Do not use the generator/pos/set or /generator/vtx/set commands.
# All variables should be set as ratdb variables, so that other
# routines, in addition to the generator, can access them
/generator/rate/set 100
/rat/run/start 1000
exit