Geant4  10.01
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 85306 2014-10-27 14:17:47Z 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  G4WentzelVIModel(G4bool comb = true, const G4String& nam = "WentzelVIUni");
72 
73  virtual ~G4WentzelVIModel();
74 
75  virtual void Initialise(const G4ParticleDefinition*, const G4DataVector&);
76 
77  virtual void InitialiseLocal(const G4ParticleDefinition*,
78  G4VEmModel* masterModel);
79 
80  void StartTracking(G4Track*);
81 
83  G4double KineticEnergy,
84  G4double AtomicNumber,
85  G4double AtomicWeight=0.,
86  G4double cut = DBL_MAX,
87  G4double emax= DBL_MAX);
88 
90  G4double safety);
91 
92  virtual G4double ComputeTruePathLengthLimit(const G4Track& track,
93  G4double& currentMinimalStep);
94 
95  virtual G4double ComputeGeomPathLength(G4double truePathLength);
96 
97  virtual G4double ComputeTrueStepLength(G4double geomStepLength);
98 
99  // defines low energy limit on energy transfer to atomic electron
100  inline void SetFixedCut(G4double);
101 
102  // low energy limit on energy transfer to atomic electron
103  inline G4double GetFixedCut() const;
104 
105  // access to cross section class
107 
108  inline void SetUseSecondMoment(G4bool);
109 
110  inline G4bool UseSecondMoment() const;
111 
113 
115  const G4MaterialCutsCouple*,
116  G4double kineticEnergy);
117 
119 
120 protected:
121 
122  inline void DefineMaterial(const G4MaterialCutsCouple*);
123 
124 private:
125 
127 
129  G4double kineticEnergy);
130 
131  inline void SetupParticle(const G4ParticleDefinition*);
132 
133  // hide assignment operator
136 
137 protected:
138 
140 
144 
145  // cache kinematics
152 
153  // cache material
157 
159 
160  // flags
163 
164 private:
165 
168 
171 
172  // cache kinematics
174 
175  // single scattering parameters
178 
180  size_t idx2;
181 
182  // data for single scattering mode
184  std::vector<G4double> xsecn;
185  std::vector<G4double> prob;
187 
189 
190  // projectile
192 
193  // flags
196 };
197 
198 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
199 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
200 
201 inline
203 {
204  if(cup != currentCouple) {
205  currentCouple = cup;
206  SetCurrentCouple(cup);
207  currentMaterial = cup->GetMaterial();
209  }
210 }
211 
212 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
213 
215 {
216  // Initialise mass and charge
217  if(p != particle) {
218  particle = p;
219  wokvi->SetupParticle(p);
220  }
221 }
222 
223 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
224 
226 {
227  fixedCut = val;
228 }
229 
230 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
231 
233 {
234  return fixedCut;
235 }
236 
237 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
238 
240 {
241  return wokvi;
242 }
243 
244 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
245 
247 {
248  useSecondMoment = val;
249 }
250 
251 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
252 
254 {
255  return useSecondMoment;
256 }
257 
258 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
259 
261 {
262  return fSecondMoments;
263 }
264 
265 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
266 
267 inline G4double
269  const G4MaterialCutsCouple* couple,
270  G4double ekin)
271 {
272  G4double x = 0.0;
273  if(useSecondMoment) {
274  DefineMaterial(couple);
275  if(fSecondMoments) {
276  x = (*fSecondMoments)[(*theDensityIdx)[currentMaterialIndex]]
277  ->Value(ekin, idx2)
278  *(*theDensityFactor)[currentMaterialIndex]/(ekin*ekin);
279  } else {
280  x = ComputeSecondMoment(part, ekin);
281  }
282  }
283  return x;
284 }
285 
286 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
287 
288 #endif
289 
G4double GetFixedCut() const
virtual ~G4WentzelVIModel()
void SetSingleScatteringFactor(G4double)
void SetupParticle(const G4ParticleDefinition *)
G4WentzelOKandVIxSection * wokvi
std::vector< G4double > prob
CLHEP::Hep3Vector G4ThreeVector
virtual G4ThreeVector & SampleScattering(const G4ThreeVector &, G4double safety)
void DefineMaterial(const G4MaterialCutsCouple *)
const G4MaterialCutsCouple * currentCouple
G4ParticleChangeForMSC * fParticleChange
const G4Material * currentMaterial
G4WentzelVIModel(G4bool comb=true, const G4String &nam="WentzelVIUni")
int G4int
Definition: G4Types.hh:78
virtual G4double ComputeTruePathLengthLimit(const G4Track &track, G4double &currentMinimalStep)
std::vector< G4double > xsecn
virtual G4double ComputeCrossSectionPerAtom(const G4ParticleDefinition *, G4double KineticEnergy, G4double AtomicNumber, G4double AtomicWeight=0., G4double cut=DBL_MAX, G4double emax=DBL_MAX)
bool G4bool
Definition: G4Types.hh:79
G4double SecondMoment(const G4ParticleDefinition *, const G4MaterialCutsCouple *, G4double kineticEnergy)
G4bool UseSecondMoment() const
G4double ComputeTransportXSectionPerVolume(G4double cosTheta)
virtual void Initialise(const G4ParticleDefinition *, const G4DataVector &)
void SetupParticle(const G4ParticleDefinition *)
const G4DataVector * currentCuts
void StartTracking(G4Track *)
void SetCurrentCouple(const G4MaterialCutsCouple *)
Definition: G4VEmModel.hh:426
G4PhysicsTable * GetSecondMomentTable()
G4WentzelVIModel & operator=(const G4WentzelVIModel &right)
const G4ParticleDefinition * particle
G4double ComputeSecondMoment(const G4ParticleDefinition *, G4double kineticEnergy)
G4PhysicsTable * fSecondMoments
double G4double
Definition: G4Types.hh:76
virtual G4double ComputeTrueStepLength(G4double geomStepLength)
void SetUseSecondMoment(G4bool)
virtual void InitialiseLocal(const G4ParticleDefinition *, G4VEmModel *masterModel)
void SetFixedCut(G4double)
#define DBL_MAX
Definition: templates.hh:83
G4WentzelOKandVIxSection * GetWVICrossSection()
virtual G4double ComputeGeomPathLength(G4double truePathLength)
const G4Material * GetMaterial() const