Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions
G4ILawCommonTruncatedExp Class Reference

#include <G4ILawCommonTruncatedExp.hh>

Inheritance diagram for G4ILawCommonTruncatedExp:
G4VBiasingInteractionLaw

Public Member Functions

 G4ILawCommonTruncatedExp (G4String name="expSharedForceInteractionLaw")
 
virtual ~G4ILawCommonTruncatedExp ()
 
virtual G4bool IsSingular () const
 
virtual G4bool IsEffectiveCrossSectionInfinite () const
 
virtual G4double ComputeEffectiveCrossSectionAt (G4double length) const
 
virtual G4double ComputeNonInteractionProbabilityAt (G4double length) const
 
void SetNumberOfSharing (G4int n)
 
G4int GetNumberOfSharing () const
 
void SetForceCrossSection (G4double xs)
 
void reset ()
 
void SetMaximumDistance (G4double d)
 
G4double GetMaximumDistance () const
 
G4double GetInteractionDistance () const
 
void SetOperation (G4BOptnForceCommonTruncatedExp *operation)
 
- Public Member Functions inherited from G4VBiasingInteractionLaw
 G4VBiasingInteractionLaw (G4String name)
 
virtual ~G4VBiasingInteractionLaw ()
 
const G4StringGetName () const
 
G4double Sample ()
 
G4double UpdateForStep (G4double truePathLength)
 
G4double GetSampledInteractionLength () const
 

Additional Inherited Members

Detailed Description

Definition at line 51 of file G4ILawCommonTruncatedExp.hh.

Constructor & Destructor Documentation

G4ILawCommonTruncatedExp::G4ILawCommonTruncatedExp ( G4String  name = "expSharedForceInteractionLaw")

Definition at line 34 of file G4ILawCommonTruncatedExp.cc.

36  fExpInteractionLaw("expLawFor"+name)
37  //fIsSingular(false)
38 {}
G4ILawCommonTruncatedExp::~G4ILawCommonTruncatedExp ( )
virtual

Definition at line 40 of file G4ILawCommonTruncatedExp.cc.

41 {}

Member Function Documentation

G4double G4ILawCommonTruncatedExp::ComputeEffectiveCrossSectionAt ( G4double  length) const
virtual

Implements G4VBiasingInteractionLaw.

Definition at line 44 of file G4ILawCommonTruncatedExp.cc.

References G4ILawTruncatedExp::ComputeEffectiveCrossSectionAt(), and G4BOptnForceCommonTruncatedExp::GetTriggeredProcessXSfraction().

45 {
46  return fExpInteractionLaw.ComputeEffectiveCrossSectionAt( distance ) * fOperation->GetTriggeredProcessXSfraction();
47 }
virtual G4double ComputeEffectiveCrossSectionAt(G4double length) const
G4double G4ILawCommonTruncatedExp::ComputeNonInteractionProbabilityAt ( G4double  length) const
virtual

Implements G4VBiasingInteractionLaw.

Definition at line 49 of file G4ILawCommonTruncatedExp.cc.

References G4ILawTruncatedExp::ComputeNonInteractionProbabilityAt(), G4endl, G4Exception(), G4VBiasingInteractionLaw::GetName(), and JustWarning.

50 {
51  G4double niProba = fExpInteractionLaw.ComputeNonInteractionProbabilityAt( distance );
52 
53  if ( niProba > 0.0 )
54  {
55  return std::exp( std::log(niProba) / fNumberOfSharing );
56  }
57  else
58  {
60  ed << " Negative probability for `" << GetName() << "' p = " << niProba << " distance = " << distance << " !!! " << G4endl;
61  G4Exception(" G4ILawCommonTruncatedExp::ComputeNonInteractionProbabilityAt(...)",
62  "BIAS.GEN.08",
64  ed);
65  return niProba;
66  }
67 }
std::ostringstream G4ExceptionDescription
Definition: globals.hh:76
virtual G4double ComputeNonInteractionProbabilityAt(G4double length) const
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
#define G4endl
Definition: G4ios.hh:61
const G4String & GetName() const
double G4double
Definition: G4Types.hh:76
G4double G4ILawCommonTruncatedExp::GetInteractionDistance ( ) const
inline

