186 if(!(gammaPolarization0.
isOrthogonal(gammaDirection0, 1e-6))||(gammaPolarization0.
mag()==0))
188 gammaPolarization0 = GetRandomPolarization(gammaDirection0);
194 gammaPolarization0 = GetPerpendicularPolarization(gammaDirection0, gammaPolarization0);
202 if(gammaEnergy0 <= lowEnergyLimit)
223 G4double alpha1 = - std::log(epsilon0);
224 G4double alpha2 = 0.5*(1.- epsilon0Sq);
239 epsilon = std::sqrt(epsilonSq);
242 onecost = (1.-
epsilon)/(epsilon*E0_m);
243 sinThetaSqr = onecost*(2.-onecost);
246 if (sinThetaSqr > 1.)
249 <<
" -- Warning -- G4LowEnergyPolarizedCompton::PostStepDoIt "
250 <<
"sin(theta)**2 = "
256 if (sinThetaSqr < 0.)
259 <<
" -- Warning -- G4LowEnergyPolarizedCompton::PostStepDoIt "
260 <<
"sin(theta)**2 = "
268 G4double x = std::sqrt(onecost/2.) / (wlGamma/
cm);;
270 greject = (1. - epsilon*sinThetaSqr/(1.+ epsilonSq))*scatteringFunction;
279 G4double phi = SetPhi(epsilon,sinThetaSqr);
292 <<
" -- Warning -- G4LowEnergyPolarizedCompton::PostStepDoIt "
302 <<
" -- Warning -- G4LowEnergyPolarizedCompton::PostStepDoIt "
312 G4double sinTheta = std::sqrt (sinThetaSqr);
318 <<
" -- Warning -- G4LowEnergyPolarizedCompton::PostStepDoIt "
328 <<
" -- Warning -- G4LowEnergyPolarizedCompton::PostStepDoIt "
338 G4double dirx = sinTheta*std::cos(phi);
339 G4double diry = sinTheta*std::sin(phi);
354 G4int maxDopplerIterations = 1000;
356 G4double photonEoriginal = epsilon * gammaEnergy0;
368 eMax = gammaEnergy0 - bindingE;
374 G4double pDoppler2 = pDoppler * pDoppler;
375 G4double var2 = 1. + onecost * E0_m;
376 G4double var3 = var2*var2 - pDoppler2;
377 G4double var4 = var2 - pDoppler2 * cosTheta;
378 G4double var = var4*var4 - var3 + pDoppler2 * var3;
382 G4double scale = gammaEnergy0 / var3;
384 if (
G4UniformRand() < 0.5) photonE = (var4 - varSqrt) * scale;
385 else photonE = (var4 + varSqrt) * scale;
391 }
while ( iteration <= maxDopplerIterations &&
392 (photonE < 0. || photonE > eMax || photonE < eMax*
G4UniformRand()) );
396 if (iteration >= maxDopplerIterations)
398 photonE = photonEoriginal;
402 gammaEnergy1 = photonE;
421 G4ThreeVector gammaPolarization1 = SetNewPolarization(epsilon,
428 gammaDirection1 = tmpDirection1;
432 SystemOfRefChange(gammaDirection0,gammaDirection1,
433 gammaPolarization0,gammaPolarization1);
435 if (gammaEnergy1 > 0.)
451 G4double ElecKineEnergy = gammaEnergy0 - gammaEnergy1 -bindingE;
462 G4ThreeVector ElecDirection((gammaEnergy0 * gammaDirection0 -
463 gammaEnergy1 * gammaDirection1) * (1./ElecMomentum));
G4double GetKineticEnergy() const
const G4DynamicParticle * GetDynamicParticle() const
const G4MaterialCutsCouple * GetMaterialCutsCouple() const
G4double BindingEnergy(G4int Z, G4int shellIndex) const
void ProposePolarization(G4double Px, G4double Py, G4double Pz)
bool isOrthogonal(const Hep3Vector &v, double epsilon=tolerance) const
double howOrthogonal(const Hep3Vector &v) const
void ProposeLocalEnergyDeposit(G4double anEnergyPart)
G4GLOB_DLL std::ostream G4cout
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)
G4StepPoint * GetPostStepPoint() const
G4int SelectRandomAtom(const G4MaterialCutsCouple *couple, G4double e) const
const G4ThreeVector & GetPolarization() const
void ProposeEnergy(G4double finalEnergy)
G4ParticleChange aParticleChange
G4double GetSafety() const
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)