ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4EmCorrections.hh
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file G4EmCorrections.hh
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 //
27 // -------------------------------------------------------------------
28 //
29 // GEANT4 Class header file
30 //
31 //
32 // File name: G4EmCorrections
33 //
34 // Author: Vladimir Ivanchenko
35 //
36 // Creation date: 13.01.2005
37 //
38 // Modifications:
39 // 28.04.2006 General cleanup, add finite size corrections (V.Ivanchenko)
40 // 13.05.2006 Add corrections for ion stopping (V.Ivanhcenko)
41 // 20.05.2008 Removed Finite Size correction (V.Ivanchenko)
42 // 12.09.2008 Added inlined interfaces to effective charge (V.Ivanchenko)
43 // 19.04.2012 Fix reproducibility problem (A.Ribon)
44 //
45 // Class Description:
46 //
47 // This class provides calculation of EM corrections to ionisation
48 //
49 
50 // -------------------------------------------------------------------
51 //
52 
53 #ifndef G4EmCorrections_h
54 #define G4EmCorrections_h 1
55 
57 
58 #include "globals.hh"
59 #include "G4ionEffectiveCharge.hh"
60 #include "G4Material.hh"
61 #include "G4ParticleDefinition.hh"
62 
63 class G4VEmModel;
64 class G4PhysicsVector;
65 class G4IonTable;
68 class G4Pow;
69 
71 {
72 
73 public:
74 
75  explicit G4EmCorrections(G4int verb);
76 
77  virtual ~G4EmCorrections();
78 
80  const G4Material*,
81  G4double kineticEnergy,
82  G4double cutEnergy);
83 
85  const G4MaterialCutsCouple*,
86  G4double kineticEnergy);
87 
89  const G4Material*,
90  G4double kineticEnergy);
91 
93  const G4Material*,
94  G4double kineticEnergy);
95 
97  const G4Material*,
98  G4double kineticEnergy);
99 
101  const G4Material*,
102  G4double kineticEnergy);
103 
105  const G4Material*,
106  G4double kineticEnergy);
107 
109  const G4Material*,
110  G4double kineticEnergy);
111 
113  const G4Material*,
114  G4double kineticEnergy);
115 
117  const G4Material*,
118  G4double kineticEnergy);
119 
121  const G4Material*,
122  G4double kineticEnergy);
123 
125  const G4Material*,
126  G4double kineticEnergy);
127 
129  const G4Material*,
130  G4double kineticEnergy);
131 
133  const G4Material*,
134  G4double kineticEnergy);
135 
137  G4PhysicsVector* dVector);
138 
139  void InitialiseForNewRun();
140 
141  // effective charge correction using stopping power data
143  const G4Material*,
144  G4double kineticEnergy);
145 
146  // effective charge of an ion
148  const G4Material*,
149  G4double kineticEnergy);
150 
151  inline
153  const G4Material*,
154  G4double kineticEnergy);
155 
156  // ionisation models for ions
157  inline void SetIonisationModels(G4VEmModel* m1 = nullptr,
158  G4VEmModel* m2 = nullptr);
159 
160  inline G4int GetNumberOfStoppingVectors() const;
161 
162  inline void SetVerbose(G4int verb);
163 
164 private:
165 
166  void Initialise();
167 
168  void BuildCorrectionVector();
169 
171  const G4Material*,
172  G4double kineticEnergy);
173 
175 
176  G4double LShell(G4double theta, G4double eta);
177 
178  G4int Index(G4double x, const G4double* y, G4int n) const;
179 
181  G4double y1, G4double y2) const;
182 
184  G4double y1, G4double y2, G4double z11, G4double z21,
185  G4double z12, G4double z22) const;
186 
187  // hide assignment operator
188  G4EmCorrections & operator=(const G4EmCorrections &right) = delete;
189  G4EmCorrections(const G4EmCorrections&) = delete;
190 
192 
193  static const G4double ZD[11];
194  static const G4double UK[20];
195  static const G4double VK[20];
196  static G4double ZK[20];
197  static const G4double Eta[29];
198  static G4double CK[20][29];
199  static G4double CL[26][28];
200  static const G4double UL[26];
201  static G4double VL[26];
202 
206 
208 
209  std::vector<const G4Material*> currmat;
210  std::map< G4int, std::vector<G4double> > thcorr;
211  size_t ncouples;
212 
219 
221 
225 
241 
243 
248 
251 
252  // Ion stopping data
256  std::vector<G4int> Zion;
257  std::vector<G4int> Aion;
258  std::vector<G4String> materialName;
259 
260  std::vector<const G4ParticleDefinition*> ionList;
261 
262  std::vector<const G4Material*> materialList;
263  std::vector<G4PhysicsVector*> stopData;
264 
267 };
268 
269 inline G4int
271 {
272  G4int iddd = n-1;
273  // Loop checking, 03-Aug-2015, Vladimir Ivanchenko
274  do {--iddd;} while (iddd>0 && x<y[iddd]);
275  return iddd;
276 }
277 
279  G4double y1, G4double y2) const
280 {
281  return y1 + (y2 - y1)*(xv - x1)/(x2 - x1);
282 }
283 
287  G4double z11, G4double z21,
288  G4double z12, G4double z22) const
289 {
290  return (z11*(x2-xv)*(y2-yv) + z22*(xv-x1)*(yv-y1) +
291  0.5*(z12*((x2-xv)*(yv-y1)+(xv-x1)*(y2-yv))+
292  z21*((xv-x1)*(y2-yv)+(yv-y1)*(x2-xv))))
293  / ((x2-x1)*(y2-y1));
294 }
295 
296 inline void
298 {
299  if(mod1) { ionLEModel = mod1; }
300  if(mod2) { ionHEModel = mod2; }
301 }
302 
304 {
305  return nIons;
306 }
307 
308 inline G4double
310  const G4Material* mat,
311  G4double kineticEnergy)
312 {
313  return effCharge.EffectiveCharge(p,mat,kineticEnergy);
314 }
315 
316 inline G4double
318  const G4Material* mat,
319  G4double kineticEnergy)
320 {
321  return effCharge.EffectiveChargeSquareRatio(p,mat,kineticEnergy);
322 }
323 
325 {
326  verbose = verb;
327 }
328 
329 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
330 
331 #endif