Geant4  10.03.p03
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 ( const G4VTrackTerminator TrackTerminator)
explicit

Definition at line 45 of file G4SamplingPostStepAction.cc.

46  : fTrackTerminator(TrackTerminator)
47 {
48 }
G4SamplingPostStepAction::~G4SamplingPostStepAction ( )

Definition at line 50 of file G4SamplingPostStepAction.cc.

51 {
52 }

Member Function Documentation

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 }
virtual void KillTrack() const =0
void ProposeWeight(G4double finalWeight)
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41

Here is the call graph for this function:

Here is the caller graph for this function:


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