Geant4 11.1.1
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 G4int Z[17]
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 G4GEMProbabilityVI, and G4EvaporationProbability.

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 75 of file G4VEmissionProbability.hh.

Referenced by G4EvaporationChannel::EmittedFragment().

◆ GetRecoilExcitation()

G4double G4VEmissionProbability::GetRecoilExcitation ( ) const
inline

Definition at line 71 of file G4VEmissionProbability.hh.

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

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

73{ 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 109 of file G4VEmissionProbability.hh.

Referenced by Initialise().

◆ pVerbose

G4int G4VEmissionProbability::pVerbose
protected

Definition at line 99 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: