Physics not loaded properly

I created a project (dose1) to load in a gdml model and using a macro file to define a particle environment. The code calculates the total dose deposited at a key detector location of the model.
I mixed elements from the following examples to create the functional project:

  • basic/B1
  • extended/persistency/gdml/G04
  • advanced/radioprotection

Next, I created a new project (dose2) that is a slight modification of dose1 to also compute statistics to verify how good my results are converging. I used elements from the following example to make the updates

For some reason, this latest update is causing me some issues and the physics are not getting
loaded properly anymore. I reviewed the code changes and have a hard time finding the root cause.

1/26/2020 update
Figured it out. I had initialize statement too esarly in main code before setting physics in macro. Removing that line and running intialize in macro after setting physics did the trick!