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.

00046   : fTrackTerminator(TrackTerminator)
00047 {
00048 }

G4SamplingPostStepAction::~G4SamplingPostStepAction (  ) 

Definition at line 50 of file G4SamplingPostStepAction.cc.

00051 {
00052 }


Member Function Documentation

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 }


The documentation for this class was generated from the following files:
Generated on Mon May 27 17:53:20 2013 for Geant4 by  doxygen 1.4.7