Geant4  10.03.p01
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
G4UrbanMscModel Class Reference

#include <G4UrbanMscModel.hh>

Inheritance diagram for G4UrbanMscModel:
Collaboration diagram for G4UrbanMscModel:

Public Member Functions

 G4UrbanMscModel (const G4String &nam="UrbanMsc")
 
virtual ~G4UrbanMscModel ()
 
virtual void Initialise (const G4ParticleDefinition *, const G4DataVector &) override
 
virtual void StartTracking (G4Track *) override
 
virtual G4double ComputeCrossSectionPerAtom (const G4ParticleDefinition *particle, G4double KineticEnergy, G4double AtomicNumber, G4double AtomicWeight=0., G4double cut=0., G4double emax=DBL_MAX) override
 
virtual G4ThreeVectorSampleScattering (const G4ThreeVector &, G4double safety) override
 
virtual G4double ComputeTruePathLengthLimit (const G4Track &track, G4double &currentMinimalStep) override
 
virtual G4double ComputeGeomPathLength (G4double truePathLength) override
 
virtual G4double ComputeTrueStepLength (G4double geomStepLength) override
 
G4double ComputeTheta0 (G4double truePathLength, G4double KineticEnergy)
 
void SetNewDisplacementFlag (G4bool)
 
- Public Member Functions inherited from G4VMscModel
 G4VMscModel (const G4String &nam)
 
virtual ~G4VMscModel ()
 
virtual void SampleSecondaries (std::vector< G4DynamicParticle * > *, const G4MaterialCutsCouple *, const G4DynamicParticle *, G4double tmin, G4double tmax) override
 
void SetStepLimitType (G4MscStepLimitType)
 
void SetLateralDisplasmentFlag (G4bool val)
 
void SetRangeFactor (G4double)
 
void SetGeomFactor (G4double)
 
void SetSkin (G4double)
 
void SetSampleZ (G4bool)
 
G4VEnergyLossProcessGetIonisation () const
 
void SetIonisation (G4VEnergyLossProcess *, const G4ParticleDefinition *part)
 
G4double ComputeSafety (const G4ThreeVector &position, G4double limit=DBL_MAX)
 
G4double ComputeGeomLimit (const G4Track &, G4double &presafety, G4double limit)
 
G4double GetDEDX (const G4ParticleDefinition *part, G4double kineticEnergy, const G4MaterialCutsCouple *couple)
 
G4double GetRange (const G4ParticleDefinition *part, G4double kineticEnergy, const G4MaterialCutsCouple *couple)
 
G4double GetEnergy (const G4ParticleDefinition *part, G4double range, const G4MaterialCutsCouple *couple)
 
G4double GetTransportMeanFreePath (const G4ParticleDefinition *part, G4double kinEnergy)
 
- Public Member Functions inherited from G4VEmModel
 G4VEmModel (const G4String &nam)
 
virtual ~G4VEmModel ()
 
virtual void InitialiseLocal (const G4ParticleDefinition *, G4VEmModel *masterModel)
 
virtual void InitialiseForMaterial (const G4ParticleDefinition *, const G4Material *)
 
virtual void InitialiseForElement (const G4ParticleDefinition *, G4int Z)
 
virtual G4double ComputeDEDXPerVolume (const G4Material *, const G4ParticleDefinition *, G4double kineticEnergy, G4double cutEnergy=DBL_MAX)
 
virtual G4double CrossSectionPerVolume (const G4Material *, const G4ParticleDefinition *, G4double kineticEnergy, G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX)
 
virtual G4double GetPartialCrossSection (const G4Material *, G4int level, const G4ParticleDefinition *, G4double kineticEnergy)
 
virtual G4double ComputeCrossSectionPerShell (const G4ParticleDefinition *, G4int Z, G4int shellIdx, G4double kinEnergy, G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX)
 
virtual G4double ChargeSquareRatio (const G4Track &)
 
virtual G4double GetChargeSquareRatio (const G4ParticleDefinition *, const G4Material *, G4double kineticEnergy)
 
virtual G4double GetParticleCharge (const G4ParticleDefinition *, const G4Material *, G4double kineticEnergy)
 
virtual void CorrectionsAlongStep (const G4MaterialCutsCouple *, const G4DynamicParticle *, G4double &eloss, G4double &niel, G4double length)
 
virtual G4double Value (const G4MaterialCutsCouple *, const G4ParticleDefinition *, G4double kineticEnergy)
 
virtual G4double MinPrimaryEnergy (const G4Material *, const G4ParticleDefinition *, G4double cut=0.0)
 
virtual G4double MinEnergyCut (const G4ParticleDefinition *, const G4MaterialCutsCouple *)
 
virtual void SetupForMaterial (const G4ParticleDefinition *, const G4Material *, G4double kineticEnergy)
 
virtual void DefineForRegion (const G4Region *)
 
virtual void ModelDescription (std::ostream &outFile) const
 
void InitialiseElementSelectors (const G4ParticleDefinition *, const G4DataVector &)
 
std::vector
< G4EmElementSelector * > * 
GetElementSelectors ()
 
void SetElementSelectors (std::vector< G4EmElementSelector * > *)
 
virtual G4double ComputeDEDX (const G4MaterialCutsCouple *, const G4ParticleDefinition *, G4double kineticEnergy, G4double cutEnergy=DBL_MAX)
 
G4double CrossSection (const G4MaterialCutsCouple *, const G4ParticleDefinition *, G4double kineticEnergy, G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX)
 
G4double ComputeMeanFreePath (const G4ParticleDefinition *, G4double kineticEnergy, const G4Material *, G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX)
 
G4double ComputeCrossSectionPerAtom (const G4ParticleDefinition *, const G4Element *, G4double kinEnergy, G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX)
 
G4int SelectIsotopeNumber (const G4Element *)
 
const G4ElementSelectRandomAtom (const G4MaterialCutsCouple *, const G4ParticleDefinition *, G4double kineticEnergy, G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX)
 
const G4ElementSelectRandomAtom (const G4Material *, const G4ParticleDefinition *, G4double kineticEnergy, G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX)
 
G4int SelectRandomAtomNumber (const G4Material *)
 
void SetParticleChange (G4VParticleChange *, G4VEmFluctuationModel *f=nullptr)
 
void SetCrossSectionTable (G4PhysicsTable *, G4bool isLocal)
 
G4ElementDataGetElementData ()
 
G4PhysicsTableGetCrossSectionTable ()
 
G4VEmFluctuationModelGetModelOfFluctuations ()
 
G4VEmAngularDistributionGetAngularDistribution ()
 
void SetAngularDistribution (G4VEmAngularDistribution *)
 
G4double HighEnergyLimit () const
 
G4double LowEnergyLimit () const
 
G4double HighEnergyActivationLimit () const
 
G4double LowEnergyActivationLimit () const
 
G4double PolarAngleLimit () const
 
G4double SecondaryThreshold () const
 
G4bool LPMFlag () const
 
