QwGeant4
QweakSimUrbanMscModel Class Reference

#include <QweakSimUrbanMscModel.hh>

Inherits G4VMscModel.

Public Member Functions

 QweakSimUrbanMscModel (const G4String &nam="UrbanMsc96")
 
virtual ~QweakSimUrbanMscModel ()
 
void Initialise (const G4ParticleDefinition *, const G4DataVector &)
 
void StartTracking (G4Track *)
 
G4double ComputeCrossSectionPerAtom (const G4ParticleDefinition *particle, G4double KineticEnergy, G4double AtomicNumber, G4double AtomicWeight=0., G4double cut=0., G4double emax=DBL_MAX)
 
G4ThreeVector & SampleScattering (const G4ThreeVector &, G4double safety)
 
G4double ComputeTruePathLengthLimit (const G4Track &track, G4double &currentMinimalStep)
 
G4double ComputeGeomPathLength (G4double truePathLength)
 
G4double ComputeTrueStepLength (G4double geomStepLength)
 
G4double ComputeTheta0 (G4double truePathLength, G4double KineticEnergy)
 

Private Member Functions

G4double SimpleScattering (G4double xmeanth, G4double x2meanth)
 
G4double SampleCosineTheta (G4double trueStepLength, G4double KineticEnergy)
 
G4double SampleDisplacement ()
 
G4double LatCorrelation ()
 
void SetParticle (const G4ParticleDefinition *)
 
void UpdateCache ()
 
QweakSimUrbanMscModeloperator= (const QweakSimUrbanMscModel &right)
 
 QweakSimUrbanMscModel (const QweakSimUrbanMscModel &)
 

Private Attributes

const G4ParticleDefinition * particle
 
G4ParticleChangeForMSC * fParticleChange
 
const G4MaterialCutsCouple * couple
 
G4LossTableManager * theManager
 
G4double mass
 
G4double charge
 
G4double ChargeSquare
 
G4double masslimite
 
G4double lambdalimit
 
G4double fr
 
G4double taubig
 
G4double tausmall
 
G4double taulim
 
G4double currentTau
 
G4double tlimit
 
G4double tlimitmin
 
G4double tlimitminfix
 
G4double tgeom
 
G4double geombig
 
G4double geommin
 
G4double geomlimit
 
G4double skindepth
 
G4double smallstep
 
G4double presafety
 
G4double lambda0
 
G4double lambdaeff
 
G4double tPathLength
 
G4double zPathLength
 
G4double par1
 
G4double par2
 
G4double par3
 
G4double stepmin
 
G4double currentKinEnergy
 
G4double currentRange
 
G4double rangeinit
 
G4double currentRadLength
 
G4double theta0max
 
G4double rellossmax
 
G4double third
 
G4int currentMaterialIndex
 
G4double y
 
G4double Zold
 
G4double Zeff
 
G4double Z2
 
G4double Z23
 
G4double lnZ
 
G4double coeffth1
 
G4double coeffth2
 
G4double coeffc1
 
G4double coeffc2
 
G4double coeffc3
 
G4double coeffc4
 
G4bool firstStep
 
G4bool inside
 
G4bool insideskin
 
G4bool ePolarized
 
G4ThreeVector polarization
 
G4double eEnergy
 
G4bool debugPrint
 

Detailed Description

Definition at line 70 of file QweakSimUrbanMscModel.hh.

Constructor & Destructor Documentation

QweakSimUrbanMscModel::QweakSimUrbanMscModel ( const G4String &  nam = "UrbanMsc96")

Definition at line 77 of file QweakSimUrbanMscModel.cc.

References charge, ChargeSquare, coeffc1, coeffc2, coeffc3, coeffc4, coeffth1, coeffth2, couple, currentKinEnergy, currentMaterialIndex, currentRadLength, currentRange, currentTau, firstStep, fParticleChange, fr, geombig, geomlimit, geommin, inside, insideskin, lambda0, lambdaeff, lambdalimit, lnZ, mass, masslimite, par1, par2, par3, particle, presafety, rangeinit, rellossmax, skindepth, smallstep, stepmin, taubig, taulim, tausmall, tgeom, theManager, theta0max, third, tlimit, tlimitmin, tlimitminfix, tPathLength, y, Z2, Z23, Zeff, Zold, and zPathLength.

78  : G4VMscModel(nam)
79 {
80  masslimite = 0.6*MeV;
81  lambdalimit = 1.*mm;
82  fr = 0.02;
83  taubig = 8.0;
84  tausmall = 1.e-16;
85  taulim = 1.e-6;
87  tlimitminfix = 1.e-6*mm;
89  smallstep = 1.e10;
90  currentRange = 0. ;
91  rangeinit = 0.;
92  tlimit = 1.e10*mm;
93  tlimitmin = 10.*tlimitminfix;
94  tgeom = 1.e50*mm;
95  geombig = 1.e50*mm;
96  geommin = 1.e-3*mm;
98  presafety = 0.*mm;
99  //facsafety = 0.50 ;
100 
101  y = 0.;
102 
103  Zold = 0.;
104  Zeff = 1.;
105  Z2 = 1.;
106  Z23 = 1.;
107  lnZ = 0.;
108  coeffth1 = 0.;
109  coeffth2 = 0.;
110  coeffc1 = 0.;
111  coeffc2 = 0.;
112  coeffc3 = 0.;
113  coeffc4 = 0.;
114 
115  theta0max = pi/6.;
116  rellossmax = 0.50;
117  third = 1./3.;
118  particle = 0;
119  theManager = G4LossTableManager::Instance();
120  firstStep = true;
121  inside = false;
122  insideskin = false;
123 
124  skindepth = skin*stepmin;
125 
126  mass = proton_mass_c2;
127  charge = ChargeSquare = 1.0;
129  = zPathLength = par1 = par2 = par3 = 0;
130 
132  fParticleChange = 0;
133  couple = 0;
134  SetSampleZ(false);
135 }
G4LossTableManager * theManager
G4ParticleChangeForMSC * fParticleChange
const G4MaterialCutsCouple * couple
const G4ParticleDefinition * particle
QweakSimUrbanMscModel::~QweakSimUrbanMscModel ( )
virtual

Definition at line 139 of file QweakSimUrbanMscModel.cc.

140 {}
QweakSimUrbanMscModel::QweakSimUrbanMscModel ( const QweakSimUrbanMscModel )
private

Member Function Documentation

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

