source: trunk/source/processes/electromagnetic/standard/src/G4UrbanMscModel.cc @ 968

Last change on this file since 968 was 961, checked in by garnier, 15 years ago

update processes

File size: 39.9 KB
Line 
1//
2// ********************************************************************
3// * License and Disclaimer                                           *
4// *                                                                  *
5// * The  Geant4 software  is  copyright of the Copyright Holders  of *
6// * the Geant4 Collaboration.  It is provided  under  the terms  and *
7// * conditions of the Geant4 Software License,  included in the file *
8// * LICENSE and available at  http://cern.ch/geant4/license .  These *
9// * include a list of copyright holders.                             *
10// *                                                                  *
11// * Neither the authors of this software system, nor their employing *
12// * institutes,nor the agencies providing financial support for this *
13// * work  make  any representation or  warranty, express or implied, *
14// * regarding  this  software system or assume any liability for its *
15// * use.  Please see the license in the file  LICENSE  and URL above *
16// * for the full disclaimer and the limitation of liability.         *
17// *                                                                  *
18// * This  code  implementation is the result of  the  scientific and *
19// * technical work of the GEANT4 collaboration.                      *
20// * By using,  copying,  modifying or  distributing the software (or *
21// * any work based  on the software)  you  agree  to acknowledge its *
22// * use  in  resulting  scientific  publications,  and indicate your *
23// * acceptance of all terms of the Geant4 Software license.          *
24// ********************************************************************
25//
26// $Id: G4UrbanMscModel.cc,v 1.86 2008/10/29 14:15:30 vnivanch Exp $
27// GEANT4 tag $Name: geant4-09-02-ref-02 $
28//
29// -------------------------------------------------------------------
30//
31// GEANT4 Class file
32//
33//
34// File name:   G4UrbanMscModel
35//
36// Author:      Laszlo Urban
37//
38// Creation date: 03.03.2001
39//
40// Modifications:
41//
42// 27-03-03 Move model part from G4MultipleScattering80 (V.Ivanchenko)
43// 23-05-03 important change in angle distribution for muons/hadrons
44//          the central part now is similar to the Highland parametrization +
45//          minor correction in angle sampling algorithm (for all particles)
46//          (L.Urban)
47// 30-05-03 misprint in SampleCosineTheta corrected(L.Urban)
48// 27-03-03 Rename (V.Ivanchenko)
49// 05-08-03 angle distribution has been modified (L.Urban)
50// 06-11-03 precision problems solved for high energy (PeV) particles
51//          change in the tail of the angular distribution
52//          highKinEnergy is set to 100 PeV (L.Urban)
53//
54// 10-11-03 highKinEnergy is set back to 100 TeV, some tail tuning +
55//          cleaning (L.Urban)
56// 26-11-03 correction in TrueStepLength :
57//          trueLength <= currentRange (L.Urban)
58// 01-03-04 signature changed in SampleCosineTheta,
59//          energy dependence calculations has been simplified,
60// 11-03-04 corrections in GeomPathLength,TrueStepLength,
61//          SampleCosineTheta
62// 23-04-04 true -> geom and geom -> true transformation has been
63//          rewritten, changes in the angular distribution (L.Urban)
64// 19-07-04 correction in SampleCosineTheta in order to avoid
65//          num. precision problems at high energy/small step(L.Urban)
66// 17-08-04 changes in the angle distribution (slightly modified
67//          Highland formula for the width of the central part,
68//          changes in the numerical values of some other parameters)
69//          ---> approximately step independent distribution (L.Urban)
70// 21-09-04 change in the tail of the angular distribution (L.Urban)
71//
72// 03-11-04 precision problem for very high energy ions and small stepsize
73//          solved in SampleCosineTheta (L.Urban).
74// 15-04-05 optimize internal interface
75//          add SampleSecondaries method (V.Ivanchenko)
76// 11-08-05 computation of lateral correlation added (L.Urban)
77// 02-10-05 nuclear size correction computation removed, the correction
78//          included in the (theoretical) tabulated values (L.Urban)
79// 17-01-06 computation of tail changed in SampleCosineTheta (l.Urban)
80// 16-02-06 code cleaning + revised 'z' sampling (L.Urban)
81// 17-02-06 Save table of transport cross sections not mfp (V.Ivanchenko)
82// 07-03-06 Create G4UrbanMscModel and move there step limit
83//           calculation (V.Ivanchenko)
84// 23-03-06 Bugfix in SampleCosineTheta method (L.Urban)
85// 10-05-06 SetMscStepLimitation at initialisation (V.Ivantchenko)
86// 11-05-06 name of data member safety changed to presafety, some new data
87//          members added (frscaling1,frscaling2,tlimitminfix,nstepmax)
88//          changes in ComputeTruePathLengthLimit,SampleCosineTheta (L.Urban)
89// 17-05-06 parameters of theta0 in SampleCosineTheta changed
90//          c_highland  13.6*MeV ---> 13.26*MeV,
91//          corr_highland  0.555 ---> 0.54,
92//          value of data member geommin changed (5 nm -> 1 nm) (L.Urban)
93// 13-10-06 data member factail removed, data member tkinlimit changed
94//          to lambdalimit,
95//          new data members tgeom,tnow,skin,skindepth,Zeff,geomlimit
96//          G4double GeomLimit(const G4Track& track) changed to
97//              void GeomLimit(const G4Track& track)
98//        - important changes in ComputeTruePathLengthLimit:
99//          possibility to have very small step(s) with single scattering
100//          before boundary crossing (with skin > 0)
101//        - changes in SampleCosineTheta :
102//          single scattering if step <= stepmin, parameter theta0
103//          slightly modified, tail modified (L.Urban)
104// 20-10-06 parameter theta0 now computed in the (public)
105//          function ComputeTheta0,
106//          single scattering modified allowing not small
107//          angles as well (L.Urban)
108// 23-10-06 correction in SampleSecondaries, now safety update
109//          computed in a simpler/faster way (L.Urban)
110// 06-11-06 corrections in ComputeTruePathLengthLimit, results are
111//          more stable in calorimeters (L.Urban)
112// 07-11-06 fix in GeomPathLength and SampleCosineTheta (L.Urban)
113// 15-11-06 bugfix in SampleCosineTheta (L.Urban)
114// 20-11-06 bugfix in single scattering part of SampleCosineTheta,
115//          single scattering just before boundary crossing now (L.Urban)
116// 04-12-06 fix in ComputeTruePathLengthLimit (L.Urban)
117// 17-01-07 remove LocatePoint from GeomLimit method (V.Ivanchenko)
118// 19-01-07 fix of true < geom problem (L.Urban)
119// 25-01-07 add protections from NaN vaues and for zero geometry step (VI)
120// 31-01-07 correction in SampleCosineTheta: screening parameter
121//          corrected in single/plural scattering +
122//          code cleaning (L.Urban)
123// 01-02-07 restore logic inside ComputeTrueStepLength (V.Ivanchenko)
124// 06-02-07 Move SetMscStepLimitation method into the source, add there
125//          reinitialisation of some private members, add protection inside
126//          SampleDisplacement(VI)
127// 07-02-07 fix single scattering for heavy particles, now skin=1 can be used
128//          for heavy particles as well (L.Urban)
129// 08-02-07 randomization of tlimit removed (L.Urban)
130// 11-02-07 modified stepping algorithm for skin=0
131// 15-02-07 new data member: smallstep, small steps with single scattering
132//          before + after boundary for skin > 1
133// 23-02-07 use tPathLength inside ComputeStep instead of geombig
134// 24-02-07 step reduction before boundary for 'small' geomlimit only
135// 03-03-07 single scattering around boundaries only (L.Urban)
136// 07-03-07 bugfix in ComputeTruePathLengthLimit (for skin > 0.) (L.Urban)
137// 10-04-07 optimize logic of ComputeTruePathLengthLimit, remove
138//          unused members, use unique G4SafetyHelper (V.Ivanchenko)
139// 01-05-07 optimization for skin > 0 (L.Urban)
140// 05-07-07 modified model functions in SampleCosineTheta (L.Urban)
141// 06-07-07 theta0 is not the same for e-/e+ as for heavy particles (L.Urban)
142// 02-08-07 compare safety not with 0. but with tlimitminfix (V.Ivanchenko)
143// 09-08-07 tail of angular distribution has been modified (L.Urban)
144// 22-10-07 - corr. in ComputeGeomPathLength in order to get better low
145//          energy behaviour for heavy particles,
146//          - theta0 is slightly modified,
147//          - some old inconsistency/bug is cured in SampleCosineTheta,
148//          now 0 <= prob <= 1 in any case (L.Urban)
149// 26-10-07 different correction parameters for e/mu/hadrons in ComputeTheta0
150// 30-11-07 fix in ComputeTheta0 (L.Urban)
151//
152
153// Class Description:
154//
155// Implementation of the model of multiple scattering based on
156// H.W.Lewis Phys Rev 78 (1950) 526 and others
157
158// -------------------------------------------------------------------
159//
160
161
162//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
163//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
164
165#include "G4UrbanMscModel.hh"
166#include "Randomize.hh"
167#include "G4Electron.hh"
168
169#include "G4LossTableManager.hh"
170#include "G4ParticleChangeForMSC.hh"
171#include "G4TransportationManager.hh"
172#include "G4SafetyHelper.hh"
173
174#include "G4Poisson.hh"
175
176//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
177
178using namespace std;
179
180G4UrbanMscModel::G4UrbanMscModel(const G4String& nam)
181  : G4VMscModel(nam),
182    isInitialized(false)
183{
184  masslimite  = 0.6*MeV;
185  masslimitmu = 110.*MeV;
186
187  taubig        = 8.0;
188  tausmall      = 1.e-16;
189  taulim        = 1.e-6;
190  currentTau    = taulim;
191  tlimitminfix  = 1.e-6*mm;           
192  stepmin       = tlimitminfix;
193  smallstep     = 1.e10;
194  currentRange  = 0. ;
195  frscaling2    = 0.25;
196  frscaling1    = 1.-frscaling2;
197  tlimit        = 1.e10*mm;
198  tlimitmin     = 10.*tlimitminfix;           
199  nstepmax      = 25.;
200  geombig       = 1.e50*mm;
201  geommin       = 1.e-3*mm;
202  geomlimit     = geombig;
203  presafety     = 0.*mm;
204  Zeff          = 1.;
205  particle      = 0;
206  theManager    = G4LossTableManager::Instance(); 
207  inside        = false; 
208  insideskin    = false;
209
210}
211
212//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
213
214G4UrbanMscModel::~G4UrbanMscModel()
215{}
216
217//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
218
219void G4UrbanMscModel::Initialise(const G4ParticleDefinition* p,
220                                 const G4DataVector&)
221{
222  skindepth = skin*stepmin;
223  if(isInitialized) return;
224
225  // set values of some data members
226  SetParticle(p);
227
228  if (pParticleChange)
229   fParticleChange = reinterpret_cast<G4ParticleChangeForMSC*>(pParticleChange);
230  else
231   fParticleChange = new G4ParticleChangeForMSC();
232
233  safetyHelper = G4TransportationManager::GetTransportationManager()
234    ->GetSafetyHelper();
235  safetyHelper->InitialiseHelper();
236
237  isInitialized = true;
238}
239
240//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
241
242G4double G4UrbanMscModel::ComputeCrossSectionPerAtom( 
243                             const G4ParticleDefinition* part,
244                                   G4double KineticEnergy,
245                                   G4double AtomicNumber,G4double,
246                                   G4double, G4double)
247{
248  const G4double sigmafactor = twopi*classic_electr_radius*classic_electr_radius;
249  const G4double epsfactor = 2.*electron_mass_c2*electron_mass_c2*
250                            Bohr_radius*Bohr_radius/(hbarc*hbarc);
251  const G4double epsmin = 1.e-4 , epsmax = 1.e10;
252
253  const G4double Zdat[15] = { 4.,  6., 13., 20., 26., 29., 32., 38., 47.,
254                             50., 56., 64., 74., 79., 82. };
255
256  const G4double Tdat[22] = { 100*eV,  200*eV,  400*eV,  700*eV,
257                               1*keV,   2*keV,   4*keV,   7*keV,
258                              10*keV,  20*keV,  40*keV,  70*keV,
259                             100*keV, 200*keV, 400*keV, 700*keV,
260                               1*MeV,   2*MeV,   4*MeV,   7*MeV,
261                              10*MeV,  20*MeV};
262
263  // corr. factors for e-/e+ lambda for T <= Tlim
264          G4double celectron[15][22] =
265          {{1.125,1.072,1.051,1.047,1.047,1.050,1.052,1.054,
266            1.054,1.057,1.062,1.069,1.075,1.090,1.105,1.111,
267            1.112,1.108,1.100,1.093,1.089,1.087            },
268           {1.408,1.246,1.143,1.096,1.077,1.059,1.053,1.051,
269            1.052,1.053,1.058,1.065,1.072,1.087,1.101,1.108,
270            1.109,1.105,1.097,1.090,1.086,1.082            },
271           {2.833,2.268,1.861,1.612,1.486,1.309,1.204,1.156,
272            1.136,1.114,1.106,1.106,1.109,1.119,1.129,1.132,
273            1.131,1.124,1.113,1.104,1.099,1.098            },
274           {3.879,3.016,2.380,2.007,1.818,1.535,1.340,1.236,
275            1.190,1.133,1.107,1.099,1.098,1.103,1.110,1.113,
276            1.112,1.105,1.096,1.089,1.085,1.098            },
277           {6.937,4.330,2.886,2.256,1.987,1.628,1.395,1.265,
278            1.203,1.122,1.080,1.065,1.061,1.063,1.070,1.073,
279            1.073,1.070,1.064,1.059,1.056,1.056            },
280           {9.616,5.708,3.424,2.551,2.204,1.762,1.485,1.330,
281            1.256,1.155,1.099,1.077,1.070,1.068,1.072,1.074,
282            1.074,1.070,1.063,1.059,1.056,1.052            },
283           {11.72,6.364,3.811,2.806,2.401,1.884,1.564,1.386,
284            1.300,1.180,1.112,1.082,1.073,1.066,1.068,1.069,
285            1.068,1.064,1.059,1.054,1.051,1.050            },
286           {18.08,8.601,4.569,3.183,2.662,2.025,1.646,1.439,
287            1.339,1.195,1.108,1.068,1.053,1.040,1.039,1.039,
288            1.039,1.037,1.034,1.031,1.030,1.036            },
289           {18.22,10.48,5.333,3.713,3.115,2.367,1.898,1.631,
290            1.498,1.301,1.171,1.105,1.077,1.048,1.036,1.033,
291            1.031,1.028,1.024,1.022,1.021,1.024            },
292           {14.14,10.65,5.710,3.929,3.266,2.453,1.951,1.669,
293            1.528,1.319,1.178,1.106,1.075,1.040,1.027,1.022,
294            1.020,1.017,1.015,1.013,1.013,1.020            },
295           {14.11,11.73,6.312,4.240,3.478,2.566,2.022,1.720,
296            1.569,1.342,1.186,1.102,1.065,1.022,1.003,0.997,
297            0.995,0.993,0.993,0.993,0.993,1.011            },
298           {22.76,20.01,8.835,5.287,4.144,2.901,2.219,1.855,
299            1.677,1.410,1.224,1.121,1.073,1.014,0.986,0.976,
300            0.974,0.972,0.973,0.974,0.975,0.987            },
301           {50.77,40.85,14.13,7.184,5.284,3.435,2.520,2.059,
302            1.837,1.512,1.283,1.153,1.091,1.010,0.969,0.954,
303            0.950,0.947,0.949,0.952,0.954,0.963            },
304           {65.87,59.06,15.87,7.570,5.567,3.650,2.682,2.182,
305            1.939,1.579,1.325,1.178,1.108,1.014,0.965,0.947,
306            0.941,0.938,0.940,0.944,0.946,0.954            },
307           {55.60,47.34,15.92,7.810,5.755,3.767,2.760,2.239,
308            1.985,1.609,1.343,1.188,1.113,1.013,0.960,0.939,
309            0.933,0.930,0.933,0.936,0.939,0.949            }};
310           
311           G4double cpositron[15][22] = {
312           {2.589,2.044,1.658,1.446,1.347,1.217,1.144,1.110,
313            1.097,1.083,1.080,1.086,1.092,1.108,1.123,1.131,
314            1.131,1.126,1.117,1.108,1.103,1.100            },
315           {3.904,2.794,2.079,1.710,1.543,1.325,1.202,1.145,
316            1.122,1.096,1.089,1.092,1.098,1.114,1.130,1.137,
317            1.138,1.132,1.122,1.113,1.108,1.102            },
318           {7.970,6.080,4.442,3.398,2.872,2.127,1.672,1.451,
319            1.357,1.246,1.194,1.179,1.178,1.188,1.201,1.205,
320            1.203,1.190,1.173,1.159,1.151,1.145            },
321           {9.714,7.607,5.747,4.493,3.815,2.777,2.079,1.715,
322            1.553,1.353,1.253,1.219,1.211,1.214,1.225,1.228,
323            1.225,1.210,1.191,1.175,1.166,1.174            },
324           {17.97,12.95,8.628,6.065,4.849,3.222,2.275,1.820,
325            1.624,1.382,1.259,1.214,1.202,1.202,1.214,1.219,
326            1.217,1.203,1.184,1.169,1.160,1.151            },
327           {24.83,17.06,10.84,7.355,5.767,3.707,2.546,1.996,
328            1.759,1.465,1.311,1.252,1.234,1.228,1.238,1.241,
329            1.237,1.222,1.201,1.184,1.174,1.159            },
330           {23.26,17.15,11.52,8.049,6.375,4.114,2.792,2.155,
331            1.880,1.535,1.353,1.281,1.258,1.247,1.254,1.256,
332            1.252,1.234,1.212,1.194,1.183,1.170            },
333           {22.33,18.01,12.86,9.212,7.336,4.702,3.117,2.348,
334            2.015,1.602,1.385,1.297,1.268,1.251,1.256,1.258,
335            1.254,1.237,1.214,1.195,1.185,1.179            },
336           {33.91,24.13,15.71,10.80,8.507,5.467,3.692,2.808,
337            2.407,1.873,1.564,1.425,1.374,1.330,1.324,1.320,
338            1.312,1.288,1.258,1.235,1.221,1.205            },
339           {32.14,24.11,16.30,11.40,9.015,5.782,3.868,2.917,
340            2.490,1.925,1.596,1.447,1.391,1.342,1.332,1.327,
341            1.320,1.294,1.264,1.240,1.226,1.214            },
342           {29.51,24.07,17.19,12.28,9.766,6.238,4.112,3.066,
343            2.602,1.995,1.641,1.477,1.414,1.356,1.342,1.336,
344            1.328,1.302,1.270,1.245,1.231,1.233            },
345           {38.19,30.85,21.76,15.35,12.07,7.521,4.812,3.498,
346            2.926,2.188,1.763,1.563,1.484,1.405,1.382,1.371,
347            1.361,1.330,1.294,1.267,1.251,1.239            },
348           {49.71,39.80,27.96,19.63,15.36,9.407,5.863,4.155,
349            3.417,2.478,1.944,1.692,1.589,1.480,1.441,1.423,
350            1.409,1.372,1.330,1.298,1.280,1.258            },
351           {59.25,45.08,30.36,20.83,16.15,9.834,6.166,4.407,
352            3.641,2.648,2.064,1.779,1.661,1.531,1.482,1.459,
353            1.442,1.400,1.354,1.319,1.299,1.272            },
354           {56.38,44.29,30.50,21.18,16.51,10.11,6.354,4.542,
355            3.752,2.724,2.116,1.817,1.692,1.554,1.499,1.474,
356            1.456,1.412,1.364,1.328,1.307,1.282            }};
357
358  //data/corrections for T > Tlim 
359  G4double Tlim = 10.*MeV;
360  G4double beta2lim = Tlim*(Tlim+2.*electron_mass_c2)/
361                      ((Tlim+electron_mass_c2)*(Tlim+electron_mass_c2));
362  G4double bg2lim   = Tlim*(Tlim+2.*electron_mass_c2)/
363                      (electron_mass_c2*electron_mass_c2);
364
365  G4double sig0[15] = {0.2672*barn,  0.5922*barn, 2.653*barn,  6.235*barn,
366                      11.69*barn  , 13.24*barn  , 16.12*barn, 23.00*barn ,
367                      35.13*barn  , 39.95*barn  , 50.85*barn, 67.19*barn ,
368                      91.15*barn  , 104.4*barn  , 113.1*barn};
369                                       
370  G4double hecorr[15] = {120.70, 117.50, 105.00, 92.92, 79.23,  74.510,  68.29,
371                          57.39,  41.97,  36.14, 24.53, 10.21,  -7.855, -16.84,
372                         -22.30};
373
374  G4double sigma;
375  SetParticle(part);
376
377  G4double Z23 = 2.*log(AtomicNumber)/3.; Z23 = exp(Z23);
378
379  // correction if particle .ne. e-/e+
380  // compute equivalent kinetic energy
381  // lambda depends on p*beta ....
382
383  G4double eKineticEnergy = KineticEnergy;
384
385  if(mass > electron_mass_c2)
386  {
387    G4double TAU = KineticEnergy/mass ;
388    G4double c = mass*TAU*(TAU+2.)/(electron_mass_c2*(TAU+1.)) ;
389    G4double w = c-2. ;
390    G4double tau = 0.5*(w+sqrt(w*w+4.*c)) ;
391    eKineticEnergy = electron_mass_c2*tau ;
392  }
393
394  G4double ChargeSquare = charge*charge;
395
396  G4double eTotalEnergy = eKineticEnergy + electron_mass_c2 ;
397  G4double beta2 = eKineticEnergy*(eTotalEnergy+electron_mass_c2)
398                                 /(eTotalEnergy*eTotalEnergy);
399  G4double bg2   = eKineticEnergy*(eTotalEnergy+electron_mass_c2)
400                                 /(electron_mass_c2*electron_mass_c2);
401
402  G4double eps = epsfactor*bg2/Z23;
403
404  if     (eps<epsmin)  sigma = 2.*eps*eps;
405  else if(eps<epsmax)  sigma = log(1.+2.*eps)-2.*eps/(1.+2.*eps);
406  else                 sigma = log(2.*eps)-1.+1./eps;
407
408  sigma *= ChargeSquare*AtomicNumber*AtomicNumber/(beta2*bg2);
409
410  // interpolate in AtomicNumber and beta2
411  G4double c1,c2,cc1,cc2,corr;
412
413  // get bin number in Z
414  G4int iZ = 14;
415  while ((iZ>=0)&&(Zdat[iZ]>=AtomicNumber)) iZ -= 1;
416  if (iZ==14)                               iZ = 13;
417  if (iZ==-1)                               iZ = 0 ;
418
419  G4double Z1 = Zdat[iZ];
420  G4double Z2 = Zdat[iZ+1];
421  G4double ratZ = (AtomicNumber-Z1)*(AtomicNumber+Z1)/
422                  ((Z2-Z1)*(Z2+Z1));
423
424  if(eKineticEnergy <= Tlim) 
425  {
426    // get bin number in T (beta2)
427    G4int iT = 21;
428    while ((iT>=0)&&(Tdat[iT]>=eKineticEnergy)) iT -= 1;
429    if(iT==21)                                  iT = 20;
430    if(iT==-1)                                  iT = 0 ;
431
432    //  calculate betasquare values
433    G4double T = Tdat[iT],   E = T + electron_mass_c2;
434    G4double b2small = T*(E+electron_mass_c2)/(E*E);
435
436    T = Tdat[iT+1]; E = T + electron_mass_c2;
437    G4double b2big = T*(E+electron_mass_c2)/(E*E);
438    G4double ratb2 = (beta2-b2small)/(b2big-b2small);
439
440    if (charge < 0.)
441    {
442       c1 = celectron[iZ][iT];
443       c2 = celectron[iZ+1][iT];
444       cc1 = c1+ratZ*(c2-c1);
445
446       c1 = celectron[iZ][iT+1];
447       c2 = celectron[iZ+1][iT+1];
448       cc2 = c1+ratZ*(c2-c1);
449
450       corr = cc1+ratb2*(cc2-cc1);
451
452       sigma *= sigmafactor/corr;
453    }
454    else             
455    {
456       c1 = cpositron[iZ][iT];
457       c2 = cpositron[iZ+1][iT];
458       cc1 = c1+ratZ*(c2-c1);
459
460       c1 = cpositron[iZ][iT+1];
461       c2 = cpositron[iZ+1][iT+1];
462       cc2 = c1+ratZ*(c2-c1);
463
464       corr = cc1+ratb2*(cc2-cc1);
465
466       sigma *= sigmafactor/corr;
467    }
468  }
469  else
470  {
471    c1 = bg2lim*sig0[iZ]*(1.+hecorr[iZ]*(beta2-beta2lim))/bg2;
472    c2 = bg2lim*sig0[iZ+1]*(1.+hecorr[iZ+1]*(beta2-beta2lim))/bg2;
473    if((AtomicNumber >= Z1) && (AtomicNumber <= Z2))
474      sigma = c1+ratZ*(c2-c1) ;
475    else if(AtomicNumber < Z1)
476      sigma = AtomicNumber*AtomicNumber*c1/(Z1*Z1);
477    else if(AtomicNumber > Z2)
478      sigma = AtomicNumber*AtomicNumber*c2/(Z2*Z2);
479  }
480  return sigma;
481
482}
483
484//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
485
486G4double G4UrbanMscModel::ComputeTruePathLengthLimit(
487                             const G4Track& track,
488                             G4PhysicsTable* theTable,
489                             G4double currentMinimalStep)
490{
491  tPathLength = currentMinimalStep;
492  const G4DynamicParticle* dp = track.GetDynamicParticle();
493  G4StepPoint* sp = track.GetStep()->GetPreStepPoint();
494  G4StepStatus stepStatus = sp->GetStepStatus();
495
496  if(stepStatus == fUndefined) {
497    inside = false;
498    insideskin = false;
499    tlimit = geombig;
500    SetParticle( dp->GetDefinition() );
501  }
502
503  theLambdaTable = theTable;
504  couple = track.GetMaterialCutsCouple();
505  currentMaterialIndex = couple->GetIndex();
506  currentKinEnergy = dp->GetKineticEnergy();
507  currentRange = 
508    theManager->GetRangeFromRestricteDEDX(particle,currentKinEnergy,couple);
509  lambda0 = GetLambda(currentKinEnergy);
510
511  // stop here if small range particle
512  if(inside) return tPathLength;           
513 
514  if(tPathLength > currentRange) tPathLength = currentRange;
515
516  presafety = sp->GetSafety();
517
518  //  G4cout << "G4UrbanMscModel::ComputeTruePathLengthLimit tPathLength= "
519  //     <<tPathLength<<" safety= " << presafety
520  //     << " range= " <<currentRange<<G4endl;
521
522  // far from geometry boundary
523  if(currentRange < presafety)
524    {
525      inside = true;
526      return tPathLength; 
527    }
528
529  // standard  version
530  //
531  if (steppingAlgorithm == fUseDistanceToBoundary)
532    {
533      //compute geomlimit and presafety
534      GeomLimit(track);
535
536      // is far from boundary
537      if(currentRange <= presafety)
538        {
539          inside = true;
540          return tPathLength;   
541        }
542
543      smallstep += 1.;
544      insideskin = false;
545
546      if((stepStatus == fGeomBoundary) || (stepStatus == fUndefined))
547        {
548          if(stepStatus == fUndefined) smallstep = 1.e10;
549          else  smallstep = 1.;
550
551          // facrange scaling in lambda
552          // not so strong step restriction above lambdalimit
553          G4double facr = facrange;
554          if(lambda0 > lambdalimit)
555            facr *= frscaling1+frscaling2*lambda0/lambdalimit;
556
557          // constraint from the physics
558          if (currentRange > lambda0) tlimit = facr*currentRange;
559          else                        tlimit = facr*lambda0;
560
561          if(tlimit > currentRange) tlimit = currentRange;
562
563          //define stepmin here (it depends on lambda!)
564          //rough estimation of lambda_elastic/lambda_transport
565          G4double rat = currentKinEnergy/MeV ;
566          rat = 1.e-3/(rat*(10.+rat)) ;
567          //stepmin ~ lambda_elastic
568          stepmin = rat*lambda0;
569          skindepth = skin*stepmin;
570
571          //define tlimitmin
572          tlimitmin = 10.*stepmin;
573          if(tlimitmin < tlimitminfix) tlimitmin = tlimitminfix;
574
575          //lower limit for tlimit
576          if(tlimit < tlimitmin) tlimit = tlimitmin;
577
578          // constraint from the geometry (if tlimit above is too big)
579          G4double tgeom = geombig; 
580
581          if((geomlimit < geombig) && (geomlimit > geommin))
582            {
583              if(stepStatus == fGeomBoundary) 
584                tgeom = geomlimit/facgeom;
585              else
586                tgeom = 2.*geomlimit/facgeom;
587
588              if(tlimit > tgeom) tlimit = tgeom;
589            }
590        }
591
592      //if track starts far from boundaries increase tlimit!
593      if(tlimit < facsafety*presafety) tlimit = facsafety*presafety ;
594
595      //  G4cout << "tgeom= " << tgeom << " geomlimit= " << geomlimit 
596      //     << " tlimit= " << tlimit << " presafety= " << presafety << G4endl;
597
598      // shortcut
599      if((tPathLength < tlimit) && (tPathLength < presafety))
600        return tPathLength;   
601
602      G4double tnow = tlimit;
603      // optimization ...
604      if(geomlimit < geombig) tnow = max(tlimit,facsafety*geomlimit);
605
606      // step reduction near to boundary
607      if(smallstep < skin)
608        {
609          tnow = stepmin;
610          insideskin = true;
611        }
612      else if(geomlimit < geombig)
613        {
614          if(geomlimit > skindepth)
615            {
616              if(tnow > geomlimit-0.999*skindepth)
617                tnow = geomlimit-0.999*skindepth;
618            }
619          else
620            {
621              insideskin = true;
622              if(tnow > stepmin) tnow = stepmin;
623            }
624        }
625
626      if(tnow < stepmin) tnow = stepmin;
627
628      if(tPathLength > tnow) tPathLength = tnow ; 
629    }
630    // for 'normal' simulation with or without magnetic field
631    //  there no small step/single scattering at boundaries
632  else if(steppingAlgorithm == fUseSafety)
633    {
634      // compute presafety again if presafety <= 0 and no boundary
635      // i.e. when it is needed for optimization purposes
636      if((stepStatus != fGeomBoundary) && (presafety < tlimitminfix)) 
637        presafety = safetyHelper->ComputeSafety(sp->GetPosition()); 
638
639      // is far from boundary
640      if(currentRange < presafety)
641        {
642          inside = true;
643          return tPathLength; 
644        }
645
646      if((stepStatus == fGeomBoundary) || (stepStatus == fUndefined))
647        { 
648          // facrange scaling in lambda
649          // not so strong step restriction above lambdalimit
650          G4double facr = facrange;
651          if(lambda0 > lambdalimit)
652            facr *= frscaling1+frscaling2*lambda0/lambdalimit;
653
654          // constraint from the physics
655          if (currentRange > lambda0) tlimit = facr*currentRange;
656          else                        tlimit = facr*lambda0;
657
658          //lower limit for tlimit
659          tlimitmin = std::max(tlimitminfix,lambda0/nstepmax);
660          if(tlimit < tlimitmin) tlimit = tlimitmin;
661        }
662
663      //if track starts far from boundaries increase tlimit!
664      if(tlimit < facsafety*presafety) tlimit = facsafety*presafety ;
665
666      if(tPathLength > tlimit) tPathLength = tlimit;
667    }
668 
669  // version similar to 7.1 (needed for some experiments)
670  else
671    {
672      if (stepStatus == fGeomBoundary)
673        {
674          if (currentRange > lambda0) tlimit = facrange*currentRange;
675          else                        tlimit = facrange*lambda0;
676
677          if(tlimit < tlimitmin) tlimit = tlimitmin;
678          if(tPathLength > tlimit) tPathLength = tlimit;
679        }
680    }
681  //  G4cout << "tPathLength= " << tPathLength << "  geomlimit= " << geomlimit
682  //     << " currentMinimalStep= " << currentMinimalStep << G4endl;
683
684  return tPathLength ;
685}
686
687//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
688
689void G4UrbanMscModel::GeomLimit(const G4Track&  track)
690{
691  geomlimit = geombig;
692
693  // no geomlimit for the World volume
694  if((track.GetVolume() != 0) &&
695     (track.GetVolume() != safetyHelper->GetWorldVolume())) 
696  {
697    G4double cstep = currentRange;
698
699    geomlimit = safetyHelper->CheckNextStep(
700                  track.GetStep()->GetPreStepPoint()->GetPosition(),
701                  track.GetMomentumDirection(),
702                  cstep,
703                  presafety);
704    //    G4cout << "!!!G4UrbanMscModel::GeomLimit presafety= " << presafety
705    //     << " limit= " << geomlimit << G4endl;
706  } 
707}
708
709//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
710
711G4double G4UrbanMscModel::ComputeGeomPathLength(G4double)
712{
713  lambdaeff = lambda0;
714  par1 = -1. ; 
715  par2 = par3 = 0. ; 
716
717  //  do the true -> geom transformation
718  zPathLength = tPathLength;
719
720  // z = t for very small tPathLength
721  if(tPathLength < tlimitminfix) return zPathLength;
722
723  // this correction needed to run MSC with eIoni and eBrem inactivated
724  // and makes no harm for a normal run
725  if(tPathLength > currentRange)
726    tPathLength = currentRange ;
727
728  G4double tau   = tPathLength/lambda0 ;
729
730  if ((tau <= tausmall) || insideskin) {
731    zPathLength  = tPathLength;
732    if(zPathLength > lambda0) zPathLength = lambda0;
733    return zPathLength;
734  }
735
736  G4double zmean = tPathLength;
737  if (tPathLength < currentRange*dtrl) {
738    if(tau < taulim) zmean = tPathLength*(1.-0.5*tau) ;
739    else             zmean = lambda0*(1.-exp(-tau));
740  } else if(currentKinEnergy < mass)  {
741    par1 = 1./currentRange ;
742    par2 = 1./(par1*lambda0) ;
743    par3 = 1.+par2 ;
744    if(tPathLength < currentRange)
745      zmean = (1.-exp(par3*log(1.-tPathLength/currentRange)))/(par1*par3) ;
746    else
747      zmean = 1./(par1*par3) ;
748  } else {
749    G4double T1 = theManager->GetEnergy(particle,currentRange-tPathLength,couple);
750    G4double lambda1 = GetLambda(T1);
751
752    par1 = (lambda0-lambda1)/(lambda0*tPathLength) ;
753    par2 = 1./(par1*lambda0) ;
754    par3 = 1.+par2 ;
755    zmean = (1.-exp(par3*log(lambda1/lambda0)))/(par1*par3) ;
756  }
757
758  zPathLength = zmean ;
759
760  //  sample z
761  if(samplez)
762  {
763    const G4double  ztmax = 0.99, onethird = 1./3. ;
764    G4double zt = zmean/tPathLength ;
765
766    if (tPathLength > stepmin && zt < ztmax)             
767    {
768      G4double u,cz1;
769      if(zt >= onethird)
770      {
771        G4double cz = 0.5*(3.*zt-1.)/(1.-zt) ;
772        cz1 = 1.+cz ;
773        G4double u0 = cz/cz1 ;
774        G4double grej ;
775        do {
776            u = exp(log(G4UniformRand())/cz1) ;
777            grej = exp(cz*log(u/u0))*(1.-u)/(1.-u0) ;
778           } while (grej < G4UniformRand()) ;
779      }
780      else
781      {
782        cz1 = 1./zt-1.;
783        u = 1.-exp(log(G4UniformRand())/cz1) ;
784      }
785      zPathLength = tPathLength*u ;
786    }
787  }
788
789  if(zPathLength > lambda0) zPathLength = lambda0;
790
791  return zPathLength;
792}
793
794//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
795
796G4double G4UrbanMscModel::ComputeTrueStepLength(G4double geomStepLength)
797{
798  // step defined other than transportation
799  if(geomStepLength == zPathLength && tPathLength <= currentRange)
800    return tPathLength;
801
802  // t = z for very small step
803  zPathLength = geomStepLength;
804  tPathLength = geomStepLength;
805  if(geomStepLength < tlimitminfix) return tPathLength;
806 
807  // recalculation
808  if((geomStepLength > lambda0*tausmall) && !insideskin)
809  {
810    if(par1 <  0.)
811      tPathLength = -lambda0*log(1.-geomStepLength/lambda0) ;
812    else 
813    {
814      if(par1*par3*geomStepLength < 1.)
815        tPathLength = (1.-exp(log(1.-par1*par3*geomStepLength)/par3))/par1 ;
816      else 
817        tPathLength = currentRange;
818    } 
819  }
820  if(tPathLength < geomStepLength) tPathLength = geomStepLength;
821
822  return tPathLength;
823}
824
825//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
826
827G4double G4UrbanMscModel::ComputeTheta0(G4double trueStepLength,
828                                        G4double KineticEnergy)
829{
830  // for all particles take the width of the central part
831  //  from a  parametrization similar to the Highland formula
832  // ( Highland formula: Particle Physics Booklet, July 2002, eq. 26.10)
833  const G4double c_highland = 13.6*MeV ;
834  G4double betacp = sqrt(currentKinEnergy*(currentKinEnergy+2.*mass)*
835                         KineticEnergy*(KineticEnergy+2.*mass)/
836                      ((currentKinEnergy+mass)*(KineticEnergy+mass)));
837  G4double y = trueStepLength/currentRadLength;
838  G4double theta0 = c_highland*std::abs(charge)*sqrt(y)/betacp;
839  y = log(y);
840  if(mass < masslimite)                 
841    theta0 *= (1.+0.051*y);
842  else if(mass < masslimitmu)
843    theta0 *= (1.+0.044*y);
844  else
845    theta0 *= (1.+0.038*y);
846   
847  return theta0;
848}
849
850//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
851
852void G4UrbanMscModel::SampleScattering(const G4DynamicParticle* dynParticle,
853                                       G4double safety)
854{
855  G4double kineticEnergy = dynParticle->GetKineticEnergy();
856  if((kineticEnergy <= 0.0) || (tPathLength <= tlimitminfix) ||
857     (tPathLength/tausmall < lambda0) ) return;
858
859  G4double cth  = SampleCosineTheta(tPathLength,kineticEnergy);
860  // protection against 'bad' cth values
861  if(abs(cth) > 1.) return;
862
863  G4double sth  = sqrt((1.0 - cth)*(1.0 + cth));
864  G4double phi  = twopi*G4UniformRand();
865  G4double dirx = sth*cos(phi);
866  G4double diry = sth*sin(phi);
867
868  G4ThreeVector oldDirection = dynParticle->GetMomentumDirection();
869  G4ThreeVector newDirection(dirx,diry,cth);
870  newDirection.rotateUz(oldDirection);
871  fParticleChange->ProposeMomentumDirection(newDirection);
872
873  if (latDisplasment && safety > tlimitminfix) {
874
875    G4double r = SampleDisplacement();
876/*
877    G4cout << "G4UrbanMscModel::SampleSecondaries: e(MeV)= " << kineticEnergy
878           << " sinTheta= " << sth << " r(mm)= " << r
879           << " trueStep(mm)= " << tPathLength
880           << " geomStep(mm)= " << zPathLength
881           << G4endl;
882*/
883    if(r > 0.)
884      {
885        G4double latcorr = LatCorrelation();
886        if(latcorr > r) latcorr = r;
887
888        // sample direction of lateral displacement
889        // compute it from the lateral correlation
890        G4double Phi = 0.;
891        if(std::abs(r*sth) < latcorr) {
892          Phi  = twopi*G4UniformRand();
893        } else {
894          G4double psi = std::acos(latcorr/(r*sth));
895          if(G4UniformRand() < 0.5) Phi = phi+psi;
896          else                      Phi = phi-psi;
897        }
898
899        dirx = std::cos(Phi);
900        diry = std::sin(Phi);
901
902        G4ThreeVector latDirection(dirx,diry,0.0);
903        latDirection.rotateUz(oldDirection);
904
905        G4ThreeVector Position = *(fParticleChange->GetProposedPosition());
906        G4double fac = 1.;
907        if(r >  safety) {
908          //  ******* so safety is computed at boundary too ************
909          G4double newsafety = safetyHelper->ComputeSafety(Position);
910          if(r > newsafety)
911            fac = newsafety/r ;
912        } 
913
914        if(fac > 0.)
915        {
916          // compute new endpoint of the Step
917          G4ThreeVector newPosition = Position+fac*r*latDirection;
918
919          // definitely not on boundary
920          if(1. == fac) {
921            safetyHelper->ReLocateWithinVolume(newPosition);
922           
923          } else {
924            // check safety after displacement
925            G4double postsafety = safetyHelper->ComputeSafety(newPosition);
926
927            // displacement to boundary
928            // if(postsafety < tlimitminfix) {
929            if(postsafety <= 0.0) {
930              safetyHelper->Locate(newPosition, newDirection);
931
932            // not on the boundary
933            } else { 
934              safetyHelper->ReLocateWithinVolume(newPosition);
935            }
936          }
937          fParticleChange->ProposePosition(newPosition);
938        } 
939     }
940  }
941}
942
943//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
944
945G4double G4UrbanMscModel::SampleCosineTheta(G4double trueStepLength,
946                                            G4double KineticEnergy)
947{
948  G4double cth = 1. ;
949  G4double tau = trueStepLength/lambda0 ;
950
951  Zeff = couple->GetMaterial()->GetTotNbOfElectPerVolume()/
952         couple->GetMaterial()->GetTotNbOfAtomsPerVolume() ;
953
954  if(insideskin)
955  {
956    //no scattering, single or plural scattering
957    G4double mean = trueStepLength/stepmin ;
958
959    G4int n = G4Poisson(mean);
960    if(n > 0)
961    {
962      G4double tm = KineticEnergy/electron_mass_c2;
963      // ascr - screening parameter
964      G4double ascr = exp(log(Zeff)/3.)/(137.*sqrt(tm*(tm+2.)));
965      G4double ascr1 = 1.+0.5*ascr*ascr;
966      G4double bp1=ascr1+1.;
967      G4double bm1=ascr1-1.;
968      // single scattering from screened Rutherford x-section
969      G4double ct,st,phi;
970      G4double sx=0.,sy=0.,sz=0.;
971      for(G4int i=1; i<=n; i++)
972      {
973        ct = ascr1-bp1*bm1/(2.*G4UniformRand()+bm1);
974        if(ct < -1.) ct = -1.;
975        if(ct >  1.) ct =  1.; 
976        st = sqrt(1.-ct*ct);
977        phi = twopi*G4UniformRand();
978        sx += st*cos(phi);
979        sy += st*sin(phi);
980        sz += ct;
981      }
982      cth = sz/sqrt(sx*sx+sy*sy+sz*sz);
983    }
984  }
985  else
986  {
987    if(trueStepLength >= currentRange*dtrl) 
988    {
989      if(par1*trueStepLength < 1.)
990        tau = -par2*log(1.-par1*trueStepLength) ;
991      // for the case if ioni/brems are inactivated
992      // see the corresponding condition in ComputeGeomPathLength
993      else if(1.-KineticEnergy/currentKinEnergy > taulim)
994        tau = taubig ;
995    }
996    currentTau = tau ;
997    lambdaeff = trueStepLength/currentTau;
998    currentRadLength = couple->GetMaterial()->GetRadlen();
999
1000    if (tau >= taubig) cth = -1.+2.*G4UniformRand();
1001    else if (tau >= tausmall)
1002    {
1003      G4double b=2.,bp1=3.,bm1=1.;
1004      G4double prob = 0. ;
1005      G4double a = 1., ea = 0., eaa = 1.;
1006      G4double xmean1 = 1., xmean2 = 0.;
1007                                                     
1008      G4double theta0 = ComputeTheta0(trueStepLength,KineticEnergy);
1009
1010      // protexction for very small angles
1011      if(theta0 < tausmall) return cth;
1012
1013      G4double sth = sin(0.5*theta0);
1014      a = 0.25/(sth*sth);
1015
1016      ea = exp(-2.*a);
1017      eaa = 1.-ea ; 
1018      xmean1 = (1.+ea)/eaa-1./a;
1019
1020      G4double xmeanth = exp(-tau);
1021      b = 1./xmeanth ;                               
1022      bp1 = b+1.;
1023      bm1 = b-1.;
1024      // protection
1025      if(bm1 > 0.)
1026        xmean2 = b-0.5*bp1*bm1*log(bp1/bm1);
1027      else
1028      {
1029        b = 1.+tau;
1030        bp1 = 2.+tau;
1031        bm1 = tau;
1032        xmean2 = 1.+tau*(1.-log(2./tau));
1033      }
1034
1035      if((xmean1 >= xmeanth) && (xmean2 <= xmeanth))
1036      {
1037        //normal case
1038        prob = (xmeanth-xmean2)/(xmean1-xmean2);
1039      }
1040      else
1041      {
1042        // x1 < xth ( x2 < xth automatically if b = 1/xth)
1043        // correct a (xmean1)
1044        if((xmeanth-xmean1)/xmeanth < 1.e-5)
1045        {   
1046          // xmean1 is small probably due to precision problems
1047          xmean1 = 0.50*(1.+xmeanth);
1048          prob = (xmeanth-xmean2)/(xmean1-xmean2);
1049        }
1050        else
1051        {
1052          //  correct a in order to have x1=xth
1053          G4int i=0, imax=10;
1054          do
1055          {
1056            a = 1./(1.-xmeanth+2.*ea/eaa);
1057            ea = exp(-2.*a);
1058            eaa = 1.-ea;
1059            xmean1 = (1.+ea)/eaa-1./a;
1060            i += 1;
1061          } while ((std::abs((xmeanth-xmean1)/xmeanth) > 0.05) && (i < imax));
1062          prob = 1.;         
1063        }
1064      }
1065
1066      // sampling of costheta
1067      if (G4UniformRand() < prob)
1068         cth = 1.+log(ea+G4UniformRand()*eaa)/a ;
1069      else
1070         cth = b-bp1*bm1/(bm1+2.*G4UniformRand()) ;
1071    }
1072  } 
1073  return cth ;
1074}
1075
1076//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
1077
1078G4double G4UrbanMscModel::SampleDisplacement()
1079{
1080  const G4double kappa = 2.5;
1081  const G4double kappapl1 = kappa+1.;
1082  const G4double kappami1 = kappa-1.;
1083  G4double rmean = 0.0;
1084  if ((currentTau >= tausmall) && !insideskin) {
1085    if (currentTau < taulim) {
1086      rmean = kappa*currentTau*currentTau*currentTau*
1087             (1.-kappapl1*currentTau*0.25)/6. ;
1088
1089    } else {
1090      G4double etau = 0.0;
1091      if (currentTau<taubig) etau = exp(-currentTau);
1092      rmean = -kappa*currentTau;
1093      rmean = -exp(rmean)/(kappa*kappami1);
1094      rmean += currentTau-kappapl1/kappa+kappa*etau/kappami1;
1095    }
1096    if (rmean>0.) rmean = 2.*lambdaeff*sqrt(rmean/3.0);
1097    else          rmean = 0.;
1098  }
1099
1100  // protection against z > t ...........................
1101  if(rmean > 0.) {
1102    G4double zt = (tPathLength-zPathLength)*(tPathLength+zPathLength);
1103    if(zt <= 0.)
1104      rmean = 0.;
1105    else if(rmean*rmean > zt)
1106      rmean = sqrt(zt);
1107  }
1108  return rmean;
1109}
1110
1111//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
1112
1113G4double G4UrbanMscModel::LatCorrelation()
1114{
1115  const G4double kappa = 2.5;
1116  const G4double kappami1 = kappa-1.;
1117
1118  G4double latcorr = 0.;
1119  if((currentTau >= tausmall) && !insideskin)
1120  {
1121    if(currentTau < taulim)
1122      latcorr = lambdaeff*kappa*currentTau*currentTau*
1123                (1.-(kappa+1.)*currentTau/3.)/3.;
1124    else
1125    {
1126      G4double etau = 0.;
1127      if(currentTau < taubig) etau = exp(-currentTau);
1128      latcorr = -kappa*currentTau;
1129      latcorr = exp(latcorr)/kappami1;
1130      latcorr += 1.-kappa*etau/kappami1 ;
1131      latcorr *= 2.*lambdaeff/3. ;
1132    }
1133  }
1134
1135  return latcorr;
1136}
1137
1138//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
1139
1140void G4UrbanMscModel::SampleSecondaries(std::vector<G4DynamicParticle*>*,
1141                                        const G4MaterialCutsCouple*,
1142                                        const G4DynamicParticle*,
1143                                        G4double,
1144                                        G4double)
1145{}
1146
1147//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Note: See TracBrowser for help on using the repository browser.