65 G4bool IsScatProjToProjCase,
87 IsScatProjToProjCase);
93 G4double gammaE2 = adjointPrimKinEnergy;
94 if (!IsScatProjToProjCase) gammaE2 = gammaE1 - adjointPrimKinEnergy;
105 if (!IsScatProjToProjCase) {
107 cos_th = (gammaE1 - gammaE2*cos_th)/p_elec;
110 if (std::abs(cos_th)>1){
118 else sin_th = std::sqrt(1.-cos_th*cos_th);
130 gammaMomentum1.
rotateUz(dir_parallel);
138 adjointPrimKinEnergy,
140 IsScatProjToProjCase);
142 if (!IsScatProjToProjCase){
157 G4bool IsScatProjToProjCase,
177 if (!IsScatProjToProjCase){
181 if (Emin>=Emax)
return;
183 G4double f2=(Emax-adjointPrimKinEnergy)/Emax/f1;
184 gammaE1=adjointPrimKinEnergy/(1.-f1*std::pow(f2,
G4UniformRand()));;
185 gammaE2=gammaE1-adjointPrimKinEnergy;
186 diffCSUsed= diffCSUsed*(1.+2.*std::log(1.+
electron_mass_c2/adjointPrimKinEnergy))*adjointPrimKinEnergy/gammaE1/gammaE2;
192 if (Emin>=Emax)
return;
193 gammaE2 =adjointPrimKinEnergy;
195 diffCSUsed= diffCSUsed/gammaE1;
219 w_corr*=diffCS/diffCSUsed;
232 if (!IsScatProjToProjCase) {
234 cos_th = (gammaE1 - gammaE2*cos_th)/p_elec;
237 if (std::abs(cos_th)>1){
245 else sin_th = std::sqrt(1.-cos_th*cos_th);
257 gammaMomentum1.
rotateUz(dir_parallel);
262 if (!IsScatProjToProjCase){
286 G4double gamEnergy1 = gamEnergy0 - kinEnergyElec;
312 G4double gamEnergy1_max = gamEnergy0;
313 G4double gamEnergy1_min = gamEnergy0/one_plus_two_epsi;
314 if (gamEnergy1 >gamEnergy1_max || gamEnergy1<gamEnergy1_min) {
324 G4double one_plus_two_epsi_2=one_plus_two_epsi*one_plus_two_epsi;
328 CS+=4./epsilon +0.5*(1.-1./one_plus_two_epsi_2);
338 G4double term1 =1.+ 1./epsilon -1/epsilon1;
339 G4double dCS_dE1= 1./v +v + term1*term1 -1.;
340 dCS_dE1 *=1./epsilon/gamEnergy0;
380 G4bool IsScatProjToProjCase)
389 if (!IsScatProjToProjCase ){
392 if (Emax_proj>Emin_proj ){
393 Cross= 0.1*std::log((Emax_proj-
float (primEnergy))*Emin_proj/Emax_proj/(Emin_proj-primEnergy))
400 if (Emax_proj>Emin_proj) {
401 Cross = 0.1*std::log(Emax_proj/Emin_proj);
410 return double(Cross);
416 G4bool IsScatProjToProjCase)
static const G4double Emin
G4bool second_part_of_same_type
CLHEP::Hep3Vector G4ThreeVector
virtual G4double GetSecondAdjEnergyMinForScatProjToProjCase(G4double PrimAdjEnergy, G4double Tcut=0)
virtual G4double DiffCrossSectionPerAtomPrimToSecond(G4double kinEnergyProj, G4double kinEnergyProd, G4double Z, G4double A=0.)
void SetApplyCutInRange(G4bool aBool)
static constexpr double twopi_mc2_rcl2
G4Material * currentMaterial
const G4ThreeVector & GetMomentumDirection() const
void SetUseOnlyOneMatrixForAllElements(G4bool aBool)
static G4AdjointElectron * AdjointElectron()
virtual G4double AdjointCrossSection(const G4MaterialCutsCouple *aCouple, G4double primEnergy, G4bool IsScatProjToProjCase)
void SetSecondaryWeightByProcess(G4bool)
Hep3Vector & rotateUz(const Hep3Vector &)
virtual G4double GetSecondAdjEnergyMaxForScatProjToProjCase(G4double PrimAdjEnergy)
G4double additional_weight_correction_factor_for_post_step_outside_model
void AddSecondary(G4Track *aSecondary)
static G4AdjointGamma * AdjointGamma()
G4double currentTcutForDirectSecond
G4MaterialCutsCouple * currentCouple
G4double GetWeight() const
G4VEmProcess * theDirectEMProcess
G4ParticleDefinition * theAdjEquivOfDirectSecondPartDef
virtual void SampleSecondaries(const G4Track &aTrack, G4bool IsScatProjToProjCase, G4ParticleChange *fParticleChange)
G4ParticleDefinition * theAdjEquivOfDirectPrimPartDef
const G4MaterialCutsCouple * GetMaterialCutsCouple() const
static constexpr double electron_mass_c2
G4double GetPostStepWeightCorrection()
virtual G4double GetSecondAdjEnergyMaxForProdToProjCase(G4double PrimAdjEnergy)
double A(double temperature)
G4double GetLambda(G4double &kinEnergy, const G4MaterialCutsCouple *couple)
virtual G4double GetSecondAdjEnergyMinForProdToProjCase(G4double PrimAdjEnergy)
void ProposeEnergy(G4double finalEnergy)
virtual G4double ComputeCrossSectionPerAtom(const G4ParticleDefinition *, G4double kinEnergy, G4double Z, G4double A=0., G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX)
static G4AdjointCSManager * GetAdjointCSManager()
G4bool correct_weight_for_post_step_in_model
virtual void CorrectPostStepWeight(G4ParticleChange *fParticleChange, G4double old_weight, G4double adjointPrimKinEnergy, G4double projectileKinEnergy, G4bool IsScatProjToProjCase)
double epsilon(double density, double temperature)
G4VEmModel * theDirectEMModel
void RapidSampleSecondaries(const G4Track &aTrack, G4bool IsScatProjToProjCase, G4ParticleChange *fParticleChange)
void SetParentWeightByProcess(G4bool)
void ProposeParentWeight(G4double finalWeight)
virtual G4double GetAdjointCrossSection(const G4MaterialCutsCouple *aCouple, G4double primEnergy, G4bool IsScatProjToProjCase)
void ProposeMomentumDirection(G4double Px, G4double Py, G4double Pz)
static const G4double Emax
G4double GetKineticEnergy() const
G4double SampleAdjSecEnergyFromCSMatrix(size_t MatrixIndex, G4double prim_energy, G4bool IsScatProjToProjCase)
G4double GetTotalMomentum() const
G4ParticleDefinition * theDirectPrimaryPartDef
virtual G4double AdjointCrossSection(const G4MaterialCutsCouple *aCouple, G4double primEnergy, G4bool IsScatProjToProjCase)
virtual G4double DiffCrossSectionPerAtomPrimToScatPrim(G4double kinEnergyProj, G4double kinEnergyScatProj, G4double Z, G4double A=0.)
void SetUseMatrixPerElement(G4bool aBool)
void ProposeTrackStatus(G4TrackStatus status)
const G4DynamicParticle * GetDynamicParticle() const
G4double GetElectronDensity() const
T min(const T t1, const T t2)
brief Return the smallest of the two arguments
void SetUseMatrix(G4bool aBool)
void DefineCurrentMaterial(const G4MaterialCutsCouple *couple)