Geant4
10.03
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
G4VBiasingInteractionLaw.hh
Go to the documentation of this file.
1
//
2
// ********************************************************************
3
// * License and Disclaimer *
4
// * *
5
// * The Geant4 software is copyright of the Copyright Holders of *
6
// * the Geant4 Collaboration. It is provided under the terms and *
7
// * conditions of the Geant4 Software License, included in the file *
8
// * LICENSE and available at http://cern.ch/geant4/license . These *
9
// * include a list of copyright holders. *
10
// * *
11
// * Neither the authors of this software system, nor their employing *
12
// * institutes,nor the agencies providing financial support for this *
13
// * work make any representation or warranty, express or implied, *
14
// * regarding this software system or assume any liability for its *
15
// * use. Please see the license in the file LICENSE and URL above *
16
// * for the full disclaimer and the limitation of liability. *
17
// * *
18
// * This code implementation is the result of the scientific and *
19
// * technical work of the GEANT4 collaboration. *
20
// * By using, copying, modifying or distributing the software (or *
21
// * any work based on the software) you agree to acknowledge its *
22
// * use in resulting scientific publications, and indicate your *
23
// * acceptance of all terms of the Geant4 Software license. *
24
// ********************************************************************
25
//
26
//
27
// $Id: $
28
//
29
// --------------------------------------------------------------------
30
// GEANT 4 class header file
31
//
32
// Class Description:
33
//
34
// An abstract class to model interaction laws, not necessarily.
35
// exponential ones.
36
// These laws, p(l), are caraterized by their:
37
// - non-interaction probability over l:
38
// P_NI(l) = 1 - integral(0,l) p(s) ds
39
// - effective cross-section at l:
40
// sigma_eff(l) = p(l)/P_NI(l) (several forms exist)
41
// If several laws compete, the resulting net law has:
42
// - an non-interaction probability over a lenght l which
43
// is the product of the individual non-interaction probabilities.
44
// - an effective cross-section which is the
45
// sum on the individual effective cross-sections.
46
//
47
// ----------------G4VBiasingInteractionLaw ----------------
48
//
49
// Author: M.Verderi (LLR), November 2013
50
// - 05/11/13 : First Implementation
51
// --------------------------------------------------------------------
52
53
54
#ifndef G4VBiasingInteractionLaw_hh
55
#define G4VBiasingInteractionLaw_hh 1
56
57
#include "
globals.hh
"
58
#include <vector>
59
60
class
G4BiasingProcessInterface
;
61
62
class
G4VBiasingInteractionLaw
{
63
public
:
64
G4VBiasingInteractionLaw
(
G4String
name
) :
fName
(name),
fSampledInteractionLength
(
DBL_MAX
) {}
65
virtual
~G4VBiasingInteractionLaw
() {}
66
67
public
:
68
const
G4String
&
GetName
()
const
{
return
fName
; }
69
70
// ----------------------------
71
// -- Interface to sub-classes:
72
// ----------------------------
73
protected
:
74
// -- Sample the distribution for point like interaction (PostStep ones)
75
virtual
G4double
SampleInteractionLength
() = 0;
76
public
:
77
// -- Compute non-interaction probability and effective cross-section:
78
// -- (probability of interaction over dl = effective_cross-section* dl)
79
virtual
G4double
ComputeNonInteractionProbabilityAt
(
G4double
length)
const
= 0;
80
virtual
G4double
ComputeEffectiveCrossSectionAt
(
G4double
length)
const
= 0;
81
protected
:
82
// -- Convenience method, used in many daughters classes :
83
// -- update the distribution for a made step of truePathLength size:
84
virtual
G4double
UpdateInteractionLengthForStep
(
G4double
/* truePathLength */
) {
return
DBL_MAX
; }
85
public
:
86
// -- Methods to deal with singularities : null cross sections or infinite ones.
87
// -- In such cases, weight can not always be computed.
88
// -- Tells if this interaction law has singularities:
89
virtual
G4bool
IsSingular
()
const
{
return
false
;}
90
// -- method interrogated only in case interaction law is IsSingular() == true:
91
virtual
G4bool
IsEffectiveCrossSectionInfinite
()
const
{
return
false
;}
92
93
94
// -----------------------------------------
95
// -- public interface to protected methods:
96
// -----------------------------------------
97
public
:
98
G4double
Sample
()
99
{
100
fSampledInteractionLength
=
SampleInteractionLength
();
101
return
fSampledInteractionLength
;
102
}
103
G4double
UpdateForStep
(
G4double
truePathLength)
104
{
105
fSampledInteractionLength
=
UpdateInteractionLengthForStep
(truePathLength);
106
return
fSampledInteractionLength
;
107
}
108
G4double
GetSampledInteractionLength
()
const
{
return
fSampledInteractionLength
; }
109
110
111
private
:
112
G4String
fName
;
113
G4double
fSampledInteractionLength
;
114
};
115
116
#endif
G4VBiasingInteractionLaw::UpdateInteractionLengthForStep
virtual G4double UpdateInteractionLengthForStep(G4double)
Definition:
G4VBiasingInteractionLaw.hh:84
G4VBiasingInteractionLaw
Definition:
G4VBiasingInteractionLaw.hh:62
G4BiasingProcessInterface
Definition:
G4BiasingProcessInterface.hh:70
G4InuclParticleNames::name
const char * name(G4int ptype)
Definition:
G4InuclParticleNames.hh:77
G4VBiasingInteractionLaw::SampleInteractionLength
virtual G4double SampleInteractionLength()=0
G4VBiasingInteractionLaw::ComputeEffectiveCrossSectionAt
virtual G4double ComputeEffectiveCrossSectionAt(G4double length) const =0
G4VBiasingInteractionLaw::fSampledInteractionLength
G4double fSampledInteractionLength
Definition:
G4VBiasingInteractionLaw.hh:113
G4VBiasingInteractionLaw::~G4VBiasingInteractionLaw
virtual ~G4VBiasingInteractionLaw()
Definition:
G4VBiasingInteractionLaw.hh:65
G4bool
bool G4bool
Definition:
G4Types.hh:79
G4VBiasingInteractionLaw::Sample
G4double Sample()
Definition:
G4VBiasingInteractionLaw.hh:98
globals.hh
G4VBiasingInteractionLaw::IsSingular
virtual G4bool IsSingular() const
Definition:
G4VBiasingInteractionLaw.hh:89
G4VBiasingInteractionLaw::ComputeNonInteractionProbabilityAt
virtual G4double ComputeNonInteractionProbabilityAt(G4double length) const =0
G4VBiasingInteractionLaw::fName
G4String fName
Definition:
G4VBiasingInteractionLaw.hh:112
G4VBiasingInteractionLaw::UpdateForStep
G4double UpdateForStep(G4double truePathLength)
Definition:
G4VBiasingInteractionLaw.hh:103
G4VBiasingInteractionLaw::GetSampledInteractionLength
G4double GetSampledInteractionLength() const
Definition:
G4VBiasingInteractionLaw.hh:108
G4VBiasingInteractionLaw::GetName
const G4String & GetName() const
Definition:
G4VBiasingInteractionLaw.hh:68
G4VBiasingInteractionLaw::IsEffectiveCrossSectionInfinite
virtual G4bool IsEffectiveCrossSectionInfinite() const
Definition:
G4VBiasingInteractionLaw.hh:91
G4VBiasingInteractionLaw::G4VBiasingInteractionLaw
G4VBiasingInteractionLaw(G4String name)
Definition:
G4VBiasingInteractionLaw.hh:64
G4double
double G4double
Definition:
G4Types.hh:76
DBL_MAX
#define DBL_MAX
Definition:
templates.hh:83
G4String
Definition:
G4String.hh:45
geant4.10.03
source
processes
biasing
management
include
G4VBiasingInteractionLaw.hh
Generated on Thu Feb 14 2002 02:28:35 for Geant4 by
1.8.8