G4bool DeexcitationFlag () const
 
G4bool ForceBuildTableFlag () const
 
G4bool UseAngularGeneratorFlag () const
 
void SetAngularGeneratorFlag (G4bool)
 
void SetHighEnergyLimit (G4double)
 
void SetLowEnergyLimit (G4double)
 
void SetActivationHighEnergyLimit (G4double)
 
void SetActivationLowEnergyLimit (G4double)
 
G4bool IsActive (G4double kinEnergy)
 
void SetPolarAngleLimit (G4double)
 
void SetSecondaryThreshold (G4double)
 
void SetLPMFlag (G4bool val)
 
void SetDeexcitationFlag (G4bool val)
 
void SetForceBuildTable (G4bool val)
 
void SetMasterThread (G4bool val)
 
G4bool IsMaster () const
 
G4double MaxSecondaryKinEnergy (const G4DynamicParticle *dynParticle)
 
const G4StringGetName () const
 
void SetCurrentCouple (const G4MaterialCutsCouple *)
 
const G4ElementGetCurrentElement () const
 
const G4IsotopeGetCurrentIsotope () const
 
G4bool IsLocked () const
 
void SetLocked (G4bool)
 

Additional Inherited Members

- Protected Member Functions inherited from G4VMscModel
G4ParticleChangeForMSCGetParticleChangeForMSC (const G4ParticleDefinition *p=nullptr)
 
G4double ConvertTrueToGeom (G4double &tLength, G4double &gLength)
 
- Protected Member Functions inherited from G4VEmModel
G4ParticleChangeForLossGetParticleChangeForLoss ()
 
G4ParticleChangeForGammaGetParticleChangeForGamma ()
 
virtual G4double MaxSecondaryEnergy (const G4ParticleDefinition *, G4double kineticEnergy)
 
const G4MaterialCutsCoupleCurrentCouple () const
 
void SetCurrentElement (const G4Element *)
 
- Protected Attributes inherited from G4VMscModel
G4double facrange
 
G4double facgeom
 
G4double facsafety
 
G4double skin
 
G4double dtrl
 
G4double lambdalimit
 
G4double geomMin
 
G4double geomMax
 
G4ThreeVector fDisplacement
 
G4MscStepLimitType steppingAlgorithm
 
G4bool samplez
 
G4bool latDisplasment
 
- Protected Attributes inherited from G4VEmModel
G4ElementDatafElementData
 
G4VParticleChangepParticleChange
 
G4PhysicsTablexSectionTable
 
const std::vector< G4double > * theDensityFactor
 
const std::vector< G4int > * theDensityIdx
 
size_t idxTable
 
- Static Protected Attributes inherited from G4VEmModel
static const G4double inveplus = 1.0/CLHEP::eplus
 

Detailed Description

Definition at line 72 of file G4UrbanMscModel.hh.

Constructor & Destructor Documentation

G4UrbanMscModel::G4UrbanMscModel ( const G4String nam = "UrbanMsc")
explicit

Definition at line 80 of file G4UrbanMscModel.cc.

81  : G4VMscModel(nam)
82 {
83  masslimite = 0.6*MeV;
84  lambdalimit = 1.*mm;
85  fr = 0.02;
86  taubig = 8.0;
87  tausmall = 1.e-16;
88  taulim = 1.e-6;
89  currentTau = taulim;
90  tlimitminfix = 0.01*nm;
91  tlimitminfix2 = 1.*nm;
92  stepmin = tlimitminfix;
93  smallstep = 1.e10;
94  currentRange = 0. ;
95  rangeinit = 0.;
96  tlimit = 1.e10*mm;
97  tlimitmin = 10.*tlimitminfix;
98  tgeom = 1.e50*mm;
99  geombig = 1.e50*mm;
100  geommin = 1.e-3*mm;
101  geomlimit = geombig;
102  presafety = 0.*mm;
103 
104  facsafety = 0.6;
105 
106  Zold = 0.;
107  Zeff = 1.;
108  Z2 = 1.;
109  Z23 = 1.;
110  lnZ = 0.;
111  coeffth1 = 0.;
112  coeffth2 = 0.;
113  coeffc1 = 0.;
114  coeffc2 = 0.;
115  coeffc3 = 0.;
116  coeffc4 = 0.;
117  particle = 0;
118 
119  positron = G4Positron::Positron();
120  theManager = G4LossTableManager::Instance();
121  rndmEngineMod = G4Random::getTheEngine();
122 
123  firstStep = true;
124  insideskin = false;
125  latDisplasmentbackup = false;
126  displacementFlag = true;
127 
128  rangecut = geombig;
129  drr = 0.35 ;
130  finalr = 10.*um ;
131 
132  skindepth = skin*stepmin;
133 
134  mass = proton_mass_c2;
135  charge = ChargeSquare = 1.0;
136  currentKinEnergy = currentRadLength = lambda0 = lambdaeff = tPathLength
137  = zPathLength = par1 = par2 = par3 = 0;
138 
139  currentMaterialIndex = -1;
140  fParticleChange = nullptr;
141  couple = nullptr;
142 }
static G4LossTableManager * Instance()
static constexpr double mm
Definition: G4SIunits.hh:115
static constexpr double proton_mass_c2
G4double skin
Definition: G4VMscModel.hh:178
static constexpr double um
Definition: G4SIunits.hh:113
static G4Positron * Positron()
Definition: G4Positron.cc:94
G4double facsafety
Definition: G4VMscModel.hh:177
static constexpr double nm
Definition: G4SIunits.hh:112
static constexpr double MeV
Definition: G4SIunits.hh:214
G4VMscModel(const G4String &nam)
Definition: G4VMscModel.cc:60

Here is the call graph for this function:

G4UrbanMscModel::~G4UrbanMscModel ( )
virtual

Definition at line 146 of file G4UrbanMscModel.cc.

147 {}

Member Function Documentation

G4double G4UrbanMscModel::ComputeCrossSectionPerAtom ( const G4ParticleDefinition particle,
G4double  KineticEnergy,
G4double  AtomicNumber,
G4double  AtomicWeight = 0.,
G4double  cut = 0.,
G4double  emax = DBL_MAX 
)
overridevirtual

Reimplemented from G4VEmModel.

Definition at line 173 of file G4UrbanMscModel.cc.

