Addendum:

I modified the code to make sure, i switch momentum direction on a step within the world volume and not between two different volumes but it still don’t work.

Here is what i did in User Stepping Action to reflect the electron:

```
void SteppingAction::UserSteppingAction(const G4Step* aStep){
//Reflect all particles outside of acceptance angle
G4Track* aTrack = aStep->GetTrack();
G4int TrackID = aTrack->GetTrackID();
G4int ParentID = aTrack->GetParentID();
G4double x,y,z,r,theta;
x=(aTrack->GetMomentumDirection()).x();
y=(aTrack->GetMomentumDirection()).y();
z=(aTrack->GetMomentumDirection()).z();
r=(std::sqrt(z*z+y*y+x*x)); //useless, it's normalized
theta=(std::acos(x/r));
if((aTrack->GetNextVolume()) != 0){
G4cout << "aTrack->GetNextVolume()->GetName(): "<<(aTrack->GetNextVolume()->GetName())<< G4endl;}
if((aTrack->GetNextVolume() != 0 && aTrack->GetDefinition()->GetPDGCharge()!=0)){
if((aTrack->GetNextMaterial()->GetName())=="G4_Galactic" && (aTrack->GetMaterial()->GetName())=="G4_Galactic"){
G4cout << "Youve made it into if" << G4endl;
G4cout << "Theta:" << theta/3.1415927*180 << " x:" << x << " y:" <<y << " z:" <<z << " r:" << r << G4endl;
G4cout << "Position: "<< aStep->GetPostStepPoint()->GetPosition() << G4endl;
if(theta<=147.1*deg && theta>90*deg){
G4cout << "Acos larger than 32.9. Trying to reflect particle."<< " x:" << x << " y:" <<y << " z:" <<z << " r:" << r << G4endl;
aTrack->SetMomentumDirection(G4ThreeVector(-x, y, z));
G4cout << "New Values: "<< " x:" << (aTrack->GetMomentumDirection()).x() << " y:" <<(aTrack->GetMomentumDirection()).y() << " z:" <<(aTrack->GetMomentumDirection()).z() << " r:" << r << G4endl;
}
return;
}
}
```

Here is the output of one of the events:

```
...
G4WT0 > aTrack->GetNextVolume()->GetName(): Absorber
G4WT0 > aTrack->GetNextVolume()->GetName(): Absorber
G4WT0 > aTrack->GetNextVolume()->GetName(): World
G4WT0 > aTrack->GetNextVolume()->GetName(): World
G4WT0 > Youve made it into if
G4WT0 > Theta:127.77 x:-0.612488 y:0.780109 z:0.127626 r:1
G4WT0 > Position: (-1.06125,0.078352,0.0127839)
G4WT0 > Acos larger than 32.9. Trying to reflect particle. x:-0.612488 y:0.780109 z:0.127626 r:1
G4WT0 > New Values: x:0.612488 y:0.780109 z:0.127626 r:1
G4WT0 > aTrack->GetNextVolume()->GetName(): World
G4WT0 > Youve made it into if
G4WT0 > Theta:127.77 x:-0.612488 y:0.780109 z:0.127626 r:1
G4WT0 > Position: (-1,0.156363,0.0255465)
G4WT0 > Acos larger than 32.9. Trying to reflect particle. x:-0.612488 y:0.780109 z:0.127626 r:1
G4WT0 > New Values: x:0.612488 y:0.780109 z:0.127626 r:1
G4WT0 > aTrack->GetNextVolume()->GetName(): Absorber
G4WT0 > aTrack->GetNextVolume()->GetName(): World
G4WT0 > aTrack->GetNextVolume()->GetName(): World
G4WT0 > Youve made it into if
G4WT0 > Theta:127.77 x:-0.612488 y:0.780109 z:0.127626 r:1
G4WT0 > Position: (-1.06125,0.234374,0.0383092)
G4WT0 > Acos larger than 32.9. Trying to reflect particle. x:-0.612488 y:0.780109 z:0.127626 r:1
G4WT0 > New Values: x:0.612488 y:0.780109 z:0.127626 r:1
G4WT0 > aTrack->GetNextVolume()->GetName(): World
G4WT0 > Youve made it into if
G4WT0 > Theta:127.77 x:-0.612488 y:0.780109 z:0.127626 r:1
G4WT0 > Position: (-1,0.312385,0.0510718)
G4WT0 > Acos larger than 32.9. Trying to reflect particle. x:-0.612488 y:0.780109 z:0.127626 r:1
G4WT0 > New Values: x:0.612488 y:0.780109 z:0.127626 r:1
G4WT0 > aTrack->GetNextVolume()->GetName(): Absorber
G4WT0 > aTrack->GetNextVolume()->GetName(): World
G4WT0 > aTrack->GetNextVolume()->GetName(): World
G4WT0 > Youve made it into if
G4WT0 > Theta:127.77 x:-0.612488 y:0.780109 z:0.127626 r:1
G4WT0 > Position: (-1.06125,0.390396,0.0638344)
G4WT0 > Acos larger than 32.9. Trying to reflect particle. x:-0.612488 y:0.780109 z:0.127626 r:1
G4WT0 > New Values: x:0.612488 y:0.780109 z:0.127626 r:1
G4WT0 > aTrack->GetNextVolume()->GetName(): World
...
```

Even it seems to make several steps also to the absorber, it always comes out with the same angle/momentum.