420{
421
422
423
424
425
426
427
428
429
431 if(!first){EndPoint= ApproxCurveV;}
432
434 Point_A=CurveA_PointVelocity.GetPosition();
435 Point_B=CurveB_PointVelocity.GetPosition();
436
438
439
440
441 if(first)
442 {
443 xa=0.;
444 ya=(PointG-Point_A).mag();
445 xb=(Point_A-CurrentF_Point).mag();
446 yb=-(PointG-CurrentF_Point).mag();
447 xc=(Point_A-Point_B).mag();
448 yc=-(CurrentE_Point-Point_B).mag();
449 }
450 else
451 {
452 xa=0.;
453 ya=(Point_A-CurrentE_Point).mag();
454 xb=(Point_A-CurrentF_Point).mag();
455 yb=(PointG-CurrentF_Point).mag();
456 xc=(Point_A-Point_B).mag();
457 yc=-(Point_B-PointG).mag();
458 if(xb==0.)
459 {
460 EndPoint=
462 CurrentE_Point, eps_step);
463 return EndPoint;
464 }
465 }
466
468 if(std::abs(ya)<=tolerance||std::abs(yc)<=tolerance)
469 {
470 ;
471
472 }
473 else
474 {
477 if(first)
478 {
479 curve=std::abs(EndPoint.GetCurveLength()
481 }
482 else
483 {
484 test_step=(test_step-xb);
485 curve=std::abs(EndPoint.GetCurveLength()
486 -CurveB_PointVelocity.GetCurveLength());
487 xb=(CurrentF_Point-Point_B).mag();
488 }
489
490 if(test_step<=0) { test_step=0.1*xb; }
491 if(test_step>=xb) { test_step=0.5*xb; }
492 if(test_step>=curve){ test_step=0.5*curve; }
493
494 if(curve*(1.+eps_step)<xb)
495 {
496 test_step=0.5*curve;
497 }
498
500
501#ifdef G4DEBUG_FIELD
502
503
504 G4cout <<
"G4ChordFinder::ApproxCurvePointS() - test-step ShF = "
505 << test_step <<
" EndPoint = " << EndPoint <<
G4endl;
506
507
508
511 CurveB_PointVelocity,
512 CurrentE_Point, eps_step );
514 G4cout <<
"G4ChordFinder::BrentApprox = " << EndPoint <<
G4endl;
515 G4cout <<
"G4ChordFinder::LinearApprox= " << TestTrack <<
G4endl;
516#endif
517 }
518 return EndPoint;
519}
G4DLLIMPORT std::ostream G4cout
G4double InvParabolic(const G4double xa, const G4double ya, const G4double xb, const G4double yb, const G4double xc, const G4double yc)
G4FieldTrack ApproxCurvePointV(const G4FieldTrack &curveAPointVelocity, const G4FieldTrack &curveBPointVelocity, const G4ThreeVector ¤tEPoint, G4double epsStep)