Definition at line 82 of file G4ILawCommonTruncatedExp.hh.

References G4ILawTruncatedExp::GetInteractionDistance().

Referenced by G4BOptnForceCommonTruncatedExp::ProposeAlongStepLimit().

82 {return fExpInteractionLaw.GetInteractionDistance();}
G4double GetInteractionDistance() const
G4double G4ILawCommonTruncatedExp::GetMaximumDistance ( ) const
inline

Definition at line 81 of file G4ILawCommonTruncatedExp.hh.

References G4ILawTruncatedExp::GetMaximumDistance().

Referenced by G4BOptnForceCommonTruncatedExp::UpdateForStep().

81 {return fExpInteractionLaw.GetMaximumDistance();}
G4double GetMaximumDistance() const
G4int G4ILawCommonTruncatedExp::GetNumberOfSharing ( ) const
inline

Definition at line 77 of file G4ILawCommonTruncatedExp.hh.

77 { return fNumberOfSharing; }
virtual G4bool G4ILawCommonTruncatedExp::IsEffectiveCrossSectionInfinite ( ) const
inlinevirtual

Reimplemented from G4VBiasingInteractionLaw.

Definition at line 60 of file G4ILawCommonTruncatedExp.hh.

References G4VBiasingInteractionLaw::IsEffectiveCrossSectionInfinite().

61  {return fExpInteractionLaw.IsEffectiveCrossSectionInfinite();}
virtual G4bool IsEffectiveCrossSectionInfinite() const
virtual G4bool G4ILawCommonTruncatedExp::IsSingular ( ) const
inlinevirtual

Reimplemented from G4VBiasingInteractionLaw.

Definition at line 58 of file G4ILawCommonTruncatedExp.hh.

References G4ILawTruncatedExp::IsSingular().

59  {return fExpInteractionLaw.IsSingular();}
virtual G4bool IsSingular() const
void G4ILawCommonTruncatedExp::reset ( )

Definition at line 84 of file G4ILawCommonTruncatedExp.cc.

Referenced by G4BOptnForceCommonTruncatedExp::Initialize(), and G4BOptnForceCommonTruncatedExp::Sample().

85 {
86  fFirstSamplingCall = true;
87  fFirstUpdateCall = true;
88 }
void G4ILawCommonTruncatedExp::SetForceCrossSection ( G4double  xs)
inline

Definition at line 78 of file G4ILawCommonTruncatedExp.hh.

References G4ILawTruncatedExp::SetForceCrossSection().

Referenced by G4BOptnForceCommonTruncatedExp::AddCrossSection().

78 { fExpInteractionLaw.SetForceCrossSection( xs ); }
void SetForceCrossSection(G4double xs)
void G4ILawCommonTruncatedExp::SetMaximumDistance ( G4double  d)
inline

Definition at line 80 of file G4ILawCommonTruncatedExp.hh.

References G4ILawTruncatedExp::SetMaximumDistance().

Referenced by G4BOptnForceCommonTruncatedExp::Initialize().

80 { fExpInteractionLaw.SetMaximumDistance(d); }
void SetMaximumDistance(G4double d)
void G4ILawCommonTruncatedExp::SetNumberOfSharing ( G4int  n)
inline

Definition at line 76 of file G4ILawCommonTruncatedExp.hh.

References n.

Referenced by G4BOptnForceCommonTruncatedExp::AddCrossSection().

76 { fNumberOfSharing = n; }
const G4int n
void G4ILawCommonTruncatedExp::SetOperation ( G4BOptnForceCommonTruncatedExp operation)
inline

Definition at line 83 of file G4ILawCommonTruncatedExp.hh.

Referenced by G4BOptnForceCommonTruncatedExp::G4BOptnForceCommonTruncatedExp().

83 {fOperation = operation;}

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