Geant4 9.6.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4SamplingPostStepAction Class Reference

#include <G4SamplingPostStepAction.hh>

Public Member Functions

 G4SamplingPostStepAction (const G4VTrackTerminator &TrackTerminator)
 
 ~G4SamplingPostStepAction ()
 
void DoIt (const G4Track &aTrack, G4ParticleChange *aParticleChange, const G4Nsplit_Weight &nw)
 

Detailed Description

Definition at line 49 of file G4SamplingPostStepAction.hh.

Constructor & Destructor Documentation

◆ G4SamplingPostStepAction()

G4SamplingPostStepAction::G4SamplingPostStepAction ( const G4VTrackTerminator TrackTerminator)
explicit

Definition at line 44 of file G4SamplingPostStepAction.cc.

46 : fTrackTerminator(TrackTerminator)
47{
48}

◆ ~G4SamplingPostStepAction()

G4SamplingPostStepAction::~G4SamplingPostStepAction ( )

Definition at line 50 of file G4SamplingPostStepAction.cc.

51{
52}

Member Function Documentation

◆ DoIt()

void G4SamplingPostStepAction::DoIt ( const G4Track aTrack,
G4ParticleChange aParticleChange,
const G4Nsplit_Weight nw 
)

Definition at line 54 of file G4SamplingPostStepAction.cc.

57{
58 // evaluate results from sampler
59 if (nw.fN>1)
60 {
61 // split track
62 Split(aTrack, nw, aParticleChange);
63 }
64 else if (nw.fN==1)
65 {
66 // don't split, but weight may be changed !
67 aParticleChange->ProposeWeight(nw.fW);
68 }
69 else if (nw.fN==0)
70 {
71 // kill track
72 fTrackTerminator.KillTrack();
73 }
74 else
75 {
76 // wrong answer
77 std::ostringstream os;
78 os << "Sampler returned nw = "
79 << nw
80 << "\n";
81 G4String msg = os.str();
82
83 G4Exception("G4SamplingPostStepAction::DoIt()",
84 "InvalidCondition", FatalException, msg);
85 }
86}
@ FatalException
void ProposeWeight(G4double finalWeight)
virtual void KillTrack() const =0
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41

Referenced by G4ImportanceProcess::PostStepDoIt(), and G4WeightWindowProcess::PostStepDoIt().


The documentation for this class was generated from the following files: