Geant4 11.3.0
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
 
virtual 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
 
G4double pWidth = 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 : pVerbose(1), theZ(Z), theA(A), elimit(CLHEP::MeV)
43{
47 G4DeexPrecoParameters* param = pNuclearLevelData->GetParameters();
48 OPTxs = param->GetDeexModelType();
49}
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

Referenced by G4EvaporationProbability::G4EvaporationProbability(), G4FissionProbability::G4FissionProbability(), G4GEMProbability::G4GEMProbability(), G4GEMProbabilityVI::G4GEMProbabilityVI(), G4VEmissionProbability(), operator!=(), operator=(), and operator==().

◆ ~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 71 of file G4VEmissionProbability.cc.

72{
73 return 0.0;
74}

Referenced by IntegrateProbability(), and SampleEnergy().

◆ EmissionProbability()

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

Reimplemented in G4FissionProbability, and G4GEMProbability.

Definition at line 66 of file G4VEmissionProbability.cc.

67{
68 return 0.0;
69}

◆ 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.

◆ GetRecoilExcitation()

G4double G4VEmissionProbability::GetRecoilExcitation ( ) const
inline

Definition at line 76 of file G4VEmissionProbability.hh.

76{ return fExcRes; };

◆ GetZ()

◆ Initialise()

void G4VEmissionProbability::Initialise ( )
virtual

Definition at line 51 of file G4VEmissionProbability.cc.

52{
53 G4DeexPrecoParameters* param = pNuclearLevelData->GetParameters();
54 pVerbose = param->GetVerbose();
55 fFD = param->GetDiscreteExcitationFlag();
58}
G4bool GetDiscreteExcitationFlag() const
G4double GetNuclearLevelWidth() const

◆ IntegrateProbability()

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

Definition at line 76 of file G4VEmissionProbability.cc.

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

61{
62 if(de > 0.0) { elimit = de; }
63 if(eps > 0.0) { accuracy = eps; }
64}

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

◆ ResetProbability()

void G4VEmissionProbability::ResetProbability ( )
inline

Definition at line 82 of file G4VEmissionProbability.hh.

82{ pProbability = 0.0; };

◆ SampleEnergy()

G4double G4VEmissionProbability::SampleEnergy ( )

Definition at line 154 of file G4VEmissionProbability.cc.

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

◆ 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

◆ 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

◆ pWidth

G4double G4VEmissionProbability::pWidth = 0.0
protected

Definition at line 115 of file G4VEmissionProbability.hh.

Referenced by Initialise().

◆ resA

◆ resZ

◆ theA

◆ theZ


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