118 static const G4double a = 20.0 , b = 230.0 , c = 440.0;
129 p3Z =
Z*(d3 +
e3*
Z + f3*
Z*
Z), p4Z =
Z*(d4 +
e4*
Z + f4*
Z*
Z);
132 if (
Z < 1.5) {
T0 = 40.0*
keV; }
135 xSection = p1Z*
G4Log(1.+2.*X)/X
136 + (p2Z + p3Z*X + p4Z*X*X)/(1. + a*X + b*X*X + c*X*X*X);
140 if (gammaEnergy <
T0) {
143 + (p2Z + p3Z*X + p4Z*X*X)/(1. + a*X + b*X*X + c*X*X*X);
144 G4double c1 = -
T0*(sigma-xSection)/(xSection*dT0);
146 if (
Z > 1.5) { c2 = 0.375-0.0556*
G4Log(
Z); }
148 xSection *=
G4Exp(-y*(c1+c2*y));
151 if(xSection < 0.0) { xSection = 0.0; }
160 std::vector<G4DynamicParticle*>* fvect,
182 for(i=0; i<nShells; ++i) {
190 static const G4int nlooplim = 1000;
207 for(i=0; i<nShells; ++i) {
if(xprob <=
fProbabilities[i]) {
break; } }
225 G4double sintet = sqrt((1 - costet)*(1 + costet));
226 lv2.
set(eTotMomentum*sintet*cos(phi),eTotMomentum*sintet*sin(phi),
231 gamEnergy0 =
lv1.
e();
254 if(nloop > nlooplim) {
return; }
259 if ( alpha1 >
alpha2*rndm[0] ) {
264 epsilonsq = epsilon0sq + (1.- epsilon0sq)*rndm[1];
269 sint2 = onecost*(2.-onecost);
270 greject = 1. -
epsilon*sint2/(1.+ epsilonsq);
273 }
while (greject < rndm[2]);
274 gamEnergy1 =
epsilon*gamEnergy0;
283 if(sint2 < 0.0) { sint2 = 0.0; }
284 costet = 1. - onecost;
285 sintet = sqrt(sint2);
294 lv1.
set(gamEnergy1*v.
x(),gamEnergy1*v.
y(),gamEnergy1*v.
z(),gamEnergy1);
303 }
while ( eKinEnergy < 0.0 );
310 gamEnergy1 =
lv1.
e();
330 fvect->push_back(dp);
331 }
else { eKinEnergy = 0.0; }
344 G4int nbefore = fvect->size();
346 G4int nafter = fvect->size();
348 for (
G4int j=nbefore; j<nafter; ++j) {
349 G4double e = ((*fvect)[j])->GetKineticEnergy();
350 if(esec + e > edep) {
353 ((*fvect)[j])->SetKineticEnergy(e);
366 for (
G4int jj=nafter-1; jj>j; --jj) {
377 if(std::abs(
energy - gamEnergy1 - eKinEnergy - esec - edep) >
eV) {
378 G4cout <<
"### G4KleinNishinaModel dE(eV)= "
379 << (
energy - gamEnergy1 - eKinEnergy - esec - edep)/
eV
383 <<
" Eg(keV)= " << gamEnergy1/
keV
384 <<
" Ee(keV)= " << eKinEnergy/
keV
385 <<
" Esec(keV)= " << esec/
keV
386 <<
" Edep(keV)= " << edep/
keV
static const G4double e4[47]
static const G4double e1[44]
static const G4double e2[44]
static const G4double e3[45]
G4double epsilon(G4double density, G4double temperature)
G4double G4Exp(G4double initial_x)
Exponential Function double precision.
G4double G4Log(G4double x)
static const G4double T0[78]
static constexpr double twopi
static constexpr double keV
static constexpr double eV
CLHEP::Hep3Vector G4ThreeVector
G4GLOB_DLL std::ostream G4cout
Hep3Vector & rotateUz(const Hep3Vector &)
Hep3Vector boostVector() const
HepLorentzVector & boost(double, double, double)
void set(double x, double y, double z, double t)
virtual void flatArray(const int size, double *vect)=0
const G4ThreeVector & GetMomentumDirection() const
G4double GetKineticEnergy() const
static G4Electron * Electron()
G4int GetNbOfAtomicShells() const
G4int GetNbOfShellElectrons(G4int index) const
G4double GetAtomicShell(G4int index) const
void Initialise(const G4ParticleDefinition *, const G4DataVector &) override
G4ParticleDefinition * theElectron
G4double ComputeCrossSectionPerAtom(const G4ParticleDefinition *, G4double kinEnergy, G4double Z, G4double A, G4double cut, G4double emax) override
G4VAtomDeexcitation * fAtomDeexcitation
~G4KleinNishinaModel() override
void InitialiseLocal(const G4ParticleDefinition *, G4VEmModel *masterModel) override
G4KleinNishinaModel(const G4String &nam="KleinNishina")
G4double lowestSecondaryEnergy
void SampleSecondaries(std::vector< G4DynamicParticle * > *, const G4MaterialCutsCouple *, const G4DynamicParticle *, G4double tmin, G4double maxEnergy) override
G4ParticleChangeForGamma * fParticleChange
G4ParticleDefinition * theGamma
std::vector< G4double > fProbabilities
static G4LossTableManager * Instance()
G4VAtomDeexcitation * AtomDeexcitation()
void SetProposedKineticEnergy(G4double proposedKinEnergy)
void ProposeMomentumDirection(G4double Px, G4double Py, G4double Pz)
G4bool CheckDeexcitationActiveRegion(G4int coupleIndex)
virtual const G4AtomicShell * GetAtomicShell(G4int Z, G4AtomicShellEnumerator shell)=0
void GenerateParticles(std::vector< G4DynamicParticle * > *secVect, const G4AtomicShell *, G4int Z, G4int coupleIndex)
void SetElementSelectors(std::vector< G4EmElementSelector * > *)
G4ParticleChangeForGamma * GetParticleChangeForGamma()
G4double LowEnergyLimit() const
std::vector< G4EmElementSelector * > * GetElementSelectors()
const G4Element * SelectRandomAtom(const G4MaterialCutsCouple *, const G4ParticleDefinition *, G4double kineticEnergy, G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX)
void SetDeexcitationFlag(G4bool val)
void InitialiseElementSelectors(const G4ParticleDefinition *, const G4DataVector &)
void ProposeTrackStatus(G4TrackStatus status)
void ProposeLocalEnergyDeposit(G4double anEnergyPart)
static constexpr double barn
G4double energy(const ThreeVector &p, const G4double m)
T max(const T t1, const T t2)
brief Return the largest of the two arguments
G4double bindingEnergy(G4int A, G4int Z)