- Timestamp:
- Apr 17, 2009, 12:17:14 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/processes/electromagnetic/standard/src/G4WentzelVIModel.cc
r968 r991 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4WentzelVIModel.cc,v 1.1 7 2009/02/19 19:17:15vnivanch Exp $27 // GEANT4 tag $Name: geant4-09-02 -ref-02$26 // $Id: G4WentzelVIModel.cc,v 1.16 2008/11/19 11:47:50 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-02 $ 28 28 // 29 29 // ------------------------------------------------------------------- … … 60 60 #include "G4LossTableManager.hh" 61 61 #include "G4ParticleChangeForMSC.hh" 62 //#include "G4TransportationManager.hh"63 //#include "G4SafetyHelper.hh"62 #include "G4TransportationManager.hh" 63 #include "G4SafetyHelper.hh" 64 64 #include "G4PhysicsTableHelper.hh" 65 65 #include "G4ElementVector.hh" … … 138 138 fParticleChange = new G4ParticleChangeForMSC(); 139 139 140 InitialiseSafetyHelper(); 140 safetyHelper = G4TransportationManager::GetTransportationManager() 141 ->GetSafetyHelper(); 142 safetyHelper->InitialiseHelper(); 141 143 } 142 144 } … … 275 277 // i.e. when it is needed for optimization purposes 276 278 if(stepStatus != fGeomBoundary && presafety < tlimitminfix) 277 presafety = ComputeSafety(sp->GetPosition(), tlimit);279 presafety = safetyHelper->ComputeSafety(sp->GetPosition()); 278 280 /* 279 281 G4cout << "G4WentzelVIModel::ComputeTruePathLengthLimit tlimit= " … … 568 570 569 571 if(r > tlimitminfix) { 570 pos /= r; 571 ComputeDisplacement(fParticleChange, pos, r, safety); 572 G4ThreeVector Position = *(fParticleChange->GetProposedPosition()); 573 G4double fac= 1.; 574 if(r >= safety) { 575 // ******* so safety is computed at boundary too ************ 576 G4double newsafety = 577 safetyHelper->ComputeSafety(Position) - tlimitminfix; 578 if(newsafety <= 0.0) fac = 0.0; 579 else if(r > newsafety) fac = newsafety/r ; 580 //G4cout << "NewSafety= " << newsafety << " fac= " << fac 581 // << " r= " << r << " sint= " << sint << " pos " << Position << G4endl; 582 } 583 584 if(fac > 0.) { 585 // compute new endpoint of the Step 586 G4ThreeVector newPosition = Position + fac*pos; 587 588 // check safety after displacement 589 G4double postsafety = safetyHelper->ComputeSafety(newPosition); 590 591 // displacement to boundary 592 if(postsafety <= 0.0) { 593 safetyHelper->Locate(newPosition, newDirection); 594 595 // not on the boundary 596 } else { 597 safetyHelper->ReLocateWithinVolume(newPosition); 598 // if(fac < 1.0) G4cout << "NewPosition " << newPosition << G4endl; 599 } 600 601 fParticleChange->ProposePosition(newPosition); 602 } 572 603 } 573 604 }
Note: See TracChangeset
for help on using the changeset viewer.