Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
GB05BOptnSplitAndKillByCrossSection Class Reference

#include <Doxymodules_biasing.h>

Inheritance diagram for GB05BOptnSplitAndKillByCrossSection:
G4VBiasingOperation

Public Member Functions

 GB05BOptnSplitAndKillByCrossSection (G4String name)
 
virtual ~GB05BOptnSplitAndKillByCrossSection ()
 
virtual const G4VBiasingInteractionLawProvideOccurenceBiasingInteractionLaw (const G4BiasingProcessInterface *, G4ForceCondition &) final
 
virtual G4VParticleChangeApplyFinalStateBiasing (const G4BiasingProcessInterface *, const G4Track *, const G4Step *, G4bool &) final
 
virtual G4double DistanceToApplyOperation (const G4Track *, G4double, G4ForceCondition *condition) final
 
virtual G4VParticleChangeGenerateBiasingFinalState (const G4Track *, const G4Step *) final
 
void SetInteractionLength (G4double interactionLength)
 

Private Attributes

G4ParticleChange fParticleChange
 
G4double fInteractionLength
 

Detailed Description

Definition at line 123 of file Doxymodules_biasing.h.

Constructor & Destructor Documentation

◆ GB05BOptnSplitAndKillByCrossSection()

GB05BOptnSplitAndKillByCrossSection::GB05BOptnSplitAndKillByCrossSection ( G4String  name)

◆ ~GB05BOptnSplitAndKillByCrossSection()

GB05BOptnSplitAndKillByCrossSection::~GB05BOptnSplitAndKillByCrossSection ( )
virtual

Definition at line 43 of file GB05BOptnSplitAndKillByCrossSection.cc.

44{}

Member Function Documentation

◆ ProvideOccurenceBiasingInteractionLaw()

virtual const G4VBiasingInteractionLaw * GB05BOptnSplitAndKillByCrossSection::ProvideOccurenceBiasingInteractionLaw ( const G4BiasingProcessInterface ,
G4ForceCondition &   
)
inlinefinalvirtual

Definition at line 51 of file GB05BOptnSplitAndKillByCrossSection.hh.

53 {return 0;}

◆ ApplyFinalStateBiasing()

virtual G4VParticleChange * GB05BOptnSplitAndKillByCrossSection::ApplyFinalStateBiasing ( const G4BiasingProcessInterface ,
const G4Track ,
const G4Step ,
G4bool &   
)
inlinefinalvirtual

Definition at line 55 of file GB05BOptnSplitAndKillByCrossSection.hh.

59 {return 0;}

◆ DistanceToApplyOperation()

G4double GB05BOptnSplitAndKillByCrossSection::DistanceToApplyOperation ( const G4Track ,
G4double  ,
G4ForceCondition *  condition 
)
finalvirtual

Definition at line 48 of file GB05BOptnSplitAndKillByCrossSection.cc.

52{
53 *condition = NotForced;
54
55 // -- Sample the exponential law using the total interaction length of processes
56 // -- to couterbalance for:
57 G4double proposedStepLength = -std::log( G4UniformRand() ) * fInteractionLength;
58
59 return proposedStepLength;
60}

◆ GenerateBiasingFinalState()

G4VParticleChange * GB05BOptnSplitAndKillByCrossSection::GenerateBiasingFinalState ( const G4Track track,
const G4Step  
)
finalvirtual

Definition at line 65 of file GB05BOptnSplitAndKillByCrossSection.cc.

67{
68
69 // -- This method is called if we have limited the step.
70 // -- We hence make the splitting or killing.
71
72 // Get track weight:
73 G4double initialWeight = track->GetWeight();
74
75 // The "particle change" is the object to be used to communicate to
76 // the tracking the update of the primary state and/or creation
77 // secondary tracks.
78 fParticleChange.Initialize(*track);
79
80 // -- Splitting and killing factors.
81 // -- They are taken the same, but the killing factor can be make bigger.
82 G4double splittingFactor = 2.0;
83 G4double killingFactor = 2.0;
84
85
86 if ( track->GetMomentumDirection().z() > 0 )
87 {
88 // -- We split if the track is moving forward:
89
90 // Define the tracks weight:
91 G4double weightOfTrack = initialWeight/splittingFactor;
92
93 // Ask currect track weight to be changed to new value:
94 fParticleChange.ProposeParentWeight( weightOfTrack );
95 // Now make clones of this track (this is the actual splitting):
96 // we will then have the primary and clone of it, hence the
97 // splitting by a factor 2:
98 G4Track* clone = new G4Track( *track );
99 clone->SetWeight( weightOfTrack );
100 fParticleChange.AddSecondary( clone );
101 // -- Below's call added for safety & illustration : inform particle change to not
102 // -- modify the clone (ie : daughter) weight to male it that of the
103 // -- primary. Here call not mandatory and both tracks have same weights.
104 fParticleChange.SetSecondaryWeightByProcess(true);
105 }
106 else
107 {
108 // -- We apply Russian roulette if the track is moving backward:
109
110 // Shoot a random number (in ]0,1[ segment):
111 G4double random = G4UniformRand();
112 G4double killingProbability = 1.0 - 1.0/killingFactor;
113 if ( random < killingProbability )
114 {
115 // We ask for the the track to be killed:
116 fParticleChange.ProposeTrackStatus(fStopAndKill);
117 }
118 else
119 {
120 // In this case, the track survives. We change its weight
121 // to conserve weight among killed and survival tracks:
122 fParticleChange.ProposeParentWeight( initialWeight*killingFactor );
123 }
124 }
125
126 return &fParticleChange;
127
128}

◆ SetInteractionLength()

void GB05BOptnSplitAndKillByCrossSection::SetInteractionLength ( G4double  interactionLength)
inline

Definition at line 80 of file GB05BOptnSplitAndKillByCrossSection.hh.

81 {
82 fInteractionLength = interactionLength;
83 }

Member Data Documentation

◆ fParticleChange

G4ParticleChange GB05BOptnSplitAndKillByCrossSection::fParticleChange
private

Definition at line 87 of file GB05BOptnSplitAndKillByCrossSection.hh.

◆ fInteractionLength

G4double GB05BOptnSplitAndKillByCrossSection::fInteractionLength
private

Definition at line 88 of file GB05BOptnSplitAndKillByCrossSection.hh.


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

Applications | User Support | Publications | Collaboration