ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4SandiaTable.hh
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file G4SandiaTable.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 // class description
27 //
28 // This class is an interface to G4StaticSandiaData.
29 // it provides - Sandia coeff for an element, given its Z
30 // - sandia coeff for a material, given a pointer to it
31 //
32 
33 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo....
34 //
35 // History:
36 //
37 // 10.06.97 created. V. Grichine
38 // 18.11.98 simplified public interface; new methods for materials. mma
39 // 30.01.01 major bug in the computation of AoverAvo and in the units (/g!)
40 // in GetSandiaCofPerAtom(). mma
41 // 03.04.01 fnulcof[4] added; returned if energy < emin
42 // 05.03.04 V.Grichine, new methods for old sorting algorithm for PAI model
43 // 21.21.13 V.Ivanchenko, changed signature of methods, reduced number of
44 // static variables, methods
45 //
46 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo....
47 
48 #ifndef G4SANDIATABLE_HH
49 #define G4SANDIATABLE_HH
50 
51 #include "G4OrderedTable.hh"
52 #include "G4ios.hh"
53 #include "globals.hh"
54 #include <assert.h>
55 #include <vector>
56 
58 
59 class G4Material;
60 
61 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo....
62 
64 {
65 public: // with description
66 
67  G4SandiaTable(const G4Material*);
68 
70 
71  //main computation per atom:
73  std::vector<G4double>& coeff) const;
74 
75  void GetSandiaCofWater(G4double energy,
76  std::vector<G4double>& coeff) const;
77 
80 
81  static G4double GetZtoA(G4int Z);
82 
83  //per volume of a material:
84  G4int GetMatNbOfIntervals() const;
87  const G4double* GetSandiaCofForMaterial(G4double energy) const;
88 
90  const G4double* GetSandiaCofForMaterialPAI(G4double energy) const;
91 
92  inline void SetVerbose(G4int ver) { fVerbose = ver; };
93 
94 public: // without description
95 
96  G4SandiaTable(__void__&);
97  // Fake default constructor for usage restricted to direct object
98  // persistency for clients requiring preallocation of memory for
99  // persistifiable objects.
100 
101 private:
102 
103  void ComputeMatSandiaMatrix();
105 
106  // methods per atom
108 
109 #ifdef G4VERBOSE
110  static G4int PrintErrorZ(G4int Z, const G4String&);
111  static void PrintErrorV(const G4String&);
112 #endif
113 
114  // computed once
115  static G4int fCumulInterval[101];
116  static const G4double funitc[5];
117 
118  // used at initialisation
119  std::vector<G4double> fSandiaCofPerAtom;
120 
121  // members of the class
126 
128 //
129 // Methods for implementation of PAI model
130 //
132 
133 public: // without description
134 
135  G4SandiaTable(G4int matIndex);
136 
137  G4SandiaTable();
138 
139  void Initialize(const G4Material*);
140 
141  G4int SandiaIntervals(G4int Z[], G4int el);
142 
143  G4int SandiaMixing(G4int Z[], const G4double* fractionW,
144  G4int el, G4int mi);
145 
146  G4double GetPhotoAbsorpCof(G4int i , G4int j) const;
147 
148  G4int GetMaxInterval() const;
149 
150  inline G4bool GetLowerI1() {return fLowerI1;};
151  inline void SetLowerI1(G4bool flag) {fLowerI1=flag;};
152 
153 private:
154 
155  void ComputeMatTable();
156 
157  void SandiaSwap(G4double** da, G4int i, G4int j);
158 
159  void SandiaSort(G4double** da, G4int sz);
160 
162 
163  // operators
164  G4bool operator==(const G4SandiaTable&) const;
165  G4bool operator!=(const G4SandiaTable&) const;
168 
169  static const G4double fSandiaTable[981][5];
170  static const G4int fNumberOfElements;
171  static const G4int fIntervalLimit;
172  static const G4int fNumberOfIntervals;
173  static const G4int fH2OlowerInt;
174 
175  // data members for PAI model
176  G4double** fPhotoAbsorptionCof; // SandiaTable for mixture
177 
181 };
182 
183 #endif