86 G4double gammaE2 = adjointPrimKinEnergy;
88 gammaE2 = gammaE1 - adjointPrimKinEnergy;
91 G4double cos_th = 1. + electron_mass_c2 * (1. / gammaE1 - 1. / gammaE2);
98 if(std::abs(cos_th) > 1.)
109 sin_th = std::sqrt(1. - cos_th * cos_th);
116 G4ThreeVector(std::cos(phi) * sin_th, std::sin(phi) * sin_th, cos_th);
117 gammaMomentum1.
rotateUz(dir_parallel);
121 adjointPrimKinEnergy, gammaE1, isScatProjToProj);
123 if(!isScatProjToProj)
155 if(!isScatProjToProj)
161 G4double f1 = (Emin - adjointPrimKinEnergy) / Emin;
162 G4double f2 = (Emax - adjointPrimKinEnergy) / Emax / f1;
163 gammaE1 = adjointPrimKinEnergy / (1. - f1 * std::pow(f2,
G4UniformRand()));
164 gammaE2 = gammaE1 - adjointPrimKinEnergy;
167 (1. + 2. * std::log(1. + electron_mass_c2 / adjointPrimKinEnergy)) *
168 adjointPrimKinEnergy / gammaE1 / gammaE2;
178 gammaE2 = adjointPrimKinEnergy;
180 diffCSUsed = diffCSUsed / gammaE1;
201 w_corr *= diffCS / diffCSUsed;
208 G4double cos_th = 1. + electron_mass_c2 * (1. / gammaE1 - 1. / gammaE2);
209 if(!isScatProjToProj)
212 cos_th = (gammaE1 - gammaE2 * cos_th) / p_elec;
215 if(std::abs(cos_th) > 1.)
225 sin_th = std::sqrt(1. - cos_th * cos_th);
232 G4ThreeVector(std::cos(phi) * sin_th, std::sin(phi) * sin_th, cos_th);
233 gammaMomentum1.
rotateUz(dir_parallel);
235 if(!isScatProjToProj)
254 G4double gamEnergy1 = gamEnergy0 - kinEnergyElec;
276 if(gamEnergy1 > gamEnergy0 || gamEnergy1 < gamEnergy0 / one_plus_two_epsi)
281 G4double CS = std::log(one_plus_two_epsi) *
284 4. /
epsilon + 0.5 * (1. - 1. / (one_plus_two_epsi * one_plus_two_epsi));
290 G4double epsilon1 = gamEnergy1 / electron_mass_c2;
293 G4double dCS_dE1 = 1. / v + v + term1 * term1 - 1.;
294 dCS_dE1 *= 1. /
epsilon / gamEnergy0;
300 dCS_dE1 *= fDirectCS / CS;
309 G4double inv_e_max = 1. / primAdjEnergy - 2. / electron_mass_c2;
312 e_max = std::min(1. / inv_e_max, e_max);
320 G4double half_e = primAdjEnergy / 2.;
321 return half_e + std::sqrt(half_e * (electron_mass_c2 + half_e));
337 if(!isScatProjToProj)
341 if(Emax_proj > Emin_proj)
344 std::log((Emax_proj -
G4float(primEnergy)) * Emin_proj /
345 Emax_proj / (Emin_proj - primEnergy)) *
346 (1. + 2. * std::log(
G4float(1. + electron_mass_c2 / primEnergy)));
353 if(Emax_proj > Emin_proj)
355 Cross = 0.1 * std::log(Emax_proj / Emin_proj);
361 return double(Cross);
G4double epsilon(G4double density, G4double temperature)
CLHEP::Hep3Vector G4ThreeVector
Hep3Vector & rotateUz(const Hep3Vector &)
G4double GetPostStepWeightCorrection()
static G4AdjointCSManager * GetAdjointCSManager()
G4double DiffCrossSectionPerAtomPrimToSecond(G4double kinEnergyProj, G4double kinEnergyProd, G4double Z, G4double A=0.) override
void SampleSecondaries(const G4Track &aTrack, G4bool isScatProjToProj, G4ParticleChange *fParticleChange) override
G4double AdjointCrossSection(const G4MaterialCutsCouple *aCouple, G4double primEnergy, G4bool isScatProjToProj) override
void RapidSampleSecondaries(const G4Track &aTrack, G4bool isScatProjToProj, G4ParticleChange *fParticleChange)
G4double GetSecondAdjEnergyMaxForScatProjToProj(G4double primAdjEnergy) override
~G4AdjointComptonModel() override
G4double GetSecondAdjEnergyMinForProdToProj(G4double primAdjEnergy) override
G4double DiffCrossSectionPerAtomPrimToScatPrim(G4double kinEnergyProj, G4double kinEnergyScatProj, G4double Z, G4double A=0.) override
static G4AdjointElectron * AdjointElectron()
static G4AdjointGamma * AdjointGamma()
const G4ThreeVector & GetMomentumDirection() const
G4double GetKineticEnergy() const
G4double GetTotalMomentum() const
G4double GetElectronDensity() const
void AddSecondary(G4Track *aSecondary)
void ProposeEnergy(G4double finalEnergy)
void ProposeMomentumDirection(G4double Px, G4double Py, G4double Pz)
G4double GetWeight() const
const G4DynamicParticle * GetDynamicParticle() const
const G4MaterialCutsCouple * GetMaterialCutsCouple() const
G4double fOutsideWeightFactor
virtual G4double GetSecondAdjEnergyMaxForProdToProj(G4double primAdjEnergy)
void SetUseMatrixPerElement(G4bool aBool)
G4bool fSecondPartSameType
G4ParticleDefinition * fAdjEquivDirectSecondPart
void SetUseMatrix(G4bool aBool)
G4bool fInModelWeightCorr
virtual G4double GetSecondAdjEnergyMinForScatProjToProj(G4double primAdjEnergy, G4double tcut=0.)
G4ParticleDefinition * fAdjEquivDirectPrimPart
G4MaterialCutsCouple * fCurrentCouple
G4Material * fCurrentMaterial
virtual void CorrectPostStepWeight(G4ParticleChange *fParticleChange, G4double old_weight, G4double adjointPrimKinEnergy, G4double projectileKinEnergy, G4bool isScatProjToProj)
void DefineCurrentMaterial(const G4MaterialCutsCouple *couple)
virtual G4double AdjointCrossSection(const G4MaterialCutsCouple *aCouple, G4double primEnergy, G4bool isScatProjToProj)
G4VEmModel * fDirectModel
void SetUseOnlyOneMatrixForAllElements(G4bool aBool)
G4ParticleDefinition * fDirectPrimaryPart
G4double SampleAdjSecEnergyFromCSMatrix(std::size_t MatrixIndex, G4double prim_energy, G4bool isScatProjToProj)
G4double GetHighEnergyLimit()
void SetApplyCutInRange(G4bool aBool)
virtual G4double ComputeCrossSectionPerAtom(const G4ParticleDefinition *, G4double kinEnergy, G4double Z, G4double A=0., G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX)
G4double GetCrossSection(const G4double kinEnergy, const G4MaterialCutsCouple *couple) override
void ProposeTrackStatus(G4TrackStatus status)
void SetSecondaryWeightByProcess(G4bool)
void SetParentWeightByProcess(G4bool)
void ProposeParentWeight(G4double finalWeight)