Changeset 1228 for trunk/source/geometry/navigation/src
- Timestamp:
- Jan 8, 2010, 11:56:51 AM (14 years ago)
- Location:
- trunk/source/geometry/navigation/src
- Files:
-
- 22 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/geometry/navigation/src/G4AuxiliaryNavServices.cc
r921 r1228 25 25 // 26 26 // $Id: G4AuxiliaryNavServices.cc,v 1.3 2006/06/29 18:36:32 gunter Exp $ 27 // GEANT4 tag $Name: geant4-09-0 2-cand-01$27 // GEANT4 tag $Name: geant4-09-03 $ 28 28 // 29 29 // -------------------------------------------------------------------- -
trunk/source/geometry/navigation/src/G4BrentLocator.cc
r1058 r1228 25 25 // 26 26 // $Id: G4BrentLocator.cc,v 1.8 2009/05/15 12:55:48 tnikitin Exp $ 27 // GEANT4 tag $Name: geant4-09-03 -beta-cand-01$27 // GEANT4 tag $Name: geant4-09-03 $ 28 28 // 29 29 // Class G4BrentLocator implementation -
trunk/source/geometry/navigation/src/G4DrawVoxels.cc
r1058 r1228 26 26 // 27 27 // $Id: G4DrawVoxels.cc,v 1.4 2006/06/29 18:36:34 gunter Exp $ 28 // GEANT4 tag $Name: geant4-09-03 -beta-cand-01$28 // GEANT4 tag $Name: geant4-09-03 $ 29 29 // 30 30 // -
trunk/source/geometry/navigation/src/G4ErrorPropagationNavigator.cc
r921 r1228 26 26 // 27 27 // $Id: G4ErrorPropagationNavigator.cc,v 1.2 2008/10/24 14:00:03 gcosmo Exp $ 28 // GEANT4 tag $Name: geant4-09-0 2-cand-01$28 // GEANT4 tag $Name: geant4-09-03 $ 29 29 // 30 30 // -
trunk/source/geometry/navigation/src/G4GeomTestErrorList.cc
r921 r1228 26 26 // 27 27 // $Id: G4GeomTestErrorList.cc,v 1.3 2006/06/29 18:36:36 gunter Exp $ 28 // GEANT4 tag $Name: geant4-09-0 2-cand-01$28 // GEANT4 tag $Name: geant4-09-03 $ 29 29 // 30 30 // -------------------------------------------------------------------- -
trunk/source/geometry/navigation/src/G4GeomTestOverlapList.cc
r921 r1228 26 26 // 27 27 // $Id: G4GeomTestOverlapList.cc,v 1.3 2006/06/29 18:36:39 gunter Exp $ 28 // GEANT4 tag $Name: geant4-09-0 2-cand-01$28 // GEANT4 tag $Name: geant4-09-03 $ 29 29 // 30 30 // -------------------------------------------------------------------- -
trunk/source/geometry/navigation/src/G4GeomTestOvershootList.cc
r921 r1228 26 26 // 27 27 // $Id: G4GeomTestOvershootList.cc,v 1.3 2006/06/29 18:36:41 gunter Exp $ 28 // GEANT4 tag $Name: geant4-09-0 2-cand-01$28 // GEANT4 tag $Name: geant4-09-03 $ 29 29 // 30 30 // -------------------------------------------------------------------- -
trunk/source/geometry/navigation/src/G4GeomTestPoint.cc
r921 r1228 26 26 // 27 27 // $Id: G4GeomTestPoint.cc,v 1.3 2006/06/29 18:36:44 gunter Exp $ 28 // GEANT4 tag $Name: geant4-09-0 2-cand-01$28 // GEANT4 tag $Name: geant4-09-03 $ 29 29 // 30 30 // -------------------------------------------------------------------- -
trunk/source/geometry/navigation/src/G4GeomTestSegment.cc
r921 r1228 26 26 // 27 27 // $Id: G4GeomTestSegment.cc,v 1.11 2007/11/16 09:39:14 gcosmo Exp $ 28 // GEANT4 tag $Name: geant4-09-0 2-cand-01$28 // GEANT4 tag $Name: geant4-09-03 $ 29 29 // 30 30 // -------------------------------------------------------------------- -
trunk/source/geometry/navigation/src/G4GeomTestStreamLogger.cc
r921 r1228 26 26 // 27 27 // $Id: G4GeomTestStreamLogger.cc,v 1.3 2006/06/29 18:36:49 gunter Exp $ 28 // GEANT4 tag $Name: geant4-09-0 2-cand-01$28 // GEANT4 tag $Name: geant4-09-03 $ 29 29 // 30 30 // -------------------------------------------------------------------- -
trunk/source/geometry/navigation/src/G4GeomTestVolPoint.cc
r921 r1228 26 26 // 27 27 // $Id: G4GeomTestVolPoint.cc,v 1.3 2006/06/29 18:36:52 gunter Exp $ 28 // GEANT4 tag $Name: geant4-09-0 2-cand-01$28 // GEANT4 tag $Name: geant4-09-03 $ 29 29 // 30 30 // -------------------------------------------------------------------- -
trunk/source/geometry/navigation/src/G4GeomTestVolume.cc
r921 r1228 26 26 // 27 27 // $Id: G4GeomTestVolume.cc,v 1.6 2007/11/16 09:39:14 gcosmo Exp $ 28 // GEANT4 tag $Name: geant4-09-0 2-cand-01$28 // GEANT4 tag $Name: geant4-09-03 $ 29 29 // 30 30 // -------------------------------------------------------------------- -
trunk/source/geometry/navigation/src/G4GeometryMessenger.cc
r921 r1228 26 26 // 27 27 // $Id: G4GeometryMessenger.cc,v 1.5 2006/06/29 18:36:57 gunter Exp $ 28 // GEANT4 tag $Name: geant4-09-0 2-cand-01$28 // GEANT4 tag $Name: geant4-09-03 $ 29 29 // 30 30 // -------------------------------------------------------------------- -
trunk/source/geometry/navigation/src/G4MultiLevelLocator.cc
r1058 r1228 25 25 // 26 26 // $Id: G4MultiLevelLocator.cc,v 1.5 2008/12/11 10:01:02 tnikitin Exp $ 27 // GEANT4 tag $Name: geant4-09-03 -beta-cand-01$27 // GEANT4 tag $Name: geant4-09-03 $ 28 28 // 29 29 // Class G4MultiLevelLocator implementation -
trunk/source/geometry/navigation/src/G4NormalNavigation.cc
r921 r1228 26 26 // 27 27 // $Id: G4NormalNavigation.cc,v 1.9 2007/05/11 13:43:59 gcosmo Exp $ 28 // GEANT4 tag $Name: geant4-09-0 2-cand-01$28 // GEANT4 tag $Name: geant4-09-03 $ 29 29 // 30 30 // -
trunk/source/geometry/navigation/src/G4ParameterisedNavigation.cc
r921 r1228 26 26 // 27 27 // $Id: G4ParameterisedNavigation.cc,v 1.12 2007/11/09 16:06:02 gcosmo Exp $ 28 // GEANT4 tag $Name: geant4-09-0 2-cand-01$28 // GEANT4 tag $Name: geant4-09-03 $ 29 29 // 30 30 // -
trunk/source/geometry/navigation/src/G4PropagatorInField.cc
r1058 r1228 36 36 // 17.03.97 John Apostolakis, renaming new set functions being added 37 37 // 38 // $Id: G4PropagatorInField.cc,v 1.50 2009/12/10 08:41:54 japost Exp $ 39 // GEANT4 tag $ Name: $ 38 40 // --------------------------------------------------------------------------- 39 41 … … 69 71 fUseSafetyForOptimisation(true), // (false) is less sensitive to incorrect safety 70 72 fSetFieldMgr(false), 73 fZeroStepThreshold( 0.0 ), 71 74 fpTrajectoryFilter( 0 ) 72 75 { … … 83 86 fPreviousSafety= 0.0; 84 87 kCarTolerance = G4GeometryTolerance::GetInstance()->GetSurfaceTolerance(); 88 fZeroStepThreshold= std::max( 1.0e5 * kCarTolerance, 1.0e-1 * micrometer ) ; 89 #ifdef G4DEBUG_FIELD 90 G4cout << " PiF: Zero Step Threshold set to " << fZeroStepThreshold / millimeter 91 << " mm." << G4endl; 92 G4cout << " PiF: Value of kCarTolerance = " << kCarTolerance / millimeter 93 << " mm. " << G4endl; 94 #endif 85 95 86 96 // Definding Intersection Locator and his parameters … … 92 102 fAllocatedLocator=false; 93 103 } 104 RefreshIntersectionLocator(); // Copy all relevant parameters 105 } 106 107 G4PropagatorInField::~G4PropagatorInField() 108 { 109 if(fAllocatedLocator)delete fIntersectionLocator; 110 } 111 112 // Update the IntersectionLocator with current parameters 113 void 114 G4PropagatorInField::RefreshIntersectionLocator() 115 { 94 116 fIntersectionLocator->SetEpsilonStepFor(fEpsilonStep); 95 fIntersectionLocator->SetDeltaIntersectionFor( GetDeltaIntersection());117 fIntersectionLocator->SetDeltaIntersectionFor(fCurrentFieldMgr->GetDeltaIntersection()); 96 118 fIntersectionLocator->SetChordFinderFor(GetChordFinder()); 97 119 fIntersectionLocator->SetSafetyParametersFor( fUseSafetyForOptimisation); 98 120 } 99 100 G4PropagatorInField::~G4PropagatorInField()101 {102 if(fAllocatedLocator)delete fIntersectionLocator;103 }104 105 121 /////////////////////////////////////////////////////////////////////////// 106 122 // … … 114 130 G4VPhysicalVolume* pPhysVol) 115 131 { 116 132 const G4String MethodName("G4PropagatorInField::ComputeStep"); 133 117 134 // If CurrentProposedStepLength is too small for finding Chords 118 135 // then return with no action (for now - TODO: some action) … … 152 169 GetChordFinder()->SetChargeMomentumMass(fCharge, fInitialMomentumModulus, fMass); 153 170 154 // Values for Intersection Locator has to be updated on each call 155 // because the CurrentFieldManager changes 156 fIntersectionLocator->SetChordFinderFor(GetChordFinder()); 157 fIntersectionLocator->SetSafetyParametersFor( fUseSafetyForOptimisation); 158 fIntersectionLocator->SetEpsilonStepFor(fEpsilonStep); 159 fIntersectionLocator->SetDeltaIntersectionFor(GetDeltaIntersection()); 171 // Values for Intersection Locator has to be updated on each call for the 172 // case that CurrentFieldManager has changed from the one of previous step 173 RefreshIntersectionLocator(); 160 174 161 175 G4FieldTrack CurrentState(pFieldTrack); … … 177 191 fLargestAcceptableStep ); 178 192 } 179 epsilon = GetDeltaOneStep() / CurrentProposedStepLength;193 epsilon = fCurrentFieldMgr->GetDeltaOneStep() / CurrentProposedStepLength; 180 194 // G4double raw_epsilon= epsilon; 181 195 G4double epsilonMin= fCurrentFieldMgr->GetMinimumEpsilonStep(); … … 200 214 G4double decreaseFactor = 0.9; // Unused default 201 215 if( (fNoZeroStep < fSevereActionThreshold_NoZeroSteps) 202 && (stepTrial > 100 0.0*kCarTolerance) )216 && (stepTrial > 100.0*fZeroStepThreshold) ) 203 217 { 204 // Ensure quickerconvergence218 // Attempt quick convergence 205 219 // 206 decreaseFactor= 0. 1;220 decreaseFactor= 0.25; 207 221 } 208 222 else … … 212 226 // Careful decreases to cope with tolerance are required. 213 227 // 214 if( stepTrial > 100 0.0*kCarTolerance)215 decreaseFactor = 0. 25; // Try slow decreases216 else if( stepTrial > 100.0* kCarTolerance)217 decreaseFactor= 0.5; // Try slower decreases218 else if( stepTrial > 10.0* kCarTolerance)228 if( stepTrial > 100.0*fZeroStepThreshold ) 229 decreaseFactor = 0.35; // Try decreasing slower 230 else if( stepTrial > 100.0*fZeroStepThreshold ) 231 decreaseFactor= 0.5; // Try yet slower decreases 232 else if( stepTrial > 10.0*fZeroStepThreshold ) 219 233 decreaseFactor= 0.75; // Try even slower decreases 220 234 else … … 224 238 225 239 #ifdef G4DEBUG_FIELD 240 G4cout << MethodName << ": " 241 << " Decreasing step - " 242 << " decreaseFactor= " << std::setw(8) << decreaseFactor 243 << " stepTrial = " << std::setw(18) << stepTrial << " " 244 << " fZeroStepThreshold = " << fZeroStepThreshold << G4endl; 226 245 PrintStepLengthDiagnostic(CurrentProposedStepLength, decreaseFactor, 227 246 stepTrial, pFieldTrack); 228 247 #endif 229 if( stepTrial == 0.0 ) 248 if( stepTrial == 0.0 ) // Change to make it < 0.1 * kCarTolerance ?? 230 249 { 231 250 G4cout << " G4PropagatorInField::ComputeStep " … … 403 422 // and only take corrective action when they occur. 404 423 // 405 if( TruePathLength < 0.5*kCarTolerance ) 424 if( ( (TruePathLength < fZeroStepThreshold) 425 && ( TruePathLength+kCarTolerance < CurrentProposedStepLength ) 426 ) 427 || ( TruePathLength < 0.5*kCarTolerance ) 428 ) 429 { 406 430 fNoZeroStep++; 407 else 431 } 432 else{ 408 433 fNoZeroStep = 0; 434 } 409 435 410 436 if( fNoZeroStep > fAbandonThreshold_NoZeroSteps ) { … … 552 578 const G4FieldTrack& ) 553 579 { 580 #if 0 554 581 G4cout << " PiF: NoZeroStep= " << fNoZeroStep 555 582 << " CurrentProposedStepLength= " << CurrentProposedStepLength 556 583 << " Full_curvelen_last=" << fFull_CurveLen_of_LastAttempt 557 584 << " last proposed step-length= " << fLast_ProposedStepLength 558 << " decrea te factor = " << decreaseFactor585 << " decrease factor = " << decreaseFactor 559 586 << " step trial = " << stepTrial 560 587 << G4endl; 588 #endif 589 int iprec= G4cout.precision(8); 590 G4cout << " " << std::setw(12) << " PiF: NoZeroStep " 591 << " " << std::setw(20) << " CurrentProposed len " 592 << " " << std::setw(18) << " Full_curvelen_last" 593 << " " << std::setw(18) << " last proposed len " 594 << " " << std::setw(18) << " decrease factor " 595 << " " << std::setw(15) << " step trial " 596 << G4endl; 597 598 G4cout << " " << std::setw(10) << fNoZeroStep << " " 599 << " " << std::setw(20) << CurrentProposedStepLength 600 << " " << std::setw(18) << fFull_CurveLen_of_LastAttempt 601 << " " << std::setw(18) << fLast_ProposedStepLength 602 << " " << std::setw(18) << decreaseFactor 603 << " " << std::setw(15) << stepTrial 604 << G4endl; 605 G4cout.precision( iprec ); 606 561 607 } 562 608 … … 617 663 if( pCurrentPhysicalVolume) 618 664 { 619 G4FieldManager *newFieldMgr = 0; 620 newFieldMgr= pCurrentPhysicalVolume->GetLogicalVolume()->GetFieldManager(); 621 if ( newFieldMgr ) 622 currentFieldMgr = newFieldMgr; 665 G4FieldManager *pRegionFieldMgr= 0, *localFieldMgr = 0; 666 G4LogicalVolume* pLogicalVol= pCurrentPhysicalVolume->GetLogicalVolume(); 667 668 if( pLogicalVol ) { 669 // Value for Region, if any, Overrides 670 G4Region* pRegion= pLogicalVol->GetRegion(); 671 if( pRegion ) { 672 pRegionFieldMgr= pRegion->GetFieldManager(); 673 if( pRegionFieldMgr ) 674 currentFieldMgr= pRegionFieldMgr; 675 } 676 677 // 'Local' Value from logical volume, if any, Overrides 678 localFieldMgr= pLogicalVol->GetFieldManager(); 679 if ( localFieldMgr ) 680 currentFieldMgr = localFieldMgr; 681 } 623 682 } 624 683 fCurrentFieldMgr= currentFieldMgr; -
trunk/source/geometry/navigation/src/G4ReplicaNavigation.cc
r921 r1228 26 26 // 27 27 // $Id: G4ReplicaNavigation.cc,v 1.19 2008/04/28 15:39:55 gcosmo Exp $ 28 // GEANT4 tag $Name: geant4-09-0 2-cand-01$28 // GEANT4 tag $Name: geant4-09-03 $ 29 29 // 30 30 // -
trunk/source/geometry/navigation/src/G4SimpleLocator.cc
r1058 r1228 25 25 // 26 26 // $Id: G4SimpleLocator.cc,v 1.5 2008/12/11 10:27:58 tnikitin Exp $ 27 // GEANT4 tag $Name: geant4-09-03 -beta-cand-01$27 // GEANT4 tag $Name: geant4-09-03 $ 28 28 // 29 29 // Class G4SimpleLocator implementation -
trunk/source/geometry/navigation/src/G4TransportationManager.cc
r921 r1228 26 26 // 27 27 // $Id: G4TransportationManager.cc,v 1.15 2007/04/12 11:51:48 vnivanch Exp $ 28 // GEANT4 tag $Name: geant4-09-0 2-cand-01$28 // GEANT4 tag $Name: geant4-09-03 $ 29 29 // 30 30 // -
trunk/source/geometry/navigation/src/G4VIntersectionLocator.cc
r1058 r1228 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4VIntersectionLocator.cc,v 1. 5 2009/05/15 12:58:23 tnikitinExp $27 // GEANT4 tag $Name: geant4-09-03 -beta-cand-01$26 // $Id: G4VIntersectionLocator.cc,v 1.7 2009/11/27 15:21:59 japost Exp $ 27 // GEANT4 tag $Name: geant4-09-03 $ 28 28 // 29 29 // Class G4VIntersectionLocator implementation … … 43 43 // Constructor 44 44 // 45 G4VIntersectionLocator:: G4VIntersectionLocator(G4Navigator *theNavigator) 45 G4VIntersectionLocator:: G4VIntersectionLocator(G4Navigator *theNavigator): 46 fUseNormalCorrection(false), 47 fiNavigator( theNavigator ), 48 fiChordFinder( 0 ), // Not set - overridden at each step 49 fiEpsilonStep( -1.0 ), // Out of range - overridden at each step 50 fiDeltaIntersection( -1.0 ), // Out of range - overridden at each step 51 fiUseSafety(false) // Default - overridden at each step 46 52 { 47 53 kCarTolerance = G4GeometryTolerance::GetInstance()->GetSurfaceTolerance(); 48 fiNavigator = theNavigator;49 54 fVerboseLevel = 0; 50 fUseNormalCorrection = false;51 55 fHelpingNavigator = new G4Navigator(); 52 56 } … … 191 195 if (std::abs(advanceLength)<kCarTolerance) 192 196 { 193 advanceLength=(EstimatedEndStateB.GetPosition() 194 -newEndPoint.GetPosition()).mag(); 197 goodAdvance=true; 195 198 } 199 else{ 196 200 goodAdvance= 197 201 integrDriver->AccurateAdvance(newEndPoint, advanceLength, 198 202 GetEpsilonStepFor()); 203 } 199 204 } 200 205 while( !goodAdvance && (++itrial < no_trials) ); -
trunk/source/geometry/navigation/src/G4VoxelNavigation.cc
r921 r1228 26 26 // 27 27 // $Id: G4VoxelNavigation.cc,v 1.9 2008/11/14 18:26:35 gcosmo Exp $ 28 // GEANT4 tag $Name: geant4-09-0 2-cand-01$28 // GEANT4 tag $Name: geant4-09-03 $ 29 29 // 30 30 //
Note: See TracChangeset
for help on using the changeset viewer.