Geant4  10.01.p03
G4UrbanMscModel.hh
Go to the documentation of this file.
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: $
27 // GEANT4 tag $Name: $
28 //
29 // -------------------------------------------------------------------
30 //
31 //
32 // GEANT4 Class header file
33 //
34 //
35 // File name: G4UrbanMscModel
36 //
37 // Author: Laszlo Urban
38 //
39 // Creation date: 19.02.2013
40 //
41 // Created from G4UrbanMscModel96
42 //
43 // New parametrization for theta0
44 // Correction for very small step length
45 //
46 // Class Description:
47 //
48 // Implementation of the model of multiple scattering based on
49 // H.W.Lewis Phys Rev 78 (1950) 526 and L.Urban model
50 
51 // -------------------------------------------------------------------
52 //
53 
54 #ifndef G4UrbanMscModel_h
55 #define G4UrbanMscModel_h 1
56 
57 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
58 
59 #include <CLHEP/Units/SystemOfUnits.h>
60 
61 #include "G4VMscModel.hh"
62 #include "G4MscStepLimitType.hh"
63 #include "G4Log.hh"
64 #include "G4Exp.hh"
65 
67 class G4SafetyHelper;
68 class G4LossTableManager;
69 
70 static const G4double c_highland = 13.6*CLHEP::MeV ;
71 
72 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
73 
75 {
76 
77 public:
78 
79  G4UrbanMscModel(const G4String& nam = "UrbanMsc");
80 
81  virtual ~G4UrbanMscModel();
82 
83  void Initialise(const G4ParticleDefinition*, const G4DataVector&);
84 
85  void StartTracking(G4Track*);
86 
88  G4double KineticEnergy,
89  G4double AtomicNumber,
90  G4double AtomicWeight=0.,
91  G4double cut =0.,
92  G4double emax=DBL_MAX);
93 
95 
97  G4double& currentMinimalStep);
98 
99  G4double ComputeGeomPathLength(G4double truePathLength);
100 
101  G4double ComputeTrueStepLength(G4double geomStepLength);
102 
103  inline G4double ComputeTheta0(G4double truePathLength,
104  G4double KineticEnergy);
105 
106 private:
107 
108  G4double SampleCosineTheta(G4double trueStepLength, G4double KineticEnergy);
109 
110  inline void SetParticle(const G4ParticleDefinition*);
111 
112  inline void UpdateCache();
113 
114  inline G4double SimpleScattering(G4double xmeanth, G4double x2meanth);
115 
116  inline G4double LatCorrelation();
117 
118  // hide assignment operator
121 
124 
127 
131 
140 
146 
148 
154 
156 
161 
164 
166 
172 
176 
178 
181 };
182 
183 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
184 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
185 
186 inline
188 {
189  if (p != particle) {
190  particle = p;
191  mass = p->GetPDGMass();
194  }
195 }
196 
197 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
198 
199 inline
201 {
202  lnZ = G4Log(Zeff);
203  // correction in theta0 formula
204  G4double w = G4Exp(lnZ/6.);
205  G4double facz = 0.990395+w*(-0.168386+w*0.093286) ;
206  coeffth1 = facz*(1. - 8.7780e-2/Zeff);
207  coeffth2 = facz*(4.0780e-2 + 1.7315e-4*Zeff);
208 
209  // tail parameters
210  G4double Z13 = w*w;
211  coeffc1 = 2.3785 - Z13*(4.1981e-1 - Z13*6.3100e-2);
212  coeffc2 = 4.7526e-1 + Z13*(1.7694 - Z13*3.3885e-1);
213  coeffc3 = 2.3683e-1 - Z13*(1.8111 - Z13*3.2774e-1);
214  coeffc4 = 1.7888e-2 + Z13*(1.9659e-2 - Z13*2.6664e-3);
215 
216  Z2 = Zeff*Zeff;
217  Z23 = Z13*Z13;
218 
219  Zold = Zeff;
220 }
221 
222 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
223 
224 inline
226  G4double KineticEnergy)
227 {
228  // for all particles take the width of the central part
229  // from a parametrization similar to the Highland formula
230  // ( Highland formula: Particle Physics Booklet, July 2002, eq. 26.10)
231  G4double invbetacp = std::sqrt((currentKinEnergy+mass)*(KineticEnergy+mass)/
233  KineticEnergy*(KineticEnergy+2.*mass)));
234  y = trueStepLength/currentRadLength;
235  G4double theta0 = c_highland*std::abs(charge)*std::sqrt(y)*invbetacp;
236  y = G4Log(y);
237  // correction factor from e- scattering data
238  theta0 *= (coeffth1+coeffth2*y);
239  return theta0;
240 }
241 
242 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
243 
244 inline
246 {
247  // 'large angle scattering'
248  // 2 model functions with correct xmean and x2mean
249  G4double a = (2.*xmeanth+9.*x2meanth-3.)/(2.*xmeanth-3.*x2meanth+1.);
250  G4double prob = (a+2.)*xmeanth/a;
251 
252  // sampling
253  G4double cth = 1.;
254  if(rndmEngineMod->flat() < prob) {
255  cth = -1.+2.*G4Exp(G4Log(rndmEngineMod->flat())/(a+1.));
256  } else {
257  cth = -1.+2.*rndmEngineMod->flat();
258  }
259  return cth;
260 }
261 
262 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
263 
264 inline
266 {
267  static const G4double kappa = 2.5;
268  static const G4double kappami1 = 1.5;
269 
270  G4double latcorr = 0.;
271  if((currentTau >= tausmall) && !insideskin)
272  {
273  if(currentTau < taulim)
274  latcorr = lambdaeff*kappa*currentTau*currentTau*
275  (1.-(kappa+1.)*currentTau*third)*third;
276  else
277  {
278  G4double etau = 0.;
279  if(currentTau < taubig) { etau = G4Exp(-currentTau); }
280  latcorr = -kappa*currentTau;
281  latcorr = G4Exp(latcorr)/kappami1;
282  latcorr += 1.-kappa*etau/kappami1 ;
283  latcorr *= 2.*lambdaeff*third;
284  }
285  }
286  return latcorr;
287 }
288 
289 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
290 
291 #endif
292 
G4ParticleChangeForMSC * fParticleChange
static const double MeV
Definition: G4SIunits.hh:193
G4UrbanMscModel(const G4String &nam="UrbanMsc")
CLHEP::Hep3Vector G4ThreeVector
virtual ~G4UrbanMscModel()
G4ThreeVector & SampleScattering(const G4ThreeVector &, G4double safety)
G4UrbanMscModel & operator=(const G4UrbanMscModel &right)
G4double a
Definition: TRTMaterials.hh:39
const G4ParticleDefinition * particle
G4double currentRadLength
int G4int
Definition: G4Types.hh:78
G4double SampleCosineTheta(G4double trueStepLength, G4double KineticEnergy)
CLHEP::HepRandomEngine * rndmEngineMod
Definition: G4VEmModel.hh:400
bool G4bool
Definition: G4Types.hh:79
G4double ComputeGeomPathLength(G4double truePathLength)
const G4MaterialCutsCouple * couple
G4double ComputeTrueStepLength(G4double geomStepLength)
G4double G4Log(G4double x)
Definition: G4Log.hh:230
G4double G4Exp(G4double initial_x)
Exponential Function double precision.
Definition: G4Exp.hh:183
void SetParticle(const G4ParticleDefinition *)
G4double LatCorrelation()
void Initialise(const G4ParticleDefinition *, const G4DataVector &)
G4LossTableManager * theManager
G4double GetPDGMass() const
static const G4double c_highland
G4double currentKinEnergy
double G4double
Definition: G4Types.hh:76
G4double ComputeTheta0(G4double truePathLength, G4double KineticEnergy)
static const double eplus
Definition: G4SIunits.hh:178
G4double GetPDGCharge() const
#define DBL_MAX
Definition: templates.hh:83
G4double SimpleScattering(G4double xmeanth, G4double x2meanth)
void StartTracking(G4Track *)
G4double ComputeCrossSectionPerAtom(const G4ParticleDefinition *particle, G4double KineticEnergy, G4double AtomicNumber, G4double AtomicWeight=0., G4double cut=0., G4double emax=DBL_MAX)
G4double ComputeTruePathLengthLimit(const G4Track &track, G4double &currentMinimalStep)