Geant4  10.03.p02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4WentzelVIModel.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: G4WentzelVIModel.hh 96934 2016-05-18 09:10:41Z gcosmo $
27 //
28 // -------------------------------------------------------------------
29 //
30 //
31 // GEANT4 Class header file
32 //
33 //
34 // File name: G4WentzelVIModel
35 //
36 // Author: V.Ivanchenko
37 //
38 // Creation date: 09.04.2008 from G4MuMscModel
39 //
40 // Modifications:
41 // 27-05-2010 V.Ivanchenko added G4WentzelOKandVIxSection class to
42 // compute cross sections and sample scattering angle
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 "G4MaterialCutsCouple.hh"
63 
64 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
65 
67 {
68 
69 public:
70 
71  explicit G4WentzelVIModel(G4bool comb = true,
72  const G4String& nam = "WentzelVIUni");
73 
74  virtual ~G4WentzelVIModel();
75 
76  virtual void Initialise(const G4ParticleDefinition*,
77  const G4DataVector&) override;
78 
79  virtual void InitialiseLocal(const G4ParticleDefinition*,
80  G4VEmModel* masterModel) override;
81 
82  virtual void StartTracking(G4Track*) override;
83 
85  G4double KineticEnergy,
86  G4double AtomicNumber,
87  G4double AtomicWeight=0.,
88  G4double cut = DBL_MAX,
89  G4double emax= DBL_MAX) override;
90 
92  G4double safety) override;
93 
94  virtual G4double
96  G4double& currentMinimalStep) override;
97 
98  virtual G4double ComputeGeomPathLength(G4double truePathLength) override;
99 
100  virtual G4double ComputeTrueStepLength(G4double geomStepLength) override;
101 
102  // defines low energy limit on energy transfer to atomic electron
103  inline void SetFixedCut(G4double);
104 
105  // low energy limit on energy transfer to atomic electron
106  inline G4double GetFixedCut() const;
107 
108  // access to cross section class
110 
111  inline void SetUseSecondMoment(G4bool);
112 
113  inline G4bool UseSecondMoment() const;
114 
116 
118  const G4MaterialCutsCouple*,
119  G4double kineticEnergy);
120 
122 
123 protected:
124 
125  inline void DefineMaterial(const G4MaterialCutsCouple*);
126 
127 private:
128 
129  G4double ComputeTransportXSectionPerVolume(G4double cosTheta);
130 
131  G4double ComputeSecondMoment(const G4ParticleDefinition*,
132  G4double kineticEnergy);
133 
134  inline void SetupParticle(const G4ParticleDefinition*);
135 
136  // hide assignment operator
137  G4WentzelVIModel & operator=(const G4WentzelVIModel &right) = delete;
138  G4WentzelVIModel(const G4WentzelVIModel&) = delete;
139 
140 protected:
141 
143 
147 
148  // cache kinematics
155 
156  // cache material
160 
162 
163  // flags
165 
166 private:
167 
168  G4ParticleChangeForMSC* fParticleChange;
169  const G4DataVector* currentCuts;
170 
171  G4double invsqrt12;
172  G4double fixedCut;
173 
174  // cache kinematics
175  G4double effKinEnergy;
176 
177  // single scattering parameters
178  G4double cosThetaMin;
179  G4double cosThetaMax;
180 
181  G4PhysicsTable* fSecondMoments;
182  size_t idx2;
183 
184  // data for single scattering mode
185  G4int minNCollisions;
186  G4int nelments;
187  std::vector<G4double> xsecn;
188  std::vector<G4double> prob;
189 
190  G4double xtsec;
191  G4double numlimit;
192 
193  // projectile
194  G4double lowEnergyLimit;
195 
196  // flags
197  G4bool isCombined;
198  G4bool useSecondMoment;
199 };
200 
201 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
202 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
203 
204 inline
206 {
207  if(cup != currentCouple) {
208  currentCouple = cup;
209  SetCurrentCouple(cup);
210  currentMaterial = cup->GetMaterial();
212  }
213 }
214 
215 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
216 
217 inline void G4WentzelVIModel::SetupParticle(const G4ParticleDefinition* p)
218 {
219  // Initialise mass and charge
220  if(p != particle) {
221  particle = p;
222  wokvi->SetupParticle(p);
223  }
224 }
225 
226 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
227 
229 {
230  fixedCut = val;
231 }
232 
233 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
234 
236 {
237  return fixedCut;
238 }
239 
240 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
241 
243 {
244  return wokvi;
245 }
246 
247 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
248 
250 {
251  useSecondMoment = val;
252 }
253 
254 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
255 
257 {
258  return useSecondMoment;
259 }
260 
261 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
262 
264 {
265  return fSecondMoments;
266 }
267 
268 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
269 
270 inline G4double
272  const G4MaterialCutsCouple* couple,
273  G4double ekin)
274 {
275  G4double x = 0.0;
276  if(useSecondMoment) {
277  DefineMaterial(couple);
278  if(fSecondMoments) {
279  x = (*fSecondMoments)[(*theDensityIdx)[currentMaterialIndex]]
280  ->Value(ekin, idx2)
281  *(*theDensityFactor)[currentMaterialIndex]/(ekin*ekin);
282  } else {
283  x = ComputeSecondMoment(part, ekin);
284  }
285  }
286  return x;
287 }
288 
289 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
290 
291 #endif
292 
G4double GetFixedCut() const
virtual ~G4WentzelVIModel()
void SetSingleScatteringFactor(G4double)
void SetupParticle(const G4ParticleDefinition *)
G4WentzelOKandVIxSection * wokvi
virtual G4double ComputeGeomPathLength(G4double truePathLength) override
const char * p
Definition: xmltok.h:285
void DefineMaterial(const G4MaterialCutsCouple *)
const G4MaterialCutsCouple * currentCouple
tuple x
Definition: test.py:50
virtual G4double ComputeTruePathLengthLimit(const G4Track &track, G4double &currentMinimalStep) override
const G4Material * currentMaterial
G4WentzelVIModel(G4bool comb=true, const G4String &nam="WentzelVIUni")
int G4int
Definition: G4Types.hh:78
bool G4bool
Definition: G4Types.hh:79
G4double SecondMoment(const G4ParticleDefinition *, const G4MaterialCutsCouple *, G4double kineticEnergy)
G4bool UseSecondMoment() const
static const G4double emax
void SetCurrentCouple(const G4MaterialCutsCouple *)
Definition: G4VEmModel.hh:447
G4PhysicsTable * GetSecondMomentTable()
virtual G4double ComputeCrossSectionPerAtom(const G4ParticleDefinition *, G4double KineticEnergy, G4double AtomicNumber, G4double AtomicWeight=0., G4double cut=DBL_MAX, G4double emax=DBL_MAX) override
const G4ParticleDefinition * particle
virtual G4ThreeVector & SampleScattering(const G4ThreeVector &, G4double safety) override
virtual G4double ComputeTrueStepLength(G4double geomStepLength) override
virtual void Initialise(const G4ParticleDefinition *, const G4DataVector &) override
double G4double
Definition: G4Types.hh:76
virtual void StartTracking(G4Track *) override
void SetUseSecondMoment(G4bool)
void SetFixedCut(G4double)
#define DBL_MAX
Definition: templates.hh:83
G4WentzelOKandVIxSection * GetWVICrossSection()
virtual void InitialiseLocal(const G4ParticleDefinition *, G4VEmModel *masterModel) override
const G4Material * GetMaterial() const