Geant4  10.02
G4GoudsmitSaundersonMscModel.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: G4GoudsmitSaundersonMscModel.hh 93663 2015-10-28 09:50:49Z gcosmo $
27 //
28 // ----------------------------------------------------------------------------
29 //
30 // GEANT4 Class header file
31 //
32 // File name: G4GoudsmitSaundersonMscModel
33 //
34 // Author: Mihaly Novak / (Omrane Kadri)
35 //
36 // Creation date: 20.02.2009
37 //
38 // Modifications:
39 // 04.03.2009 V.Ivanchenko cleanup and format according to Geant4 EM style
40 // 12.05.2010 O.Kadri: adding Qn1 and Qn12 as private doubles
41 // 18.05.2015 M. Novak provide PLERIMINARYY version of updated class.
42 // All algorithms of the class were revised and updated, new methods added.
43 // A new version of Kawrakow-Bielajew Goudsmit-Saunderson MSC model
44 // based on the screened Rutherford DCS for elastic scattering of
45 // electrons/positrons has been introduced[1,2]. The corresponding MSC
46 // angular distributions over a 2D parameter grid have been recomputed
47 // and the CDFs are now stored in a variable transformed (smooth) form[2,3]
48 // together with the corresponding rational interpolation parameters.
49 // These angular distributions are handled by the new
50 // G4GoudsmitSaundersonTable class that is responsible to sample if
51 // it was no, single, few or multiple scattering case and delivers the
52 // angular deflection (i.e. cos(theta) and sin(theta)).
53 // Two screening options are provided:
54 // - if fgIsUsePWATotalXsecData=TRUE i.e. SetOptionPWAScreening(TRUE)
55 // was called before initialisation: screening parameter value A is
56 // determined such that the first transport coefficient G1(A)
57 // computed according to the screened Rutherford DCS for elastic
58 // scattering will reproduce the one computed from the PWA elastic
59 // and first transport mean free paths[4].
60 // - if fgIsUsePWATotalXsecData=FALSE i.e. default value or
61 // SetOptionPWAScreening(FALSE) was called before initialisation:
62 // screening parameter value A is computed according to Moliere's
63 // formula (by using material dependent parameters \chi_cc2 and b_c
64 // precomputed for each material used at initialization in
65 // G4GoudsmitSaundersonTable) [3]
66 // Elastic and first trasport mean free paths are used consistently.
67 // The new version is self-consistent, several times faster, more
68 // robust and accurate compared to the earlier version.
69 // Spin effects as well as a more accurate energy loss correction and
70 // computations of Lewis moments will be implemented later on.
71 // 02.09.2015 M. Novak: first version of new step limit is provided.
72 // fUseSafetyPlus corresponds to Urban fUseSafety (default)
73 // fUseDistanceToBoundary corresponds to Urban fUseDistanceToBoundary
74 // fUseSafety corresponds to EGSnrc error-free stepping algorithm
75 // Range factor can be significantly higher at each case than in Urban.
76 //
77 // Class description:
78 // Kawrakow-Bielajew Goudsmit-Saunderson MSC model based on the screened
79 // Rutherford DCS for elastic scattering of electrons/positrons. Step limitation
80 // algorithm as well as true to geomerty and geometry to true step length
81 // computations are adopted from Urban model[5].
82 //
83 // References:
84 // [1] A.F.Bielajew, NIMB 111 (1996) 195-208
85 // [2] I.Kawrakow, A.F.Bielajew, NIMB 134(1998) 325-336
86 // [3] I.Kawrakow, E.Mainegra-Hing, D.W.O.Rogers, F.Tessier,B.R.B.Walters, NRCC
87 // Report PIRS-701 (2013)
88 // [4] F.Salvat, A.Jablonski, C.J. Powell, CPC 165(2005) 157-190
89 // [5] L.Urban, Preprint CERN-OPEN-2006-077 (2006)
90 //
91 // -----------------------------------------------------------------------------
92 
93 #ifndef G4GoudsmitSaundersonMscModel_h
94 #define G4GoudsmitSaundersonMscModel_h 1
95 
96 #include <CLHEP/Units/SystemOfUnits.h>
97 
98 #include "G4VMscModel.hh"
99 #include "G4PhysicsTable.hh"
100 #include "G4MaterialCutsCouple.hh"
101 #include "globals.hh"
102 
103 
104 class G4DataVector;
106 class G4LossTableManager;
108 class G4PWATotalXsecTable;
109 
110 
112 {
113 public:
114 
115  G4GoudsmitSaundersonMscModel(const G4String& nam = "GoudsmitSaunderson");
116 
118 
119  virtual void Initialise(const G4ParticleDefinition*, const G4DataVector&);
120 
121  void StartTracking(G4Track*);
122 
124  void SingleScattering(G4double &cost, G4double &sint);
125  void SampleMSC();
126 
128  G4double safety);
129 
130  virtual G4double ComputeTruePathLengthLimit(const G4Track& track,
131  G4double& currentMinimalStep);
132 
133  virtual G4double ComputeGeomPathLength(G4double truePathLength);
134 
135  virtual G4double ComputeTrueStepLength(G4double geomStepLength);
136 
138 
139 private:
140  inline void SetParticle(const G4ParticleDefinition* p);
141 
142  inline G4double GetLambda(G4double);
143 
144  // hide assignment operator
148 
149  inline G4double Randomizetlimit();
150 
151 private:
152  CLHEP::HepRandomEngine* rndmEngineMod;
153 
154 
159 
163 
165 
167 
172 
175 
177 
180 
181  //
182  G4double fLambda0; // elastic mean free path
183  G4double fLambda1; // first transport mean free path
184  G4double fScrA; // screening parameter
185  G4double fG1; // first transport coef.
186  //
192  //
193  G4bool fIsEndedUpOnBoundary; // step ended up on boundary i.e. transportation is the winer
199  //
203 };
204 
206 inline
208 {
209  if (p != particle) {
210  particle = p;
212  mass = p->GetPDGMass();
213  }
214 }
215 
216 
217 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
218 inline
220 {
221  G4double temptlimit = tlimit;
222  do {
223  temptlimit = G4RandGauss::shoot(rndmEngineMod,tlimit,0.3*tlimit);
224  } while ( (temptlimit<0.) || (temptlimit > 2.*tlimit));
225 
226  return temptlimit;
227 }
228 
229 
230 
231 #endif
G4GoudsmitSaundersonMscModel(const G4String &nam="GoudsmitSaunderson")
virtual G4double ComputeTrueStepLength(G4double geomStepLength)
ThreeVector shoot(const G4int Ap, const G4int Af)
CLHEP::Hep3Vector G4ThreeVector
G4double GetTransportMeanFreePathOnly(const G4ParticleDefinition *, G4double)
static G4PWATotalXsecTable * fgPWAXsecTable
const G4ParticleDefinition * particle
G4GoudsmitSaundersonMscModel & operator=(const G4GoudsmitSaundersonMscModel &right)
int G4int
Definition: G4Types.hh:78
virtual G4double ComputeTruePathLengthLimit(const G4Track &track, G4double &currentMinimalStep)
void SingleScattering(G4double &cost, G4double &sint)
virtual void Initialise(const G4ParticleDefinition *, const G4DataVector &)
bool G4bool
Definition: G4Types.hh:79
static G4GoudsmitSaundersonTable * fgGSTable
G4double GetPDGMass() const
void SetParticle(const G4ParticleDefinition *p)
G4double GetTransportMeanFreePath(const G4ParticleDefinition *, G4double)
G4double GetLambda(G4double)
virtual G4ThreeVector & SampleScattering(const G4ThreeVector &, G4double safety)
double G4double
Definition: G4Types.hh:76
static const double eplus
Definition: G4SIunits.hh:196
G4double GetPDGCharge() const
const G4MaterialCutsCouple * currentCouple
virtual G4double ComputeGeomPathLength(G4double truePathLength)