Geant4 11.2.2
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4PreCompoundFragment.cc
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// J. M. Quesada (August 2008).
28// Based on previous work by V. Lara
29//
30// Modified:
31// 06.09.2008 JMQ Also external choice has been added for:
32// - superimposed Coulomb barrier (if useSICB=true)
33// 20.08.2010 V.Ivanchenko cleanup
34//
35
40#include "Randomize.hh"
41
43 G4VCoulombBarrier* aCoulBarrier)
44 : G4VPreCompoundFragment(p, aCoulBarrier)
45{
46 muu = probmax = 0.0;
47 if(0 == theZ) { index = 0; }
48 else if(1 == theZ) { index = theA; }
49 else { index = theA + 1; }
50}
51
53{
54 //G4cout << theCoulombBarrier << " " << GetMaximalKineticEnergy() << G4endl;
55 // If theCoulombBarrier effect is included in the emission probabilities
56 // Coulomb barrier is the lower limit of integration over kinetic energy
57
59
60 if (theMaxKinEnergy <= theMinKinEnergy) { return 0.0; }
61
62 // compute power once
63 if(0 < index) {
65 }
66
68 IntegrateEmissionProbability(theMinKinEnergy, theMaxKinEnergy, fr);
69 /*
70 G4cout << "## G4PreCompoundFragment::CalcEmisProb "
71 << "Z= " << fr.GetZ_asInt()
72 << " A= " << fr.GetA_asInt()
73 << " Elow= " << LowerLimit/MeV
74 << " Eup= " << UpperLimit/MeV
75 << " prob= " << theEmissionProbability
76 << G4endl;
77 */
79}
80
82G4PreCompoundFragment::IntegrateEmissionProbability(G4double low, G4double up,
83 const G4Fragment& fr)
84{
85 static const G4double den = 1.0/CLHEP::MeV;
86 G4double del = (up - low);
87 G4int nbins = del*den;
88 nbins = std::max(nbins, 4);
89 del /= static_cast<G4double>(nbins);
90 G4double e = low + 0.5*del;
91 probmax = ProbabilityDistributionFunction(e, fr);
92 //G4cout << " 0. e= " << e << " y= " << probmax << G4endl;
93
94 G4double sum = probmax;
95 for (G4int i=1; i<nbins; ++i) {
96 e += del;
97
99 probmax = std::max(probmax, y);
100 sum += y;
101 if(y < sum*0.01) { break; }
102 //G4cout <<" "<<i<<". e= "<<e<<" y= "<<y<<" sum= "<<sum<< G4endl;
103 }
104 sum *= del;
105 //G4cout << "Evap prob: " << sum << " probmax= " << probmax << G4endl;
106 return sum;
107}
108
110{
111 G4double res;
112 if(OPTxs == 0 || (OPTxs == 4 && theMaxKinEnergy < 10.)) {
113 res = GetOpt0(ekin);
114
115 } else if(OPTxs <= 2) {
118 theResA13, muu,
119 index, theZ, theResA);
120
121 } else {
123 theResA13, muu, index,
124 theZ, theA, theResA);
125 }
126 return res;
127}
128
129G4double G4PreCompoundFragment::GetOpt0(G4double ekin) const
130// OPT=0 : Dostrovski's cross section
131{
132 G4double r0 = theParameters->GetR0()*theResA13;
133 // cross section is now given in mb (r0 is in mm) for the sake of consistency
134 // with the rest of the options
135 return 1.e+25*CLHEP::pi*r0*r0*theResA13*GetAlpha()*(1.0 + GetBeta()/ekin);
136}
137
139{
141 static const G4double toler = 1.25;
142 probmax *= toler;
143 G4double prob, T(0.0);
144 CLHEP::HepRandomEngine* rndm = G4Random::getTheEngine();
145 G4int i;
146 for(i=0; i<100; ++i) {
147 T = theMinKinEnergy + delta*rndm->flat();
148 prob = ProbabilityDistributionFunction(T, fragment);
149 /*
150 if(prob > probmax) {
151 G4cout << "G4PreCompoundFragment WARNING: prob= " << prob
152 << " probmax= " << probmax << G4endl;
153 G4cout << "i= " << i << " Z= " << theZ << " A= " << theA
154 << " resZ= " << theResZ << " resA= " << theResA << "\n"
155 << " T= " << T << " Tmax= " << theMaxKinEnergy
156 << " Tmin= " << limit
157 << G4endl;
158 for(G4int i=0; i<N; ++i) { G4cout << " " << probability[i]; }
159 G4cout << G4endl;
160 }
161 */
162 // Loop checking, 05-Aug-2015, Vladimir Ivanchenko
163 if(probmax*rndm->flat() <= prob) { break; }
164 }
165 /*
166 G4cout << "G4PreCompoundFragment: i= " << i << " Z= " << theZ
167 << " A= " << theA <<" T(MeV)= " << T << " Emin(MeV)= "
168 << theMinKinEnergy << " Emax= " << theMaxKinEnergy << G4endl;
169 */
170 return T;
171}
172
double G4double
Definition G4Types.hh:83
int G4int
Definition G4Types.hh:85
virtual double flat()=0
static G4double ComputeCrossSection(G4double K, G4double cb, G4double resA13, G4double amu1, G4int idx, G4int Z, G4int resA)
static G4double ComputePowerParameter(G4int resA, G4int idx)
static G4double ComputeCrossSection(G4double K, G4double cb, G4double resA13, G4double amu1, G4int idx, G4int Z, G4int A, G4int resA)
G4double CalcEmissionProbability(const G4Fragment &aFragment) override
G4PreCompoundFragment(const G4ParticleDefinition *, G4VCoulombBarrier *aCoulombBarrier)
G4double CrossSection(G4double ekin) const
G4double SampleKineticEnergy(const G4Fragment &aFragment) override
virtual G4double ProbabilityDistributionFunction(G4double ekin, const G4Fragment &aFragment)=0