Local-To-Global Monte Carlo Algorithms For Radiation Therapy Treatment Plan Optimization And Dose Calculation In Magnetic Fields