- Timestamp:
- Jun 18, 2010, 11:42:07 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/processes/electromagnetic/standard/src/G4UrbanMscModel93.cc
r1228 r1315 1 // 1 // 2 2 // ******************************************************************** 3 3 // * License and Disclaimer * … … 25 25 // 26 26 // 27 // $Id: G4UrbanMscModel93.cc,v 1. 1 2009/11/01 13:05:01vnivanch Exp $28 // GEANT4 tag $Name: geant4-09-0 3$27 // $Id: G4UrbanMscModel93.cc,v 1.4 2010/05/20 13:17:25 vnivanch Exp $ 28 // GEANT4 tag $Name: geant4-09-04-beta-cand-01 $ 29 29 // 30 30 // ------------------------------------------------------------------- 31 // 31 // 32 32 // GEANT4 Class file 33 // 33 // 34 34 // 35 35 // File name: G4UrbanMscModel93 … … 466 466 presafety = sp->GetSafety(); 467 467 468 //G4cout << "G4Urban2::StepLimit tPathLength= "469 //<<tPathLength<<" safety= " << presafety470 //<< " range= " <<currentRange<< " lambda= "<<lambda0471 //<< " Alg: " << steppingAlgorithm <<G4endl;468 // G4cout << "G4Urban2::StepLimit tPathLength= " 469 // <<tPathLength<<" safety= " << presafety 470 // << " range= " <<currentRange<< " lambda= "<<lambda0 471 // << " Alg: " << steppingAlgorithm <<G4endl; 472 472 473 473 // far from geometry boundary … … 571 571 if(tlimit < stepmin) tlimit = stepmin; 572 572 573 if(tPathLength > tlimit) tPathLength = tlimit ; 573 // randomize 1st step or 1st 'normal' step in volume 574 if((stepStatus == fUndefined) || 575 ((smallstep == skin) && !insideskin)) 576 { 577 G4double temptlimit = tlimit; 578 if(temptlimit > tlimitmin) 579 { 580 do { 581 temptlimit = G4RandGauss::shoot(tlimit,0.3*tlimit); 582 } while ((temptlimit < tlimitmin) || 583 (temptlimit > 2.*tlimit-tlimitmin)); 584 } 585 else 586 temptlimit = tlimitmin; 587 if(tPathLength > temptlimit) tPathLength = temptlimit; 588 } 589 else 590 { 591 if(tPathLength > tlimit) tPathLength = tlimit ; 592 } 574 593 575 594 } … … 617 636 //lower limit for tlimit 618 637 if(tlimit < tlimitmin) tlimit = tlimitmin; 619 638 620 639 if(tPathLength > tlimit) tPathLength = tlimit; 640 621 641 } 622 642 … … 1002 1022 G4double G4UrbanMscModel93::SampleDisplacement() 1003 1023 { 1024 // compute rmean = sqrt(<r**2>) from theory 1004 1025 const G4double kappa = 2.5; 1005 1026 const G4double kappapl1 = kappa+1.; 1006 1027 const G4double kappami1 = kappa-1.; 1028 // Compute rmean = sqrt(<r**2>) from theory 1007 1029 G4double rmean = 0.0; 1008 1030 if ((currentTau >= tausmall) && !insideskin) { … … 1022 1044 } 1023 1045 1046 if(rmean == 0.) return rmean; 1047 1024 1048 // protection against z > t ........................... 1025 if(rmean > 0.) { 1026 G4double zt = (tPathLength-zPathLength)*(tPathLength+zPathLength); 1027 if(zt <= 0.) 1028 rmean = 0.; 1029 else if(rmean*rmean > zt) 1030 rmean = sqrt(zt); 1031 } 1049 G4double rmax = (tPathLength-zPathLength)*(tPathLength+zPathLength); 1050 if(rmax <= 0.) 1051 rmax = 0.; 1052 else 1053 rmax = sqrt(rmax); 1054 1055 if(rmean >= rmax) return rmax; 1056 1032 1057 return rmean; 1058 // VI comment out for the time being 1059 /* 1060 //sample r (Gaussian distribution with a mean of rmean ) 1061 G4double r = 0.; 1062 G4double sigma = min(rmean,rmax-rmean); 1063 sigma /= 3.; 1064 G4double rlow = rmean-3.*sigma; 1065 G4double rhigh = rmean+3.*sigma; 1066 do { 1067 r = G4RandGauss::shoot(rmean,sigma); 1068 } while ((r < rlow) || (r > rhigh)); 1069 1070 return r; 1071 */ 1033 1072 } 1034 1073
Note: See TracChangeset
for help on using the changeset viewer.