# File: fit.mac # Brief: Macro showing how to run various fitters in SNO+ # # Date: 19-05-2014 # Contact: Dr M Mottram, # Revisions: # 19-05-2014 I. Coulter # Transfered from old fit.mac # # Example Macro for simulating and fitting events in SNO+. # # Note: This aims to show possible uses of all fitters in RAT. # There is no guarantee over the accuracy of the results these # fitters return. # For the recommended use, refer to the RAT companion/scintFitter code. # For use in the water phase, refer to fitWater.mac # /run/initialize # BEGIN EVENT LOOP /rat/proc frontend /rat/proc trigger /rat/proc eventbuilder /rat/proc count /rat/procset update 10 /rat/proc calibratePMT # Simple usage, this is probably what you want to do # This produces the best possible position and energy reconstruction # values as defined by reconstruction group /rat/proc scintFitter ## Advanced usage (if you want to try your own combination fitter) # Start with a centroid fit /rat/proc fitter /rat/procset method "centroid" # quadFitter /rat/proc fitter /rat/procset method "quad" # Use the nearAVFitter: # This requires the classifier to be run before the fitter itself /rat/proc classifier /rat/procset classifier "nearAVAngular" /rat/proc fitter /rat/procset method "nearAVAngular" # Add a seed at a fixed position /rat/proc fitter /rat/procset method "fixedSeed" /rat/procset method.position 0 100 0 200 /rat/procset name "fixedPosition" # Now use these seeds for a likelihood method position fit, optimised # by powell with the et1d pdf, using the quadFitter as a seed and no # PMT selector. # Catchily known as "positionTimeLikelihood:powell:et1d:null:quad" # so give it the nickname "likelihoodFit" instead... /rat/proc fitter /rat/procset method "positionTimeLikelihood" /rat/procset optimiser "powell" /rat/procset pdf "et1d" /rat/procset seed "quad" /rat/procset selector "null" /rat/procset name "likelihoodFit" ## Run fits for time, given a fixed position: # First use the simpleTime method /rat/proc fitter /rat/procset method "simpleTime" # Then fit for event time using the fixedPosition seed, simpleTiming # PDF and null PMT selector with minuit as an optimiser. # Instead of "timeLikelihood:minuit:simpleTiming:null:fixedPosition" # call this "timingFit" /rat/proc fitter /rat/procset method "timeLikelihood" /rat/procset optimiser "minuit" /rat/procset pdf "simpleTiming" /rat/procset seed "fixedPosition" /rat/procset selector "null" /rat/procset name "timingFit" ## Add some energy fits: # First using a single valued nhit per MeV conversion /rat/proc fitter /rat/procset method "simpleEnergy" # Then a 2D lookup table, using nhit and radius /rat/proc fitter /rat/procset method "energyLookup" /rat/procset seed "likelihoodFit" ## Now run some classifiers: # beta14 /rat/proc classifier /rat/procset classifier "beta14" /rat/procset seed "likelihoodFit" #Isotropy /rat/proc classifier /rat/procset classifier "isotropy" /rat/procset seed "scintFitter" /rat/procset selector "timeResidualCut" # ITR /rat/proc classifier /rat/procset classifier "ITR" /rat/procset seed "likelihoodFit" # QPDT /rat/proc classifier /rat/procset classifier "QPDT" /rat/procset seed "likelihoodFit" # earlyTime /rat/proc classifier /rat/procset classifier "earlyTime" /rat/procset seed "quad" # meanTime /rat/proc classifier /rat/procset classifier "meanTime" /rat/procset seed "quad" # timingPeaks /rat/proc classifier /rat/procset classifier "timingPeaks" # preTriggerHits /rat/proc classifier /rat/procset classifier "preTriggerHits" ## A variety of Alpha-Beta/BiPo Classifiers: # UnseededAlpha /rat/proc classifier /rat/procset classifier "UnseededAlpha" # SeededAlpha /rat/proc classifier /rat/procset classifier "SeededAlpha" /rat/procset seed "likelihoodFit" # AlphaBeta classifier, requires an optimiser and a seed /rat/proc classifier /rat/procset classifier "AlphaBetaClassifier-212_wPSD:te_0p3_labppo_scintillator_Oct2012" /rat/procset optimiser "grid-100" /rat/procset seed "quad" # BiPoClassifier, Time Residual based. Requires a seed. /rat/proc classifier /rat/procset classifier "BiPoCumulTimeResid-te_0p3_labppo_scintillator_Oct2012" /rat/procset seed "likelihoodFit" # BiPoClassifier, Likelihood based. # Requires a seed and an optimiser, grid works best. /rat/proc classifier /rat/procset classifier "BiPoLikelihoodDiff-te_0p3_labppo_scintillator_Oct2012_214BiPo" /rat/procset optimiser "grid-55" /rat/procset seed "likelihoodFit" /rat/proclast outroot /rat/procset file "fit_electrons.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