Message: Re: Energy Conservation with G4ParticleChange ProposeTrackStatus Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Feedback Re: Energy Conservation with G4ParticleChange ProposeTrackStatus 

Forum: Event and Track Management
Re: Question Energy Conservation with G4ParticleChange ProposeTrackStatus (Aatif Imtiaz Butt)
Date: 22 Jul, 2010
From: Gumplinger Peter <Gumplinger Peter>

Hi Aatif,

I am not sure I understand your second paragraph...

G4ParticleChange is a class that allows a G4VProcess to communicate with the G4 kernel. You shouldn't be dealing with G4ParticleChange in UserSteppingAction(?).

Instead, do

theTrack->SetTrackStatus(fStopAndKill);

and, as you correctly say, add the kinetic energy manually to ensure energy conservation.

Alternatively, you can write a process class, similar to photon absorption, that kills the track when you want. In that case, you register the process with the particle process manager as you do for all the other processes and you fill G4ParticleChange and ProposeTrackStatus as required (including: ProposeEnergy(0.0) and ProposeLocalEnergyDeposit(kinEnergy)).

see for example:

http://www-geant4.kek.jp/lxr/source/examples/advanced/underground_physics/src/DMXSpecialCuts.cc#L68

In that case, you don't have to do any accounting additionally in SteppingAction.

Hope this helps, Peter

 Add Message Add Message
to: "Re: Energy Conservation with G4ParticleChange ProposeTrackStatus"

 Subscribe Subscribe

This site runs SLAC HyperNews version 1.11-slac-98, derived from the original HyperNews


[ Geant 4 Home | Geant 4 HyperNews | Search | Request New Forum | Feedback ]