Definition at line 168 of file QweakSimUrbanMscModel.cc.

References charge, ChargeSquare, mass, SetParticle(), and Z23.

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

+ Here is the call graph for this function:

G4double QweakSimUrbanMscModel::ComputeGeomPathLength ( G4double  truePathLength)

Definition at line 677 of file QweakSimUrbanMscModel.cc.

References couple, currentKinEnergy, currentRange, firstStep, insideskin, lambda0, lambdaeff, mass, par1, par2, par3, particle, stepmin, taulim, tausmall, third, tlimitminfix, tPathLength, and zPathLength.

678 {
679  firstStep = false;
680  lambdaeff = lambda0;
681  par1 = -1. ;
682  par2 = par3 = 0. ;
683 
684  // do the true -> geom transformation
686 
687  // z = t for very small tPathLength
688  if(tPathLength < tlimitminfix) return zPathLength;
689 
690  // this correction needed to run MSC with eIoni and eBrem inactivated
691  // and makes no harm for a normal run
692  // It is already checked
693  // if(tPathLength > currentRange)
694  // tPathLength = currentRange ;
695 
696  G4double tau = tPathLength/lambda0 ;
697 
698  if ((tau <= tausmall) || insideskin) {
701  return zPathLength;
702  }
703 
704  G4double zmean = tPathLength;
705  if (tPathLength < currentRange*dtrl) {
706  if(tau < taulim) zmean = tPathLength*(1.-0.5*tau) ;
707  else zmean = lambda0*(1.-exp(-tau));
708  zPathLength = zmean ;
709  return zPathLength;
710 
711  } else if(currentKinEnergy < mass || tPathLength == currentRange) {
712  par1 = 1./currentRange ;
713  par2 = 1./(par1*lambda0) ;
714  par3 = 1.+par2 ;
716  zmean = (1.-exp(par3*log(1.-tPathLength/currentRange)))/(par1*par3) ;
717  else {
718  zmean = 1./(par1*par3) ;
719  }
720  zPathLength = zmean ;
721  return zPathLength;
722 
723  } else {
724  G4double T1 = GetEnergy(particle,currentRange-tPathLength,couple);
725  G4double lambda1 = GetTransportMeanFreePath(particle,T1);
726 
727  par1 = (lambda0-lambda1)/(lambda0*tPathLength);
728  par2 = 1./(par1*lambda0);
729  par3 = 1.+par2 ;
730  zmean = (1.-exp(par3*log(lambda1/lambda0)))/(par1*par3);
731  }
732 
733  zPathLength = zmean;
734 
735  // sample z
736  if(samplez)
737  {
738  const G4double ztmax = 0.999 ;
739  G4double zt = zmean/tPathLength ;
740 
741  if (tPathLength > stepmin && zt < ztmax)
742  {
743  G4double u,cz1;
744  if(zt >= third)
745  {
746  G4double cz = 0.5*(3.*zt-1.)/(1.-zt) ;
747  cz1 = 1.+cz ;
748  G4double u0 = cz/cz1 ;
749  G4double grej ;
750  do {
751  u = exp(log(G4UniformRand())/cz1) ;
752  grej = exp(cz*log(u/u0))*(1.-u)/(1.-u0) ;
753  } while (grej < G4UniformRand()) ;
754  }
755  else
756  {
757  u = 2.*zt*G4UniformRand();
758  }
759  zPathLength = tPathLength*u ;
760  }
761  }
762 
764  //G4cout<< "zPathLength= "<< zPathLength<< " lambda1= " << lambda0 << G4endl;
765  return zPathLength;
766 }
const G4MaterialCutsCouple * couple
const G4ParticleDefinition * particle
G4double QweakSimUrbanMscModel::ComputeTheta0 ( G4double  truePathLength,
G4double  KineticEnergy 
)

Definition at line 810 of file QweakSimUrbanMscModel.cc.

References charge, coeffth1, coeffth2, currentKinEnergy, currentRadLength, mass, and y.

Referenced by SampleCosineTheta().

812 {
813  // for all particles take the width of the central part
814  // from a parametrization similar to the Highland formula
815  // ( Highland formula: Particle Physics Booklet, July 2002, eq. 26.10)
816  static const G4double c_highland = 13.6*MeV ;
817  G4double betacp = sqrt(currentKinEnergy*(currentKinEnergy+2.*mass)*
818  KineticEnergy*(KineticEnergy+2.*mass)/
819  ((currentKinEnergy+mass)*(KineticEnergy+mass)));
820  y = trueStepLength/currentRadLength;
821  G4double theta0 = c_highland*std::abs(charge)*sqrt(y)/betacp;
822  y = log(y);
823  // correction factor from e- scattering data
824  G4double corr = coeffth1+coeffth2*y;
825 
826  theta0 *= corr ;
827 
828  return theta0;
829 }

+ Here is the caller graph for this function:

G4double QweakSimUrbanMscModel::ComputeTruePathLengthLimit ( const G4Track &  track,
G4double &  currentMinimalStep 
)

Definition at line 426 of file QweakSimUrbanMscModel.cc.

References couple, currentKinEnergy, currentMaterialIndex, currentRange, debugPrint, eEnergy, ePolarized, firstStep, fr, geombig, geomlimit, geommin, inside, insideskin, lambda0, lambdalimit, mass, masslimite, particle, polarization, presafety, rangeinit, skindepth, smallstep, stepmin, tgeom, tlimit, tlimitmin, tlimitminfix, and tPathLength.

