#include <G4InteractionLawPhysical.hh>
Definition at line 45 of file G4InteractionLawPhysical.hh.
G4InteractionLawPhysical::G4InteractionLawPhysical |
( |
G4String |
name = "exponentialLaw" | ) |
|
Definition at line 29 of file G4InteractionLawPhysical.cc.
32 fCrossSectionDefined(
false),
33 fNumberOfInteractionLength(-1.0)
G4VBiasingInteractionLaw(G4String name)
G4InteractionLawPhysical::~G4InteractionLawPhysical |
( |
| ) |
|
|
virtual |
G4double G4InteractionLawPhysical::ComputeEffectiveCrossSectionAt |
( |
G4double |
length | ) |
const |
|
virtual |
Implements G4VBiasingInteractionLaw.
Definition at line 53 of file G4InteractionLawPhysical.cc.
55 if (!fCrossSectionDefined)
G4Exception(
"G4InteractionLawPhysical::ComputeEffectiveCrossSection(..)",
58 "Cross-section value requested, but has not been defined yet. Assumes 0 !");
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
G4double G4InteractionLawPhysical::ComputeNonInteractionProbabilityAt |
( |
G4double |
length | ) |
const |
|
virtual |
Implements G4VBiasingInteractionLaw.
Definition at line 62 of file G4InteractionLawPhysical.cc.
64 if (!fCrossSectionDefined)
G4Exception(
"G4InteractionLawPhysical::ComputeNonInteractionProbability(..)",
67 "Non interaction probabitlity value requested, but cross section has not been defined yet. Assumes it to be 0 !");
69 if ( fCrossSection == 0.0 )
return 1.0;
70 else return std::exp(-fCrossSection*stepLength);
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
G4double G4InteractionLawPhysical::GetPhysicalCrossSection |
( |
| ) |
const |
|
inline |
G4double G4InteractionLawPhysical::SampleInteractionLength |
( |
| ) |
|
|
virtual |
Implements G4VBiasingInteractionLaw.
Definition at line 73 of file G4InteractionLawPhysical.cc.
75 if ( !fCrossSectionDefined || fCrossSection < 0.0 )
G4Exception(
"G4InteractionLawPhysical::Sample(..)",
78 "Trying to sample while cross-section is not defined or < 0 !");
79 if ( fCrossSection == 0.0 )
return DBL_MAX;
82 return fNumberOfInteractionLength/fCrossSection;
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
void G4InteractionLawPhysical::SetPhysicalCrossSection |
( |
G4double |
crossSection | ) |
|
Definition at line 39 of file G4InteractionLawPhysical.cc.
41 if (crossSection < 0.0)
43 G4Exception(
"G4InteractionLawPhysical::SetPhysicalCrossSection(..)",
46 "Cross-section value passed is negative. It is set to zero !");
49 fCrossSectionDefined =
true;
50 fCrossSection = crossSection;
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
G4double G4InteractionLawPhysical::UpdateInteractionLengthForStep |
( |
G4double |
truePathLength | ) |
|
|
virtual |
Reimplemented from G4VBiasingInteractionLaw.
Definition at line 86 of file G4InteractionLawPhysical.cc.
88 fNumberOfInteractionLength -= truePathLength*fCrossSection;
90 if ( fNumberOfInteractionLength < 0 )
93 ed <<
" Negative number of interaction length for `" <<
GetName() <<
"' " << fNumberOfInteractionLength <<
", set it to zero !" <<
G4endl;
94 G4Exception(
"G4InteractionLawPhysical::UpdateInteractionLengthForStep(...)",
98 fNumberOfInteractionLength = 0.;
100 return fNumberOfInteractionLength/fCrossSection;
std::ostringstream G4ExceptionDescription
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
const G4String & GetName() const
The documentation for this class was generated from the following files: