Automated four-dimensional Monte Carlo workflow using log files and real-time motion monitoring