429 {
430  tPathLength = currentMinimalStep;
431  const G4DynamicParticle* dp = track.GetDynamicParticle();
432 
433  //FIXME
434  ePolarized=false;
435  debugPrint=false;
436  if(strcmp(track.GetParticleDefinition()->GetParticleName().data() , "e-") == 0)
437  if(strcmp(track.GetMaterial()->GetName(),"PBA") == 0){
438  if(track.GetPolarization().getR() >= 0.1) debugPrint=true;
439  if(sqrt(pow(track.GetPolarization().getX(),2)+pow(track.GetPolarization().getY(),2))>0.01){
440  ePolarized=true;
441  polarization=track.GetPolarization();
442  eEnergy=track.GetTotalEnergy();
443  }
444  }
445  debugPrint=false;
446  //FIXME
447 
448  G4StepPoint* sp = track.GetStep()->GetPreStepPoint();
449  G4StepStatus stepStatus = sp->GetStepStatus();
450  couple = track.GetMaterialCutsCouple();
451  SetCurrentCouple(couple);
452  currentMaterialIndex = couple->GetIndex();
453  currentKinEnergy = dp->GetKineticEnergy();
455  lambda0 = GetTransportMeanFreePath(particle,currentKinEnergy);
457 
458  // stop here if small range particle
459  if(inside || tPathLength < tlimitminfix) {
460  return ConvertTrueToGeom(tPathLength, currentMinimalStep);
461  }
462 
463  presafety = sp->GetSafety();
464  /*
465  G4cout << "G4Urban96::StepLimit tPathLength= "
466  <<tPathLength<<" safety= " << presafety
467  << " range= " <<currentRange<< " lambda= "<<lambda0
468  << " Alg: " << steppingAlgorithm <<G4endl;
469  */
470  // far from geometry boundary
471  if(currentRange < presafety)
472  {
473  inside = true;
474  return ConvertTrueToGeom(tPathLength, currentMinimalStep);
475  }
476 
477  // standard version
478  //
479  if (steppingAlgorithm == fUseDistanceToBoundary)
480  {
481  //compute geomlimit and presafety
482  geomlimit = ComputeGeomLimit(track, presafety, currentRange);
483 
484  // is it far from boundary ?
485  if(currentRange < presafety)
486  {
487  inside = true;
488  return ConvertTrueToGeom(tPathLength, currentMinimalStep);
489  }
490 
491  smallstep += 1.;
492  insideskin = false;
493 
494  if(firstStep || (stepStatus == fGeomBoundary))
495  {
497  if(firstStep) smallstep = 1.e10;
498  else smallstep = 1.;
499 
500  //define stepmin here (it depends on lambda!)
501  //rough estimation of lambda_elastic/lambda_transport
502  G4double rat = currentKinEnergy/MeV ;
503  rat = 1.e-3/(rat*(10.+rat)) ;
504  //stepmin ~ lambda_elastic
505  stepmin = rat*lambda0;
506  skindepth = skin*stepmin;
507  //define tlimitmin
508  tlimitmin = 10.*stepmin;
510  //G4cout << "rangeinit= " << rangeinit << " stepmin= " << stepmin
511  // << " tlimitmin= " << tlimitmin << " geomlimit= " << geomlimit <<G4endl;
512  // constraint from the geometry
513  if((geomlimit < geombig) && (geomlimit > geommin))
514  {
515  // geomlimit is a geometrical step length
516  // transform it to true path length (estimation)
517  if((1.-geomlimit/lambda0) > 0.)
518  geomlimit = -lambda0*log(1.-geomlimit/lambda0)+tlimitmin ;
519 
520  if(stepStatus == fGeomBoundary)
521  tgeom = geomlimit/facgeom;
522  else
523  tgeom = 2.*geomlimit/facgeom;
524  }
525  else
526  tgeom = geombig;
527  }
528 
529 
530  //step limit
531  tlimit = facrange*rangeinit;
532 
533  //lower limit for tlimit
535 
536  if(tlimit > tgeom) tlimit = tgeom;
537 
538  //G4cout << "tgeom= " << tgeom << " geomlimit= " << geomlimit
539  // << " tlimit= " << tlimit << " presafety= " << presafety << G4endl;
540 
541  // shortcut
542  if((tPathLength < tlimit) && (tPathLength < presafety) &&
543  (smallstep > skin) && (tPathLength < geomlimit-0.999*skindepth))
544  return ConvertTrueToGeom(tPathLength, currentMinimalStep);
545 
546  // step reduction near to boundary
547  if(smallstep <= skin)
548  {
549  tlimit = stepmin;
550  insideskin = true;
551  }
552  else if(geomlimit < geombig)
553  {
554  if(geomlimit > skindepth)
555  {
556  if(tlimit > geomlimit-0.999*skindepth)
557  tlimit = geomlimit-0.999*skindepth;
558  }
559  else
560  {
561  insideskin = true;
562  if(tlimit > stepmin) tlimit = stepmin;
563  }
564  }
565 
566  if(tlimit < stepmin) tlimit = stepmin;
567 
568  // randomize 1st step or 1st 'normal' step in volume
569  if(firstStep || ((smallstep == skin+1) && !insideskin))
570  {
571  G4double temptlimit = tlimit;
572  if(temptlimit > tlimitmin)
573  {
574  do {
575  temptlimit = G4RandGauss::shoot(tlimit,0.3*tlimit);
576  } while ((temptlimit < tlimitmin) ||
577  (temptlimit > 2.*tlimit-tlimitmin));
578  }
579  else
580  temptlimit = tlimitmin;
581  if(tPathLength > temptlimit) tPathLength = temptlimit;
582  }
583  else
584  {
586  }
587 
588  }
589  // for 'normal' simulation with or without magnetic field
590  // there no small step/single scattering at boundaries
591  else if(steppingAlgorithm == fUseSafety)
592  {
593  // compute presafety again if presafety <= 0 and no boundary
594  // i.e. when it is needed for optimization purposes
595  if((stepStatus != fGeomBoundary) && (presafety < tlimitminfix))
596  presafety = ComputeSafety(sp->GetPosition(),tPathLength);
597  /*
598  G4cout << "presafety= " << presafety
599  << " firstStep= " << firstStep
600  << " stepStatus= " << stepStatus
601  << G4endl;
602  */
603  // is far from boundary
604  if(currentRange < presafety)
605  {
606  inside = true;
607  return ConvertTrueToGeom(tPathLength, currentMinimalStep);
608  }
609 
610  if(firstStep || stepStatus == fGeomBoundary)
611  {
612  rangeinit = currentRange;
613  fr = facrange;
614  // 9.1 like stepping for e+/e- only (not for muons,hadrons)
615  if(mass < masslimite)
616  {
617  if(lambda0 > currentRange)
618  rangeinit = lambda0;
619  if(lambda0 > lambdalimit)
620  fr *= 0.75+0.25*lambda0/lambdalimit;
621  }
622 
623  //lower limit for tlimit
624  G4double rat = currentKinEnergy/MeV ;
625  rat = 1.e-3/(rat*(10.+rat)) ;
626  stepmin = lambda0*rat;
627  tlimitmin = 10.*stepmin;
629  }
630  //step limit
631  tlimit = fr*rangeinit;
632 
633  if(tlimit < facsafety*presafety)
634  tlimit = facsafety*presafety;
635 
636  //lower limit for tlimit
638 
639  if(firstStep || stepStatus == fGeomBoundary)
640  {
641  G4double temptlimit = tlimit;
642  if(temptlimit > tlimitmin)
643  {
644  do {
645  temptlimit = G4RandGauss::shoot(tlimit,0.3*tlimit);
646  } while ((temptlimit < tlimitmin) ||
647  (temptlimit > 2.*tlimit-tlimitmin));
648  }
649  else
650  temptlimit = tlimitmin;
651 
652  if(tPathLength > temptlimit) tPathLength = temptlimit;
653  }
654  else
656  }
657 
658  // version similar to 7.1 (needed for some experiments)
659  else
660  {
661  if (stepStatus == fGeomBoundary)
662  {
663  if (currentRange > lambda0) tlimit = facrange*currentRange;
664  else tlimit = facrange*lambda0;
665 
668  }
669  }
670  //G4cout << "tPathLength= " << tPathLength
671  // << " currentMinimalStep= " << currentMinimalStep << G4endl;
672  return ConvertTrueToGeom(tPathLength, currentMinimalStep);
673 }
const G4MaterialCutsCouple * couple
const G4ParticleDefinition * particle
G4double QweakSimUrbanMscModel::ComputeTrueStepLength ( G4double  geomStepLength)

