move beginLoop hook to TreeAnalyzerNumpy