Geant4 11.2.2
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4VEmissionProbability Class Reference

#include <G4VEmissionProbability.hh>

+ Inheritance diagram for G4VEmissionProbability:

Public Member Functions

 G4VEmissionProbability (G4int Z, G4int A)
 
virtual ~G4VEmissionProbability ()=default
 
void Initialise ()
 
virtual G4double EmissionProbability (const G4Fragment &fragment, G4double anEnergy)
 
virtual G4double ComputeProbability (G4double anEnergy, G4double CB)
 
G4int GetZ (void) const
 
G4int GetA (void) const
 
void SetDecayKinematics (G4int rZ, G4int rA, G4double rmass, G4double fmass)
 
G4double GetRecoilExcitation () const
 
void SetEvapExcitation (G4double exc)
 
G4double GetProbability () const
 
void ResetProbability ()
 
G4double SampleEnergy ()
 
 G4VEmissionProbability (const G4VEmissionProbability &right)=delete
 
const G4VEmissionProbabilityoperator= (const G4VEmissionProbability &right)=delete
 
G4bool operator== (const G4VEmissionProbability &right) const =delete
 
G4bool operator!= (const G4VEmissionProbability &right) const =delete
 

Protected Member Functions

void ResetIntegrator (size_t nbin, G4double de, G4double eps)
 
G4double IntegrateProbability (G4double elow, G4double ehigh, G4double CB)
 

Protected Attributes

G4NuclearLevelDatapNuclearLevelData
 
G4PowpG4pow
 
G4int OPTxs
 
G4int pVerbose
 
G4int theZ
 
G4int theA
 
G4int resZ = 0
 
G4int resA = 0
 
G4double pMass = 0.0
 
G4double pEvapMass = 0.0
 
G4double pResMass = 0.0
 
G4double pProbability = 0.0
 
G4double pTolerance = 0.0
 

Detailed Description

Definition at line 46 of file G4VEmissionProbability.hh.

Constructor & Destructor Documentation

◆ G4VEmissionProbability() [1/2]

G4VEmissionProbability::G4VEmissionProbability ( G4int Z,
G4int A )
explicit

Definition at line 41 of file G4VEmissionProbability.cc.

42 : OPTxs(3), pVerbose(1), theZ(Z), theA(A), elimit(CLHEP::MeV)
43{
47}
const G4double A[17]
static G4NuclearLevelData * GetInstance()
static G4double GetNuclearMass(const G4double A, const G4double Z)
static G4Pow * GetInstance()
Definition G4Pow.cc:41
G4NuclearLevelData * pNuclearLevelData

◆ ~G4VEmissionProbability()

virtual G4VEmissionProbability::~G4VEmissionProbability ( )
virtualdefault

◆ G4VEmissionProbability() [2/2]

G4VEmissionProbability::G4VEmissionProbability ( const G4VEmissionProbability & right)
delete

Member Function Documentation

◆ ComputeProbability()

G4double G4VEmissionProbability::ComputeProbability ( G4double anEnergy,
G4double CB )
virtual

Reimplemented in G4EvaporationProbability, and G4GEMProbabilityVI.

Definition at line 69 of file G4VEmissionProbability.cc.

70{
71 return 0.0;
72}

Referenced by IntegrateProbability(), and SampleEnergy().

◆ EmissionProbability()

G4double G4VEmissionProbability::EmissionProbability ( const G4Fragment & fragment,
G4double anEnergy )
virtual

Reimplemented in G4FissionProbability, and G4GEMProbability.

Definition at line 64 of file G4VEmissionProbability.cc.

65{
66 return 0.0;
67}

Referenced by G4CompetitiveFission::GetEmissionProbability().

◆ GetA()

G4int G4VEmissionProbability::GetA ( void ) const
inline

Definition at line 63 of file G4VEmissionProbability.hh.

63{ return theA; }

◆ GetProbability()

G4double G4VEmissionProbability::GetProbability ( ) const
inline

Definition at line 80 of file G4VEmissionProbability.hh.

Referenced by G4EvaporationChannel::EmittedFragment().

◆ GetRecoilExcitation()

G4double G4VEmissionProbability::GetRecoilExcitation ( ) const
inline

Definition at line 76 of file G4VEmissionProbability.hh.

76{ return fExcRes; };

◆ GetZ()

◆ Initialise()

void G4VEmissionProbability::Initialise ( )

◆ IntegrateProbability()

G4double G4VEmissionProbability::IntegrateProbability ( G4double elow,
G4double ehigh,
G4double CB )
protected

