Changeset 850 for trunk/source/geometry/navigation/src
- Timestamp:
- Sep 10, 2008, 5:40:37 PM (16 years ago)
- Location:
- trunk/source/geometry/navigation/src
- Files:
-
- 19 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/geometry/navigation/src/G4AuxiliaryNavServices.cc
r831 r850 25 25 // 26 26 // $Id: G4AuxiliaryNavServices.cc,v 1.3 2006/06/29 18:36:32 gunter Exp $ 27 // GEANT4 tag $Name: $27 // GEANT4 tag $Name: HEAD $ 28 28 // 29 29 // -------------------------------------------------------------------- -
trunk/source/geometry/navigation/src/G4DrawVoxels.cc
r831 r850 26 26 // 27 27 // $Id: G4DrawVoxels.cc,v 1.4 2006/06/29 18:36:34 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: HEAD $ 29 29 // 30 30 // -
trunk/source/geometry/navigation/src/G4ErrorPropagationNavigator.cc
r831 r850 26 26 // 27 27 // $Id: G4ErrorPropagationNavigator.cc,v 1.1 2007/05/16 12:49:18 gcosmo Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: HEAD $ 29 29 // 30 30 // -
trunk/source/geometry/navigation/src/G4GeomTestErrorList.cc
r831 r850 26 26 // 27 27 // $Id: G4GeomTestErrorList.cc,v 1.3 2006/06/29 18:36:36 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: HEAD $ 29 29 // 30 30 // -------------------------------------------------------------------- -
trunk/source/geometry/navigation/src/G4GeomTestOverlapList.cc
r831 r850 26 26 // 27 27 // $Id: G4GeomTestOverlapList.cc,v 1.3 2006/06/29 18:36:39 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: HEAD $ 29 29 // 30 30 // -------------------------------------------------------------------- -
trunk/source/geometry/navigation/src/G4GeomTestOvershootList.cc
r831 r850 26 26 // 27 27 // $Id: G4GeomTestOvershootList.cc,v 1.3 2006/06/29 18:36:41 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: HEAD $ 29 29 // 30 30 // -------------------------------------------------------------------- -
trunk/source/geometry/navigation/src/G4GeomTestPoint.cc
r831 r850 26 26 // 27 27 // $Id: G4GeomTestPoint.cc,v 1.3 2006/06/29 18:36:44 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: HEAD $ 29 29 // 30 30 // -------------------------------------------------------------------- -
trunk/source/geometry/navigation/src/G4GeomTestSegment.cc
r831 r850 26 26 // 27 27 // $Id: G4GeomTestSegment.cc,v 1.11 2007/11/16 09:39:14 gcosmo Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: HEAD $ 29 29 // 30 30 // -------------------------------------------------------------------- -
trunk/source/geometry/navigation/src/G4GeomTestStreamLogger.cc
r831 r850 26 26 // 27 27 // $Id: G4GeomTestStreamLogger.cc,v 1.3 2006/06/29 18:36:49 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: HEAD $ 29 29 // 30 30 // -------------------------------------------------------------------- -
trunk/source/geometry/navigation/src/G4GeomTestVolPoint.cc
r831 r850 26 26 // 27 27 // $Id: G4GeomTestVolPoint.cc,v 1.3 2006/06/29 18:36:52 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: HEAD $ 29 29 // 30 30 // -------------------------------------------------------------------- -
trunk/source/geometry/navigation/src/G4GeomTestVolume.cc
r831 r850 26 26 // 27 27 // $Id: G4GeomTestVolume.cc,v 1.6 2007/11/16 09:39:14 gcosmo Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: HEAD $ 29 29 // 30 30 // -------------------------------------------------------------------- -
trunk/source/geometry/navigation/src/G4GeometryMessenger.cc
r831 r850 26 26 // 27 27 // $Id: G4GeometryMessenger.cc,v 1.5 2006/06/29 18:36:57 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: HEAD $ 29 29 // 30 30 // -------------------------------------------------------------------- -
trunk/source/geometry/navigation/src/G4NormalNavigation.cc
r831 r850 26 26 // 27 27 // $Id: G4NormalNavigation.cc,v 1.9 2007/05/11 13:43:59 gcosmo Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: HEAD $ 29 29 // 30 30 // -
trunk/source/geometry/navigation/src/G4ParameterisedNavigation.cc
r831 r850 26 26 // 27 27 // $Id: G4ParameterisedNavigation.cc,v 1.12 2007/11/09 16:06:02 gcosmo Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: HEAD $ 29 29 // 30 30 // -
trunk/source/geometry/navigation/src/G4PathFinder.cc
r831 r850 25 25 // 26 26 // 27 // $Id: G4PathFinder.cc,v 1.5 8.2.1 2008/04/29 15:37:16gcosmo Exp $27 // $Id: G4PathFinder.cc,v 1.59 2008/04/29 15:32:54 gcosmo Exp $ 28 28 // GEANT4 tag $ Name: $ 29 29 // -
trunk/source/geometry/navigation/src/G4PropagatorInField.cc
r831 r850 25 25 // 26 26 // 27 // $Id: G4PropagatorInField.cc,v 1.4 2 2008/01/24 08:54:01 gcosmoExp $28 // GEANT4 tag $Name: $27 // $Id: G4PropagatorInField.cc,v 1.43 2008/05/28 09:12:23 tnikitin Exp $ 28 // GEANT4 tag $Name: HEAD $ 29 29 // 30 30 // … … 83 83 fPreviousSafety= 0.0; 84 84 kCarTolerance = G4GeometryTolerance::GetInstance()->GetSurfaceTolerance(); 85 85 // 86 fUseBrentLocator=true; 86 87 // In case of too slow progress in finding Intersection Point 87 88 // intermediates Points on the Track must be stored. 88 89 // Initialise the array of Pointers [max_depth+1] to do this 89 90 90 G4ThreeVector zeroV(0.0,0.0,0.0); 91 91 for (G4int idepth=0; idepth<max_depth+1; idepth++ ) … … 93 93 ptrInterMedFT[ idepth ] = new G4FieldTrack( zeroV, zeroV, 0., 0., 0., 0.); 94 94 } 95 // Counter for Maximum Number Of Trial before Intersection Found 96 maxNumberOfStepsForIntersection=0; 97 // Counter for Number Of Calls to ReIntegrationEndPoint Method 98 maxNumberOfCallsToReIntegration=0; 99 maxNumberOfCallsToReIntegration_depth=0; 95 100 } 96 101 … … 100 105 { 101 106 delete ptrInterMedFT[idepth]; 107 } 108 if(fVerboseLevel>0){ 109 G4cout<<"G4PropagatorInField::Location with Max Number of Steps=" 110 << maxNumberOfStepsForIntersection<<G4endl; 111 G4cout<<"G4PropagatorInField::ReIntegrateEndPoint was called "<< 112 maxNumberOfCallsToReIntegration<<" times and for depth algorithm "<< 113 maxNumberOfCallsToReIntegration_depth<<" times"<<G4endl; 102 114 } 103 115 } … … 114 126 G4VPhysicalVolume* pPhysVol) 115 127 { 128 116 129 // If CurrentProposedStepLength is too small for finding Chords 117 130 // then return with no action (for now - TODO: some action) … … 150 163 151 164 GetChordFinder()->SetChargeMomentumMass(fCharge, fInitialMomentumModulus, fMass); 152 165 153 166 G4FieldTrack CurrentState(pFieldTrack); 154 167 G4FieldTrack OriginalState = CurrentState; … … 291 304 InterSectionPointE, IntersectPointVelct_G, 292 305 recalculatedEndPt); 293 // G4cout<<"In Locate"<<recalculatedEndPt<<" and V"<<IntersectPointVelct_G.GetPosition()<<G4endl;306 // G4cout<<"In Locate"<<recalculatedEndPt<<" and V"<<IntersectPointVelct_G.GetPosition()<<G4endl; 294 307 intersects = intersects && found_intersection; 295 308 if( found_intersection ) { … … 405 418 << " Zero progress for " << fNoZeroStep << " attempted steps." 406 419 << G4endl; 420 G4cout << "Proposed Step is "<<CurrentProposedStepLength <<" but Step Taken is "<< fFull_CurveLen_of_LastAttempt <<G4endl; 421 G4cout << "For Particle with Charge ="<<fCharge 422 << " Momentum="<< fInitialMomentumModulus<<" Mass="<< fMass<<G4endl; 423 if( pPhysVol ) 424 G4cout << " in the volume " << pPhysVol->GetName() ; 425 else 426 G4cout << " in unknown or null volume. " ; 427 G4cout << G4endl; 407 428 if ( fVerboseLevel > 2 ) 408 429 G4cout << " Particle that is stuck will be killed." << G4endl; 409 430 fNoZeroStep = 0; 410 431 } 411 // G4cout << "G4PropagatorInField returns " << TruePathLength << G4endl;432 412 433 return TruePathLength; 413 434 } … … 463 484 G4FieldTrack ApproxIntersecPointV(CurveEndPointVelocity); // FT-Def-Construct 464 485 G4double NewSafety= -0.0; 465 486 466 487 G4bool final_section= true; // Shows whether current section is last 467 488 // (i.e. B=full end) 468 489 G4bool first_section=true; 469 490 recalculatedEndPoint= false; 470 491 471 492 G4bool restoredFullEndpoint= false; 472 493 … … 482 503 static G4int max_no_seen= -1; 483 504 static G4int trigger_substepno_print= warn_substeps - 20 ; 484 505 485 506 //-------------------------------------------------------------------------- 486 507 // Algoritm for the case if progress in founding intersection is too slow. … … 492 513 // until 'max_depth'. 493 514 //-------------------------------------------------------------------------- 494 495 const G4int param_substeps=10; // Test value for the maximum number 496 // of substeps 515 G4double count_did_len=0.; 516 G4double count_all_len=0; 517 G4int param_substeps=100;//Test value for the maximum number of substeps 518 if(!fUseBrentLocator) param_substeps=10;// Reduced value for the maximum number 519 497 520 const G4double fraction_done=0.3; 498 521 … … 549 572 // (the closest if possible) 550 573 // 551 ApproxIntersecPointV = GetChordFinder() 574 if((!fUseBrentLocator)||(substep_no_p==0)){ 575 ApproxIntersecPointV = GetChordFinder() 552 576 ->ApproxCurvePointV( CurrentA_PointVelocity, 553 577 CurrentB_PointVelocity, … … 555 579 fEpsilonStep ); 556 580 // The above method is the key & most intuitive part ... 557 581 } 558 582 #ifdef G4DEBUG_FIELD 559 583 if( ApproxIntersecPointV.GetCurveLength() > … … 571 595 572 596 G4ThreeVector CurrentF_Point= ApproxIntersecPointV.GetPosition(); 573 597 if(substep_no> maxNumberOfStepsForIntersection)maxNumberOfStepsForIntersection=substep_no; 574 598 // First check whether EF is small - then F is a good approx. point 575 599 // Calculate the length and direction of the chord AF … … 580 604 { 581 605 found_approximate_intersection = true; 582 583 606 // Create the "point" return value 584 607 // … … 609 632 if( Intersects_AF ) 610 633 { 634 if(fUseBrentLocator){ 635 636 G4FieldTrack EndPoint=ApproxIntersecPointV; 637 ApproxIntersecPointV= GetChordFinder()->ApproxCurvePointS( 638 CurrentA_PointVelocity,CurrentB_PointVelocity, 639 CurrentE_Point,CurrentF_Point,PointG,true,fEpsilonStep); 640 CurrentB_PointVelocity = EndPoint; 641 CurrentE_Point = PointG; 642 // By moving point B, must take care if current 643 // AF has no intersection to try current FB!! 644 // 645 final_section= false; 646 647 } 648 else{ 611 649 // G is our new Candidate for the intersection point. 612 650 // It replaces "E" and we will repeat the test to see if … … 617 655 CurrentB_PointVelocity = ApproxIntersecPointV; 618 656 CurrentE_Point = PointG; 619 657 620 658 // By moving point B, must take care if current 621 659 // AF has no intersection to try current FB!! 622 660 // 623 661 final_section= false; 624 662 } 625 663 #ifdef G4VERBOSE 626 664 if( fVerboseLevel > 3 ) … … 651 689 PointH ); 652 690 if( Intersects_FB ) 653 { 691 { 692 if(fUseBrentLocator){ 693 CurrentA_PointVelocity = ApproxIntersecPointV; 694 ApproxIntersecPointV= GetChordFinder()->ApproxCurvePointS( 695 CurrentA_PointVelocity,CurrentB_PointVelocity, 696 CurrentE_Point,Point_A,PointH,false,fEpsilonStep); 697 CurrentE_Point = PointH; 698 } 699 else{ 700 654 701 // There is an intersection of FB with a volume boundary 655 702 // H <- First Intersection of Chord FB … … 666 713 CurrentA_PointVelocity = ApproxIntersecPointV; 667 714 CurrentE_Point = PointH; 715 } 668 716 } 669 717 else // not Intersects_FB … … 719 767 curveDist = CurrentB_PointVelocity.GetCurveLength() 720 768 - CurrentA_PointVelocity.GetCurveLength(); 721 722 // Change this condition for very strict parameters of propagation 723 // 724 if( curveDist*curveDist*(1+2* fEpsilonStep ) < linDistSq ) 769 if( curveDist*curveDist*(1+2*fEpsilonStep ) < linDistSq ) 725 770 { 726 771 // Re-integrate to obtain a new B … … 733 778 G4FieldTrack oldPointVelB = CurrentB_PointVelocity; 734 779 CurrentB_PointVelocity = newEndPointFT; 735 780 maxNumberOfCallsToReIntegration= maxNumberOfCallsToReIntegration+1; 781 #ifdef G4DEBUG_FIELD 782 G4cout<<"G4PIF::Call ReIntEnd1 linD="<<std::sqrt(linDistSq)<<" curve="<<curveDist<<" n="<<substep_no<<G4endl; 783 G4cout<<"G4PIF::Call ReIntEnd2 IntersectAF="<< Intersects_AF<<" final_section="<<final_section<<G4endl; 784 #endif 736 785 if( (final_section)&&(Second_half)&&(depth==0) ) // real final section 737 786 { … … 740 789 // So that we can return it, if it is the endpoint! 741 790 } 791 742 792 } 793 743 794 if( curveDist < 0.0 ) 744 795 { … … 757 808 << "The final curve point is not further along" 758 809 << " than the original!" << G4endl; 759 760 810 if( recalculatedEndPoint ) 761 811 { … … 782 832 G4cerr << " Substep depth no= "<< substep_no_p << " Depth= " 783 833 << depth << G4endl; 784 834 G4cerr << " did_len= "<< count_did_len << " all_len= " 835 << count_all_len << G4endl; 785 836 G4Exception("G4PropagatorInField::LocateIntersectionPoint()", 786 837 "FatalError", FatalException, 787 838 "Error in advancing propagation."); 788 839 } 789 840 790 841 if(restoredFullEndpoint) 791 842 { … … 832 883 G4double all_len = std::abs( CurrentB_PointVelocity.GetCurveLength() 833 884 - SubStart_PointVelocity.GetCurveLength()); 834 885 count_did_len=did_len; 886 count_all_len=all_len; 835 887 G4double stepLengthAB; 836 888 G4ThreeVector PointGe; … … 890 942 CurrentA_PointVelocity = *ptrInterMedFT[depth]; 891 943 CurrentB_PointVelocity = *ptrInterMedFT[depth-1]; 944 // Ensure that the new endpoints are not further apart in space 945 // than on the curve due to different errors in the integration 946 // 947 G4double linDistSq, curveDist; 948 linDistSq = ( CurrentB_PointVelocity.GetPosition() 949 - CurrentA_PointVelocity.GetPosition() ).mag2(); 950 curveDist = CurrentB_PointVelocity.GetCurveLength() 951 - CurrentA_PointVelocity.GetCurveLength(); 952 if( curveDist*curveDist*(1+2*fEpsilonStep ) < linDistSq ) 953 { 954 // Re-integrate to obtain a new B 955 // 956 G4FieldTrack newEndPointFT= 957 ReEstimateEndpoint( CurrentA_PointVelocity, 958 CurrentB_PointVelocity, 959 linDistSq, // to avoid recalculation 960 curveDist ); 961 G4FieldTrack oldPointVelB = CurrentB_PointVelocity; 962 CurrentB_PointVelocity = newEndPointFT; 963 maxNumberOfCallsToReIntegration_depth= maxNumberOfCallsToReIntegration_depth+1; 964 } 965 892 966 G4ThreeVector Point_A = CurrentA_PointVelocity.GetPosition(); 893 967 G4ThreeVector SubE_point = CurrentB_PointVelocity.GetPosition(); -
trunk/source/geometry/navigation/src/G4ReplicaNavigation.cc
r831 r850 25 25 // 26 26 // 27 // $Id: G4ReplicaNavigation.cc,v 1.1 7.2.2 2008/04/28 16:05:41gcosmo Exp $28 // GEANT4 tag $Name: geant4-09-01-patch-02$27 // $Id: G4ReplicaNavigation.cc,v 1.19 2008/04/28 15:39:55 gcosmo Exp $ 28 // GEANT4 tag $Name: HEAD $ 29 29 // 30 30 // -
trunk/source/geometry/navigation/src/G4TransportationManager.cc
r831 r850 26 26 // 27 27 // $Id: G4TransportationManager.cc,v 1.15 2007/04/12 11:51:48 vnivanch Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: HEAD $ 29 29 // 30 30 // -
trunk/source/geometry/navigation/src/G4VoxelNavigation.cc
r831 r850 26 26 // 27 27 // $Id: G4VoxelNavigation.cc,v 1.7 2007/05/11 13:43:59 gcosmo Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: HEAD $ 29 29 // 30 30 //
Note: See TracChangeset
for help on using the changeset viewer.