QwGeant4
QweakSimWentzelVIModel.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 74726 2013-10-21 08:42:46Z 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 QweakSimWentzelVIModel_h
56 #define QweakSimWentzelVIModel_h 1
57 
58 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
59 
60 #include "G4VMscModel.hh"
61 #include "G4MaterialCutsCouple.hh"
62 #include "G4WentzelOKandVIxSection.hh"
63 
64 class G4ParticleDefinition;
65 class G4LossTableManager;
66 
67 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
68 
69 class QweakSimWentzelVIModel : public G4VMscModel
70 {
71 
72 public:
73 
74  QweakSimWentzelVIModel(const G4String& nam = "WentzelVIUni");
75 
76  virtual ~QweakSimWentzelVIModel();
77 
78  virtual void Initialise(const G4ParticleDefinition*, const G4DataVector&);
79 
80  void StartTracking(G4Track*);
81 
82  virtual G4double ComputeCrossSectionPerAtom(const G4ParticleDefinition*,
83  G4double KineticEnergy,
84  G4double AtomicNumber,
85  G4double AtomicWeight=0.,
86  G4double cut = DBL_MAX,
87  G4double emax= DBL_MAX);
88 
89  virtual G4ThreeVector& SampleScattering(const G4ThreeVector&,
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
106  inline G4WentzelOKandVIxSection* GetWVICrossSection();
107 
108 private:
109 
110  G4double ComputeXSectionPerVolume();
111 
112  inline void SetupParticle(const G4ParticleDefinition*);
113 
114  inline void DefineMaterial(const G4MaterialCutsCouple*);
115 
116  // hide assignment operator
119 
120  G4LossTableManager* theManager;
121  G4ParticleChangeForMSC* fParticleChange;
122  G4WentzelOKandVIxSection* wokvi;
123 
124  const G4DataVector* currentCuts;
125 
126  G4double tlimitminfix;
127  G4double invsqrt12;
128  G4double fixedCut;
129 
130  // cache kinematics
131  G4double preKinEnergy;
132  G4double tPathLength;
133  G4double zPathLength;
134  G4double lambdaeff;
135  G4double currentRange;
136 
137  // data for single scattering mode
138  G4double xtsec;
139  std::vector<G4double> xsecn;
140  std::vector<G4double> prob;
141  G4int nelments;
142 
143  G4double numlimit;
144 
145  // cache material
147  const G4MaterialCutsCouple* currentCouple;
148  const G4Material* currentMaterial;
149 
150  // single scattering parameters
151  G4double cosThetaMin;
152  G4double cosThetaMax;
153  G4double cosTetMaxNuc;
154 
155  // projectile
156  const G4ParticleDefinition* particle;
157  G4double lowEnergyLimit;
158 
159  // flags
160  G4bool inside;
162  //FIXME
163  G4bool ePolarized;
164  G4ThreeVector polarization;
165  G4double eEnergy;
166  G4bool debugPrint;
167  //FIXME
168 };
169 
170 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
171 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
172 
173 inline
174 void QweakSimWentzelVIModel::DefineMaterial(const G4MaterialCutsCouple* cup)
175 {
176  if(cup != currentCouple) {
177  currentCouple = cup;
178  SetCurrentCouple(cup);
179  currentMaterial = cup->GetMaterial();
180  currentMaterialIndex = currentCouple->GetIndex();
181  }
182 }
183 
184 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
185 
186 inline void QweakSimWentzelVIModel::SetupParticle(const G4ParticleDefinition* p)
187 {
188  // Initialise mass and charge
189  if(p != particle) {
190  particle = p;
191  wokvi->SetupParticle(p);
192  }
193 }
194 
195 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
196 
197 inline void QweakSimWentzelVIModel::SetFixedCut(G4double val)
198 {
199  fixedCut = val;
200 }
201 
202 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
203 
204 inline G4double QweakSimWentzelVIModel::GetFixedCut() const
205 {
206  return fixedCut;
207 }
208 
209 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
210 
211 inline G4WentzelOKandVIxSection* QweakSimWentzelVIModel::GetWVICrossSection()
212 {
213  return wokvi;
214 }
215 
216 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
217 
218 #endif
219 
virtual G4double ComputeCrossSectionPerAtom(const G4ParticleDefinition *, G4double KineticEnergy, G4double AtomicNumber, G4double AtomicWeight=0., G4double cut=DBL_MAX, G4double emax=DBL_MAX)
std::vector< G4double > prob
virtual G4ThreeVector & SampleScattering(const G4ThreeVector &, G4double safety)
virtual G4double ComputeGeomPathLength(G4double truePathLength)
G4WentzelOKandVIxSection * GetWVICrossSection()
void SetupParticle(const G4ParticleDefinition *)
virtual G4double ComputeTrueStepLength(G4double geomStepLength)
virtual void Initialise(const G4ParticleDefinition *, const G4DataVector &)
std::vector< G4double > xsecn
const G4Material * currentMaterial
const G4DataVector * currentCuts
G4LossTableManager * theManager
const G4MaterialCutsCouple * currentCouple
void DefineMaterial(const G4MaterialCutsCouple *)
const G4ParticleDefinition * particle
QweakSimWentzelVIModel & operator=(const QweakSimWentzelVIModel &right)
G4ParticleChangeForMSC * fParticleChange
G4WentzelOKandVIxSection * wokvi
QweakSimWentzelVIModel(const G4String &nam="WentzelVIUni")
virtual G4double ComputeTruePathLengthLimit(const G4Track &track, G4double &currentMinimalStep)