#include <G4SamplingPostStepAction.hh>
Public Member Functions | |
G4SamplingPostStepAction (const G4VTrackTerminator &TrackTerminator) | |
~G4SamplingPostStepAction () | |
void | DoIt (const G4Track &aTrack, G4ParticleChange *aParticleChange, const G4Nsplit_Weight &nw) |
Definition at line 49 of file G4SamplingPostStepAction.hh.
G4SamplingPostStepAction::G4SamplingPostStepAction | ( | const G4VTrackTerminator & | TrackTerminator | ) | [explicit] |
G4SamplingPostStepAction::~G4SamplingPostStepAction | ( | ) |
void G4SamplingPostStepAction::DoIt | ( | const G4Track & | aTrack, | |
G4ParticleChange * | aParticleChange, | |||
const G4Nsplit_Weight & | nw | |||
) |
Definition at line 54 of file G4SamplingPostStepAction.cc.
References FatalException, G4Nsplit_Weight::fN, G4Nsplit_Weight::fW, G4Exception(), G4VTrackTerminator::KillTrack(), and G4VParticleChange::ProposeWeight().
Referenced by G4WeightWindowProcess::PostStepDoIt(), and G4ImportanceProcess::PostStepDoIt().
00057 { 00058 // evaluate results from sampler 00059 if (nw.fN>1) 00060 { 00061 // split track 00062 Split(aTrack, nw, aParticleChange); 00063 } 00064 else if (nw.fN==1) 00065 { 00066 // don't split, but weight may be changed ! 00067 aParticleChange->ProposeWeight(nw.fW); 00068 } 00069 else if (nw.fN==0) 00070 { 00071 // kill track 00072 fTrackTerminator.KillTrack(); 00073 } 00074 else 00075 { 00076 // wrong answer 00077 std::ostringstream os; 00078 os << "Sampler returned nw = " 00079 << nw 00080 << "\n"; 00081 G4String msg = os.str(); 00082 00083 G4Exception("G4SamplingPostStepAction::DoIt()", 00084 "InvalidCondition", FatalException, msg); 00085 } 00086 }