90 fDirectEnergyLossProcess->GetDEDX(fPreStepKinEnergy, fCurrentCouple);
101 if(Tkin != fPreStepKinEnergy && fIsIon)
103 G4double chargeSqRatio = fCurrentModel->GetChargeSquareRatio(
104 fDirectPartDef, fCurrentMaterial, Tkin);
105 fDirectEnergyLossProcess->SetDynamicMassCharge(fMassRatio, chargeSqRatio);
108 G4double r = fDirectEnergyLossProcess->GetRange(Tkin, fCurrentCouple);
109 if(dlength <= fLinLossLimit * r)
111 degain = DEDX_before * dlength;
116 G4double E = fDirectEnergyLossProcess->GetKineticEnergy(x, fCurrentCouple);
119 G4double chargeSqRatio = fCurrentModel->GetChargeSquareRatio(
120 fDirectPartDef, fCurrentMaterial, E);
121 fDirectEnergyLossProcess->SetDynamicMassCharge(fMassRatio, chargeSqRatio);
122 G4double x1 = fDirectEnergyLossProcess->GetRange(E, fCurrentCouple);
125 constexpr G4int iimax = 100;
126 while(std::abs(x - x1) > 0.01 * x)
128 E = fDirectEnergyLossProcess->GetKineticEnergy(x, fCurrentCouple);
129 chargeSqRatio = fCurrentModel->GetChargeSquareRatio(
130 fDirectPartDef, fCurrentMaterial, E);
131 fDirectEnergyLossProcess->SetDynamicMassCharge(fMassRatio,
133 x1 = fDirectEnergyLossProcess->GetRange(E, fCurrentCouple);
144 G4double tmax = fCurrentModel->MaxSecondaryKinEnergy(dynParticle);
145 fCurrentTcut = std::min(fCurrentTcut, tmax);
150 fCurrentModel->CorrectionsAlongStep(fCurrentCouple, dynParticle, dlength, degain);
154 if(fLossFluctuationFlag)
156 deltaE = fCurrentModel->GetModelOfFluctuations()->SampleFluctuations(
157 fCurrentCouple, dynParticle, fCurrentTcut, tmax, dlength, degain)
171 G4double chargeSqRatio = fCurrentModel->GetChargeSquareRatio(
172 fDirectPartDef, fCurrentMaterial, Tkin);
173 fDirectEnergyLossProcess->SetDynamicMassCharge(fMassRatio, chargeSqRatio);
176 G4double DEDX_after = fDirectEnergyLossProcess->GetDEDX(Tkin, fCurrentCouple);
177 G4double weight_correction = DEDX_after / DEDX_before;
209 fCurrentModel = fDirectEnergyLossProcess->SelectModelForMaterial(
211 G4double emax_model = fCurrentModel->HighEnergyLimit();
215 G4double chargeSqRatio = fCurrentModel->GetChargeSquareRatio(
216 fDirectPartDef, fCurrentMaterial, fPreStepKinEnergy);
217 preStepChargeSqRatio = chargeSqRatio;
218 fDirectEnergyLossProcess->SetDynamicMassCharge(fMassRatio,
219 preStepChargeSqRatio);
222 G4double maxE = 1.1 * fPreStepKinEnergy;
224 if(fPreStepKinEnergy < fCurrentTcut)
225 maxE = std::min(fCurrentTcut, maxE);
227 maxE = std::min(emax_model * 1.001, maxE);
230 fDirectEnergyLossProcess->GetRange(fPreStepKinEnergy, fCurrentCouple);
234 G4double chargeSqRatioAtEmax = fCurrentModel->GetChargeSquareRatio(
235 fDirectPartDef, fCurrentMaterial, maxE);
236 fDirectEnergyLossProcess->SetDynamicMassCharge(fMassRatio,
237 chargeSqRatioAtEmax);
240 G4double r1 = fDirectEnergyLossProcess->GetRange(maxE, fCurrentCouple);
243 fDirectEnergyLossProcess->SetDynamicMassCharge(fMassRatio,
244 preStepChargeSqRatio);
246 return std::max(r1 - preStepRange, 0.001 * mm);
void SetDefinition(const G4ParticleDefinition *aParticleDefinition)
G4double GetKineticEnergy() const
void SetKineticEnergy(G4double aEnergy)