76 fProbabilities.resize(9,0.0);
79 fAtomDeexcitation =
nullptr;
118 static const G4double a = 20.0 , b = 230.0 , c = 440.0;
121 d1= 2.7965e-1*CLHEP::barn, d2=-1.8300e-1*CLHEP::barn,
122 d3= 6.7527 *CLHEP::barn, d4=-1.9798e+1*CLHEP::barn,
123 e1= 1.9756e-5*CLHEP::barn, e2=-1.0205e-2*CLHEP::barn,
124 e3=-7.3913e-2*CLHEP::barn, e4= 2.7079e-2*CLHEP::barn,
125 f1=-3.9178e-7*CLHEP::barn, f2= 6.8241e-5*CLHEP::barn,
126 f3= 6.0480e-5*CLHEP::barn, f4= 3.0274e-4*CLHEP::barn;
128 G4double p1Z = Z*(d1 + e1*Z + f1*Z*Z), p2Z = Z*(d2 + e2*Z + f2*Z*Z),
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; }
134 G4double X = max(gammaEnergy, T0) / electron_mass_c2;
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) {
141 X = (T0+dT0) / electron_mass_c2 ;
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,
179 if(nShells > (
G4int)fProbabilities.size()) { fProbabilities.resize(nShells); }
182 for(i=0; i<nShells; ++i) {
186 fProbabilities[i] = totprob;
190 static const G4int nlooplim = 1000;
193 G4double bindingEnergy, ePotEnergy, eKinEnergy;
207 for(i=0; i<nShells; ++i) {
if(xprob <= fProbabilities[i]) {
break; } }
210 lv1.
set(0.0,0.0,energy,energy);
218 eKinEnergy = bindingEnergy*x;
219 ePotEnergy = bindingEnergy*(1.0 + x);
222 G4double eTotMomentum = sqrt(eKinEnergy*(eKinEnergy + 2*electron_mass_c2));
225 G4double sintet = sqrt((1 - costet)*(1 + costet));
226 lv2.
set(eTotMomentum*sintet*cos(phi),eTotMomentum*sintet*sin(phi),
227 eTotMomentum*costet,eKinEnergy + electron_mass_c2);
231 gamEnergy0 = lv1.
e();
237 G4double E0_m = gamEnergy0/electron_mass_c2;
249 G4double alpha2 = alpha1 + 0.5*(1 - epsilon0sq);
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;
277 lv2.
set(0.0,0.0,0.0,electron_mass_c2);
283 if(sint2 < 0.0) { sint2 = 0.0; }
284 costet = 1. - onecost;
285 sintet = sqrt(sint2);
286 phi = twopi * rndmEngineMod->
flat();
294 lv1.
set(gamEnergy1*v.
x(),gamEnergy1*v.
y(),gamEnergy1*v.
z(),gamEnergy1);
299 eKinEnergy = lv2.
e() - electron_mass_c2 - ePotEnergy;
303 }
while ( eKinEnergy < 0.0 );
310 gamEnergy1 = lv1.
e();
330 fvect->push_back(dp);
331 }
else { eKinEnergy = 0.0; }
333 G4double edep = energy - gamEnergy1 - eKinEnergy;
338 if(fAtomDeexcitation) {
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
381 <<
" E(keV)= " << energy/keV
382 <<
" Ebind(keV)= " << bindingEnergy/keV
383 <<
" Eg(keV)= " << gamEnergy1/keV
384 <<
" Ee(keV)= " << eKinEnergy/keV
385 <<
" Esec(keV)= " << esec/keV
386 <<
" Edep(keV)= " << edep/keV
double epsilon(double density, double temperature)
G4double G4Exp(G4double initial_x)
Exponential Function double precision.
G4double G4Log(G4double x)
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
virtual void Initialise(const G4ParticleDefinition *, const G4DataVector &) override
G4ParticleDefinition * theElectron
virtual G4double ComputeCrossSectionPerAtom(const G4ParticleDefinition *, G4double kinEnergy, G4double Z, G4double A, G4double cut, G4double emax) override
virtual void InitialiseLocal(const G4ParticleDefinition *, G4VEmModel *masterModel) override
virtual ~G4KleinNishinaModel()
G4KleinNishinaModel(const G4String &nam="KleinNishina")
G4double lowestSecondaryEnergy
virtual void SampleSecondaries(std::vector< G4DynamicParticle * > *, const G4MaterialCutsCouple *, const G4DynamicParticle *, G4double tmin, G4double maxEnergy) override
G4ParticleChangeForGamma * fParticleChange
G4ParticleDefinition * theGamma
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)