Some questions about scoring mesh

_Geant4 Version:_11.1

When I read BookForApplicationDevelopers ,I find the score mesh will help me to construct my goals.
But the books gives me example is using command. Is there some examples about it by using C++ code not command.(some obsession by coder).

And I want to know if I construct my scoring mesh in parallel world. When I try to use G4Step* to get the information about this step in which Logical Volume. How could I get the information about my parallel world’s logical volume (my scoring mesh) instead of mass world.