178 {
179  static const G4double epsmin = 1.e-4 , epsmax = 1.e10;
180 
181  static const G4double Zdat[15] = { 4., 6., 13., 20., 26., 29., 32., 38.,47.,
182  50., 56., 64., 74., 79., 82. };
183 
184  // corr. factors for e-/e+ lambda for T <= Tlim
185  static const G4double celectron[15][22] =
186  {{1.125,1.072,1.051,1.047,1.047,1.050,1.052,1.054,
187  1.054,1.057,1.062,1.069,1.075,1.090,1.105,1.111,
188  1.112,1.108,1.100,1.093,1.089,1.087 },
189  {1.408,1.246,1.143,1.096,1.077,1.059,1.053,1.051,
190  1.052,1.053,1.058,1.065,1.072,1.087,1.101,1.108,
191  1.109,1.105,1.097,1.090,1.086,1.082 },
192  {2.833,2.268,1.861,1.612,1.486,1.309,1.204,1.156,
193  1.136,1.114,1.106,1.106,1.109,1.119,1.129,1.132,
194  1.131,1.124,1.113,1.104,1.099,1.098 },
195  {3.879,3.016,2.380,2.007,1.818,1.535,1.340,1.236,
196  1.190,1.133,1.107,1.099,1.098,1.103,1.110,1.113,
197  1.112,1.105,1.096,1.089,1.085,1.098 },
198  {6.937,4.330,2.886,2.256,1.987,1.628,1.395,1.265,
199  1.203,1.122,1.080,1.065,1.061,1.063,1.070,1.073,
200  1.073,1.070,1.064,1.059,1.056,1.056 },
201  {9.616,5.708,3.424,2.551,2.204,1.762,1.485,1.330,
202  1.256,1.155,1.099,1.077,1.070,1.068,1.072,1.074,
203  1.074,1.070,1.063,1.059,1.056,1.052 },
204  {11.72,6.364,3.811,2.806,2.401,1.884,1.564,1.386,
205  1.300,1.180,1.112,1.082,1.073,1.066,1.068,1.069,
206  1.068,1.064,1.059,1.054,1.051,1.050 },
207  {18.08,8.601,4.569,3.183,2.662,2.025,1.646,1.439,
208  1.339,1.195,1.108,1.068,1.053,1.040,1.039,1.039,
209  1.039,1.037,1.034,1.031,1.030,1.036 },
210  {18.22,10.48,5.333,3.713,3.115,2.367,1.898,1.631,
211  1.498,1.301,1.171,1.105,1.077,1.048,1.036,1.033,
212  1.031,1.028,1.024,1.022,1.021,1.024 },
213  {14.14,10.65,5.710,3.929,3.266,2.453,1.951,1.669,
214  1.528,1.319,1.178,1.106,1.075,1.040,1.027,1.022,
215  1.020,1.017,1.015,1.013,1.013,1.020 },
216  {14.11,11.73,6.312,4.240,3.478,2.566,2.022,1.720,
217  1.569,1.342,1.186,1.102,1.065,1.022,1.003,0.997,
218  0.995,0.993,0.993,0.993,0.993,1.011 },
219  {22.76,20.01,8.835,5.287,4.144,2.901,2.219,1.855,
220  1.677,1.410,1.224,1.121,1.073,1.014,0.986,0.976,
221  0.974,0.972,0.973,0.974,0.975,0.987 },
222  {50.77,40.85,14.13,7.184,5.284,3.435,2.520,2.059,
223  1.837,1.512,1.283,1.153,1.091,1.010,0.969,0.954,
224  0.950,0.947,0.949,0.952,0.954,0.963 },
225  {65.87,59.06,15.87,7.570,5.567,3.650,2.682,2.182,
226  1.939,1.579,1.325,1.178,1.108,1.014,0.965,0.947,
227  0.941,0.938,0.940,0.944,0.946,0.954 },
228  {55.60,47.34,15.92,7.810,5.755,3.767,2.760,2.239,
229  1.985,1.609,1.343,1.188,1.113,1.013,0.960,0.939,
230  0.933,0.930,0.933,0.936,0.939,0.949 }};
231 
232  static const G4double cpositron[15][22] = {
233  {2.589,2.044,1.658,1.446,1.347,1.217,1.144,1.110,
234  1.097,1.083,1.080,1.086,1.092,1.108,1.123,1.131,
235  1.131,1.126,1.117,1.108,1.103,1.100 },
236  {3.904,2.794,2.079,1.710,1.543,1.325,1.202,1.145,
237  1.122,1.096,1.089,1.092,1.098,1.114,1.130,1.137,
238  1.138,1.132,1.122,1.113,1.108,1.102 },
239  {7.970,6.080,4.442,3.398,2.872,2.127,1.672,1.451,
240  1.357,1.246,1.194,1.179,1.178,1.188,1.201,1.205,
241  1.203,1.190,1.173,1.159,1.151,1.145 },
242  {9.714,7.607,5.747,4.493,3.815,2.777,2.079,1.715,
243  1.553,1.353,1.253,1.219,1.211,1.214,1.225,1.228,
244  1.225,1.210,1.191,1.175,1.166,1.174 },
245  {17.97,12.95,8.628,6.065,4.849,3.222,2.275,1.820,
246  1.624,1.382,1.259,1.214,1.202,1.202,1.214,1.219,
247  1.217,1.203,1.184,1.169,1.160,1.151 },
248  {24.83,17.06,10.84,7.355,5.767,3.707,2.546,1.996,
249  1.759,1.465,1.311,1.252,1.234,1.228,1.238,1.241,
250  1.237,1.222,1.201,1.184,1.174,1.159 },
251  {23.26,17.15,11.52,8.049,6.375,4.114,2.792,2.155,
252  1.880,1.535,1.353,1.281,1.258,1.247,1.254,1.256,
253  1.252,1.234,1.212,1.194,1.183,1.170 },
254  {22.33,18.01,12.86,9.212,7.336,4.702,3.117,2.348,
255  2.015,1.602,1.385,1.297,1.268,1.251,1.256,1.258,
256  1.254,1.237,1.214,1.195,1.185,1.179 },
257  {33.91,24.13,15.71,10.80,8.507,5.467,3.692,2.808,
258  2.407,1.873,1.564,1.425,1.374,1.330,1.324,1.320,
259  1.312,1.288,1.258,1.235,1.221,1.205 },
260  {32.14,24.11,16.30,11.40,9.015,5.782,3.868,2.917,
261  2.490,1.925,1.596,1.447,1.391,1.342,1.332,1.327,
262  1.320,1.294,1.264,1.240,1.226,1.214 },
263  {29.51,24.07,17.19,12.28,9.766,6.238,4.112,3.066,
264  2.602,1.995,1.641,1.477,1.414,1.356,1.342,1.336,
265  1.328,1.302,1.270,1.245,1.231,1.233 },
266  {38.19,30.85,21.76,15.35,12.07,7.521,4.812,3.498,
267  2.926,2.188,1.763,1.563,1.484,1.405,1.382,1.371,
268  1.361,1.330,1.294,1.267,1.251,1.239 },
269  {49.71,39.80,27.96,19.63,15.36,9.407,5.863,4.155,
270  3.417,2.478,1.944,1.692,1.589,1.480,1.441,1.423,
271  1.409,1.372,1.330,1.298,1.280,1.258 },
272  {59.25,45.08,30.36,20.83,16.15,9.834,6.166,4.407,
273  3.641,2.648,2.064,1.779,1.661,1.531,1.482,1.459,
274  1.442,1.400,1.354,1.319,1.299,1.272 },
275  {56.38,44.29,30.50,21.18,16.51,10.11,6.354,4.542,
276  3.752,2.724,2.116,1.817,1.692,1.554,1.499,1.474,
277  1.456,1.412,1.364,1.328,1.307,1.282 }};
278 
279  //data/corrections for T > Tlim
280 
281  static const G4double hecorr[15] = {
282  120.70, 117.50, 105.00, 92.92, 79.23, 74.510, 68.29,
283  57.39, 41.97, 36.14, 24.53, 10.21, -7.855, -16.84,
284  -22.30};
285 
286  G4double sigma;
287  SetParticle(part);
288 
289  Z23 = G4Pow::GetInstance()->Z23(G4lrint(AtomicNumber));
290 
291  // correction if particle .ne. e-/e+
292  // compute equivalent kinetic energy
293  // lambda depends on p*beta ....
294 
295  G4double eKineticEnergy = KineticEnergy;
296 
297  if(mass > electron_mass_c2)
298  {
299  G4double TAU = KineticEnergy/mass ;
300  G4double c = mass*TAU*(TAU+2.)/(electron_mass_c2*(TAU+1.)) ;
301  G4double w = c-2. ;
302  G4double tau = 0.5*(w+sqrt(w*w+4.*c)) ;
303  eKineticEnergy = electron_mass_c2*tau ;
304  }
305 
306  G4double eTotalEnergy = eKineticEnergy + electron_mass_c2 ;
307  G4double beta2 = eKineticEnergy*(eTotalEnergy+electron_mass_c2)
308  /(eTotalEnergy*eTotalEnergy);
309  G4double bg2 = eKineticEnergy*(eTotalEnergy+electron_mass_c2)
310  /(electron_mass_c2*electron_mass_c2);
311 
312  static const G4double epsfactor = 2.*CLHEP::electron_mass_c2*
315  G4double eps = epsfactor*bg2/Z23;
316 
317  if (eps<epsmin) sigma = 2.*eps*eps;
318  else if(eps<epsmax) sigma = G4Log(1.+2.*eps)-2.*eps/(1.+2.*eps);
319  else sigma = G4Log(2.*eps)-1.+1./eps;
320 
321  sigma *= ChargeSquare*AtomicNumber*AtomicNumber/(beta2*bg2);
322 
323  // interpolate in AtomicNumber and beta2
324  G4double c1,c2,cc1,cc2,corr;
325 
326  // get bin number in Z
327  G4int iZ = 14;
328  // Loop checking, 03-Aug-2015, Vladimir Ivanchenko
329  while ((iZ>=0)&&(Zdat[iZ]>=AtomicNumber)) iZ -= 1;
330  if (iZ==14) iZ = 13;
331  if (iZ==-1) iZ = 0 ;
332 
333  G4double ZZ1 = Zdat[iZ];
334  G4double ZZ2 = Zdat[iZ+1];
335  G4double ratZ = (AtomicNumber-ZZ1)*(AtomicNumber+ZZ1)/
336  ((ZZ2-ZZ1)*(ZZ2+ZZ1));
337 
338  static const G4double Tlim = 10.*CLHEP::MeV;
339  static const G4double sigmafactor =
341  static const G4double beta2lim = Tlim*(Tlim+2.*CLHEP::electron_mass_c2)/
343  static const G4double bg2lim = Tlim*(Tlim+2.*CLHEP::electron_mass_c2)/
345 
346  static const G4double sig0[15] = {
347  0.2672*CLHEP::barn, 0.5922*CLHEP::barn, 2.653*CLHEP::barn, 6.235*CLHEP::barn,
348  11.69*CLHEP::barn , 13.24*CLHEP::barn , 16.12*CLHEP::barn, 23.00*CLHEP::barn,
349  35.13*CLHEP::barn , 39.95*CLHEP::barn , 50.85*CLHEP::barn, 67.19*CLHEP::barn,
350  91.15*CLHEP::barn , 104.4*CLHEP::barn , 113.1*CLHEP::barn};
351 
352  static const G4double Tdat[22] = {
353  100*CLHEP::eV, 200*CLHEP::eV, 400*CLHEP::eV, 700*CLHEP::eV,
356  100*CLHEP::keV, 200*CLHEP::keV, 400*CLHEP::keV, 700*CLHEP::keV,
358  10*CLHEP::MeV, 20*CLHEP::MeV};
359 
360  if(eKineticEnergy <= Tlim)
361  {
362  // get bin number in T (beta2)
363  G4int iT = 21;
364  // Loop checking, 03-Aug-2015, Vladimir Ivanchenko
365  while ((iT>=0)&&(Tdat[iT]>=eKineticEnergy)) iT -= 1;
366  if(iT==21) iT = 20;
367  if(iT==-1) iT = 0 ;
368 
369  // calculate betasquare values
370  G4double T = Tdat[iT], E = T + electron_mass_c2;
371  G4double b2small = T*(E+electron_mass_c2)/(E*E);
372 
373  T = Tdat[iT+1]; E = T + electron_mass_c2;
374  G4double b2big = T*(E+electron_mass_c2)/(E*E);
375  G4double ratb2 = (beta2-b2small)/(b2big-b2small);
376 
377  if (charge < 0.)
378  {
379  c1 = celectron[iZ][iT];
380  c2 = celectron[iZ+1][iT];
381  cc1 = c1+ratZ*(c2-c1);
382 
383  c1 = celectron[iZ][iT+1];
384  c2 = celectron[iZ+1][iT+1];
385  cc2 = c1+ratZ*(c2-c1);
386 
387  corr = cc1+ratb2*(cc2-cc1);
388 
389  sigma *= sigmafactor/corr;
390  }
391  else
392  {
393  c1 = cpositron[iZ][iT];
394  c2 = cpositron[iZ+1][iT];
395  cc1 = c1+ratZ*(c2-c1);
396 
397  c1 = cpositron[iZ][iT+1];
398  c2 = cpositron[iZ+1][iT+1];
399  cc2 = c1+ratZ*(c2-c1);
400 
401  corr = cc1+ratb2*(cc2-cc1);
402 
403  sigma *= sigmafactor/corr;
404  }
405  }
406  else
407  {
408  c1 = bg2lim*sig0[iZ]*(1.+hecorr[iZ]*(beta2-beta2lim))/bg2;
409  c2 = bg2lim*sig0[iZ+1]*(1.+hecorr[iZ+1]*(beta2-beta2lim))/bg2;
410  if((AtomicNumber >= ZZ1) && (AtomicNumber <= ZZ2))
411  sigma = c1+ratZ*(c2-c1) ;
412  else if(AtomicNumber < ZZ1)
413  sigma = AtomicNumber*AtomicNumber*c1/(ZZ1*ZZ1);
414  else if(AtomicNumber > ZZ2)
415  sigma = AtomicNumber*AtomicNumber*c2/(ZZ2*ZZ2);
416  }
417  return sigma;
418 
419 }
static G4Pow * GetInstance()
Definition: G4Pow.cc:55
static constexpr double Bohr_radius
static constexpr double keV
static constexpr double hbarc
static const G4double eps
int G4int
Definition: G4Types.hh:78
static constexpr double electron_mass_c2
static constexpr double barn
Definition: SystemOfUnits.h:85
static constexpr double classic_electr_radius
static constexpr double MeV
static constexpr double eV
G4double G4Log(G4double x)
Definition: G4Log.hh:230
int G4lrint(double ad)
Definition: templates.hh:163
G4double Z23(G4int Z) const
Definition: G4Pow.hh:154
double G4double
Definition: G4Types.hh:76
static constexpr double twopi
Definition: SystemOfUnits.h:55

