# File: XSite.mac
# Brief: Short macro showing how to run the XSite classifier
#
# Date: 1-08-2019
# Contact: Yang Zhang, <yzhang23@ualberta.ca>
# Revisions:
#       1-08-2019 Yang Zhang <yzhang23@ualberta.ca> Initial commit.
#
# This is a macro which shows how to run the XSite classifier.
# This returns the XSite parameter for an event, that
# is, the likelihood ratio of PMT hit time residuals that fall within
# the selected window between S/B
# default S/B is 0nv and Co60 in Te_load phase.
#

/run/initialize

# BEGIN EVENT LOOP
/rat/proc frontend
/rat/proc trigger
/rat/proc eventbuilder
/rat/proc count
/rat/procset update 10
/rat/proc calibratePMT

# XSite classifier requires a position+time seed.
# Use the quadFitter.
/rat/proc fitter
/rat/procset method "quad"

# Now run the XSite classifier
/rat/proc classifier
/rat/procset classifier "XSite"
/rat/procset seed "quad"

/rat/proclast outroot
/rat/procset file "xsite.root"
# END EVENTLOOP

/generator/add combo gun:fill
/generator/vtx/set e- 0 0 0 1.0
/generator/pos/set 0 0 0
/generator/rate/set 1

/rat/run/start 10
exit