110 static const G4double a = 20.0 , b = 230.0 , c = 440.0;
120 G4double p1Z = Z*(d1 + e1*Z + f1*Z*
Z), p2Z = Z*(d2 + e2*Z + f2*Z*Z),
121 p3Z = Z*(d3 + e3*Z + f3*Z*
Z), p4Z = Z*(d4 + e4*Z + f4*Z*Z);
124 if (Z < 1.5) { T0 = 40.0*
keV; }
127 xSection = p1Z*
G4Log(1.+2.*X)/X
128 + (p2Z + p3Z*X + p4Z*X*
X)/(1. + a*X + b*X*X + c*X*X*X);
131 if (GammaEnergy < T0) {
135 + (p2Z + p3Z*X + p4Z*X*
X)/(1. + a*X + b*X*X + c*X*X*X);
136 G4double c1 = -T0*(sigma-xSection)/(xSection*dT0);
138 if (Z > 1.5) { c2 = 0.375-0.0556*
G4Log(Z); }
140 xSection *=
G4Exp(-y*(c1+c2*y));
149 std::vector<G4DynamicParticle*>* fvect,
178 G4double alpha2 = alpha1 + 0.5*(1.- epsilon0sq);
188 if(nloop > nlooplim) {
return; }
193 if ( alpha1 > alpha2*rndm[0] ) {
194 epsilon =
G4Exp(-alpha1*rndm[1]);
198 epsilonsq = epsilon0sq + (1.- epsilon0sq)*rndm[1];
199 epsilon = sqrt(epsilonsq);
202 onecost = (1.-
epsilon)/(epsilon*E0_m);
203 sint2 = onecost*(2.-onecost);
204 greject = 1. - epsilon*sint2/(1.+ epsilonsq);
207 }
while (greject < rndm[2]);
213 if(sint2 < 0.0) { sint2 = 0.0; }
222 G4ThreeVector gamDirection1(sinTeta*cos(Phi), sinTeta*sin(Phi), cosTeta);
223 gamDirection1.
rotateUz(gamDirection0);
224 G4double gamEnergy1 = epsilon*gamEnergy0;
239 G4double eKinEnergy = gamEnergy0 - gamEnergy1;
242 G4ThreeVector eDirection = gamEnergy0*gamDirection0 - gamEnergy1*gamDirection1;
243 eDirection = eDirection.
unit();
247 fvect->push_back(dp);
void SetElementSelectors(std::vector< G4EmElementSelector * > *)
G4double G4Exp(G4double initial_x)
Exponential Function double precision.
T max(const T t1, const T t2)
brief Return the largest of the two arguments
virtual ~G4KleinNishinaCompton()
std::vector< ExP01TrackerHit * > a
static constexpr double keV
G4double lowestSecondaryEnergy
const G4ThreeVector & GetMomentumDirection() const
void SetProposedKineticEnergy(G4double proposedKinEnergy)
virtual void flatArray(const int size, double *vect)=0
Hep3Vector & rotateUz(const Hep3Vector &)
virtual void SampleSecondaries(std::vector< G4DynamicParticle * > *, const G4MaterialCutsCouple *, const G4DynamicParticle *, G4double tmin, G4double maxEnergy) override
std::vector< G4EmElementSelector * > * GetElementSelectors()
G4double G4Log(G4double x)
G4double LowEnergyLimit() const
virtual void Initialise(const G4ParticleDefinition *, const G4DataVector &) override
virtual void InitialiseLocal(const G4ParticleDefinition *, G4VEmModel *masterModel) override
G4ParticleDefinition * theGamma
void InitialiseElementSelectors(const G4ParticleDefinition *, const G4DataVector &)
static const G4double T0[78]
static constexpr double electron_mass_c2
void ProposeMomentumDirection(G4double Px, G4double Py, G4double Pz)
static constexpr double twopi
G4ParticleDefinition * theElectron
static const G4int nlooplim
static constexpr double eV
static G4Electron * Electron()
G4ParticleChangeForGamma * fParticleChange
virtual G4double ComputeCrossSectionPerAtom(const G4ParticleDefinition *, G4double kinEnergy, G4double Z, G4double A, G4double cut, G4double emax) override
G4KleinNishinaCompton(const G4ParticleDefinition *p=nullptr, const G4String &nam="Klein-Nishina")
double epsilon(double density, double temperature)
G4double GetKineticEnergy() const
G4ParticleChangeForGamma * GetParticleChangeForGamma()
void ProposeLocalEnergyDeposit(G4double anEnergyPart)
void ProposeTrackStatus(G4TrackStatus status)
static constexpr double barn