Geant4-11
Public Member Functions | Private Attributes
G4BOptnForceCommonTruncatedExp Class Reference

#include <G4BOptnForceCommonTruncatedExp.hh>

Inheritance diagram for G4BOptnForceCommonTruncatedExp:
G4VBiasingOperation

Public Member Functions

void AddCrossSection (const G4VProcess *, G4double)
 
virtual void AlongMoveBy (const G4BiasingProcessInterface *, const G4Step *, G4double)
 
virtual G4VParticleChangeApplyFinalStateBiasing (const G4BiasingProcessInterface *, const G4Track *, const G4Step *, G4bool &)
 
void ChooseProcessToApply ()
 
virtual G4double DistanceToApplyOperation (const G4Track *, G4double, G4ForceCondition *)
 
 G4BOptnForceCommonTruncatedExp (G4String name)
 
virtual G4VParticleChangeGenerateBiasingFinalState (const G4Track *, const G4Step *)
 
G4ILawCommonTruncatedExpGetCommonTruncatedExpLaw ()
 
G4ILawForceFreeFlightGetForceFreeFlightLaw ()
 
const G4ThreeVectorGetInitialMomentum () const
 
G4bool GetInteractionOccured () const
 
G4double GetMaximumDistance () const
 
const G4StringGetName () const
 
size_t GetNumberOfSharing () const
 
const G4VProcessGetProcessToApply () const
 
std::size_t GetUniqueID () const
 
void Initialize (const G4Track *)
 
virtual G4double ProposeAlongStepLimit (const G4BiasingProcessInterface *)
 
virtual G4GPILSelection ProposeGPILSelection (const G4GPILSelection processSelection)
 
virtual const G4VBiasingInteractionLawProvideOccurenceBiasingInteractionLaw (const G4BiasingProcessInterface *, G4ForceCondition &)
 
void Sample ()
 
void SetInteractionOccured (G4bool b)
 
void UpdateForStep (const G4Step *)
 
virtual ~G4BOptnForceCommonTruncatedExp ()
 

Private Attributes

G4ILawCommonTruncatedExpfCommonTruncatedExpLaw
 
std::map< const G4VProcess *, G4doublefCrossSections
 
G4ParticleChangeForNothing fDummyParticleChange
 
G4ILawForceFreeFlightfForceFreeFlightLaw
 
G4ThreeVector fInitialMomentum
 
G4bool fInteractionOccured
 
G4double fMaximumDistance
 
const G4String fName
 
size_t fNumberOfSharing
 
const G4VProcessfProcessToApply
 
G4double fTotalCrossSection
 
std::size_t fUniqueID
 

Detailed Description

Definition at line 59 of file G4BOptnForceCommonTruncatedExp.hh.

Constructor & Destructor Documentation

◆ G4BOptnForceCommonTruncatedExp()

G4BOptnForceCommonTruncatedExp::G4BOptnForceCommonTruncatedExp ( G4String  name)

Definition at line 34 of file G4BOptnForceCommonTruncatedExp.cc.

37 fProcessToApply(nullptr),
40{
41 fCommonTruncatedExpLaw = new G4ILawCommonTruncatedExp("ExpLawForOperation"+name);
42 fForceFreeFlightLaw = new G4ILawForceFreeFlight ("FFFLawForOperation"+name);
43
45}
G4ILawCommonTruncatedExp * fCommonTruncatedExpLaw
G4VBiasingOperation(G4String name)
const char * name(G4int ptype)

References fCommonTruncatedExpLaw, fForceFreeFlightLaw, fTotalCrossSection, and G4InuclParticleNames::name().

◆ ~G4BOptnForceCommonTruncatedExp()

G4BOptnForceCommonTruncatedExp::~G4BOptnForceCommonTruncatedExp ( )
virtual

Member Function Documentation

◆ AddCrossSection()

void G4BOptnForceCommonTruncatedExp::AddCrossSection ( const G4VProcess process,
G4double  crossSection 
)

Definition at line 116 of file G4BOptnForceCommonTruncatedExp.cc.

117{
118 fTotalCrossSection += crossSection;
119 fCrossSections[process] = crossSection;
121}
std::map< const G4VProcess *, G4double > fCrossSections