Definition at line 770 of file QweakSimUrbanMscModel.cc.

References currentRange, insideskin, lambda0, par1, par3, tausmall, tlimitminfix, tPathLength, and zPathLength.

771 {
772  // step defined other than transportation
773  if(geomStepLength == zPathLength)
774  { return tPathLength; }
775 
776  zPathLength = geomStepLength;
777 
778  // t = z for very small step
779  if(geomStepLength < tlimitminfix) {
780  tPathLength = geomStepLength;
781 
782  // recalculation
783  } else {
784 
785  G4double tlength = geomStepLength;
786  if((geomStepLength > lambda0*tausmall) && !insideskin) {
787 
788  if(par1 < 0.) {
789  tlength = -lambda0*log(1.-geomStepLength/lambda0) ;
790  } else {
791  if(par1*par3*geomStepLength < 1.) {
792  tlength = (1.-exp(log(1.-par1*par3*geomStepLength)/par3))/par1 ;
793  } else {
794  tlength = currentRange;
795  }
796  }
797  if(tlength < geomStepLength) { tlength = geomStepLength; }
798  else if(tlength > tPathLength) { tlength = tPathLength; }
799  }
800  tPathLength = tlength;
801  }
802  //G4cout << "Urban96::ComputeTrueLength: tPathLength= " << tPathLength
803  // << " step= " << geomStepLength << G4endl;
804 
805  return tPathLength;
806 }
void QweakSimUrbanMscModel::Initialise ( const G4ParticleDefinition *  p,
const G4DataVector &   
)

Definition at line 144 of file QweakSimUrbanMscModel.cc.

References fParticleChange, SetParticle(), skindepth, and stepmin.

146 {
147  skindepth = skin*stepmin;
148  // trackID = -1;
149 
150  // set values of some data members
151  SetParticle(p);
152  /*
153  if(p->GetPDGMass() > MeV) {
154  G4cout << "### WARNING: QweakSimUrbanMscModel model is used for "
155  << p->GetParticleName() << " !!! " << G4endl;
156  G4cout << "### This model should be used only for e+-"
157  << G4endl;
158  }
159  */
160  fParticleChange = GetParticleChangeForMSC(p);
161 
162  //samplez = true;
163  //G4cout << "### QweakSimUrbanMscModel::Initialise done!" << G4endl;
164 }
void SetParticle(const G4ParticleDefinition *)
G4ParticleChangeForMSC * fParticleChange

+ Here is the call graph for this function:

G4double QweakSimUrbanMscModel::LatCorrelation ( )
private

Definition at line 1162 of file QweakSimUrbanMscModel.cc.

References currentTau, insideskin, lambdaeff, taubig, taulim, and tausmall.

Referenced by SampleScattering().

1163 {
1164  static const G4double kappa = 2.5;
1165  static const G4double kappami1 = kappa-1.;
1166 
1167  G4double latcorr = 0.;
1168  if((currentTau >= tausmall) && !insideskin)
1169  {
1170  if(currentTau < taulim)
1171  latcorr = lambdaeff*kappa*currentTau*currentTau*
1172  (1.-(kappa+1.)*currentTau/3.)/3.;
1173  else
1174  {
1175  G4double etau = 0.;
1176  if(currentTau < taubig) etau = exp(-currentTau);
1177  latcorr = -kappa*currentTau;
1178  latcorr = exp(latcorr)/kappami1;
1179  latcorr += 1.-kappa*etau/kappami1 ;
1180  latcorr *= 2.*lambdaeff/3. ;
1181  }
1182  }
1183 
1184  return latcorr;
1185 }

+ Here is the caller graph for this function:

QweakSimUrbanMscModel& QweakSimUrbanMscModel::operator= ( const QweakSimUrbanMscModel right)
private
G4double QweakSimUrbanMscModel::SampleCosineTheta ( G4double  trueStepLength,
G4double  KineticEnergy 
)
private

Definition at line 955 of file QweakSimUrbanMscModel.cc.

References coeffc1, coeffc2, coeffc3, coeffc4, ComputeTheta0(), couple, currentKinEnergy, currentRadLength, currentTau, lambda0, lambdaeff, particle, rellossmax, SimpleScattering(), taubig, tausmall, theta0max, tlimitmin, UpdateCache(), Zeff, and Zold.

Referenced by SampleScattering().

