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

#include <G4InteractionLawPhysical.hh>

Inheritance diagram for G4InteractionLawPhysical:
G4VBiasingInteractionLaw

Public Member Functions

virtual G4double ComputeEffectiveCrossSectionAt (G4double length) const
 
virtual G4double ComputeNonInteractionProbabilityAt (G4double length) const
 
 G4InteractionLawPhysical (G4String name="exponentialLaw")
 
const G4StringGetName () const
 
G4double GetPhysicalCrossSection () const
 
G4double GetSampledInteractionLength () const
 
virtual G4bool IsEffectiveCrossSectionInfinite () const
 
virtual G4bool IsSingular () const
 
G4double Sample ()
 
virtual G4double SampleInteractionLength ()
 
void SetPhysicalCrossSection (G4double crossSection)
 
G4double UpdateForStep (G4double truePathLength)
 
virtual G4double UpdateInteractionLengthForStep (G4double truePathLength)
 
virtual ~G4InteractionLawPhysical ()
 

Private Attributes

G4double fCrossSection
 
G4bool fCrossSectionDefined
 
G4String fName
 
G4double fNumberOfInteractionLength
 
G4double fSampledInteractionLength
 

Detailed Description

Definition at line 44 of file G4InteractionLawPhysical.hh.

Constructor & Destructor Documentation

◆ G4InteractionLawPhysical()

G4InteractionLawPhysical::G4InteractionLawPhysical ( G4String  name = "exponentialLaw")

◆ ~G4InteractionLawPhysical()

G4InteractionLawPhysical::~G4InteractionLawPhysical ( )
virtual

Definition at line 36 of file G4InteractionLawPhysical.cc.

37{}

Member Function Documentation

◆ ComputeEffectiveCrossSectionAt()

G4double G4InteractionLawPhysical::ComputeEffectiveCrossSectionAt ( G4double  length) const
virtual

Implements G4VBiasingInteractionLaw.

Definition at line 53 of file G4InteractionLawPhysical.cc.

54{
55 if (!fCrossSectionDefined) G4Exception("G4InteractionLawPhysical::ComputeEffectiveCrossSection(..)",
56 "BIAS.GEN.15",
58 "Cross-section value requested, but has not been defined yet. Assumes 0 !");
59 return fCrossSection;
60}
@ JustWarning
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
Definition: G4Exception.cc:35

References fCrossSection, fCrossSectionDefined, G4Exception(), and JustWarning.

Referenced by G4BiasingProcessInterface::PostStepDoIt().

◆ ComputeNonInteractionProbabilityAt()

G4double G4InteractionLawPhysical::ComputeNonInteractionProbabilityAt ( G4double  length) const
virtual

Implements G4VBiasingInteractionLaw.

Definition at line 62 of file G4InteractionLawPhysical.cc.

63{
64 if (!fCrossSectionDefined) G4Exception("G4InteractionLawPhysical::ComputeNonInteractionProbability(..)",
65 "BIAS.GEN.16",
67 "Non interaction probabitlity value requested, but cross section has not been defined yet. Assumes it to be 0 !");
68 // -- allows zero cross-section case, by convention:
69 if ( fCrossSection == 0.0 ) return 1.0;
70 else return std::exp(-fCrossSection*stepLength);
71}

References fCrossSection, fCrossSectionDefined, G4Exception(), and JustWarning.

Referenced by G4BiasingProcessInterface::AlongStepDoIt().

◆ GetName()

const G4String & G4VBiasingInteractionLaw::GetName ( ) const
inlineinherited

◆ GetPhysicalCrossSection()

G4double G4InteractionLawPhysical::GetPhysicalCrossSection ( ) const
inline

Definition at line 52 of file G4InteractionLawPhysical.hh.

52{return fCrossSection;}

References fCrossSection.

Referenced by G4BOptnChangeCrossSection::GetBiasedCrossSection().

◆ GetSampledInteractionLength()

G4double G4VBiasingInteractionLaw::GetSampledInteractionLength ( ) const
inlineinherited

◆ IsEffectiveCrossSectionInfinite()

