64 G4bool IsScatProjToProjCase,
86 IsScatProjToProjCase);
92 G4double gammaE2 = adjointPrimKinEnergy;
93 if (!IsScatProjToProjCase) gammaE2 = gammaE1 - adjointPrimKinEnergy;
103 G4double cos_th = 1.+ electron_mass_c2*(1./gammaE1 -1./gammaE2);
104 if (!IsScatProjToProjCase) {
106 cos_th = (gammaE1 - gammaE2*cos_th)/p_elec;
109 if (std::abs(cos_th)>1){
117 else sin_th = std::sqrt(1.-cos_th*cos_th);
129 gammaMomentum1.
rotateUz(dir_parallel);
137 adjointPrimKinEnergy,
139 IsScatProjToProjCase);
141 if (!IsScatProjToProjCase){
156 G4bool IsScatProjToProjCase,
176 if (!IsScatProjToProjCase){
180 if (Emin>=Emax)
return;
181 G4double f1=(Emin-adjointPrimKinEnergy)/Emin;
182 G4double f2=(Emax-adjointPrimKinEnergy)/Emax/f1;
183 gammaE1=adjointPrimKinEnergy/(1.-f1*std::pow(f2,
G4UniformRand()));;
184 gammaE2=gammaE1-adjointPrimKinEnergy;
185 diffCSUsed= diffCSUsed*(1.+2.*std::log(1.+electron_mass_c2/adjointPrimKinEnergy))*adjointPrimKinEnergy/gammaE1/gammaE2;
191 if (Emin>=Emax)
return;
192 gammaE2 =adjointPrimKinEnergy;
194 diffCSUsed= diffCSUsed/gammaE1;
212 if (diffCS >0) diffCS /=G4direct_CS;
218 w_corr*=diffCS/diffCSUsed;
230 G4double cos_th = 1.+ electron_mass_c2*(1./gammaE1 -1./gammaE2);
231 if (!IsScatProjToProjCase) {
233 cos_th = (gammaE1 - gammaE2*cos_th)/p_elec;
236 if (std::abs(cos_th)>1){
244 else sin_th = std::sqrt(1.-cos_th*cos_th);
256 gammaMomentum1.
rotateUz(dir_parallel);
261 if (!IsScatProjToProjCase){
285 G4double gamEnergy1 = gamEnergy0 - kinEnergyElec;
311 G4double gamEnergy1_max = gamEnergy0;
312 G4double gamEnergy1_min = gamEnergy0/one_plus_two_epsi;
313 if (gamEnergy1 >gamEnergy1_max || gamEnergy1<gamEnergy1_min) {
323 G4double one_plus_two_epsi_2=one_plus_two_epsi*one_plus_two_epsi;
327 CS+=4./
epsilon +0.5*(1.-1./one_plus_two_epsi_2);
335 G4double epsilon1 = gamEnergy1 / electron_mass_c2 ;
338 G4double dCS_dE1= 1./v +v + term1*term1 -1.;
339 dCS_dE1 *=1./
epsilon/gamEnergy0;
349 dCS_dE1 *= G4direct_CS/CS;
362{
G4double inv_e_max = 1./PrimAdjEnergy - 2./electron_mass_c2;
371 G4double term=std::sqrt(half_e*(electron_mass_c2+half_e));
379 G4bool IsScatProjToProjCase)
388 if (!IsScatProjToProjCase ){
391 if (Emax_proj>Emin_proj ){
392 Cross= 0.1*std::log((Emax_proj-
float (primEnergy))*Emin_proj/Emax_proj/(Emin_proj-primEnergy))
393 *(1.+2.*std::log(
float(1.+electron_mass_c2/primEnergy)));
399 if (Emax_proj>Emin_proj) {
400 Cross = 0.1*std::log(Emax_proj/Emin_proj);
409 return double(Cross);
415 G4bool IsScatProjToProjCase)
double epsilon(double density, double temperature)
double A(double temperature)
CLHEP::Hep3Vector G4ThreeVector
Hep3Vector & rotateUz(const Hep3Vector &)
G4double GetPostStepWeightCorrection()
static G4AdjointCSManager * GetAdjointCSManager()
virtual void SampleSecondaries(const G4Track &aTrack, G4bool IsScatProjToProjCase, G4ParticleChange *fParticleChange)
virtual G4double AdjointCrossSection(const G4MaterialCutsCouple *aCouple, G4double primEnergy, G4bool IsScatProjToProjCase)
virtual G4double GetSecondAdjEnergyMaxForScatProjToProjCase(G4double PrimAdjEnergy)
virtual G4double DiffCrossSectionPerAtomPrimToSecond(G4double kinEnergyProj, G4double kinEnergyProd, G4double Z, G4double A=0.)
void RapidSampleSecondaries(const G4Track &aTrack, G4bool IsScatProjToProjCase, G4ParticleChange *fParticleChange)
virtual G4double DiffCrossSectionPerAtomPrimToScatPrim(G4double kinEnergyProj, G4double kinEnergyScatProj, G4double Z, G4double A=0.)
virtual G4double GetAdjointCrossSection(const G4MaterialCutsCouple *aCouple, G4double primEnergy, G4bool IsScatProjToProjCase)
virtual G4double GetSecondAdjEnergyMinForProdToProjCase(G4double PrimAdjEnergy)
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
void SetUseMatrixPerElement(G4bool aBool)
G4VEmModel * theDirectEMModel
void SetUseMatrix(G4bool aBool)
virtual G4double GetSecondAdjEnergyMaxForProdToProjCase(G4double PrimAdjEnergy)
virtual void CorrectPostStepWeight(G4ParticleChange *fParticleChange, G4double old_weight, G4double adjointPrimKinEnergy, G4double projectileKinEnergy, G4bool IsScatProjToProjCase)
G4bool second_part_of_same_type
G4double additional_weight_correction_factor_for_post_step_outside_model
void DefineCurrentMaterial(const G4MaterialCutsCouple *couple)
G4ParticleDefinition * theDirectPrimaryPartDef
G4double SampleAdjSecEnergyFromCSMatrix(size_t MatrixIndex, G4double prim_energy, G4bool IsScatProjToProjCase)
G4Material * currentMaterial
void SetUseOnlyOneMatrixForAllElements(G4bool aBool)
G4bool correct_weight_for_post_step_in_model
G4double currentTcutForDirectSecond
G4MaterialCutsCouple * currentCouple
virtual G4double AdjointCrossSection(const G4MaterialCutsCouple *aCouple, G4double primEnergy, G4bool IsScatProjToProjCase)
G4ParticleDefinition * theAdjEquivOfDirectSecondPartDef
void SetApplyCutInRange(G4bool aBool)
virtual G4double GetSecondAdjEnergyMinForScatProjToProjCase(G4double PrimAdjEnergy, G4double Tcut=0)
G4ParticleDefinition * theAdjEquivOfDirectPrimPartDef
virtual G4double ComputeCrossSectionPerAtom(const G4ParticleDefinition *, G4double kinEnergy, G4double Z, G4double A=0., G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX)
G4double GetLambda(G4double kinEnergy, const G4MaterialCutsCouple *couple)
void ProposeTrackStatus(G4TrackStatus status)
void SetSecondaryWeightByProcess(G4bool)
void SetParentWeightByProcess(G4bool)
void ProposeParentWeight(G4double finalWeight)