Ignore:
Timestamp:
Jun 18, 2010, 11:42:07 AM (14 years ago)
Author:
garnier
Message:

update geant4-09-04-beta-cand-01 interfaces-V09-03-09 vis-V09-03-08

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/processes/electromagnetic/standard/src/G4UrbanMscModel93.cc

    r1228 r1315  
    1 //
     1// 
    22// ********************************************************************
    33// * License and Disclaimer                                           *
     
    2525//
    2626//
    27 // $Id: G4UrbanMscModel93.cc,v 1.1 2009/11/01 13:05:01 vnivanch Exp $
    28 // GEANT4 tag $Name: geant4-09-03 $
     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 $
    2929//
    3030// -------------------------------------------------------------------
    31 //
     31//   
    3232// GEANT4 Class file
    33 //
     33//   
    3434//
    3535// File name:   G4UrbanMscModel93
     
    466466  presafety = sp->GetSafety();
    467467
    468   //G4cout << "G4Urban2::StepLimit tPathLength= "
    469   //     <<tPathLength<<" safety= " << presafety
    470   //       << " range= " <<currentRange<< " lambda= "<<lambda0
    471   //     << " Alg: " << steppingAlgorithm <<G4endl;
     468 // G4cout << "G4Urban2::StepLimit tPathLength= "
     469 //      <<tPathLength<<" safety= " << presafety
     470 //        << " range= " <<currentRange<< " lambda= "<<lambda0
     471 //      << " Alg: " << steppingAlgorithm <<G4endl;
    472472
    473473  // far from geometry boundary
     
    571571      if(tlimit < stepmin) tlimit = stepmin;
    572572
    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        }
    574593
    575594    }
     
    617636      //lower limit for tlimit
    618637      if(tlimit < tlimitmin) tlimit = tlimitmin;
    619 
     638     
    620639      if(tPathLength > tlimit) tPathLength = tlimit;
     640
    621641    }
    622642 
     
    10021022G4double G4UrbanMscModel93::SampleDisplacement()
    10031023{
     1024  // compute rmean = sqrt(<r**2>) from theory
    10041025  const G4double kappa = 2.5;
    10051026  const G4double kappapl1 = kappa+1.;
    10061027  const G4double kappami1 = kappa-1.;
     1028  // Compute rmean = sqrt(<r**2>) from theory
    10071029  G4double rmean = 0.0;
    10081030  if ((currentTau >= tausmall) && !insideskin) {
     
    10221044  }
    10231045
     1046  if(rmean == 0.) return rmean;
     1047
    10241048  // 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     
    10321057  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  */
    10331072}
    10341073
Note: See TracChangeset for help on using the changeset viewer.