117   if ( Z < 0.9999 || GammaEnergy < 0.1*
keV) { 
return xSection; }
 
  119   static const G4double a = 20.0 , b = 230.0 , c = 440.0;
 
  122            p3Z = Z*(
d3 + 
e3*Z + 
f3*Z*Z), p4Z = Z*(
d4 + 
e4*Z + 
f4*Z*Z);
 
  125   if (Z < 1.5) { T0 = 40.0*
keV; } 
 
  127   G4double X   = 
max(GammaEnergy, T0) / electron_mass_c2;
 
  128   xSection = p1Z*
G4Log(1.+2.*X)/X
 
  129                + (p2Z + p3Z*X + p4Z*X*X)/(1. + a*X + b*X*X + c*X*X*X);
 
  132   if (GammaEnergy < T0) {
 
  134     X = (T0+dT0) / electron_mass_c2 ;
 
  136                     + (p2Z + p3Z*X + p4Z*X*X)/(1. + a*X + b*X*X + c*X*X*X);
 
  137     G4double   c1 = -T0*(sigma-xSection)/(xSection*dT0);             
 
  139     if (Z > 1.5) { c2 = 0.375-0.0556*
G4Log(Z); }
 
  141     xSection *= 
G4Exp(-y*(c1+c2*y));          
 
  144   if(xSection < 0.0) { xSection = 0.0; }
 
  153                              std::vector<G4DynamicParticle*>* fvect,
 
  171   for(i=0; i<nShells; ++i) {
 
  193     for(i=0; i<nShells; ++i) { 
if(xprob <= 
fProbabilities[i]) { 
break; } }
 
  198     lv1.set(0.0,0.0,energy,energy);
 
  207     eKinEnergy = bindingEnergy*x;
 
  208     ePotEnergy = bindingEnergy*(1.0 + x);
 
  211     G4double eTotMomentum = sqrt(eKinEnergy*(eKinEnergy + 2*electron_mass_c2));
 
  214     G4double sintet = sqrt((1 - costet)*(1 + costet));
 
  215     lv2.set(eTotMomentum*sintet*cos(phi),eTotMomentum*sintet*sin(phi),
 
  216             eTotMomentum*costet,eKinEnergy + electron_mass_c2);
 
  220     gamEnergy0 = 
lv1.e();
 
  226     G4double E0_m = gamEnergy0/electron_mass_c2;
 
  232     G4double epsilon, epsilonsq, onecost, sint2, greject ;
 
  237     G4double alpha2     = 0.5*(1 - epsilon0sq);
 
  242         epsilonsq = epsilon*epsilon; 
 
  246         epsilon   = sqrt(epsilonsq);
 
  249       onecost = (1.- epsilon)/(epsilon*E0_m);
 
  250       sint2   = onecost*(2.-onecost);
 
  251       greject = 1. - epsilon*sint2/(1.+ epsilonsq);
 
  254     gamEnergy1 = epsilon*gamEnergy0;
 
  257     lv2.set(0.0,0.0,0.0,electron_mass_c2);
 
  263     if(sint2 < 0.0) { sint2 = 0.0; }
 
  264     costet = 1. - onecost; 
 
  265     sintet = sqrt(sint2);
 
  274     lv1.set(gamEnergy1*v.x(),gamEnergy1*v.y(),gamEnergy1*v.z(),gamEnergy1);
 
  278     eKinEnergy = 
lv2.e() - electron_mass_c2 - ePotEnergy;   
 
  281   } 
while ( eKinEnergy < 0.0 );
 
  288   gamEnergy1 = 
lv1.e();
 
  291     gamDirection1.rotateUz(direction);
 
  305     eDirection.rotateUz(direction);
 
  308     fvect->push_back(dp);
 
  309   } 