References fCrossSections, fNumberOfSharing, and fTotalCrossSection.

Referenced by G4BOptrForceCollision::ProposeOccurenceBiasingOperation().

◆ AlongMoveBy()

virtual void G4VBiasingOperation::AlongMoveBy ( const G4BiasingProcessInterface ,
const G4Step ,
G4double   
)
inlinevirtualinherited

Reimplemented in G4BOptnForceFreeFlight.

Definition at line 139 of file G4VBiasingOperation.hh.

141 {}

Referenced by G4BiasingProcessInterface::AlongStepDoIt().

◆ ApplyFinalStateBiasing()

G4VParticleChange * G4BOptnForceCommonTruncatedExp::ApplyFinalStateBiasing ( const G4BiasingProcessInterface callingProcess,
const G4Track track,
const G4Step step,
G4bool forceFinalState 
)
virtual

Implements G4VBiasingOperation.

Definition at line 76 of file G4BOptnForceCommonTruncatedExp.cc.

80{
81 if ( callingProcess->GetWrappedProcess() != fProcessToApply )
82 {
83 forceFinalState = true;
85 return &fDummyParticleChange;
86 }
88 {
89 forceFinalState = true;
92 }
93
94 // -- checks if process won the GPIL race:
95 G4double processGPIL = callingProcess->GetPostStepGPIL() < callingProcess->GetAlongStepGPIL() ?
96 callingProcess->GetPostStepGPIL() : callingProcess->GetAlongStepGPIL() ;
97 if ( processGPIL <= step->GetStepLength() )
98 {
99 // -- if process won, wrapped process produces the final state.
100 // -- In this case, the weight for occurrence biasing is applied
101 // -- by the callingProcess, at exit of present method. This is
102 // -- selected by "forceFinalState = false":
103 forceFinalState = false;
104 fInteractionOccured = true;
105 return callingProcess->GetWrappedProcess()->PostStepDoIt( *track, *step );
106 }
107 else
108 {
109 forceFinalState = true;
111 return &fDummyParticleChange;
112 }
113}
double G4double
Definition: G4Types.hh:83
G4VProcess * GetWrappedProcess() const
virtual void Initialize(const G4Track &track)
virtual G4VParticleChange * PostStepDoIt(const G4Track &track, const G4Step &stepData)=0

References fDummyParticleChange, fInteractionOccured, fProcessToApply, G4BiasingProcessInterface::GetAlongStepGPIL(), G4BiasingProcessInterface::GetPostStepGPIL(), G4BiasingProcessInterface::GetWrappedProcess(), G4ParticleChangeForNothing::Initialize(), and G4VProcess::PostStepDoIt().

◆ ChooseProcessToApply()

void G4BOptnForceCommonTruncatedExp::ChooseProcessToApply ( )

Definition at line 167 of file G4BOptnForceCommonTruncatedExp.cc.

168{
170 G4double sigmaSelect = 0.0;
171 for ( std::map< const G4VProcess*, G4double>::const_iterator it = fCrossSections.begin();
172 it != fCrossSections.end();
173 it++)
174 {
175 sigmaSelect += (*it).second;
176 if ( sigmaRand <= sigmaSelect )
177 {
178 fProcessToApply = (*it).first;
179 break;
180 }
181 }
182}
#define G4UniformRand()
Definition: Randomize.hh:52

References fCrossSections, fProcessToApply, fTotalCrossSection, and G4UniformRand.

Referenced by Sample().

◆ DistanceToApplyOperation()

virtual G4double G4BOptnForceCommonTruncatedExp::DistanceToApplyOperation ( const G4Track ,
G4double  ,
G4ForceCondition  
)
inlinevirtual

Implements G4VBiasingOperation.

Definition at line 78 of file G4BOptnForceCommonTruncatedExp.hh.

80 {return DBL_MAX;}
#define DBL_MAX
Definition: templates.hh:62

References DBL_MAX.

◆ GenerateBiasingFinalState()

virtual G4VParticleChange * G4BOptnForceCommonTruncatedExp::GenerateBiasingFinalState ( const G4Track ,
const G4Step  
)
inlinevirtual

Implements G4VBiasingOperation.

