Sorry @guatelli and @mkelsey! I understood the problem!
Given that I modified the code to get muons outgoling the second target, the code
if(!step->GetTrack()->GetNextVolume() ) {
was inside the
if (volume == fScoringVolume2) {
that’s the reason because I didn’t get particles outgoing the world! then, I moved the if(!step->GetTrack()->GetNextVolume() ) {
out of the if (volume == fScoringVolume2) {
and it worked!