259{
261 G4double geometryStepLength(-1.0), newSafety(-1.0);
262
263 State(fParticleIsLooping) =
false;
264 State(fEndGlobalTimeComputed) =
false;
265 State(fGeometryLimitedStep) =
false;
266
267
268
269
270
271
272
273
274
275
277
278
279
281
284
285
286
287
288
289
290
294 {
295 currentSafety = 0.0;
296 }
297 else
298 {
300 }
301
302
303
305
306
307
308
309
310
311
313 G4bool fieldExertsForce =
false;
314 if ((particleCharge != 0.0))
315 {
317 if (fieldMgr != 0)
318 {
319
321
322
323
324
325
327 }
328 }
329
330
331
332
333
334
335 if (!fieldExertsForce)
336 {
339 {
340
341
342 geometryStepLength = currentMinimumStep;
343 State(fGeometryLimitedStep) =
false;
344 }
345 else
346 {
347
348
349
351 startMomentumDir,
352 currentMinimumStep,
353 newSafety);
354
355
356
357
358
359
360
363
367
369 State(fTransportEndPosition));
371
372
373
374 currentSafety = newSafety;
375
376 State(fGeometryLimitedStep) = (linearStepLength <= currentMinimumStep);
377 if (
State(fGeometryLimitedStep))
378 {
379
380 geometryStepLength = linearStepLength;
381 }
382 else
383 {
384
385 geometryStepLength = currentMinimumStep;
386 }
387 }
388 State(fEndPointDistance) = geometryStepLength;
389
390
391
392 State(fTransportEndPosition) = startPosition
393 + geometryStepLength * startMomentumDir;
394
395
396
397 State(fTransportEndMomentumDir) = startMomentumDir;
400 State(fParticleIsLooping) =
false;
401 State(fMomentumChanged) =
false;
402 State(fEndGlobalTimeComputed) =
true;
403 State(theInteractionTimeLeft) =
State(fEndPointDistance)
405 State(fCandidateEndGlobalTime) =
State(theInteractionTimeLeft)
407
408
409
410
411
412
413
414
415
416
417 }
418 else
419 {
420
422 exceptionDescription
423 << "ITTransportation does not support external fields.";
424 exceptionDescription
425 << " If you are dealing with a tradiational MC simulation, ";
426 exceptionDescription << "please use G4Transportation.";
427
428 G4Exception(
"G4ITTransportation::AlongStepGetPhysicalInteractionLength",
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579 }
580
581
582
583
584 if (currentMinimumStep == 0.0)
585 {
586 if (currentSafety == 0.0)
587 {
588 State(fGeometryLimitedStep) =
true;
589
590
591
592 }
593 }
594
595
596
597
598 if (currentSafety <
State(fEndPointDistance))
599 {
600
601
602
603 if (particleCharge != 0.0)
604 {
605
607 State(fTransportEndPosition));
608 currentSafety = endSafety;
611
612
613
614
615
619
621 State(fTransportEndPosition));
623
624
625
626
627 currentSafety +=
State(fEndPointDistance);
628
629#ifdef G4DEBUG_TRANSPORT
631 G4cout <<
"***G4Transportation::AlongStepGPIL ** " <<
G4endl;
632 G4cout <<
" Called Navigator->ComputeSafety at "
633 <<
State(fTransportEndPosition)
634 <<
" and it returned safety= " << endSafety <<
G4endl;
635 G4cout <<
" Adding endpoint distance " <<
State(fEndPointDistance)
636 <<
" to obtain pseudo-safety= " << currentSafety <<
G4endl;
637#endif
638 }
639 }
640
641
642
643
644
645
646 return geometryStepLength;
647}
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
std::ostringstream G4ExceptionDescription
#define fPreviousSftOrigin
G4IT * GetIT(const G4Track *track)
const G4ThreeVector & GetMomentumDirection() const
G4double GetCharge() const
virtual void ConfigureForTrack(const G4Track *)
const G4Field * GetDetectorField() const
void SetCurrentSafety(G4double val, const G4ThreeVector &pos)
G4TrackingInformation * GetTrackingInfo()
G4FieldManager * FindAndSetFieldManager(G4VPhysicalVolume *pCurrentPhysVol)
virtual void LoadTrackState(G4TrackStateManager &manager)
virtual void ResetTrackState()
G4double GetVelocity() const
G4VPhysicalVolume * GetVolume() const
const G4ThreeVector & GetPosition() const
const G4DynamicParticle * GetDynamicParticle() const
const G4ThreeVector & GetPolarization() const