Definition at line 81 of file G4BOptnForceCommonTruncatedExp.hh.

82 {return 0;}

◆ GetCommonTruncatedExpLaw()

G4ILawCommonTruncatedExp * G4BOptnForceCommonTruncatedExp::GetCommonTruncatedExpLaw ( )
inline

Definition at line 88 of file G4BOptnForceCommonTruncatedExp.hh.

89 {
91 }

References fCommonTruncatedExpLaw.

◆ GetForceFreeFlightLaw()

G4ILawForceFreeFlight * G4BOptnForceCommonTruncatedExp::GetForceFreeFlightLaw ( )
inline

Definition at line 92 of file G4BOptnForceCommonTruncatedExp.hh.

93 {
95 }

References fForceFreeFlightLaw.

◆ GetInitialMomentum()

const G4ThreeVector & G4BOptnForceCommonTruncatedExp::GetInitialMomentum ( ) const
inline

◆ GetInteractionOccured()

G4bool G4BOptnForceCommonTruncatedExp::GetInteractionOccured ( ) const
inline

◆ GetMaximumDistance()

G4double G4BOptnForceCommonTruncatedExp::GetMaximumDistance ( ) const
inline

◆ GetName()

const G4String & G4VBiasingOperation::GetName ( ) const
inlineinherited

Definition at line 198 of file G4VBiasingOperation.hh.

198{return fName;}

References G4VBiasingOperation::fName.

◆ GetNumberOfSharing()

size_t G4BOptnForceCommonTruncatedExp::GetNumberOfSharing ( ) const
inline

◆ GetProcessToApply()

const G4VProcess * G4BOptnForceCommonTruncatedExp::GetProcessToApply ( ) const
inline

Definition at line 103 of file G4BOptnForceCommonTruncatedExp.hh.

103{ return fProcessToApply; }

References fProcessToApply.

◆ GetUniqueID()

std::size_t G4VBiasingOperation::GetUniqueID ( ) const
inlineinherited

Definition at line 199 of file G4VBiasingOperation.hh.

199{return fUniqueID;}

References G4VBiasingOperation::fUniqueID.

◆ Initialize()

void G4BOptnForceCommonTruncatedExp::Initialize ( const G4Track track)

Definition at line 124 of file G4BOptnForceCommonTruncatedExp.cc.

125{
126 fCrossSections.clear();
127 fTotalCrossSection = 0.0;
129 fProcessToApply = 0;
130 fInteractionOccured = false;
131 fInitialMomentum = track->GetMomentum();
132
133 G4VSolid* currentSolid = track->GetVolume()->GetLogicalVolume()->GetSolid();
135 GetNavigatorForTracking()->
136 GetGlobalToLocalTransform()).TransformPoint(track->GetPosition());
138 GetNavigatorForTracking()->
139 GetGlobalToLocalTransform()).TransformAxis(track->GetMomentumDirection());
140 fMaximumDistance = currentSolid->DistanceToOut(localPosition, localDirection);
143}
G4VSolid * GetSolid() const
G4VPhysicalVolume * GetVolume() const
const G4ThreeVector & GetPosition() const
G4ThreeVector GetMomentum() const
const G4ThreeVector & GetMomentumDirection() const
static G4TransportationManager * GetTransportationManager()
G4LogicalVolume * GetLogicalVolume() const
virtual G4double DistanceToOut(const G4ThreeVector &p, const G4ThreeVector &v, const G4bool calcNorm=false, G4bool *validNorm=nullptr, G4ThreeVector *n=nullptr) const =0
#define DBL_MIN
Definition: templates.hh:54

References DBL_MIN, G4VSolid::DistanceToOut(), fCommonTruncatedExpLaw, fCrossSections, fInitialMomentum, fInteractionOccured, fMaximumDistance, fNumberOfSharing, fProcessToApply, fTotalCrossSection, G4VPhysicalVolume::GetLogicalVolume(), G4Track::GetMomentum(), G4Track::GetMomentumDirection(), G4Track::GetPosition(), G4LogicalVolume::GetSolid(), G4TransportationManager::GetTransportationManager(), G4Track::GetVolume(), and G4ILawCommonTruncatedExp::SetMaximumDistance().

