56 #include "G4ParticleChangeForGamma.hh" 129 static const G4double a = 20.0 ,
b = 230.0 ,
c = 440.0;
135 if (Z < 1.5) { T0 = 40.0*
keV; }
138 xSection = p1Z*
G4Log(1.+2.*X)/X
139 + (p2Z + p3Z*X + p4Z*X*
X)/(1. + a*X +
b*X*X +
c*X*X*X);
142 if (gammaEnergy < T0) {
145 + (p2Z + p3Z*X + p4Z*X*
X)/(1. + a*X +
b*X*X +
c*X*X*X);
148 if (Z > 1.5) { c2 = 0.375-0.0556*
G4Log(Z); }
150 xSection *=
G4Exp(-y*(c1+c2*y));
153 if(xSection < 0.0) { xSection = 0.0; }
162 std::vector<G4DynamicParticle*>* fvect,
184 for(i=0; i<nShells; ++i) {
194 G4double bindingEnergy, ePotEnergy, eKinEnergy;
208 for(i=0; i<nShells; ++i) {
if(xprob <=
fProbabilities[i]) {
break; } }
211 lv1.
set(0.0,0.0,energy,energy);
219 eKinEnergy = bindingEnergy*
x;
220 ePotEnergy = bindingEnergy*(1.0 +
x);
226 G4double sintet = sqrt((1 - costet)*(1 + costet));
227 lv2.
set(eTotMomentum*sintet*cos(phi),eTotMomentum*sintet*sin(phi),
232 gamEnergy0 =
lv1.
e();
250 G4double alpha2 = alpha1 + 0.5*(1 - epsilon0sq);
260 if ( alpha1 > alpha2*rndm[0] ) {
261 epsilon =
G4Exp(-alpha1*rndm[1]);
265 epsilonsq = epsilon0sq + (1.- epsilon0sq)*rndm[1];
266 epsilon = sqrt(epsilonsq);
269 onecost = (1.-
epsilon)/(epsilon*E0_m);
270 sint2 = onecost*(2.-onecost);
271 greject = 1. - epsilon*sint2/(1.+ epsilonsq);
274 }
while (greject < rndm[2]);
275 gamEnergy1 = epsilon*gamEnergy0;
284 if(sint2 < 0.0) { sint2 = 0.0; }
285 costet = 1. - onecost;
286 sintet = sqrt(sint2);
287 phi = twopi * rndmEngineMod->
flat();
295 lv1.
set(gamEnergy1*v.
x(),gamEnergy1*v.
y(),gamEnergy1*v.
z(),gamEnergy1);
304 }
while ( eKinEnergy < 0.0 );
311 gamEnergy1 =
lv1.
e();
331 fvect->push_back(dp);
332 }
else { eKinEnergy = 0.0; }
345 G4int nbefore = fvect->size();
347 G4int nafter = fvect->size();
349 for (
G4int j=nbefore; j<nafter; ++j) {
350 G4double e = ((*fvect)[j])->GetKineticEnergy();
351 if(esec + e > edep) {
354 ((*fvect)[j])->SetKineticEnergy(e);
367 for (
G4int jj=nafter-1; jj>j; --jj) {
378 if(fabs(energy - gamEnergy1 - eKinEnergy - esec - edep) >
eV) {
379 G4cout <<
"### G4KleinNishinaModel dE(eV)= " 380 << (energy - gamEnergy1 - eKinEnergy - esec -
edep)/
eV 382 <<
" E(keV)= " << energy/
keV 383 <<
" Ebind(keV)= " << bindingEnergy/
keV 384 <<
" Eg(keV)= " << gamEnergy1/
keV 385 <<
" Ee(keV)= " << eKinEnergy/
keV 386 <<
" Esec(keV)= " << esec/
keV 387 <<
" Edep(keV)= " << edep/
keV
G4double LowEnergyLimit() const
G4double GetAtomicShell(G4int index) const
virtual G4double ComputeCrossSectionPerAtom(const G4ParticleDefinition *, G4double kinEnergy, G4double Z, G4double A, G4double cut, G4double emax)
G4bool CheckDeexcitationActiveRegion(G4int coupleIndex)
static G4LossTableManager * Instance()
CLHEP::Hep3Vector G4ThreeVector
void InitialiseElementSelectors(const G4ParticleDefinition *, const G4DataVector &)
virtual ~G4KleinNishinaModel()
G4ParticleChangeForGamma * fParticleChange
void SetElementSelectors(std::vector< G4EmElementSelector *> *)
virtual const G4AtomicShell * GetAtomicShell(G4int Z, G4AtomicShellEnumerator shell)=0
G4double GetKineticEnergy() const
virtual void SampleSecondaries(std::vector< G4DynamicParticle *> *, const G4MaterialCutsCouple *, const G4DynamicParticle *, G4double tmin, G4double maxEnergy)
G4GLOB_DLL std::ostream G4cout
std::vector< G4double > fProbabilities
HepLorentzVector & boost(double, double, double)
Hep3Vector & rotateUz(const Hep3Vector &)
static const double twopi
G4int GetNbOfAtomicShells() const
G4double lowestSecondaryEnergy
virtual void Initialise(const G4ParticleDefinition *, const G4DataVector &)
std::vector< G4EmElementSelector * > * GetElementSelectors()
virtual void InitialiseLocal(const G4ParticleDefinition *, G4VEmModel *masterModel)
G4int GetNbOfShellElectrons(G4int index) const
G4double G4Log(G4double x)
G4double G4Exp(G4double initial_x)
Exponential Function double precision.
G4KleinNishinaModel(const G4String &nam="KleinNishina")
void set(double x, double y, double z, double t)
G4ParticleDefinition * theElectron
const G4ThreeVector & GetMomentumDirection() const
void GenerateParticles(std::vector< G4DynamicParticle *> *secVect, const G4AtomicShell *, G4int Z, G4int coupleIndex)
static const G4int nlooplim
Hep3Vector boostVector() const
G4VAtomDeexcitation * fAtomDeexcitation
G4ParticleDefinition * theGamma
static G4Electron * Electron()
G4VAtomDeexcitation * AtomDeexcitation()
void SetDeexcitationFlag(G4bool val)
virtual void flatArray(const int size, double *vect)=0
double epsilon(double density, double temperature)
static const G4double dT0
const G4Element * SelectRandomAtom(const G4MaterialCutsCouple *, const G4ParticleDefinition *, G4double kineticEnergy, G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX)
G4ParticleChangeForGamma * GetParticleChangeForGamma()