Definition at line 74 of file G4VEmissionProbability.cc.

77{
78 pProbability = 0.0;
79 if(elow >= ehigh) { return pProbability; }
80
81 emin = elow;
82 emax = ehigh;
83 eCoulomb = cb;
84
85 const G4double edeltamin = 0.1*CLHEP::MeV;
86 const G4double edeltamax = 2*CLHEP::MeV;
87 G4double edelta = std::min(std::min(elimit, edeltamax), edeltamin);
88 G4double xbin = (emax - emin)/edelta + 1.0;
89 G4int ibin = std::max((G4int)xbin, 4);
90
91 // providing smart binning
92 G4int nbin = ibin*5;
93 edelta = (emax - emin)/ibin;
94
95 G4double x(emin), y(0.0);
96 G4double edelmicro = edelta*0.02;
97 probmax = ComputeProbability(x + edelmicro, eCoulomb);
98 G4double problast = probmax;
99 if(pVerbose > 1) {
100 G4cout << "### G4VEmissionProbability::IntegrateProbability: "
101 << "probmax=" << probmax << " Emin=" << emin
102 << " Emax=" << emax << " QB=" << cb << " nbin=" << nbin
103 << G4endl;
104 }
105 fE1 = fE2 = fP2 = 0.0;
106 G4double emax0 = emax - edelmicro;
107 G4bool endpoint = false;
108 for(G4int i=0; i<nbin; ++i) {
109 x += edelta;
110 if(x >= emax0) {
111 x = emax0;
112 endpoint = true;
113 }
114 y = ComputeProbability(x, eCoulomb);
115 if(pVerbose > 2) {
116 G4cout << " " << i << ". E= " << x << " prob= " << y
117 << " Edel= " << edelta << G4endl;
118 }
119 if(y >= probmax) {
120 probmax = y;
121 } else if(0.0 == fE1 && 2*y < probmax) {
122 fE1 = x;
123 }
124
125 G4double del = (y + problast)*edelta*0.5;
126 pProbability += del;
127 // end of the loop
128 if(del < accuracy*pProbability || endpoint) { break; }
129 problast = y;
130
131 // smart step definition
132 if(del != pProbability && del > 0.8*pProbability &&
133 0.7*edelta > edeltamin) {
134 edelta *= 0.7;
135 } else if(del < 0.1*pProbability && 1.5*edelta < edeltamax) {
136 edelta *= 1.5;
137 }
138 }
139 if(fE1 > emin && fE1 < emax) {
140 fE2 = std::max(0.5*(fE1 + emax), emax - edelta);
141 fP2 = 2*ComputeProbability(fE2, eCoulomb);
142 }
143
144 if(pVerbose > 1) {
145 G4cout << " Probability= " << pProbability << " probmax= "
146 << probmax << " emin=" << emin << " emax=" << emax
147 << " E1=" << fE1 << " E2=" << fE2 << G4endl;
148 }
149 return pProbability;
150}
double G4double
Definition G4Types.hh:83
bool G4bool
Definition G4Types.hh:86
int G4int
Definition G4Types.hh:85
#define G4endl
Definition G4ios.hh:67
G4GLOB_DLL std::ostream G4cout
virtual G4double ComputeProbability(G4double anEnergy, G4double CB)

Referenced by G4GEMProbabilityVI::ComputeTotalProbability(), and G4EvaporationProbability::TotalProbability().

◆ operator!=()

G4bool G4VEmissionProbability::operator!= ( const G4VEmissionProbability & right) const
delete

◆ operator=()

const G4VEmissionProbability & G4VEmissionProbability::operator= ( const G4VEmissionProbability & right)
delete

◆ operator==()

G4bool G4VEmissionProbability::operator== ( const G4VEmissionProbability & right) const
delete

◆ ResetIntegrator()

void G4VEmissionProbability::ResetIntegrator ( size_t nbin,
G4double de,
G4double eps )
protected

Definition at line 58 of file G4VEmissionProbability.cc.

59{
60 if(de > 0.0) { elimit = de; }
61 if(eps > 0.0) { accuracy = eps; }
62}

Referenced by G4EvaporationProbability::G4EvaporationProbability(), and G4GEMProbabilityVI::G4GEMProbabilityVI().

◆ ResetProbability()

void G4VEmissionProbability::ResetProbability ( )
inline

◆ SampleEnergy()

G4double G4VEmissionProbability::SampleEnergy ( )

Definition at line 152 of file G4VEmissionProbability.cc.