Here is the call graph for this function:

G4double G4UrbanMscModel::ComputeGeomPathLength ( G4double  truePathLength)
overridevirtual

Reimplemented from G4VMscModel.

Definition at line 746 of file G4UrbanMscModel.cc.

747 {
748  lambdaeff = lambda0;
749  par1 = -1. ;
750  par2 = par3 = 0. ;
751 
752  // this correction needed to run MSC with eIoni and eBrem inactivated
753  // and makes no harm for a normal run
754  tPathLength = std::min(tPathLength,currentRange);
755 
756  // do the true -> geom transformation
757  zPathLength = tPathLength;
758 
759  // z = t for very small tPathLength
760  if(tPathLength < tlimitminfix2) return zPathLength;
761 
762  // VI: it is already checked
763  // if(tPathLength > currentRange)
764  // tPathLength = currentRange ;
765  /*
766  G4cout << "ComputeGeomPathLength: tpl= " << tPathLength
767  << " R= " << currentRange << " L0= " << lambda0
768  << " E= " << currentKinEnergy << " "
769  << particle->GetParticleName() << G4endl;
770  */
771  G4double tau = tPathLength/lambda0 ;
772 
773  if ((tau <= tausmall) || insideskin) {
774  zPathLength = min(tPathLength, lambda0);
775 
776  } else if (tPathLength < currentRange*dtrl) {
777  if(tau < taulim) zPathLength = tPathLength*(1.-0.5*tau) ;
778  else zPathLength = lambda0*(1.-G4Exp(-tau));
779 
780  } else if(currentKinEnergy < mass || tPathLength == currentRange) {
781  par1 = 1./currentRange ;
782  par2 = 1./(par1*lambda0) ;
783  par3 = 1.+par2 ;
784  if(tPathLength < currentRange) {
785  zPathLength =
786  (1.-G4Exp(par3*G4Log(1.-tPathLength/currentRange)))/(par1*par3);
787  } else {
788  zPathLength = 1./(par1*par3);
789  }
790 
791  } else {
792  G4double rfin = max(currentRange-tPathLength, 0.01*currentRange);
793  G4double T1 = GetEnergy(particle,rfin,couple);
794  G4double lambda1 = GetTransportMeanFreePath(particle,T1);
795 
796  par1 = (lambda0-lambda1)/(lambda0*tPathLength);
797  //G4cout << "par1= " << par1 << " L1= " << lambda1 << G4endl;
798  par2 = 1./(par1*lambda0);
799  par3 = 1.+par2 ;
800  zPathLength = (1.-G4Exp(par3*G4Log(lambda1/lambda0)))/(par1*par3);
801  }
802 
803  zPathLength = min(zPathLength, lambda0);
804  //G4cout<< "zPathLength= "<< zPathLength<< " L0= " << lambda0 << G4endl;
805  return zPathLength;
806 }
G4double dtrl
Definition: G4VMscModel.hh:179
G4double GetEnergy(const G4ParticleDefinition *part, G4double range, const G4MaterialCutsCouple *couple)
Definition: G4VMscModel.hh:303
G4double GetTransportMeanFreePath(const G4ParticleDefinition *part, G4double kinEnergy)
Definition: G4VMscModel.hh:340
G4double G4Log(G4double x)
Definition: G4Log.hh:230
G4double G4Exp(G4double initial_x)
Exponential Function double precision.
Definition: G4Exp.hh:183
T max(const T t1, const T t2)
brief Return the largest of the two arguments
T min(const T t1, const T t2)
brief Return the smallest of the two arguments
double G4double
Definition: G4Types.hh:76