957 {
958  G4double cth = 1. ;
959  G4double tau = trueStepLength/lambda0;
960  currentTau = tau;
961  lambdaeff = lambda0;
962 
963  Zeff = couple->GetMaterial()->GetTotNbOfElectPerVolume()/
964  couple->GetMaterial()->GetTotNbOfAtomsPerVolume() ;
965 
966  if(Zold != Zeff)
967  UpdateCache();
968 
969  G4double lambda1 = GetTransportMeanFreePath(particle,KineticEnergy);
970  if(std::fabs(lambda1/lambda0 - 1) > 0.01 && lambda1 > 0.)
971  {
972  // mean tau value
973  tau = trueStepLength*log(lambda0/lambda1)/(lambda0-lambda1);
974  }
975 
976  currentTau = tau ;
977  lambdaeff = trueStepLength/currentTau;
978  currentRadLength = couple->GetMaterial()->GetRadlen();
979 
980  if (tau >= taubig) { cth = -1.+2.*G4UniformRand(); }
981  else if (tau >= tausmall) {
982  static const G4double numlim = 0.01;
983  G4double xmeanth, x2meanth;
984  if(tau < numlim) {
985  xmeanth = 1.0 - tau*(1.0 - 0.5*tau);
986  x2meanth= 1.0 - tau*(5.0 - 6.25*tau)/3.;
987  } else {
988  xmeanth = exp(-tau);
989  x2meanth = (1.+2.*exp(-2.5*tau))/3.;
990  }
991  G4double relloss = 1.-KineticEnergy/currentKinEnergy;
992 
993  if(relloss > rellossmax)
994  return SimpleScattering(xmeanth,x2meanth);
995 
996  // is step extreme small ?
997  G4bool extremesmallstep = false ;
998  G4double tsmall = tlimitmin ;
999  G4double theta0 = 0.;
1000  if(trueStepLength > tsmall) {
1001  theta0 = ComputeTheta0(trueStepLength,KineticEnergy);
1002  } else {
1003  G4double rate = trueStepLength/tsmall ;
1004  if(G4UniformRand() < rate) {
1005  theta0 = ComputeTheta0(tsmall,KineticEnergy);
1006  extremesmallstep = true ;
1007  }
1008  }
1009  //G4cout << "Theta0= " << theta0 << " theta0max= " << theta0max
1010  // << " sqrt(tausmall)= " << sqrt(tausmall) << G4endl;
1011 
1012  // protection for very small angles
1013  G4double theta2 = theta0*theta0;
1014 
1015  if(theta2 < tausmall) { return cth; }
1016 
1017  if(theta0 > theta0max) {
1018  return SimpleScattering(xmeanth,x2meanth);
1019  }
1020 
1021  G4double x = theta2*(1.0 - theta2/12.);
1022  if(theta2 > numlim) {
1023  G4double sth = 2*sin(0.5*theta0);
1024  x = sth*sth;
1025  }
1026 
1027  // parameter for tail
1028  G4double ltau= log(tau);
1029  G4double u = exp(ltau/6.);
1030  if(extremesmallstep) u = exp(log(tsmall/lambda0)/6.);
1031  G4double xx = log(lambdaeff/currentRadLength);
1032  G4double xsi = coeffc1+u*(coeffc2+coeffc3*u)+coeffc4*xx;
1033 
1034  // tail should not be too big
1035  if(xsi < 1.9) {
1036  /*
1037  if(KineticEnergy > 20*MeV && xsi < 1.6) {
1038  G4cout << "QweakSimUrbanMscModel::SampleCosineTheta: E(GeV)= "
1039  << KineticEnergy/GeV
1040  << " !!** c= " << xsi
1041  << " **!! length(mm)= " << trueStepLength << " Zeff= " << Zeff
1042  << " " << couple->GetMaterial()->GetName()
1043  << " tau= " << tau << G4endl;
1044  }
1045  */
1046  xsi = 1.9;
1047  }
1048 
1049  G4double c = xsi;
1050 
1051  if(fabs(c-3.) < 0.001) { c = 3.001; }
1052  else if(fabs(c-2.) < 0.001) { c = 2.001; }
1053 
1054  G4double c1 = c-1.;
1055 
1056  G4double ea = exp(-xsi);
1057  G4double eaa = 1.-ea ;
1058  G4double xmean1 = 1.-(1.-(1.+xsi)*ea)*x/eaa;
1059  G4double x0 = 1. - xsi*x;
1060 
1061  // G4cout << " xmean1= " << xmean1 << " xmeanth= " << xmeanth << G4endl;
1062 
1063  if(xmean1 <= 0.999*xmeanth) {
1064  return SimpleScattering(xmeanth,x2meanth);
1065  }
1066  //from continuity of derivatives
1067  G4double b = 1.+(c-xsi)*x;
1068 
1069  G4double b1 = b+1.;
1070  G4double bx = c*x;
1071 
1072  G4double eb1 = pow(b1,c1);
1073  G4double ebx = pow(bx,c1);
1074  G4double d = ebx/eb1;
1075 
1076  G4double xmean2 = (x0 + d - (bx - b1*d)/(c-2.))/(1. - d);
1077 
1078  G4double f1x0 = ea/eaa;
1079  G4double f2x0 = c1/(c*(1. - d));
1080  G4double prob = f2x0/(f1x0+f2x0);
1081 
1082  G4double qprob = xmeanth/(prob*xmean1+(1.-prob)*xmean2);
1083 
1084  // sampling of costheta
1085  //G4cout << "c= " << c << " qprob= " << qprob << " eb1= " << eb1
1086  // << " c1= " << c1 << " b1= " << b1 << " bx= " << bx << " eb1= " << eb1
1087  // << G4endl;
1088  if(G4UniformRand() < qprob)
1089  {
1090  G4double var = 0;
1091  if(G4UniformRand() < prob) {
1092  cth = 1.+log(ea+G4UniformRand()*eaa)*x;
1093  } else {
1094  var = (1.0 - d)*G4UniformRand();
1095  if(var < numlim*d) {
1096  var /= (d*c1);
1097  cth = -1.0 + var*(1.0 - 0.5*var*c)*(2. + (c - xsi)*x);
1098  } else {
1099  cth = 1. + x*(c - xsi - c*pow(var + d, -1.0/c1));
1100  //b-b1*bx/exp(log(ebx+(eb1-ebx)*G4UniformRand())/c1) ;
1101  }
1102  }
1103  if(KineticEnergy > 5*GeV && cth < 0.9) {
1104  G4cout << "QweakSimUrbanMscModel::SampleCosineTheta: E(GeV)= "
1105  << KineticEnergy/GeV
1106  << " 1-cosT= " << 1 - cth
1107  << " length(mm)= " << trueStepLength << " Zeff= " << Zeff
1108  << " tau= " << tau
1109  << " prob= " << prob << " var= " << var << G4endl;
1110  G4cout << " c= " << c << " qprob= " << qprob << " eb1= " << eb1
1111  << " ebx= " << ebx
1112  << " c1= " << c1 << " b= " << b << " b1= " << b1
1113  << " bx= " << bx << " d= " << d
1114  << " ea= " << ea << " eaa= " << eaa << G4endl;
1115  }
1116  }
1117  else {
1118  cth = -1.+2.*G4UniformRand();
1119  if(KineticEnergy > 5*GeV) {
1120  G4cout << "QweakSimUrbanMscModel::SampleCosineTheta: E(GeV)= "
1121  << KineticEnergy/GeV
1122  << " length(mm)= " << trueStepLength << " Zeff= " << Zeff
1123  << " qprob= " << qprob << G4endl;
1124  }
1125  }
1126  }
1127  return cth ;
1128 }
G4double ComputeTheta0(G4double truePathLength, G4double KineticEnergy)
G4double SimpleScattering(G4double xmeanth, G4double x2meanth)
const G4MaterialCutsCouple * couple
const G4ParticleDefinition * particle

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

