Geant4  10.02
G4EmCorrections.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: G4EmCorrections.hh 91745 2015-08-04 11:51:12Z gcosmo $
27 //
28 // -------------------------------------------------------------------
29 //
30 // GEANT4 Class header file
31 //
32 //
33 // File name: G4EmCorrections
34 //
35 // Author: Vladimir Ivanchenko
36 //
37 // Creation date: 13.01.2005
38 //
39 // Modifications:
40 // 28.04.2006 General cleanup, add finite size corrections (V.Ivanchenko)
41 // 13.05.2006 Add corrections for ion stopping (V.Ivanhcenko)
42 // 20.05.2008 Removed Finite Size correction (V.Ivanchenko)
43 // 12.09.2008 Added inlined interfaces to effective charge (V.Ivanchenko)
44 // 19.04.2012 Fix reproducibility problem (A.Ribon)
45 //
46 // Class Description:
47 //
48 // This class provides calculation of EM corrections to ionisation
49 //
50 
51 // -------------------------------------------------------------------
52 //
53 
54 #ifndef G4EmCorrections_h
55 #define G4EmCorrections_h 1
56 
57 #include <CLHEP/Units/PhysicalConstants.h>
58 
59 #include "globals.hh"
60 #include "G4ionEffectiveCharge.hh"
61 #include "G4Material.hh"
62 #include "G4ParticleDefinition.hh"
63 #include "G4NistManager.hh"
64 
65 class G4VEmModel;
66 class G4PhysicsVector;
67 class G4IonTable;
70 
72 {
73 
74 public:
75 
76  G4EmCorrections(G4int verb);
77 
78  virtual ~G4EmCorrections();
79 
81  const G4Material*,
82  G4double kineticEnergy,
83  G4double cutEnergy);
84 
86  const G4MaterialCutsCouple*,
87  G4double kineticEnergy);
88 
90  const G4Material*,
91  G4double kineticEnergy);
92 
94  const G4Material*,
95  G4double kineticEnergy);
96 
98  const G4Material*,
99  G4double kineticEnergy);
100 
102  const G4Material*,
103  G4double kineticEnergy);
104 
106  const G4Material*,
107  G4double kineticEnergy);
108 
110  const G4Material*,
111  G4double kineticEnergy);
112 
114  const G4Material*,
115  G4double kineticEnergy);
116 
118  const G4Material*,
119  G4double kineticEnergy);
120 
122  const G4Material*,
123  G4double kineticEnergy);
124 
126  const G4Material*,
127  G4double kineticEnergy);
128 
130  const G4Material*,
131  G4double kineticEnergy);
132 
134  const G4Material*,
135  G4double kineticEnergy);
136 
138  const G4Material*,
139  G4double kineticEnergy,
140  G4bool fluct = true);
141 
143  G4PhysicsVector* dVector);
144 
145  void InitialiseForNewRun();
146 
147  // effective charge correction using stopping power data
149  const G4Material*,
150  G4double kineticEnergy);
151 
152  // effective charge of an ion
154  const G4Material*,
155  G4double kineticEnergy);
156 
157  inline
159  const G4Material*,
160  G4double kineticEnergy);
161 
162  // ionisation models for ions
163  inline void SetIonisationModels(G4VEmModel* m1 = 0, G4VEmModel* m2 = 0);
164 
166 
167  inline void SetVerbose(G4int verb);
168 
169 private:
170 
171  void Initialise();
172 
173  void BuildCorrectionVector();
174 
176  const G4Material*,
177  G4double kineticEnergy);
178 
179  G4double KShell(G4double theta, G4double eta);
180 
181  G4double LShell(G4double theta, G4double eta);
182 
184 
186  G4double y1, G4double y2);
187 
189  G4double y1, G4double y2,
190  G4double z11, G4double z21, G4double z12, G4double z22);
191 
193  G4double m1, G4double m2);
194 
195  // hide assignment operator
198 
199  static const G4double inveplus;
200 
201  G4double ed[104];
202  G4double a[104];
206 
208 
213 
217 
224 
230 
232  G4double CK[20][29];
233  G4double CL[26][28];
236  G4double Z23[100];
237 
241 
242  std::vector<const G4Material*> currmat;
243  std::map< G4int, std::vector<G4double> > thcorr;
244  size_t ncouples;
245 
252 
271 
273 
278 
279  // Ion stopping data
283  std::vector<G4int> Zion;
284  std::vector<G4int> Aion;
285  std::vector<G4String> materialName;
286 
287  std::vector<const G4ParticleDefinition*> ionList;
288 
289  std::vector<const G4Material*> materialList;
290  std::vector<G4PhysicsVector*> stopData;
292 };
293 
295 {
296  G4int iddd = n-1;
297  // Loop checking, 03-Aug-2015, Vladimir Ivanchenko
298  do {--iddd;} while (iddd>0 && x<y[iddd]);
299  return iddd;
300 }
301 
303  G4double y1, G4double y2)
304 {
305  return y1 + (y2 - y1)*(xv - x1)/(x2 - x1);
306 }
307 
309  G4double x1, G4double x2,
310  G4double y1, G4double y2,
311  G4double z11, G4double z21,
312  G4double z12, G4double z22)
313 {
314  return (z11*(x2-xv)*(y2-yv) + z22*(xv-x1)*(yv-y1) +
315  0.5*(z12*((x2-xv)*(yv-y1)+(xv-x1)*(y2-yv))+
316  z21*((xv-x1)*(y2-yv)+(yv-y1)*(x2-xv))))
317  / ((x2-x1)*(y2-y1));
318 }
319 
320 inline void
322 {
323  if(mod1) { ionLEModel = mod1; }
324  if(mod2) { ionHEModel = mod2; }
325 }
326 
328 {
329  return nIons;
330 }
331 
332 inline G4double
334  const G4Material* mat,
335  G4double kineticEnergy)
336 {
337  return effCharge.EffectiveCharge(p,mat,kineticEnergy);
338 }
339 
340 inline G4double
342  const G4Material* mat,
343  G4double kineticEnergy)
344 {
345  return effCharge.EffectiveChargeSquareRatio(p,mat,kineticEnergy);
346 }
347 
349  const G4Material* mat,
350  G4double kineticEnergy)
351 {
352  if(kineticEnergy != kinEnergy || p != particle) {
353  particle = p;
354  kinEnergy = kineticEnergy;
355  mass = p->GetPDGMass();
356  tau = kineticEnergy / mass;
357  gamma = 1.0 + tau;
358  bg2 = tau * (tau+2.0);
359  beta2 = bg2/(gamma*gamma);
360  beta = std::sqrt(beta2);
361  ba2 = beta2/alpha2;
362  G4double ratio = CLHEP::electron_mass_c2/mass;
363  tmax = 2.0*CLHEP::electron_mass_c2*bg2
364  /(1. + 2.0*gamma*ratio + ratio*ratio);
366  if(charge > 1.5) { charge = effCharge.EffectiveCharge(p,mat,kinEnergy); }
367  q2 = charge*charge;
368  }
369  if(mat != material) {
370  material = mat;
374  }
375 }
376 
378 {
379  verbose = verb;
380 }
381 
382 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
383 
384 #endif
G4double COSXI[14]
const G4ElementVector * theElementVector
G4double CK[20][29]
G4double HighOrderCorrections(const G4ParticleDefinition *, const G4Material *, G4double kineticEnergy, G4double cutEnergy)
G4VEmModel * ionLEModel
G4double DensityCorrection(const G4ParticleDefinition *, const G4Material *, G4double kineticEnergy)
G4double ed[104]
G4double theZieglerFactor
std::vector< G4Element * > G4ElementVector
void SetVerbose(G4int verb)
void SetIonisationModels(G4VEmModel *m1=0, G4VEmModel *m2=0)
std::vector< const G4Material * > currmat
G4double KShell(G4double theta, G4double eta)
G4double EffectiveChargeSquareRatio(const G4ParticleDefinition *, const G4Material *, G4double kineticEnergy)
G4LPhysicsFreeVector * ThetaK
G4double EffectiveChargeSquareRatio(const G4ParticleDefinition *p, const G4Material *material, G4double kineticEnergy)
const G4Material * material
G4double MottCorrection(const G4ParticleDefinition *, const G4Material *, G4double kineticEnergy)
G4double GetParticleCharge(const G4ParticleDefinition *, const G4Material *, G4double kineticEnergy)
G4double EffectiveChargeCorrection(const G4ParticleDefinition *, const G4Material *, G4double kineticEnergy)
std::vector< G4int > Aion
G4NistManager * nist
G4double BlochCorrection(const G4ParticleDefinition *, const G4Material *, G4double kineticEnergy)
G4EmCorrections & operator=(const G4EmCorrections &right)
const G4ElementVector * GetElementVector() const
Definition: G4Material.hh:190
int G4int
Definition: G4Types.hh:78
G4double SpinCorrection(const G4ParticleDefinition *, const G4Material *, G4double kineticEnergy)
G4LPhysicsFreeVector * ThetaL
G4VEmModel * ionHEModel
G4double TheL[26]
void AddStoppingData(G4int Z, G4int A, const G4String &materialName, G4PhysicsVector *dVector)
G4EmCorrections(G4int verb)
std::map< G4int, std::vector< G4double > > thcorr
G4double Value2(G4double xv, G4double yv, G4double x1, G4double x2, G4double y1, G4double y2, G4double z11, G4double z21, G4double z12, G4double z22)
double A(double temperature)
G4double NuclearStoppingPower(G4double e, G4double z1, G4double z2, G4double m1, G4double m2)
static const double m2
Definition: G4SIunits.hh:129
G4int Index(G4double x, G4double *y, G4int n)
G4double NuclearDEDX(const G4ParticleDefinition *, const G4Material *, G4double kineticEnergy, G4bool fluct=true)
bool G4bool
Definition: G4Types.hh:79
G4double IonBarkasCorrection(const G4ParticleDefinition *, const G4Material *, G4double kineticEnergy)
std::vector< G4String > materialName
G4double BarkasCorrection(const G4ParticleDefinition *, const G4Material *, G4double kineticEnergy)
G4double IonHighOrderCorrections(const G4ParticleDefinition *, const G4MaterialCutsCouple *, G4double kineticEnergy)
const G4int n
const G4ParticleDefinition * particle
const G4double * GetAtomicNumDensityVector() const
Definition: G4Material.hh:216
const G4ParticleDefinition * curParticle
std::vector< const G4Material * > materialList
G4double EffectiveCharge(const G4ParticleDefinition *p, const G4Material *material, G4double kineticEnergy)
void SetupKinematics(const G4ParticleDefinition *, const G4Material *, G4double kineticEnergy)
G4double ShellCorrection(const G4ParticleDefinition *, const G4Material *, G4double kineticEnergy)
const G4double * atomDensity
G4double TheK[20]
G4double GetPDGMass() const
void BuildCorrectionVector()
std::vector< const G4ParticleDefinition * > ionList
const G4double x[NPOINTSGL]
static const G4double inveplus
G4double COSEB[14]
G4IonTable * ionTable
G4double KShellCorrection(const G4ParticleDefinition *, const G4Material *, G4double kineticEnergy)
G4double LShell(G4double theta, G4double eta)
G4double LShellCorrection(const G4ParticleDefinition *, const G4Material *, G4double kineticEnergy)
G4double a[104]
std::vector< G4PhysicsVector * > stopData
G4LPhysicsFreeVector * BarkasCorr
G4double Z23[100]
G4ionEffectiveCharge effCharge
size_t GetNumberOfElements() const
Definition: G4Material.hh:186
G4double ComputeIonCorrections(const G4ParticleDefinition *, const G4Material *, G4double kineticEnergy)
double G4double
Definition: G4Types.hh:76
G4double ShellCorrectionSTD(const G4ParticleDefinition *, const G4Material *, G4double kineticEnergy)
const G4Material * curMaterial
G4PhysicsVector * curVector
G4double GetPDGCharge() const
G4int GetNumberOfStoppingVectors()
G4double Value(G4double xv, G4double x1, G4double x2, G4double y1, G4double y2)
virtual ~G4EmCorrections()
G4double Bethe(const G4ParticleDefinition *, const G4Material *, G4double kineticEnergy)
G4double CL[26][28]
std::vector< G4int > Zion
G4double Eta[29]