Geant4 11.2.2
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 48 of file G4SamplingPostStepAction.hh.

Constructor & Destructor Documentation

◆ G4SamplingPostStepAction()

G4SamplingPostStepAction::G4SamplingPostStepAction ( const G4VTrackTerminator & TrackTerminator)
explicit

Definition at line 43 of file G4SamplingPostStepAction.cc.

45 : fTrackTerminator(TrackTerminator)
46{
47}

◆ ~G4SamplingPostStepAction()

G4SamplingPostStepAction::~G4SamplingPostStepAction ( )

Definition at line 49 of file G4SamplingPostStepAction.cc.

50{
51}

Member Function Documentation

◆ DoIt()

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

Definition at line 53 of file G4SamplingPostStepAction.cc.

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

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


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