Hi! I would like to retrieve from the B1SteppingAction, the initial momentum of a track.
Initially, I would have expected that the Momentum before the first step should be identical to the one I am giving in the G4ParticleGun (inside PrimaryGeneratorAction class). In fact it is not.
I found a couple of method to find the momentum of a track.
if ( theTrack -> GetCurrentStepNumber() == 1 && theTrack->GetParentID()==0 ) G4cout << " VertexMom: " <GetVertexMomentumDirection().getX() << " G4TrackMomentum " << theTrack->GetMomentum().getX()/GeV << " PreStepMom: " << theTrack ->GetStep()->GetPreStepPoint()->GetMomentumDirection().getX() << " PostStepMom: " << theTrack ->GetStep()->GetPostStepPoint()->GetMomentumDirection().getX() << "pdg code "<< theTrack->GetDefinition()->GetPDGEncoding() << G4endl;
1. VertexMom: -0.145659 G4TrackMomentum -0.282452 PreStepMom: -0.145659 PostStepMom: -0.145317pdg code 211
2. VertexMom: 0.26067902914328 G4TrackMomentum 0.20885139163474 PreStepMom: 0.26067902914328 PostStepMom: 0.26093791297248pdg code -211
This is what I am actually giving to the particle gun.
1.mom x: -0.262733 mom y: 0.0633266 mom z: 1.78339 pdg: 211
2.mom x: 0.171599 mom y: -0.0157178 mom z: 0.635323 pdg: -211
i. What is the difference between theTrack->GetVertexMomentumDirection() and theTrack->GetMomentum() at step number1?
ii/ Why the momentum before step one is not the one I gave in ParticleGun?
Thank you so much! Regards, Robert Amarinei