G4double QweakSimUrbanMscModel::SampleDisplacement ( )
private

Definition at line 1150 of file QweakSimUrbanMscModel.cc.

References currentTau, insideskin, tausmall, tPathLength, and zPathLength.

Referenced by SampleScattering().

1151 {
1152  G4double r = 0.0;
1153  if ((currentTau >= tausmall) && !insideskin) {
1154  G4double rmax = sqrt((tPathLength-zPathLength)*(tPathLength+zPathLength));
1155  r = rmax*exp(log(G4UniformRand())/3.);
1156  }
1157  return r;
1158 }

+ Here is the caller graph for this function:

G4ThreeVector & QweakSimUrbanMscModel::SampleScattering ( const G4ThreeVector &  oldDirection,
G4double  safety 
)

Definition at line 834 of file QweakSimUrbanMscModel.cc.

References couple, currentKinEnergy, currentRange, debugPrint, eEnergy, ePolarized, fParticleChange, lambda0, LatCorrelation(), particle, polarization, SampleCosineTheta(), SampleDisplacement(), tausmall, tlimitminfix, and tPathLength.

836 {
837  fDisplacement.set(0.0,0.0,0.0);
838  G4double kineticEnergy = currentKinEnergy;
839  if (tPathLength > currentRange*dtrl) {
840  kineticEnergy = GetEnergy(particle,currentRange-tPathLength,couple);
841  } else {
842  kineticEnergy -= tPathLength*GetDEDX(particle,currentKinEnergy,couple);
843  }
844 
845  if((kineticEnergy <= eV) || (tPathLength <= tlimitminfix) ||
846  (tPathLength/tausmall < lambda0)) { return fDisplacement; }
847 
848  G4double cth = SampleCosineTheta(tPathLength,kineticEnergy);
849 
850  // protection against 'bad' cth values
851  if(std::fabs(cth) > 1.) { return fDisplacement; }
852 
853  // extra protection agaist high energy particles backscattered
854  //G4cout << "Warning: large scattering E(MeV)= " << kineticEnergy
855  // << " s(mm)= " << tPathLength/mm
856  // << " 1-cosTheta= " << 1.0 - cth << G4endl;
857  // do Gaussian central scattering
858  // if(kineticEnergy > 5*GeV && cth < 0.9) {
859  /*
860  if(cth < 1.0 - 1000*tPathLength/lambda0
861  && cth < 0.8 && kineticEnergy > 20*MeV) {
862  G4ExceptionDescription ed;
863  ed << particle->GetParticleName()
864  << " E(MeV)= " << kineticEnergy/MeV
865  << " Step(mm)= " << tPathLength/mm
866  << " in " << CurrentCouple()->GetMaterial()->GetName()
867  << " CosTheta= " << cth
868  << " is too big";
869  G4Exception("QweakSimUrbanMscModel::SampleScattering","em0004",
870  JustWarning, ed,"");
871 
872  if(kineticEnergy > GeV && cth < 0.0) {
873  do {
874  cth = 1.0 + 2*log(G4UniformRand())*tPathLength/lambda0;
875  } while(cth < -1.0);
876  }
877 */
878 
879  G4double sth = sqrt((1.0 - cth)*(1.0 + cth));
880  G4double phi = twopi*G4UniformRand();
881  if(ePolarized){//FIXME
882  if(debugPrint) G4cout<<" Urban fix "<<G4endl;
883  G4double _prob=G4UniformRand();
884  G4double _amplitude=1.0/eEnergy * sth *
885  sqrt(pow(polarization.getX(),2)+pow(polarization.getY(),2));//scale by transvers polarization
886  if(_amplitude > 1 ) _amplitude=1;
887  if( _prob < _amplitude * sin(phi-pi) )
888  phi-=pi;
889  phi+= polarization.getPhi() - oldDirection.getPhi();
890  if(phi<0) phi+=twopi;
891  else if(phi>twopi) phi=fmod(phi,twopi);
892  }//FIXME
893 
894  G4double dirx = sth*cos(phi);
895  G4double diry = sth*sin(phi);
896 
897  G4ThreeVector newDirection(dirx,diry,cth);
898  newDirection.rotateUz(oldDirection);
899  fParticleChange->ProposeMomentumDirection(newDirection);
900 
901  //FIXME
902  if(debugPrint){
903  G4cout<<" Urban96 cth, th, phi old.angle(new)" << cth << " " << acos(cth) << " " << phi << " " <<oldDirection.angle(newDirection) << G4endl;
904  G4cout<<" Urban96: old dir: R th phi "<<oldDirection.getR()<<" "<<oldDirection.getTheta()<<" "<<oldDirection.getPhi()<<G4endl;
905  G4cout<<" Urban96: new dir: R th phi "<<newDirection.getR()<<" "<<newDirection.getTheta()<<" "<<newDirection.getPhi()<<G4endl;
906  }//FIXME
907  /*
908  G4cout << "QweakSimUrbanMscModel::SampleSecondaries: e(MeV)= " << kineticEnergy
909  << " sinTheta= " << sth << " safety(mm)= " << safety
910  << " trueStep(mm)= " << tPathLength
911  << " geomStep(mm)= " << zPathLength
912  << G4endl;
913  */
914  if (latDisplasment && safety > tlimitminfix) {
915 
916  G4double r = SampleDisplacement();
917  /*
918  G4cout << "QweakSimUrbanMscModel::SampleSecondaries: e(MeV)= " << kineticEnergy
919  << " sinTheta= " << sth << " r(mm)= " << r
920  << " trueStep(mm)= " << tPathLength
921  << " geomStep(mm)= " << zPathLength
922  << G4endl;
923  */
924  if(r > 0.)
925  {
926  G4double latcorr = LatCorrelation();
927  if(latcorr > r) latcorr = r;
928 
929  // sample direction of lateral displacement
930  // compute it from the lateral correlation
931  G4double Phi = 0.;
932  if(std::abs(r*sth) < latcorr)
933  Phi = twopi*G4UniformRand();
934  else
935  {
936  G4double psi = std::acos(latcorr/(r*sth));
937  if(G4UniformRand() < 0.5)
938  Phi = phi+psi;
939  else
940  Phi = phi-psi;
941  }
942 
943  dirx = std::cos(Phi);
944  diry = std::sin(Phi);
945 
946  fDisplacement.set(r*dirx,r*diry,0.0);
947  fDisplacement.rotateUz(oldDirection);
948  }
949  }
950  return fDisplacement;
951 }
G4ParticleChangeForMSC * fParticleChange
const G4MaterialCutsCouple * couple
G4double SampleCosineTheta(G4double trueStepLength, G4double KineticEnergy)
const G4ParticleDefinition * particle

