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: G4WentzelVIModel.hh,v 1.21 2009/10/10 15:16:57 vnivanch Exp $ |
---|
27 | // GEANT4 tag $Name: geant4-09-03-cand-01 $ |
---|
28 | // |
---|
29 | // ------------------------------------------------------------------- |
---|
30 | // |
---|
31 | // |
---|
32 | // GEANT4 Class header file |
---|
33 | // |
---|
34 | // |
---|
35 | // File name: G4WentzelVIModel |
---|
36 | // |
---|
37 | // Author: V.Ivanchenko |
---|
38 | // |
---|
39 | // Creation date: 09.04.2008 from G4MuMscModel |
---|
40 | // |
---|
41 | // Modifications: |
---|
42 | // |
---|
43 | // |
---|
44 | // Class Description: |
---|
45 | // |
---|
46 | // Implementation of the model of multiple scattering based on |
---|
47 | // G.Wentzel, Z. Phys. 40 (1927) 590. |
---|
48 | // H.W.Lewis, Phys Rev 78 (1950) 526. |
---|
49 | // J.M. Fernandez-Varea et al., NIM B73 (1993) 447. |
---|
50 | // L.Urban, CERN-OPEN-2006-077. |
---|
51 | |
---|
52 | // ------------------------------------------------------------------- |
---|
53 | // |
---|
54 | |
---|
55 | #ifndef G4WentzelVIModel_h |
---|
56 | #define G4WentzelVIModel_h 1 |
---|
57 | |
---|
58 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... |
---|
59 | |
---|
60 | #include "G4VMscModel.hh" |
---|
61 | #include "G4PhysicsTable.hh" |
---|
62 | #include "G4MscStepLimitType.hh" |
---|
63 | #include "G4MaterialCutsCouple.hh" |
---|
64 | #include "G4NistManager.hh" |
---|
65 | |
---|
66 | class G4LossTableManager; |
---|
67 | class G4ParticleChangeForMSC; |
---|
68 | class G4ParticleDefinition; |
---|
69 | |
---|
70 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... |
---|
71 | |
---|
72 | class G4WentzelVIModel : public G4VMscModel |
---|
73 | { |
---|
74 | |
---|
75 | public: |
---|
76 | |
---|
77 | G4WentzelVIModel(const G4String& nam = "WentzelVIUni"); |
---|
78 | |
---|
79 | virtual ~G4WentzelVIModel(); |
---|
80 | |
---|
81 | virtual void Initialise(const G4ParticleDefinition*, const G4DataVector&); |
---|
82 | |
---|
83 | virtual G4double ComputeCrossSectionPerAtom(const G4ParticleDefinition*, |
---|
84 | G4double KineticEnergy, |
---|
85 | G4double AtomicNumber, |
---|
86 | G4double AtomicWeight=0., |
---|
87 | G4double cut = DBL_MAX, |
---|
88 | G4double emax= DBL_MAX); |
---|
89 | |
---|
90 | virtual void SampleScattering(const G4DynamicParticle*, G4double safety); |
---|
91 | |
---|
92 | virtual G4double ComputeTruePathLengthLimit(const G4Track& track, |
---|
93 | G4PhysicsTable* theLambdaTable, |
---|
94 | G4double currentMinimalStep); |
---|
95 | |
---|
96 | virtual G4double ComputeGeomPathLength(G4double truePathLength); |
---|
97 | |
---|
98 | virtual G4double ComputeTrueStepLength(G4double geomStepLength); |
---|
99 | |
---|
100 | private: |
---|
101 | |
---|
102 | G4double ComputeTransportXSectionPerAtom(); |
---|
103 | |
---|
104 | G4double ComputeXSectionPerVolume(); |
---|
105 | |
---|
106 | void ComputeMaxElectronScattering(G4double cut); |
---|
107 | |
---|
108 | inline G4double GetLambda(G4double kinEnergy); |
---|
109 | |
---|
110 | inline void SetupParticle(const G4ParticleDefinition*); |
---|
111 | |
---|
112 | inline void SetupKinematic(G4double kinEnergy, G4double cut); |
---|
113 | |
---|
114 | inline void SetupTarget(G4double Z, G4double kinEnergy); |
---|
115 | |
---|
116 | inline void DefineMaterial(const G4MaterialCutsCouple*); |
---|
117 | |
---|
118 | // hide assignment operator |
---|
119 | G4WentzelVIModel & operator=(const G4WentzelVIModel &right); |
---|
120 | G4WentzelVIModel(const G4WentzelVIModel&); |
---|
121 | |
---|
122 | const G4ParticleDefinition* theProton; |
---|
123 | const G4ParticleDefinition* theElectron; |
---|
124 | const G4ParticleDefinition* thePositron; |
---|
125 | |
---|
126 | G4ParticleChangeForMSC* fParticleChange; |
---|
127 | |
---|
128 | G4PhysicsTable* theLambdaTable; |
---|
129 | G4PhysicsTable* theLambda2Table; |
---|
130 | G4LossTableManager* theManager; |
---|
131 | const G4DataVector* currentCuts; |
---|
132 | |
---|
133 | G4NistManager* fNistManager; |
---|
134 | |
---|
135 | G4double numlimit; |
---|
136 | G4double tlimitminfix; |
---|
137 | G4double invsqrt12; |
---|
138 | |
---|
139 | // cash |
---|
140 | G4double preKinEnergy; |
---|
141 | G4double ecut; |
---|
142 | G4double lambda0; |
---|
143 | G4double tPathLength; |
---|
144 | G4double zPathLength; |
---|
145 | G4double lambdaeff; |
---|
146 | G4double currentRange; |
---|
147 | G4double par1; |
---|
148 | G4double par2; |
---|
149 | G4double par3; |
---|
150 | |
---|
151 | G4double xtsec; |
---|
152 | std::vector<G4double> xsecn; |
---|
153 | std::vector<G4double> prob; |
---|
154 | G4int nelments; |
---|
155 | |
---|
156 | G4int nbins; |
---|
157 | G4int nwarnings; |
---|
158 | G4int nwarnlimit; |
---|
159 | |
---|
160 | G4int currentMaterialIndex; |
---|
161 | |
---|
162 | const G4MaterialCutsCouple* currentCouple; |
---|
163 | const G4Material* currentMaterial; |
---|
164 | |
---|
165 | // single scattering parameters |
---|
166 | G4double coeff; |
---|
167 | G4double cosThetaMin; |
---|
168 | G4double cosThetaMax; |
---|
169 | G4double cosTetMaxNuc; |
---|
170 | G4double cosTetMaxNuc2; |
---|
171 | G4double cosTetMaxElec; |
---|
172 | G4double cosTetMaxElec2; |
---|
173 | G4double q2Limit; |
---|
174 | G4double alpha2; |
---|
175 | |
---|
176 | // projectile |
---|
177 | const G4ParticleDefinition* particle; |
---|
178 | |
---|
179 | G4double chargeSquare; |
---|
180 | G4double spin; |
---|
181 | G4double mass; |
---|
182 | G4double tkin; |
---|
183 | G4double mom2; |
---|
184 | G4double invbeta2; |
---|
185 | G4double kinFactor; |
---|
186 | G4double etag; |
---|
187 | G4double lowEnergyLimit; |
---|
188 | |
---|
189 | // target |
---|
190 | G4double targetZ; |
---|
191 | G4double targetMass; |
---|
192 | G4double screenZ; |
---|
193 | G4double formfactA; |
---|
194 | G4int iz; |
---|
195 | |
---|
196 | static G4double ScreenRSquare[100]; |
---|
197 | static G4double FormFactor[100]; |
---|
198 | |
---|
199 | // flags |
---|
200 | G4bool isInitialized; |
---|
201 | G4bool inside; |
---|
202 | }; |
---|
203 | |
---|
204 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... |
---|
205 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... |
---|
206 | |
---|
207 | inline |
---|
208 | void G4WentzelVIModel::DefineMaterial(const G4MaterialCutsCouple* cup) |
---|
209 | { |
---|
210 | if(cup != currentCouple) { |
---|
211 | currentCouple = cup; |
---|
212 | currentMaterial = cup->GetMaterial(); |
---|
213 | currentMaterialIndex = currentCouple->GetIndex(); |
---|
214 | } |
---|
215 | } |
---|
216 | |
---|
217 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... |
---|
218 | |
---|
219 | inline |
---|
220 | G4double G4WentzelVIModel::GetLambda(G4double e) |
---|
221 | { |
---|
222 | G4double x; |
---|
223 | if(theLambdaTable) { |
---|
224 | G4bool b; |
---|
225 | x = ((*theLambdaTable)[currentMaterialIndex])->GetValue(e, b); |
---|
226 | } else { |
---|
227 | x = CrossSection(currentCouple,particle,e, |
---|
228 | (*currentCuts)[currentMaterialIndex]); |
---|
229 | } |
---|
230 | if(x > DBL_MIN) x = 1./x; |
---|
231 | else x = DBL_MAX; |
---|
232 | return x; |
---|
233 | } |
---|
234 | |
---|
235 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... |
---|
236 | |
---|
237 | inline void G4WentzelVIModel::SetupParticle(const G4ParticleDefinition* p) |
---|
238 | { |
---|
239 | // Initialise mass and charge |
---|
240 | if(p != particle) { |
---|
241 | particle = p; |
---|
242 | mass = particle->GetPDGMass(); |
---|
243 | spin = particle->GetPDGSpin(); |
---|
244 | G4double q = particle->GetPDGCharge()/eplus; |
---|
245 | chargeSquare = q*q; |
---|
246 | tkin = 0.0; |
---|
247 | } |
---|
248 | } |
---|
249 | |
---|
250 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... |
---|
251 | |
---|
252 | inline void G4WentzelVIModel::SetupKinematic(G4double ekin, G4double cut) |
---|
253 | { |
---|
254 | if(ekin != tkin || ecut != cut) { |
---|
255 | tkin = ekin; |
---|
256 | mom2 = tkin*(tkin + 2.0*mass); |
---|
257 | invbeta2 = 1.0 + mass*mass/mom2; |
---|
258 | cosTetMaxNuc = cosThetaMax; |
---|
259 | if(mass < MeV && ekin <= 10.*cut) { |
---|
260 | cosTetMaxNuc = ekin*(cosThetaMax + 1.0)/(10.*cut) - 1.0; |
---|
261 | } |
---|
262 | ComputeMaxElectronScattering(cut); |
---|
263 | } |
---|
264 | } |
---|
265 | |
---|
266 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... |
---|
267 | |
---|
268 | inline void G4WentzelVIModel::SetupTarget(G4double Z, G4double e) |
---|
269 | { |
---|
270 | if(Z != targetZ || e != etag) { |
---|
271 | etag = e; |
---|
272 | targetZ = Z; |
---|
273 | iz = G4int(Z); |
---|
274 | if(iz > 99) iz = 99; |
---|
275 | targetMass = fNistManager->GetAtomicMassAmu(iz)*amu_c2; |
---|
276 | screenZ = ScreenRSquare[iz]/mom2; |
---|
277 | G4double meff = targetMass/(mass+targetMass); |
---|
278 | kinFactor = coeff*targetZ*chargeSquare*invbeta2/(mom2*meff*meff); |
---|
279 | screenZ *=(1.13 + std::min(1.0,3.76*Z*Z*invbeta2*alpha2)); |
---|
280 | if(mass > MeV) { screenZ *= 2.0; } |
---|
281 | formfactA = FormFactor[iz]*mom2; |
---|
282 | cosTetMaxNuc2 = cosTetMaxNuc; |
---|
283 | cosTetMaxElec2 = cosTetMaxElec; |
---|
284 | } |
---|
285 | } |
---|
286 | |
---|
287 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... |
---|
288 | |
---|
289 | #endif |
---|
290 | |
---|