Here is the call graph for this function:

G4double G4UrbanMscModel::ComputeTheta0 ( G4double  truePathLength,
G4double  KineticEnergy 
)

Definition at line 1088 of file G4UrbanMscModel.cc.

1090 {
1091  // for all particles take the width of the central part
1092  // from a parametrization similar to the Highland formula
1093  // ( Highland formula: Particle Physics Booklet, July 2002, eq. 26.10)
1094  G4double invbetacp = std::sqrt((currentKinEnergy+mass)*(KineticEnergy+mass)/
1095  (currentKinEnergy*(currentKinEnergy+2.*mass)*
1096  KineticEnergy*(KineticEnergy+2.*mass)));
1097  G4double y = trueStepLength/currentRadLength;
1098 
1099  if(particle == positron)
1100  {
1101  static const G4double xl= 0.6;
1102  static const G4double xh= 0.9;
1103  static const G4double e = 113.0;
1104  G4double corr;
1105 
1106  G4double tau = std::sqrt(currentKinEnergy*KineticEnergy)/mass;
1107  G4double x = std::sqrt(tau*(tau+2.)/((tau+1.)*(tau+1.)));
1108  G4double a = 0.994-4.08e-3*Zeff;
1109  G4double b = 7.16+(52.6+365./Zeff)/Zeff;
1110  G4double c = 1.000-4.47e-3*Zeff;
1111  G4double d = 1.21e-3*Zeff;
1112  if(x < xl) {
1113  corr = a*(1.-G4Exp(-b*x));
1114  } else if(x > xh) {
1115  corr = c+d*G4Exp(e*(x-1.));
1116  } else {
1117  G4double yl = a*(1.-G4Exp(-b*xl));
1118  G4double yh = c+d*G4Exp(e*(xh-1.));
1119  G4double y0 = (yh-yl)/(xh-xl);
1120  G4double y1 = yl-y0*xl;
1121  corr = y0*x+y1;
1122  }
1123  //==================================================================
1124  y *= corr*(1.+Zeff*(1.84035e-4*Zeff-1.86427e-2)+0.41125);
1125  }
1126 
1127  static const G4double c_highland = 13.6*CLHEP::MeV;
1128  G4double theta0 = c_highland*std::abs(charge)*std::sqrt(y)*invbetacp;
1129 
1130  // correction factor from e- scattering data
1131  theta0 *= (coeffth1+coeffth2*G4Log(y));
1132  return theta0;
1133 }
static constexpr double MeV
G4double G4Log(G4double x)
Definition: G4Log.hh:230
G4double G4Exp(G4double initial_x)
Exponential Function double precision.
Definition: G4Exp.hh:183
double G4double
Definition: G4Types.hh:76

Here is the call graph for this function:

