How to force particle to constantly move in upward direction

Hi, I have a box geometry filled with air. My particle is at bottom, and I am applying some initial energy of 86 KeV to the particle (I got the value from theoretical calculations so I cannot change it). I added the physics list as QGSP_BERT_HP. Now what happens is particle travels some distance in upward direction and stop. This is because energy absorption in box material air I suppose. But I want some mechanism by which I can force this particle in upward direction since I want to study traversal properties through various materials inside box. I can assume that the particle is moving because of air currents/pressure/drift velocity in upward direction. Can anyone tell me how can I achieve this?

1 Like

I would start by trying to define a user trackingaction: Optional User Actions — Book For Application Developers 11.0 documentation

and in virtual void PreUserTrackingAction(const G4Track* aTrack){} I would try something along the lines of

  const G4ParticleMomentum dir = aTrack->GetMomentumDirection();
  aTrack->SetMomentumDirection(G4ThreeVector(dir.x(), dir.y(), std::abs(dir.z()));
1 Like

this is somehow not correct. The particle is still not travelling. I believe I need to create my own physics process which will add some momentum to particle in each step with G4VProcess. Do you know how to do it?

oh, sorry. I missed where you wrote that the particle comes to rest… the snippet above only forces the z-component to point upwards if it was downwards before.
would it make sense to set or add a constant z-value instead?

const G4ParticleMomentum dir = aTrack->GetMomentumDirection();
aTrack->SetMomentumDirection(G4ThreeVector(dir.x(), dir.y(), dir.z() + 3.14*millimeter/second );

or

aTrack->SetMomentumDirection(G4ThreeVector(dir.x(), dir.y(), 3.14*millimeter/second );