virtual G4bool G4VBiasingInteractionLaw::IsEffectiveCrossSectionInfinite ( ) const
inlinevirtualinherited

◆ IsSingular()

virtual G4bool G4VBiasingInteractionLaw::IsSingular ( ) const
inlinevirtualinherited

Reimplemented in G4ILawCommonTruncatedExp, G4ILawForceFreeFlight, and G4ILawTruncatedExp.

Definition at line 88 of file G4VBiasingInteractionLaw.hh.

88{return false;}

Referenced by G4BiasingProcessInterface::PostStepDoIt().

◆ Sample()

G4double G4VBiasingInteractionLaw::Sample ( )
inlineinherited

◆ SampleInteractionLength()

G4double G4InteractionLawPhysical::SampleInteractionLength ( )
virtual

Implements G4VBiasingInteractionLaw.

Definition at line 73 of file G4InteractionLawPhysical.cc.

74{
75 if ( !fCrossSectionDefined || fCrossSection < 0.0 ) G4Exception("G4InteractionLawPhysical::Sample(..)",
76 "BIAS.GEN.17",
78 "Trying to sample while cross-section is not defined or < 0 !");
79 if ( fCrossSection == 0.0 ) return DBL_MAX;
80
83}
@ FatalException
#define G4UniformRand()
Definition: Randomize.hh:52
#define DBL_MAX
Definition: templates.hh:62

References DBL_MAX, FatalException, fCrossSection, fCrossSectionDefined, fNumberOfInteractionLength, G4Exception(), and G4UniformRand.

◆ SetPhysicalCrossSection()

void G4InteractionLawPhysical::SetPhysicalCrossSection ( G4double  crossSection)

Definition at line 39 of file G4InteractionLawPhysical.cc.

40{
41 if (crossSection < 0.0)
42 {
43 G4Exception("G4InteractionLawPhysical::SetPhysicalCrossSection(..)",
44 "BIAS.GEN.14",
46 "Cross-section value passed is negative. It is set to zero !");
47 crossSection = 0.0;
48 }
50 fCrossSection = crossSection;
51}

References fCrossSection, fCrossSectionDefined, G4Exception(), and JustWarning.

Referenced by G4BiasingProcessInterface::PostStepGetPhysicalInteractionLength(), and G4BOptnChangeCrossSection::SetBiasedCrossSection().

◆ UpdateForStep()

G4double G4VBiasingInteractionLaw::UpdateForStep ( G4double  truePathLength)
inlineinherited

◆ UpdateInteractionLengthForStep()

G4double G4InteractionLawPhysical::UpdateInteractionLengthForStep ( G4double  truePathLength)
virtual

Reimplemented from G4VBiasingInteractionLaw.

Definition at line 86 of file G4InteractionLawPhysical.cc.

87{
89
91 {
93 ed << " Negative number of interaction length for `" << GetName() << "' " << fNumberOfInteractionLength << ", set it to zero !" << G4endl;
94 G4Exception("G4InteractionLawPhysical::UpdateInteractionLengthForStep(...)",
95 "BIAS.GEN.13",
97 ed);
99 }
101}
std::ostringstream G4ExceptionDescription
Definition: G4Exception.hh:40
#define G4endl
Definition: G4ios.hh:57
const G4String & GetName() const

References fCrossSection, fNumberOfInteractionLength, G4endl, G4Exception(), G4VBiasingInteractionLaw::GetName(), and JustWarning.

Field Documentation

◆ fCrossSection

G4double G4InteractionLawPhysical::fCrossSection
private

◆ fCrossSectionDefined

G4bool G4InteractionLawPhysical::fCrossSectionDefined
private

◆ fName

G4String G4VBiasingInteractionLaw::fName
privateinherited

Definition at line 111 of file G4VBiasingInteractionLaw.hh.

Referenced by G4VBiasingInteractionLaw::GetName().

◆ fNumberOfInteractionLength

G4double G4InteractionLawPhysical::fNumberOfInteractionLength
private

◆ fSampledInteractionLength

G4double G4VBiasingInteractionLaw::fSampledInteractionLength
privateinherited

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