G4double G4UrbanMscModel::ComputeTruePathLengthLimit ( const G4Track track,
G4double currentMinimalStep 
)
overridevirtual

Reimplemented from G4VMscModel.

Definition at line 438 of file G4UrbanMscModel.cc.

441 {
442  tPathLength = currentMinimalStep;
443  const G4DynamicParticle* dp = track.GetDynamicParticle();
444 
445  G4StepPoint* sp = track.GetStep()->GetPreStepPoint();
446  G4StepStatus stepStatus = sp->GetStepStatus();
447  couple = track.GetMaterialCutsCouple();
448  SetCurrentCouple(couple);
449  currentMaterialIndex = couple->GetIndex();
450  currentKinEnergy = dp->GetKineticEnergy();
451  currentRange = GetRange(particle,currentKinEnergy,couple);
452  lambda0 = GetTransportMeanFreePath(particle,currentKinEnergy);
453  tPathLength = min(tPathLength,currentRange);
454  /*
455  G4cout << "G4Urban::StepLimit tPathLength= " << tPathLength
456  << " range= " <<currentRange<< " lambda= "<<lambda0
457  <<G4endl;
458  */
459  // set flag to default values
460  Zeff = couple->GetMaterial()->GetIonisation()->GetZeffective();
461  // couple->GetMaterial()->GetTotNbOfAtomsPerVolume();
462 
463  if(Zold != Zeff)
464  UpdateCache();
465 
466  // stop here if small step
467  if(tPathLength < tlimitminfix) {
468  latDisplasment = false;
469  return ConvertTrueToGeom(tPathLength, currentMinimalStep);
470  }
471 
472  // upper limit for the straight line distance the particle can travel
473  // for electrons and positrons
474  G4double distance = currentRange;
475  // for muons, hadrons
476  if(mass > masslimite) {
477  distance *= (1.15-9.76e-4*Zeff);
478  } else {
479  distance *= (1.20-Zeff*(1.62e-2-9.22e-5*Zeff));
480  }
481  presafety = sp->GetSafety();
482  /*
483  G4cout << "G4Urban::StepLimit tPathLength= "
484  <<tPathLength<<" safety= " << presafety
485  << " range= " <<currentRange<< " lambda= "<<lambda0
486  << " Alg: " << steppingAlgorithm <<G4endl;
487  */
488  // far from geometry boundary
489  if(distance < presafety)
490  {
491  latDisplasment = false;
492  return ConvertTrueToGeom(tPathLength, currentMinimalStep);
493  }
494 
495  latDisplasment = latDisplasmentbackup;
496  static const G4double invmev = 1.0/CLHEP::MeV;
497  // standard version
498  //
500  {
501  //compute geomlimit and presafety
502  geomlimit = ComputeGeomLimit(track, presafety, currentRange);
503  /*
504  G4cout << "G4Urban::Distance to boundary geomlimit= "
505  <<geomlimit<<" safety= " << presafety<<G4endl;
506  */
507 
508  // is it far from boundary ?
509  if(distance < presafety)
510  {
511  latDisplasment = false;
512  return ConvertTrueToGeom(tPathLength, currentMinimalStep);
513  }
514 
515  smallstep += 1.;
516  insideskin = false;
517 
518  // initialisation at firs step and at the boundary
519  if(firstStep || (stepStatus == fGeomBoundary))
520  {
521  rangeinit = currentRange;
522  if(!firstStep) { smallstep = 1.; }
523 
524  //define stepmin here (it depends on lambda!)
525  //rough estimation of lambda_elastic/lambda_transport
526  G4double rat = currentKinEnergy*invmev;
527  rat = 1.e-3/(rat*(10.+rat)) ;
528  //stepmin ~ lambda_elastic
529  stepmin = rat*lambda0;
530  skindepth = skin*stepmin;
531  tlimitmin = max(10*stepmin,tlimitminfix);
532  /*
533  G4cout << "rangeinit= " << rangeinit << " stepmin= " << stepmin
534  << " tlimitmin= " << tlimitmin << " geomlimit= "
535  << geomlimit <<G4endl;
536  */
537  // constraint from the geometry
538 
539  if((geomlimit < geombig) && (geomlimit > geommin))
540  {
541  // geomlimit is a geometrical step length
542  // transform it to true path length (estimation)
543  if((1.-geomlimit/lambda0) > 0.)
544  geomlimit = -lambda0*G4Log(1.-geomlimit/lambda0)+tlimitmin ;
545 
546  if(stepStatus == fGeomBoundary)
547  tgeom = geomlimit/facgeom;
548  else
549  tgeom = 2.*geomlimit/facgeom;
550  }
551  else
552  tgeom = geombig;
553  }
554 
555  //step limit
556  tlimit = facrange*rangeinit;
557 
558  //lower limit for tlimit
559  tlimit = max(tlimit,tlimitmin);
560  tlimit = min(tlimit,tgeom);
561  /*
562  G4cout << "tgeom= " << tgeom << " geomlimit= " << geomlimit
563  << " tlimit= " << tlimit << " presafety= " << presafety << G4endl;
564  */
565  // shortcut
566  if((tPathLength < tlimit) && (tPathLength < presafety) &&
567  (smallstep > skin) && (tPathLength < geomlimit-0.999*skindepth))
568  {
569  return ConvertTrueToGeom(tPathLength, currentMinimalStep);
570  }
571 
572  // step reduction near to boundary
573  if(smallstep <= skin)
574  {
575  tlimit = stepmin;
576  insideskin = true;
577  }
578  else if(geomlimit < geombig)
579  {
580  if(geomlimit > skindepth)
581  {
582  tlimit = min(tlimit, geomlimit-0.999*skindepth);
583  }
584  else
585  {
586  insideskin = true;
587  tlimit = min(tlimit, stepmin);
588  }
589  }
590 
591  tlimit = max(tlimit, stepmin);
592 
593  // randomise if not 'small' step and step determined by msc
594  if((tlimit < tPathLength) && (smallstep > skin) && !insideskin)
595  {
596  tPathLength = min(tPathLength, Randomizetlimit());
597  }
598  else
599  {
600  tPathLength = min(tPathLength, tlimit);
601  }
602 
603  }
604  // for 'normal' simulation with or without magnetic field
605  // there no small step/single scattering at boundaries
606  else if(steppingAlgorithm == fUseSafety)
607  {
608  if(stepStatus != fGeomBoundary) {
609  presafety = ComputeSafety(sp->GetPosition(),tPathLength);
610  }
611  /*
612  G4cout << "presafety= " << presafety
613  << " firstStep= " << firstStep
614  << " stepStatus= " << stepStatus
615  << G4endl;
616  */
617  // is far from boundary
618  if(distance < presafety)
619  {
620  latDisplasment = false;
621  return ConvertTrueToGeom(tPathLength, currentMinimalStep);
622  }
623 
624  if(firstStep || (stepStatus == fGeomBoundary)) {
625  rangeinit = currentRange;
626  fr = facrange;
627  // 9.1 like stepping for e+/e- only (not for muons,hadrons)
628  if(mass < masslimite)
629  {
630  rangeinit = max(rangeinit, lambda0);
631  if(lambda0 > lambdalimit) {
632  fr *= (0.75+0.25*lambda0/lambdalimit);
633  }
634  }
635  //lower limit for tlimit
636  G4double rat = currentKinEnergy*invmev;
637  rat = 1.e-3/(rat*(10 + rat)) ;
638  stepmin = lambda0*rat;
639  tlimitmin = max(10*stepmin, tlimitminfix);
640  }
641 
642  //step limit
643  tlimit = max(fr*rangeinit, facsafety*presafety);
644 
645  //lower limit for tlimit
646  tlimit = max(tlimit, tlimitmin);
647 
648  // randomise if step determined by msc
649  if(tlimit < tPathLength)
650  {
651  tPathLength = min(tPathLength, Randomizetlimit());
652  }
653  else { tPathLength = min(tPathLength, tlimit); }
654  }
655  // new stepping mode UseSafetyPlus
657  {
658  if(stepStatus != fGeomBoundary) {
659  presafety = ComputeSafety(sp->GetPosition(),tPathLength);
660  }
661  /*
662  G4cout << "presafety= " << presafety
663  << " firstStep= " << firstStep
664  << " stepStatus= " << stepStatus
665  << G4endl;
666  */
667  // is far from boundary
668  if(distance < presafety)
669  {
670  latDisplasment = false;
671  return ConvertTrueToGeom(tPathLength, currentMinimalStep);
672  }
673 
674  if(firstStep || (stepStatus == fGeomBoundary)) {
675  rangeinit = currentRange;
676  fr = facrange;
677  rangecut = geombig;
678  if(mass < masslimite)
679  {
680  G4int index = 1;
681  if(charge > 0.) index = 2;
682  rangecut = couple->GetProductionCuts()->GetProductionCut(index);
683  if(lambda0 > lambdalimit) {
684  fr *= (0.84+0.16*lambda0/lambdalimit);
685  }
686  }
687  //lower limit for tlimit
688  G4double rat = currentKinEnergy*invmev;
689  rat = 1.e-3/(rat*(10 + rat)) ;
690  stepmin = lambda0*rat;
691  tlimitmin = max(10*stepmin, tlimitminfix);
692  }
693  //step limit
694  tlimit = max(fr*rangeinit, facsafety*presafety);
695 
696  //lower limit for tlimit
697  tlimit = max(tlimit, tlimitmin);
698 
699  // condition for tPathLength from drr and finalr
700  if(currentRange > finalr) {
701  G4double tmax = drr*currentRange+
702  finalr*(1.-drr)*(2.-finalr/currentRange);
703  tPathLength = min(tPathLength,tmax);
704  }
705 
706  // condition safety
707  if(currentRange > rangecut) {
708  if(firstStep) {
709  tPathLength = min(tPathLength,facsafety*presafety);
710  } else if(stepStatus != fGeomBoundary && presafety > stepmin) {
711  tPathLength = min(tPathLength,presafety);
712  }
713  }
714 
715  // randomise if step determined by msc
716  if(tPathLength < tlimit)
717  {
718  tPathLength = min(tPathLength, Randomizetlimit());
719  }
720  else { tPathLength = min(tPathLength, tlimit); }
721  }
722 
723  // version similar to 7.1 (needed for some experiments)
724  else
725  {
726  if (stepStatus == fGeomBoundary)
727  {
728  if (currentRange > lambda0) { tlimit = facrange*currentRange; }
729  else { tlimit = facrange*lambda0; }
730 
731  tlimit = max(tlimit, tlimitmin);
732  }
733  // randomise if step determined by msc
734  if(tlimit < tPathLength)
735  {
736  tPathLength = min(tPathLength, Randomizetlimit());
737  }
738  else { tPathLength = min(tPathLength, tlimit); }
739  }
740  firstStep = false;
741  return ConvertTrueToGeom(tPathLength, currentMinimalStep);
742 }
G4double facgeom
Definition: G4VMscModel.hh:176
G4IonisParamMat * GetIonisation() const
Definition: G4Material.hh:226
G4double GetKineticEnergy() const
const G4DynamicParticle * GetDynamicParticle() const
G4double facrange
Definition: G4VMscModel.hh:175
G4double GetProductionCut(G4int index) const
G4StepStatus GetStepStatus() const
G4double ConvertTrueToGeom(G4double &tLength, G4double &gLength)
Definition: G4VMscModel.hh:245
G4double skin
Definition: G4VMscModel.hh:178
const G4MaterialCutsCouple * GetMaterialCutsCouple() const
G4bool latDisplasment
Definition: G4VMscModel.hh:188
const G4Step * GetStep() const
G4double ComputeSafety(const G4ThreeVector &position, G4double limit=DBL_MAX)
Definition: G4VMscModel.hh:237
int G4int
Definition: G4Types.hh:78
G4StepStatus
Definition: G4StepStatus.hh:49
G4double GetZeffective() const
G4StepPoint * GetPreStepPoint() const
const G4ThreeVector & GetPosition() const
G4double GetRange(const G4ParticleDefinition *part, G4double kineticEnergy, const G4MaterialCutsCouple *couple)
Definition: G4VMscModel.hh:283
static constexpr double MeV
G4double ComputeGeomLimit(const G4Track &, G4double &presafety, G4double limit)
Definition: G4VMscModel.hh:255
G4double GetTransportMeanFreePath(const G4ParticleDefinition *part, G4double kinEnergy)
Definition: G4VMscModel.hh:340
G4double G4Log(G4double x)
Definition: G4Log.hh:230
T max(const T t1, const T t2)
brief Return the largest of the two arguments
G4double facsafety
Definition: G4VMscModel.hh:177
void SetCurrentCouple(const G4MaterialCutsCouple *)
Definition: G4VEmModel.hh:444
T min(const T t1, const T t2)
brief Return the smallest of the two arguments
G4double GetSafety() const
G4MscStepLimitType steppingAlgorithm
Definition: G4VMscModel.hh:185
double G4double
Definition: G4Types.hh:76
G4ProductionCuts * GetProductionCuts() const
const G4Material * GetMaterial() const

