# File: positionNNFit.mac # Brief: Macro showing how to run the neural network position fitter. # # Date: 06-01-2020 # Contact: M Anderson, # # This is a macro which shows how to run the neural network position # fitter with a trained TensorFlow model. The geometry to use, any selectors # such as the mode cut, and other parameters should be set based on how the # model was trained. # # Must set the model path, and it must also be a .pb file. # The input tensor name, output tensor name, and scale factors are optional # because they have default values. However, they will of course depend # on how the model was trained. # Load water geometry. /rat/db/set DETECTOR geo_file "geo/snoplus_water.geo" /run/initialize # BEGIN EVENT LOOP /rat/proc frontend /rat/proc trigger /rat/proc eventbuilder /rat/proc count /rat/procset update 10 /rat/proc calibratePMT # Run the neural network fitter. /rat/proc fitter /rat/procset method "positionNN" /rat/procset method.modelPath "/.pb" #/rat/procset method.inputTensorName "input" #/rat/procset method.outputTensorName "output" #/rat/procset method.scaleXYZ 1.0 #/rat/procset method.scaleTime 1.0 /rat/procset selector "modeCut" /rat/procset name "nn" # Run the position likelihood fitter seeded with the neural network. /rat/proc fitter /rat/procset method "positionTimeLikelihood" /rat/procset optimiser "metaDriveCorrectSeed-powell" /rat/procset pdf "gv1d" /rat/procset seed "nn" /rat/procset selector "PMTCalSelector" /rat/procset name "positionTimeLikelihood_nn" /rat/proclast outroot /rat/procset file "positionNNFitH2O.root" # END EVENTLOOP /generator/add combo gun:point /generator/vtx/set e- 0 0 0 5.0 /generator/pos/set 0 0 0 /generator/rate/set 1 /rat/run/start 100 exit