CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
UrbanMscModel93.h
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: UrbanMscModel93.hh 66602 2012-12-29 15:54:43Z vnivanch $
27 //
28 // -------------------------------------------------------------------
29 //
30 //
31 // GEANT4 Class header file
32 //
33 //
34 // File name: UrbanMscModel93
35 //
36 // Author: Laszlo Urban, V.Ivanchenko copy it from G4UrbanMscModel93
37 // geant4-09-06-ref-07a global tag
38 //
39 // Creation date: 21.08.2013
40 //
41 //
42 // Modifications:
43 //
44 // Class Description:
45 //
46 // Implementation of the model of multiple scattering based on
47 // H.W.Lewis Phys Rev 78 (1950) 526 and L.Urban model
48 
49 // -------------------------------------------------------------------
50 //
51 
52 #ifndef UrbanMscModel93_h
53 #define UrbanMscModel93_h 1
54 
55 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
56 
57 #include "G4VMscModel.hh"
58 #include "G4MscStepLimitType.hh"
59 #include "G4Log.hh"
60 #include "G4Exp.hh"
61 #include "G4SystemOfUnits.hh"
62 
63 class G4ParticleChangeForMSC;
64 class G4SafetyHelper;
65 class G4LossTableManager;
66 
67 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
68 
69 class UrbanMscModel93 : public G4VMscModel
70 {
71 
72 public:
73 
74  UrbanMscModel93(const G4String& nam = "UrbanMsc93");
75 
76  virtual ~UrbanMscModel93();
77 
78  void Initialise(const G4ParticleDefinition*, const G4DataVector&);
79 
80  void StartTracking(G4Track*);
81 
82  G4double ComputeCrossSectionPerAtom(const G4ParticleDefinition* particle,
83  G4double KineticEnergy,
84  G4double AtomicNumber,
85  G4double AtomicWeight=0.,
86  G4double cut =0.,
87  G4double emax=DBL_MAX);
88 
89  G4ThreeVector& SampleScattering(const G4ThreeVector&, G4double safety);
90 
91  G4double ComputeTruePathLengthLimit(const G4Track& track,
92  G4double& currentMinimalStep);
93 
94  G4double ComputeGeomPathLength(G4double truePathLength);
95 
96  G4double ComputeTrueStepLength(G4double geomStepLength);
97 
98  inline G4double ComputeTheta0(G4double truePathLength,
99  G4double KineticEnergy);
100 
101 private:
102 
103  G4double SampleCosineTheta(G4double trueStepLength, G4double KineticEnergy);
104 
105  G4double SampleDisplacement();
106 
107  G4double LatCorrelation();
108 
109  inline void SetParticle(const G4ParticleDefinition*);
110 
111  inline void UpdateCache();
112 
113  inline G4double SimpleScattering(G4double xmeanth, G4double x2meanth);
114 
115  // hide assignment operator
116  UrbanMscModel93 & operator=(const UrbanMscModel93 &right);
118 
119  const G4ParticleDefinition* particle;
120  G4ParticleChangeForMSC* fParticleChange;
121 
122  const G4MaterialCutsCouple* couple;
123  G4LossTableManager* theManager;
124 
125  G4double mass;
128 
129  G4double taubig;
130  G4double tausmall;
131  G4double taulim;
132  G4double currentTau;
133  G4double tlimit;
134  G4double tlimitmin;
135  G4double tlimitminfix;
136  G4double tgeom;
137 
138  G4double geombig;
139  G4double geommin;
140  G4double geomlimit;
141  G4double skindepth;
142  G4double smallstep;
143 
144  G4double presafety;
145 
146  G4double lambda0;
147  G4double lambdaeff;
148  G4double tPathLength;
149  G4double zPathLength;
150  G4double par1,par2,par3;
151 
152  G4double stepmin;
153 
155  G4double currentRange;
156  G4double rangeinit;
158 
159  G4double numlim, xsi, ea, eaa;
160 
162  G4double third;
163 
165 
166  G4double y;
167  G4double Zold;
168  G4double Zeff,Z2,Z23,lnZ;
169  G4double coeffth1,coeffth2;
170  G4double coeffc1,coeffc2;
172 
173  G4bool firstStep;
174  G4bool inside;
175  G4bool insideskin;
176 };
177 
178 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
179 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
180 
181 inline
182 void UrbanMscModel93::SetParticle(const G4ParticleDefinition* p)
183 {
184  if (p != particle) {
185  particle = p;
186  mass = p->GetPDGMass();
187  charge = p->GetPDGCharge()/CLHEP::eplus;
189  }
190 }
191 
192 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
193 
194 inline
196 {
197  lnZ = G4Log(Zeff);
198  //new correction in theta0 formula
199  coeffth1 = (1.-8.7780e-2/Zeff)*(0.87+0.03*lnZ);
200  coeffth2 = (4.0780e-2+1.7315e-4*Zeff)*(0.87+0.03*lnZ);
201  // tail parameters
202  G4double lnZ1 = G4Log(Zeff+1.);
203  coeffc1 = 2.943-0.197*lnZ1;
204  coeffc2 = 0.0987-0.0143*lnZ1;
205  // for single scattering
206  Z2 = Zeff*Zeff;
207  Z23 = G4Exp(2.*lnZ/3.);
208  scr1 = scr1ini*Z23;
210 
211  Zold = Zeff;
212 }
213 
214 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
215 
216 inline
217 G4double UrbanMscModel93::ComputeTheta0(G4double trueStepLength,
218  G4double KineticEnergy)
219 {
220  // for all particles take the width of the central part
221  // from a parametrization similar to the Highland formula
222  // ( Highland formula: Particle Physics Booklet, July 2002, eq. 26.10)
223  static const G4double c_highland = 13.6*CLHEP::MeV;
224  G4double invbetacp = sqrt((currentKinEnergy+mass)*(KineticEnergy+mass)/
226  KineticEnergy*(KineticEnergy+2.*mass)));
227  y = trueStepLength/currentRadLength;
228  G4double theta0 = c_highland*std::abs(charge)*sqrt(y)*invbetacp;
229  // correction factor from e- scattering data
230  theta0 *= (coeffth1+coeffth2*G4Log(y));
231 
232  return theta0;
233 }
234 
235 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
236 
237 inline
238 G4double UrbanMscModel93::SimpleScattering(G4double xmeanth, G4double x2meanth)
239 {
240  // 'large angle scattering'
241  // 2 model functions with correct xmean and x2mean
242  G4double a = (2.*xmeanth+9.*x2meanth-3.)/(2.*xmeanth-3.*x2meanth+1.);
243  G4double prob = (a+2.)*xmeanth/a;
244 
245  // sampling
246  G4double cth = 1.;
247  if(G4UniformRand() < prob) {
248  cth = -1.+2.*G4Exp(G4Log(G4UniformRand())/(a+1.));
249  } else {
250  cth = -1.+2.*G4UniformRand();
251  }
252  return cth;
253 }
254 
255 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
256 
257 #endif
258 
const G4ParticleDefinition * particle
const G4MaterialCutsCouple * couple
G4ParticleChangeForMSC * fParticleChange
G4double ComputeTheta0(G4double truePathLength, G4double KineticEnergy)
void Initialise(const G4ParticleDefinition *, const G4DataVector &)
G4double ComputeGeomPathLength(G4double truePathLength)
G4double currentRadLength
void SetParticle(const G4ParticleDefinition *)
G4double LatCorrelation()
UrbanMscModel93(const G4String &nam="UrbanMsc93")
G4double ComputeCrossSectionPerAtom(const G4ParticleDefinition *particle, G4double KineticEnergy, G4double AtomicNumber, G4double AtomicWeight=0., G4double cut=0., G4double emax=DBL_MAX)
void StartTracking(G4Track *)
G4LossTableManager * theManager
T sqrt(T t)
Definition: SSEVec.h:48
G4double currentKinEnergy
G4double SimpleScattering(G4double xmeanth, G4double x2meanth)
G4double SampleDisplacement()
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
G4double ComputeTrueStepLength(G4double geomStepLength)
UrbanMscModel93 & operator=(const UrbanMscModel93 &right)
double a
Definition: hdecay.h:121
G4double SampleCosineTheta(G4double trueStepLength, G4double KineticEnergy)
virtual ~UrbanMscModel93()
G4ThreeVector & SampleScattering(const G4ThreeVector &, G4double safety)
G4double ComputeTruePathLengthLimit(const G4Track &track, G4double &currentMinimalStep)