Here is the call graph for this function:

G4double G4UrbanMscModel::ComputeTrueStepLength ( G4double  geomStepLength)
overridevirtual

Reimplemented from G4VMscModel.

Definition at line 810 of file G4UrbanMscModel.cc.

811 {
812  // step defined other than transportation
813  if(geomStepLength == zPathLength) {
814  //G4cout << "Urban::ComputeTrueLength: tPathLength= " << tPathLength
815  // << " step= " << geomStepLength << " *** " << G4endl;
816  return tPathLength;
817  }
818 
819  zPathLength = geomStepLength;
820 
821  // t = z for very small step
822  if(geomStepLength < tlimitminfix2) {
823  tPathLength = geomStepLength;
824 
825  // recalculation
826  } else {
827 
828  G4double tlength = geomStepLength;
829  if((geomStepLength > lambda0*tausmall) && !insideskin) {
830 
831  if(par1 < 0.) {
832  tlength = -lambda0*G4Log(1.-geomStepLength/lambda0) ;
833  } else {
834  if(par1*par3*geomStepLength < 1.) {
835  tlength = (1.-G4Exp(G4Log(1.-par1*par3*geomStepLength)/par3))/par1 ;
836  } else {
837  tlength = currentRange;
838  }
839  }
840 
841  if(tlength < geomStepLength) { tlength = geomStepLength; }
842  else if(tlength > tPathLength) { tlength = tPathLength; }
843  }
844  tPathLength = tlength;
845  }
846  //G4cout << "Urban::ComputeTrueLength: tPathLength= " << tPathLength
847  // << " step= " << geomStepLength << " &&& " << G4endl;
848 
849  return tPathLength;
850 }
G4double G4Log(G4double x)
Definition: G4Log.hh:230
G4double G4Exp(G4double initial_x)
Exponential Function double precision.
Definition: G4Exp.hh:183
double G4double
Definition: G4Types.hh:76