153{
154 static const G4double fact = 1.05;
155 static const G4double alim = 0.05;
156 static const G4double blim = 20.;
157 probmax *= fact;
158
159 // two regions with flat and exponential majorant
160 G4double del = emax - emin;
161 G4double p1 = 1.0;
162 G4double p2 = 0.0;
163 G4double a0 = 0.0;
164 G4double a1 = 1.0;
165 G4double x;
166 if(fE1 > 0.0 && fP2 > 0.0 && fP2 < 0.5*probmax) {
167 a0 = G4Log(probmax/fP2)/(fE2 - fE1);
168 del= fE1 - emin;
169 p1 = del;
170 x = a0*(emax - fE1);
171 if(x < blim) {
172 a1 = (x > alim) ? 1.0 - G4Exp(-x) : x*(1.0 - 0.5*x);
173 }
174 p2 = a1/a0;
175 p1 /= (p1 + p2);
176 p2 = 1.0 - p1;
177 }
178
179 if(pVerbose > 1) {
180 G4cout << "### G4VEmissionProbability::SampleEnergy: "
181 << " Emin= " << emin << " Emax= " << emax
182 << "/n E1=" << fE1 << " p1=" << p1
183 << " probmax=" << probmax << " P2=" << fP2 << G4endl;
184 }
185
186 CLHEP::HepRandomEngine* rndm = G4Random::getTheEngine();
187 const G4int nmax = 1000;
188 G4double ekin, g, gmax;
189 G4int n = 0;
190 do {
191 ++n;
192 G4double q = rndm->flat();
193 if(q <= p1) {
194 gmax = probmax;
195 ekin = del*q/p1 + emin;
196 } else {
197 ekin = fE1 - G4Log(1.0 - (q - p1)*a1/p2)/a0;
198 x = a0*(ekin - fE1);
199 gmax = fP2;
200 if(x < blim) {
201 gmax = probmax*((x > alim) ? G4Exp(-x) : 1.0 - x*(1.0 - 0.5*x));
202 }
203 }
204 g = ComputeProbability(ekin, eCoulomb);
205 if(pVerbose > 2) {
206 G4cout << " " << n
207 << ". prob= " << g << " probmax= " << probmax
208 << " Ekin= " << ekin << G4endl;
209 }
210 if((g > gmax || n > nmax) && pVerbose > 1) {
211 G4cout << "### G4VEmissionProbability::SampleEnergy for Z= " << theZ
212 << " A= " << theA << " Eex(MeV)=" << fExc << " p1=" << p1
213 << "\n Warning n= " << n
214 << " prob/gmax=" << g/gmax
215 << " prob=" << g << " gmax=" << gmax << " probmax=" << probmax
216 << "\n Ekin= " << ekin << " Emin= " << emin
217 << " Emax= " << emax << G4endl;
218 }
219 } while(gmax*rndm->flat() > g && n < nmax);
220 G4double enew = FindRecoilExcitation(ekin);
221 if(pVerbose > 1) {
222 G4cout << "### SampleEnergy: Efinal= "
223 << enew << " E=" << ekin << " Eexc=" << fExcRes << G4endl;
224 }
225 return enew;
226}
G4double G4Exp(G4double initial_x)
Exponential Function double precision.
Definition G4Exp.hh:180
const G4double a0
G4double G4Log(G4double x)
Definition G4Log.hh:227
virtual double flat()=0

Referenced by G4EvaporationChannel::EmittedFragment(), and G4GEMProbabilityVI::SampleEvaporationFragment().

◆ SetDecayKinematics()

void G4VEmissionProbability::SetDecayKinematics ( G4int rZ,
G4int rA,
G4double rmass,
G4double fmass )
inline

◆ SetEvapExcitation()

void G4VEmissionProbability::SetEvapExcitation ( G4double exc)
inline

Definition at line 78 of file G4VEmissionProbability.hh.

78{ fExc = exc; };

Member Data Documentation

◆ OPTxs

G4int G4VEmissionProbability::OPTxs
protected

◆ pEvapMass

◆ pG4pow

◆ pMass

◆ pNuclearLevelData

◆ pProbability

◆ pResMass

◆ pTolerance

G4double G4VEmissionProbability::pTolerance = 0.0
protected

Definition at line 114 of file G4VEmissionProbability.hh.

Referenced by Initialise().

◆ pVerbose

G4int G4VEmissionProbability::pVerbose
protected

Definition at line 104 of file G4VEmissionProbability.hh.

Referenced by Initialise(), IntegrateProbability(), and SampleEnergy().

◆ resA

◆ resZ

◆ theA

◆ theZ


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