Referenced by G4BOptrForceCollision::ProposeOccurenceBiasingOperation().

◆ ProposeAlongStepLimit()

virtual G4double G4BOptnForceCommonTruncatedExp::ProposeAlongStepLimit ( const G4BiasingProcessInterface )
inlinevirtual

Reimplemented from G4VBiasingOperation.

Definition at line 71 of file G4BOptnForceCommonTruncatedExp.hh.

71{ return DBL_MAX; }

References DBL_MAX.

◆ ProposeGPILSelection()

G4GPILSelection G4BOptnForceCommonTruncatedExp::ProposeGPILSelection ( const G4GPILSelection  processSelection)
virtual

Reimplemented from G4VBiasingOperation.

Definition at line 70 of file G4BOptnForceCommonTruncatedExp.cc.

71{
73}
@ NotCandidateForSelection

References NotCandidateForSelection.

◆ ProvideOccurenceBiasingInteractionLaw()

const G4VBiasingInteractionLaw * G4BOptnForceCommonTruncatedExp::ProvideOccurenceBiasingInteractionLaw ( const G4BiasingProcessInterface callingProcess,
G4ForceCondition proposeForceCondition 
)
virtual

Implements G4VBiasingOperation.

Definition at line 53 of file G4BOptnForceCommonTruncatedExp.cc.

56{
57 if ( callingProcess->GetWrappedProcess() == fProcessToApply )
58 {
59 proposeForceCondition = Forced;
61 }
62 else
63 {
64 proposeForceCondition = Forced;
66 }
67}
@ Forced

References fCommonTruncatedExpLaw, fForceFreeFlightLaw, Forced, fProcessToApply, and G4BiasingProcessInterface::GetWrappedProcess().

◆ Sample()

void G4BOptnForceCommonTruncatedExp::Sample ( )

◆ SetInteractionOccured()

void G4BOptnForceCommonTruncatedExp::SetInteractionOccured ( G4bool  b)
inline

Definition at line 106 of file G4BOptnForceCommonTruncatedExp.hh.

106{ fInteractionOccured = b; }

References fInteractionOccured.

◆ UpdateForStep()

void G4BOptnForceCommonTruncatedExp::UpdateForStep ( const G4Step step)

Field Documentation

◆ fCommonTruncatedExpLaw

G4ILawCommonTruncatedExp* G4BOptnForceCommonTruncatedExp::fCommonTruncatedExpLaw
private

◆ fCrossSections

std::map< const G4VProcess*, G4double > G4BOptnForceCommonTruncatedExp::fCrossSections
private

◆ fDummyParticleChange

G4ParticleChangeForNothing G4BOptnForceCommonTruncatedExp::fDummyParticleChange
private

Definition at line 119 of file G4BOptnForceCommonTruncatedExp.hh.

Referenced by ApplyFinalStateBiasing().

◆ fForceFreeFlightLaw

G4ILawForceFreeFlight* G4BOptnForceCommonTruncatedExp::fForceFreeFlightLaw
private

◆ fInitialMomentum

G4ThreeVector G4BOptnForceCommonTruncatedExp::fInitialMomentum
private

Definition at line 117 of file G4BOptnForceCommonTruncatedExp.hh.

Referenced by GetInitialMomentum(), and Initialize().

◆ fInteractionOccured

G4bool G4BOptnForceCommonTruncatedExp::fInteractionOccured
private

◆ fMaximumDistance

G4double G4BOptnForceCommonTruncatedExp::fMaximumDistance
private

◆ fName

const G4String G4VBiasingOperation::fName
privateinherited

Definition at line 203 of file G4VBiasingOperation.hh.

Referenced by G4VBiasingOperation::GetName().

◆ fNumberOfSharing

size_t G4BOptnForceCommonTruncatedExp::fNumberOfSharing
private

◆ fProcessToApply

const G4VProcess* G4BOptnForceCommonTruncatedExp::fProcessToApply
private

◆ fTotalCrossSection

G4double G4BOptnForceCommonTruncatedExp::fTotalCrossSection
private

◆ fUniqueID

std::size_t G4VBiasingOperation::fUniqueID
privateinherited

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