Here is the call graph for this function:

void G4UrbanMscModel::Initialise ( const G4ParticleDefinition p,
const G4DataVector  
)
overridevirtual

Implements G4VEmModel.

Definition at line 151 of file G4UrbanMscModel.cc.

153 {
154  // set values of some data members
155  SetParticle(p);
156  /*
157  if(p->GetPDGMass() > MeV) {
158  G4cout << "### WARNING: G4UrbanMscModel model is used for "
159  << p->GetParticleName() << " !!! " << G4endl;
160  G4cout << "### This model should be used only for e+-"
161  << G4endl;
162  }
163  */
164  fParticleChange = GetParticleChangeForMSC(p);
165 
166  latDisplasmentbackup = latDisplasment;
167 
168  //G4cout << "### G4UrbanMscModel::Initialise done!" << G4endl;
169 }
G4bool latDisplasment
Definition: G4VMscModel.hh:188
G4ParticleChangeForMSC * GetParticleChangeForMSC(const G4ParticleDefinition *p=nullptr)
Definition: G4VMscModel.cc:91

Here is the call graph for this function:

G4ThreeVector & G4UrbanMscModel::SampleScattering ( const G4ThreeVector oldDirection,
G4double  safety 
)
overridevirtual

Reimplemented from G4VMscModel.

Definition at line 855 of file G4UrbanMscModel.cc.

857 {
858  fDisplacement.set(0.0,0.0,0.0);
859  G4double kineticEnergy = currentKinEnergy;
860  if (tPathLength > currentRange*dtrl) {
861  kineticEnergy = GetEnergy(particle,currentRange-tPathLength,couple);
862  } else {
863  kineticEnergy -= tPathLength*GetDEDX(particle,currentKinEnergy,couple);
864  }
865 
866  if((kineticEnergy <= eV) || (tPathLength <= tlimitminfix) ||
867  (tPathLength < tausmall*lambda0)) { return fDisplacement; }
868 
869  G4double cth = SampleCosineTheta(tPathLength,kineticEnergy);
870 
871  // protection against 'bad' cth values
872  if(std::fabs(cth) >= 1.0) { return fDisplacement; }
873 
874  /*
875  if(cth < 1.0 - 1000*tPathLength/lambda0 && cth < 0.5 &&
876  kineticEnergy > 20*MeV) {
877  G4cout << "### G4UrbanMscModel::SampleScattering for "
878  << particle->GetParticleName()
879  << " E(MeV)= " << kineticEnergy/MeV
880  << " Step(mm)= " << tPathLength/mm
881  << " in " << CurrentCouple()->GetMaterial()->GetName()
882  << " CosTheta= " << cth << G4endl;
883  }
884  */
885  G4double sth = sqrt((1.0 - cth)*(1.0 + cth));
886  G4double phi = twopi*rndmEngineMod->flat();
887  G4double dirx = sth*cos(phi);
888  G4double diry = sth*sin(phi);
889 
890  G4ThreeVector newDirection(dirx,diry,cth);
891  newDirection.rotateUz(oldDirection);
892 
893  fParticleChange->ProposeMomentumDirection(newDirection);
894  /*
895  G4cout << "G4UrbanMscModel::SampleSecondaries: e(MeV)= " << kineticEnergy
896  << " sinTheta= " << sth << " safety(mm)= " << safety
897  << " trueStep(mm)= " << tPathLength
898  << " geomStep(mm)= " << zPathLength
899  << G4endl;
900  */
901 
902 
903  if (latDisplasment && currentTau >= tausmall) {
904  if(displacementFlag) { SampleDisplacementNew(cth, phi); }
905  else { SampleDisplacement(sth, phi); }
906  fDisplacement.rotateUz(oldDirection);
907  }
908  return fDisplacement;
909 }
void set(double x, double y, double z)
G4double dtrl
Definition: G4VMscModel.hh:179
G4bool latDisplasment
Definition: G4VMscModel.hh:188
virtual double flat()=0
static constexpr double twopi
Definition: G4SIunits.hh:76
G4double GetEnergy(const G4ParticleDefinition *part, G4double range, const G4MaterialCutsCouple *couple)
Definition: G4VMscModel.hh:303
Hep3Vector & rotateUz(const Hep3Vector &)
Definition: ThreeVector.cc:38
static constexpr double eV
Definition: G4SIunits.hh:215
G4ThreeVector fDisplacement
Definition: G4VMscModel.hh:184
void ProposeMomentumDirection(const G4ThreeVector &Pfinal)
G4double GetDEDX(const G4ParticleDefinition *part, G4double kineticEnergy, const G4MaterialCutsCouple *couple)
Definition: G4VMscModel.hh:268
double G4double
Definition: G4Types.hh:76

Here is the call graph for this function:

void G4UrbanMscModel::SetNewDisplacementFlag ( G4bool  val)
inline

Definition at line 195 of file G4UrbanMscModel.hh.

196 {
197  displacementFlag = val;
198 }

Here is the caller graph for this function:

void G4UrbanMscModel::StartTracking ( G4Track track)
overridevirtual

Reimplemented from G4VEmModel.

Definition at line 423 of file G4UrbanMscModel.cc.

424 {
425  SetParticle(track->GetDynamicParticle()->GetDefinition());
426  firstStep = true;
427  insideskin = false;
428  fr = facrange;
429  tlimit = tgeom = rangeinit = rangecut = geombig;
430  smallstep = 1.e10;
431  stepmin = tlimitminfix;
432  tlimitmin = 10.*tlimitminfix;
433  rndmEngineMod = G4Random::getTheEngine();
434 }
const G4DynamicParticle * GetDynamicParticle() const
G4double facrange
Definition: G4VMscModel.hh:175
G4ParticleDefinition * GetDefinition() const

Here is the call graph for this function:


The documentation for this class was generated from the following files: