# File: outroot.mac
# Brief: Macro showing how to output to a root file
#
# Date: 2014-07-24
# Contact: P G Jones, <p.g.jones@qmul.ac.uk>
# Revisions:
#
# This macro demonstrates how to output events to a root file called output.root

/run/initialize

# BEGIN EVENT LOOP
/rat/proc outroot
/rat/procset file "output.root"

# In order to specify file name by the '-o' command line option, simply use:
# /rat/proc outroot
# with no second line

/rat/proc count # An example processor
/rat/procset update 5

# It is possible to output to many files after various processors by adding
# further outroot processors such as
#/rat/proc outroot
#/rat/procset file "output2.root"

# END EVENT LOOP

# Generate something to save, 1MeV electrons
/generator/add combo gun:point
/generator/vtx/set e- 0 0 0 1.0
/generator/pos/set 0 0 0
/generator/rate/set 1

/rat/run/start 10

exit