The G4UserAction interface only provides access to a constant track. So there is no way to avoid the const_cast.
G4UserAction
const_cast