else { eKinEnergy = 0.0; }
 
  311   G4double edep = energy - gamEnergy1 - eKinEnergy;
 
  322       size_t nbefore = fvect->size();
 
  324       size_t nafter = fvect->size();
 
  325       if(nafter > nbefore) {
 
  326         for (
size_t j=nbefore; j<nafter; ++j) {
 
  327           G4double e = ((*fvect)[j])->GetKineticEnergy();
 
  328           if(esec + e > edep) {
 
  339             for (
size_t jj=j; jj<nafter; ++jj) { 
delete (*fvect)[jj]; }
 
  340             for (
size_t jj=j; jj<nafter; ++jj) { fvect->pop_back(); }
 
  349   if(fabs(energy - gamEnergy1 - eKinEnergy - esec - edep) > 
eV) {
 
  350     G4cout << 
"### G4KleinNishinaModel dE(eV)= "  
  351            << (energy - gamEnergy1 - eKinEnergy - esec - edep)/
eV  
  353            << 
"  E(keV)= " << energy/
keV  
  354            << 
"  Ebind(keV)= " << bindingEnergy/
keV  
  355            << 
"  Eg(keV)= " << gamEnergy1/
keV  
  356            << 
"  Ee(keV)= " << eKinEnergy/
keV  
  357            << 
"  Esec(keV)= " << esec/
keV  
  358            << 
"  Edep(keV)= " << edep/
keV  
static c2_factory< G4double > c2
 
virtual G4double ComputeCrossSectionPerAtom(const G4ParticleDefinition *, G4double kinEnergy, G4double Z, G4double A, G4double cut, G4double emax)
 
G4bool CheckDeexcitationActiveRegion(G4int coupleIndex)
 
static G4LossTableManager * Instance()
 
G4int GetNbOfAtomicShells() const 
 
G4double GetKineticEnergy() const 
 
CLHEP::Hep3Vector G4ThreeVector
 
void InitialiseElementSelectors(const G4ParticleDefinition *, const G4DataVector &)
 
virtual ~G4KleinNishinaModel()
 
G4ParticleChangeForGamma * fParticleChange
 
G4int GetNbOfShellElectrons(G4int index) const 
 
void ProposeMomentumDirection(G4double Px, G4double Py, G4double Pz)
 
void ProposeLocalEnergyDeposit(G4double anEnergyPart)
 
virtual const G4AtomicShell * GetAtomicShell(G4int Z, G4AtomicShellEnumerator shell)=0
 
G4GLOB_DLL std::ostream G4cout
 
std::vector< G4double > fProbabilities
 
const G4ThreeVector & GetMomentumDirection() const 
 
virtual void Initialise(const G4ParticleDefinition *, const G4DataVector &)
 
std::vector< G4EmElementSelector * > * GetElementSelectors()
 
virtual void InitialiseLocal(const G4ParticleDefinition *, G4VEmModel *masterModel)
 
G4double G4Log(G4double x)
 
G4double G4Exp(G4double initial_x)
Exponential Function double precision. 
 
G4KleinNishinaModel(const G4String &nam="KleinNishina")
 
void SetElementSelectors(std::vector< G4EmElementSelector * > *)
 
G4ParticleDefinition * theElectron
 
T max(const T t1, const T t2)
brief Return the largest of the two arguments 
 
G4double energy(const ThreeVector &p, const G4double m)
 
G4VAtomDeexcitation * fAtomDeexcitation
 
G4ParticleDefinition * theGamma
 
static G4Electron * Electron()
 
void SetProposedKineticEnergy(G4double proposedKinEnergy)
 
G4VAtomDeexcitation * AtomDeexcitation()
 
G4double GetAtomicShell(G4int index) const 
 
void ProposeTrackStatus(G4TrackStatus status)
 
void GenerateParticles(std::vector< G4DynamicParticle * > *secVect, const G4AtomicShell *, G4int Z, G4int coupleIndex)
 
void SetDeexcitationFlag(G4bool val)
 
G4double bindingEnergy(G4int A, G4int Z)
 
virtual void SampleSecondaries(std::vector< G4DynamicParticle * > *, const G4MaterialCutsCouple *, const G4DynamicParticle *, G4double tmin, G4double maxEnergy)
 
G4double lowestGammaEnergy
 
const G4Element * SelectRandomAtom(const G4MaterialCutsCouple *, const G4ParticleDefinition *, G4double kineticEnergy, G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX)
 
G4ParticleChangeForGamma * GetParticleChangeForGamma()