158 if (photonEnergy0 <= lowEnergyLimit)
170 G4double alpha1 = -std::log(epsilon0);
171 G4double alpha2 = 0.5 * (1. - epsilon0Sq);
193 epsilonSq = epsilon0Sq + (1. - epsilon0Sq) *
G4UniformRand();
194 epsilon = std::sqrt(epsilonSq);
197 oneCosT = (1. -
epsilon) / ( epsilon * e0m);
198 sinT2 = oneCosT * (2. - oneCosT);
199 G4double x = std::sqrt(oneCosT/2.) / (wlPhoton/
cm);
201 gReject = (1. - epsilon * sinT2 / (1. + epsilonSq)) * scatteringFunction;
206 G4double sinTheta = std::sqrt (sinT2);
208 G4double dirX = sinTheta * std::cos(phi);
209 G4double dirY = sinTheta * std::sin(phi);
218 G4int maxDopplerIterations = 1000;
220 G4double photonEoriginal = epsilon * photonEnergy0;
231 eMax = photonEnergy0 - bindingE;
237 G4double pDoppler2 = pDoppler * pDoppler;
239 G4double var3 = var2*var2 - pDoppler2;
240 G4double var4 = var2 - pDoppler2 * cosTheta;
241 G4double var = var4*var4 - var3 + pDoppler2 * var3;
245 G4double scale = photonEnergy0 / var3;
247 if (
G4UniformRand() < 0.5) photonE = (var4 - varSqrt) * scale;
248 else photonE = (var4 + varSqrt) * scale;
254 }
while ( iteration <= maxDopplerIterations &&
255 (photonE < 0. || photonE > eMax || photonE < eMax*
G4UniformRand()) );
259 if (iteration >= maxDopplerIterations)
261 photonE = photonEoriginal;
268 photonDirection1.rotateUz(photonDirection0);
274 if (photonEnergy1 > 0.)
285 G4double eKineticEnergy = photonEnergy0 - photonEnergy1 - bindingE;
288 G4double electronE = photonEnergy0 * (1. -
epsilon) + electron_mass_c2;
294 cosThetaE = (eTotalEnergy + photonEnergy1 )* (1. - epsilon) / std::sqrt(electronP2);
295 sinThetaE = -1. * std::sqrt(1. - cosThetaE * cosThetaE);
298 G4double eDirX = sinThetaE * std::cos(phi);
299 G4double eDirY = sinThetaE * std::sin(phi);
304 G4double safety = aStep.GetPostStepPoint()->GetSafety();
309 eDirection.rotateUz(photonDirection0);
G4double GetKineticEnergy() const
G4double BindingEnergy(G4int Z, G4int shellIndex) const
void ProposeLocalEnergyDeposit(G4double anEnergyPart)
static constexpr double twopi
const G4ThreeVector & GetMomentumDirection() const
static constexpr double cm
virtual G4double FindValue(G4double x, G4int componentId=0) const =0
G4double RandomSelectMomentum(G4int Z, G4int shellIndex) const
virtual G4bool Escape(const G4ParticleDefinition *particle, const G4MaterialCutsCouple *couple, G4double energy, G4double safety) const =0
virtual void Initialize(const G4Track &)
void SetNumberOfSecondaries(G4int totSecondaries)
G4int SelectRandomAtom(const G4MaterialCutsCouple *couple, G4double e) const
void ProposeEnergy(G4double finalEnergy)
G4ParticleChange aParticleChange
void AddSecondary(G4Track *aSecondary)
static G4Electron * Electron()
void ProposeMomentumDirection(G4double Px, G4double Py, G4double Pz)
void ProposeTrackStatus(G4TrackStatus status)
G4int SelectRandomShell(G4int Z) const
virtual G4VParticleChange * PostStepDoIt(const G4Track &, const G4Step &)
double epsilon(double density, double temperature)