+ Here is the call graph for this function:

void QweakSimUrbanMscModel::SetParticle ( const G4ParticleDefinition *  p)
inlineprivate

Definition at line 186 of file QweakSimUrbanMscModel.hh.

References charge, ChargeSquare, mass, and particle.

Referenced by ComputeCrossSectionPerAtom(), Initialise(), and StartTracking().

187 {
188  if (p != particle) {
189  particle = p;
190  mass = p->GetPDGMass();
191  charge = p->GetPDGCharge()/CLHEP::eplus;
193  }
194 }
const G4ParticleDefinition * particle

+ Here is the caller graph for this function:

G4double QweakSimUrbanMscModel::SimpleScattering ( G4double  xmeanth,
G4double  x2meanth 
)
private

Definition at line 1132 of file QweakSimUrbanMscModel.cc.

Referenced by SampleCosineTheta().

1133 {
1134  // 'large angle scattering'
1135  // 2 model functions with correct xmean and x2mean
1136  G4double a = (2.*xmeanth+9.*x2meanth-3.)/(2.*xmeanth-3.*x2meanth+1.);
1137  G4double prob = (a+2.)*xmeanth/a;
1138 
1139  // sampling
1140  G4double cth = 1.;
1141  if(G4UniformRand() < prob)
1142  cth = -1.+2.*exp(log(G4UniformRand())/(a+1.));
1143  else
1144  cth = -1.+2.*G4UniformRand();
1145  return cth;
1146 }

+ Here is the caller graph for this function:

void QweakSimUrbanMscModel::StartTracking ( G4Track *  track)

Definition at line 413 of file QweakSimUrbanMscModel.cc.

References firstStep, geombig, inside, insideskin, SetParticle(), stepmin, tlimit, tlimitmin, and tlimitminfix.

414 {
415  SetParticle(track->GetDynamicParticle()->GetDefinition());
416  firstStep = true;
417  inside = false;
418  insideskin = false;
419  tlimit = geombig;
421  tlimitmin = 10.*stepmin ;
422 }
void SetParticle(const G4ParticleDefinition *)

+ Here is the call graph for this function:

void QweakSimUrbanMscModel::UpdateCache ( )
inlineprivate

Definition at line 199 of file QweakSimUrbanMscModel.hh.

References coeffc1, coeffc2, coeffc3, coeffc4, coeffth1, coeffth2, lnZ, Z2, Z23, Zeff, and Zold.

Referenced by SampleCosineTheta().

200 {
201  lnZ = std::log(Zeff);
202  // correction in theta0 formula
203  G4double facz = 0.74845+0.13354*exp(log(Zeff)/6.);
204  coeffth1 = facz*(1. - 8.7780e-2/Zeff);
205  coeffth2 = facz*(4.0780e-2 + 1.7315e-4*Zeff);
206 
207  // tail parameters
208  G4double Z13 = std::exp(lnZ/3.);
209  coeffc1 = 2.3785 - Z13*(4.1981e-1 - Z13*6.3100e-2);
210  coeffc2 = 4.7526e-1 + Z13*(1.7694 - Z13*3.3885e-1);
211  coeffc3 = 2.3683e-1 - Z13*(1.8111 - Z13*3.2774e-1);
212  coeffc4 = 1.7888e-2 + Z13*(1.9659e-2 - Z13*2.6664e-3);
213 
214  Z2 = Zeff*Zeff;
215  Z23 = Z13*Z13;
216 
217  Zold = Zeff;
218 }

+ Here is the caller graph for this function:

Field Documentation

G4double QweakSimUrbanMscModel::charge
private
G4double QweakSimUrbanMscModel::ChargeSquare
private
G4double QweakSimUrbanMscModel::coeffc1
private

Definition at line 169 of file QweakSimUrbanMscModel.hh.

Referenced by QweakSimUrbanMscModel(), SampleCosineTheta(), and UpdateCache().

G4double QweakSimUrbanMscModel::coeffc2
private

Definition at line 169 of file QweakSimUrbanMscModel.hh.

Referenced by QweakSimUrbanMscModel(), SampleCosineTheta(), and UpdateCache().

G4double QweakSimUrbanMscModel::coeffc3
private

Definition at line 169 of file QweakSimUrbanMscModel.hh.

Referenced by QweakSimUrbanMscModel(), SampleCosineTheta(), and UpdateCache().

G4double QweakSimUrbanMscModel::coeffc4
private

Definition at line 169 of file QweakSimUrbanMscModel.hh.

Referenced by QweakSimUrbanMscModel(), SampleCosineTheta(), and UpdateCache().

G4double QweakSimUrbanMscModel::coeffth1
private

Definition at line 168 of file QweakSimUrbanMscModel.hh.

Referenced by ComputeTheta0(), QweakSimUrbanMscModel(), and UpdateCache().

G4double QweakSimUrbanMscModel::coeffth2
private

Definition at line 168 of file QweakSimUrbanMscModel.hh.

Referenced by ComputeTheta0(), QweakSimUrbanMscModel(), and UpdateCache().

const G4MaterialCutsCouple* QweakSimUrbanMscModel::couple
private
G4double QweakSimUrbanMscModel::currentKinEnergy
private
G4int QweakSimUrbanMscModel::currentMaterialIndex
private

Definition at line 163 of file QweakSimUrbanMscModel.hh.

Referenced by ComputeTruePathLengthLimit(), and QweakSimUrbanMscModel().

