116{
117
118
119
120
121
122
123
124
126
127
128
131
132
133
134
135
136 G4double DEDX_before = theDirectEnergyLossProcess->
GetDEDX(preStepKinEnergy, currentCouple);
137
138
139
140
141
142
147
148
150 if (is_integral )
n=10;
153 for (
size_t i=0;i<
n;i++) {
154 if (Tkin != preStepKinEnergy && IsIon) {
157
158 }
159
161 if( dlength <= linLossLimit * r ) {
162 degain = DEDX_before*dlength;
163 }
164 else {
166
168 if (IsIon){
172
173
175 const G4int iimax = 100;
176 while (std::abs(x-x1)>0.01*x) {
180 x1= theDirectEnergyLossProcess->
GetRange(E, currentCouple);
181 ++ii;
182 if(ii >= iimax) { break; }
183 }
184 }
185
186 degain=E-Tkin;
187
188
189
190 }
191
193 tmax = std::min(tmax,currentTcut);
194
195
197
198
199
202
203
204
205
206
208 if (lossFluctuationFlag ) {
210 SampleFluctuations(currentCouple,dynParticle,tmax,dlength,degain)-degain;
211 }
212
214 if (egain <=0) egain=degain;
215 Tkin+=egain;
217 }
218
219
220
221
222
223 delete dynParticle;
224
225 if (IsIon){
228
229 }
230
231 G4double DEDX_after = theDirectEnergyLossProcess->
GetDEDX(Tkin, currentCouple);
232
233
234 G4double weight_correction=DEDX_after/DEDX_before;
235
236
238
239
240
241
242
243
244
245
246
250
251
253
254}
void SetDefinition(const G4ParticleDefinition *aParticleDefinition)
G4double GetKineticEnergy() const
void SetKineticEnergy(G4double aEnergy)
void ProposeEnergy(G4double finalEnergy)
virtual void Initialize(const G4Track &)
G4double GetWeight() const
G4double GetStepLength() const
G4StepPoint * GetPostStepPoint() const
const G4DynamicParticle * GetDynamicParticle() const
virtual void CorrectionsAlongStep(const G4MaterialCutsCouple *, const G4DynamicParticle *, G4double &eloss, G4double &niel, G4double length)
G4VEmFluctuationModel * GetModelOfFluctuations()
virtual G4double GetChargeSquareRatio(const G4ParticleDefinition *, const G4Material *, G4double kineticEnergy)
G4double MaxSecondaryKinEnergy(const G4DynamicParticle *dynParticle)
G4double GetKineticEnergy(G4double range, const G4MaterialCutsCouple *)
void SetDynamicMassCharge(G4double massratio, G4double charge2ratio)
G4double GetDEDX(G4double kineticEnergy, const G4MaterialCutsCouple *)
G4double GetRange(G4double kineticEnergy, const G4MaterialCutsCouple *)
void SetParentWeightByProcess(G4bool)
void ProposeParentWeight(G4double finalWeight)
G4ParticleChange aParticleChange