227{
228
230
231
232
233 std::vector<G4KineticTrack *>::iterator i;
234 for(i = active.begin(); i != active.end(); ++i)
235 {
239
240 std::map <G4int, G4VNuclearField*, std::less<G4int> >::iterator fieldIter= theFieldMap->find(
encoding);
241
243 if ( fieldIter != theFieldMap->end() ) currentField=fieldIter->second;
244
245
246
247
248
249
250
252
254 {
256 continue;
257 }
258
259
260#ifdef debug_1_RKPropagation
261 G4cout <<
" kt,timeStep, Intersection times tenter, tleave "
262 <<kt<<
" / state= " <<kt->
GetState() <<
" / " <<
" "<< currTimeStep <<
" / " << t_enter <<
" / " << t_leave <<
G4endl;
263#endif
264
265
266
267
268
269
270
271
272
273
274
275 if( ! currentField )
276 {
277 if(currTimeStep ==
DBL_MAX)currTimeStep = t_leave*1.05;
278 FreeTransport(kt, currTimeStep);
279 if ( currTimeStep >= t_leave )
280 {
283 else
287 }
288
289 continue;
290 }
291
292 if(t_enter > 0)
293 {
294 if(t_enter > currTimeStep)
295 {
296 FreeTransport(kt, currTimeStep);
297 continue;
298 }
299 else
300 {
301 FreeTransport(kt, t_enter);
302 currTimeStep -= t_enter;
303 t_leave -= t_enter;
304
305
306
308
309 if(newE <= kt->GetActualMass())
310 {
311
312
313 FreeTransport(kt, 1.1*t_leave);
315
316
317
318
319 continue;
320 }
321
329
330
331
332
333
334
335
336
337
338
339
340 }
341 }
342
343
344
345
347 if(currTimeStep > t_leave)
348 {
349 currTimeStep = t_leave;
350 is_exiting=true;
351 }
352
353#ifdef debug_1_RKPropagation
354 G4cerr <<
"RKPropagation is_exiting?, t_leave, curTimeStep " <<is_exiting<<
" "<<t_leave <<
" " <<currTimeStep<<
G4endl;
355 G4cout <<
"RKPropagation Ekin, field, projectile potential, p "
362#endif
363
366
367
368 if (currTimeStep > 0 &&
369 ! FieldTransport(kt, currTimeStep)) {
370 FreeTransport(kt,currTimeStep);
371 }
372
373#ifdef debug_1_RKPropagation
374 G4cout <<
"RKPropagation Ekin, field, p "
382#endif
383
384
385
386
387
389
390
391 if(is_exiting ||
393 {
394 if(t_in < 0 && t_out >= 0)
395 {
396
397
399 FreeTransport(kt, t_out);
400
402
403
404
405
406
407
408 if ( std::abs(currentField->
GetField(savePos)) > 0. &&
410 {
411
412
413 newE += currentField->
GetField(savePos)
415 }
416
417
418
419 if(newE < kt->GetActualMass())
420 {
421#ifdef debug_1_RKPropagation
422 G4cout <<
"RKPropagation-Transport: problem with particle exiting - ignored" <<
G4endl;
424#endif
428 } else {
430 }
431 continue;
432 }
439 }
440
441
443 if(newE < kt->GetActualMass())
444 {
445#ifdef debug_1_RKPropagation
447#endif
451 } else {
453 }
454 continue;
455 }
463 }
464
465 }
466
467}
CLHEP::HepLorentzRotation G4LorentzRotation
CLHEP::Hep3Vector G4ThreeVector
G4GLOB_DLL std::ostream G4cerr
G4GLOB_DLL std::ostream G4cout
CascadeState SetState(const CascadeState new_state)
G4double GetProjectilePotential() const
CascadeState GetState() const
const G4ThreeVector & GetPosition() const
void SetTrackingMomentum(const G4LorentzVector &a4Momentum)
const G4ParticleDefinition * GetDefinition() const
const G4LorentzVector & GetTrackingMomentum() const
G4double GetActualMass() const
G4bool GetSphereIntersectionTimes(const G4KineticTrack *track, G4double &t1, G4double &t2)
virtual G4double GetMass()=0
virtual G4double GetField(const G4ThreeVector &aPosition)=0