G4double QweakSimUrbanMscModel::currentRadLength
private
G4double QweakSimUrbanMscModel::currentRange
private
G4double QweakSimUrbanMscModel::currentTau
private
G4bool QweakSimUrbanMscModel::debugPrint
private

Definition at line 178 of file QweakSimUrbanMscModel.hh.

Referenced by ComputeTruePathLengthLimit(), and SampleScattering().

G4double QweakSimUrbanMscModel::eEnergy
private

Definition at line 177 of file QweakSimUrbanMscModel.hh.

Referenced by ComputeTruePathLengthLimit(), and SampleScattering().

G4bool QweakSimUrbanMscModel::ePolarized
private

Definition at line 175 of file QweakSimUrbanMscModel.hh.

Referenced by ComputeTruePathLengthLimit(), and SampleScattering().

G4bool QweakSimUrbanMscModel::firstStep
private
G4ParticleChangeForMSC* QweakSimUrbanMscModel::fParticleChange
private

Definition at line 121 of file QweakSimUrbanMscModel.hh.

Referenced by Initialise(), QweakSimUrbanMscModel(), and SampleScattering().

G4double QweakSimUrbanMscModel::fr
private

Definition at line 128 of file QweakSimUrbanMscModel.hh.

Referenced by ComputeTruePathLengthLimit(), and QweakSimUrbanMscModel().

G4double QweakSimUrbanMscModel::geombig
private
G4double QweakSimUrbanMscModel::geomlimit
private

Definition at line 141 of file QweakSimUrbanMscModel.hh.

Referenced by ComputeTruePathLengthLimit(), and QweakSimUrbanMscModel().

G4double QweakSimUrbanMscModel::geommin
private

Definition at line 140 of file QweakSimUrbanMscModel.hh.

Referenced by ComputeTruePathLengthLimit(), and QweakSimUrbanMscModel().

G4bool QweakSimUrbanMscModel::inside
private
G4double QweakSimUrbanMscModel::lambda0
private
G4double QweakSimUrbanMscModel::lambdaeff
private
G4double QweakSimUrbanMscModel::lambdalimit
private

Definition at line 128 of file QweakSimUrbanMscModel.hh.

Referenced by ComputeTruePathLengthLimit(), and QweakSimUrbanMscModel().

G4double QweakSimUrbanMscModel::lnZ
private

Definition at line 167 of file QweakSimUrbanMscModel.hh.

Referenced by QweakSimUrbanMscModel(), and UpdateCache().

G4double QweakSimUrbanMscModel::mass
private
G4double QweakSimUrbanMscModel::masslimite
private

Definition at line 128 of file QweakSimUrbanMscModel.hh.

Referenced by ComputeTruePathLengthLimit(), and QweakSimUrbanMscModel().

G4double QweakSimUrbanMscModel::par1
private
G4double QweakSimUrbanMscModel::par2
private

Definition at line 151 of file QweakSimUrbanMscModel.hh.

Referenced by ComputeGeomPathLength(), and QweakSimUrbanMscModel().

G4double QweakSimUrbanMscModel::par3
private
const G4ParticleDefinition* QweakSimUrbanMscModel::particle
private
G4ThreeVector QweakSimUrbanMscModel::polarization
private

Definition at line 176 of file QweakSimUrbanMscModel.hh.

Referenced by ComputeTruePathLengthLimit(), and SampleScattering().

G4double QweakSimUrbanMscModel::presafety
private

Definition at line 145 of file QweakSimUrbanMscModel.hh.

Referenced by ComputeTruePathLengthLimit(), and QweakSimUrbanMscModel().

G4double QweakSimUrbanMscModel::rangeinit
private

Definition at line 157 of file QweakSimUrbanMscModel.hh.

Referenced by ComputeTruePathLengthLimit(), and QweakSimUrbanMscModel().

G4double QweakSimUrbanMscModel::rellossmax
private

Definition at line 160 of file QweakSimUrbanMscModel.hh.

Referenced by QweakSimUrbanMscModel(), and SampleCosineTheta().

G4double QweakSimUrbanMscModel::skindepth
private
G4double QweakSimUrbanMscModel::smallstep
private

Definition at line 143 of file QweakSimUrbanMscModel.hh.

Referenced by ComputeTruePathLengthLimit(), and QweakSimUrbanMscModel().

G4double QweakSimUrbanMscModel::stepmin
private
G4double QweakSimUrbanMscModel::taubig
private
G4double QweakSimUrbanMscModel::taulim
private
G4double QweakSimUrbanMscModel::tgeom
private

Definition at line 137 of file QweakSimUrbanMscModel.hh.

Referenced by ComputeTruePathLengthLimit(), and QweakSimUrbanMscModel().

G4LossTableManager* QweakSimUrbanMscModel::theManager
private

Definition at line 124 of file QweakSimUrbanMscModel.hh.

Referenced by QweakSimUrbanMscModel().

G4double QweakSimUrbanMscModel::theta0max
private

Definition at line 160 of file QweakSimUrbanMscModel.hh.

Referenced by QweakSimUrbanMscModel(), and SampleCosineTheta().

G4double QweakSimUrbanMscModel::third
private

Definition at line 161 of file QweakSimUrbanMscModel.hh.

Referenced by ComputeGeomPathLength(), and QweakSimUrbanMscModel().

G4double QweakSimUrbanMscModel::tlimit
private
G4double QweakSimUrbanMscModel::tlimitmin
private
G4double QweakSimUrbanMscModel::tlimitminfix
private
G4double QweakSimUrbanMscModel::tPathLength
private
G4double QweakSimUrbanMscModel::y
private

Definition at line 165 of file QweakSimUrbanMscModel.hh.

Referenced by ComputeTheta0(), and QweakSimUrbanMscModel().

G4double QweakSimUrbanMscModel::Z2
private

Definition at line 167 of file QweakSimUrbanMscModel.hh.

Referenced by QweakSimUrbanMscModel(), and UpdateCache().

G4double QweakSimUrbanMscModel::Z23
private
G4double QweakSimUrbanMscModel::Zeff
private

Definition at line 167 of file QweakSimUrbanMscModel.hh.

Referenced by QweakSimUrbanMscModel(), SampleCosineTheta(), and UpdateCache().

G4double QweakSimUrbanMscModel::Zold
private

Definition at line 166 of file QweakSimUrbanMscModel.hh.

Referenced by QweakSimUrbanMscModel(), SampleCosineTheta(), and UpdateCache().

G4double QweakSimUrbanMscModel::zPathLength
private

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