Abstract
BACKGROUND AND PURPOSE: Accurate commissioning of proton beam models remained a major challenge in pencil beam scanning (PBS) proton therapy. This study presented an automated Monte Carlo (MC) modeling framework that was designed to automate and standardize beam model commissioning. MATERIALS AND METHODS: This framework supported commissioning workflows by optimizing beam parameters based on user-supplied data including integrated depth dose curves, lateral profiles, measured absolute dose per energy, etc. It incorporated optimization algorithms including particle swarm optimization and Nelder-Mead, and followed a modular pipeline including data preparation, phase space parameter fitting, energy spectrum tuning, and dose calibration. Validation was performed using 20 clinical cases and over 100 measurement 2D planes in water-based patient-specific quality assurance (QA) plans. The framework was commissioned with TOol for PArticle Simulation (TOPAS) and Monte Carlo square (MCsquare). RESULTS: After tuning, both MC engines reproduced maximum range errors of 0.3 % (TOPAS) and 0.6 % (MCsquare) at depths corresponding to 80 % and 20 % of the maximum dose, and similarly small deviations in the full width at half maximum and peak dose. For QA plans, the median gamma pass rate was 100.0 % for TOPAS under the 3 %/3 mm criterion (range: 95.3 %-100.0 %, mean: 99.9 %), with MCsquare achieved comparable results with minimum pass rates above 94.3 %. CONCLUSIONS: This open-source, Python-based framework provided a robust and extensible solution for automated multi-engine MC beam commissioning in proton therapy. It enhanced reproducibility and efficiency, facilitating both clinical and research applications in medical physics.