Track in magnetic field

When tracking particles inside a vacuum volume with magnetic field, in the stepping action I get the pre and post step positions as two points on the boundaries of the volume. How can I get the full curved path that the particle followed inside the volume?

You should be able to see it. Try

/vis/scene/add/trajectories smooth

Not sure the best way to get those intermediate points. Have a look in G4SmoothTrajectory. It looks like the step has a method GetPointerToVectorOfAuxiliaryPoints. Give it a try.

Thank you @allison
I am trying to access it in the SteppingAction with
but it always return nullptr
I’ve added a command
/tracking/storeTrajectory 2 also with 3 and 4
still the same

I can confirm that /vis/scene/add/trajectories smooth works. Please try that rather than got to /tracking/storeTrajectory directly.

But…that might not help. I do not understand why step->GetPointerToVectorOfAuxiliaryPoints() returns a null pointer.

Please continue to dig and we will solve this.

Thank @allison, thats good to know that through the GUI it works, so I can find out how it does it.
In my application am not using the GUI so I cannot issue the /vis/scene/add/trajectories command.
I would like to access it through the SteppingAction to perform custom scoring.