Geant4  10.03.p01
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
G4SandiaTable.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 //
27 // $Id: G4SandiaTable.hh 96794 2016-05-09 10:09:30Z gcosmo $
28 
29 // class description
30 //
31 // This class is an interface to G4StaticSandiaData.
32 // it provides - Sandia coeff for an element, given its Z
33 // - sandia coeff for a material, given a pointer to it
34 //
35 
36 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo....
37 //
38 // History:
39 //
40 // 10.06.97 created. V. Grichine
41 // 18.11.98 simplified public interface; new methods for materials. mma
42 // 30.01.01 major bug in the computation of AoverAvo and in the units (/g!)
43 // in GetSandiaCofPerAtom(). mma
44 // 03.04.01 fnulcof[4] added; returned if energy < emin
45 // 05.03.04 V.Grichine, new methods for old sorting algorithm for PAI model
46 // 21.21.13 V.Ivanchenko, changed signature of methods, reduced number of
47 // static variables, methods
48 //
49 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo....
50 
51 #ifndef G4SANDIATABLE_HH
52 #define G4SANDIATABLE_HH
53 
54 #include "G4OrderedTable.hh"
55 #include "G4ios.hh"
56 #include "globals.hh"
57 #include <assert.h>
58 #include <vector>
59 
61 
62 class G4Material;
63 
64 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo....
65 
67 {
68 public: // with description
69 
71 
73 
74  //main computation per atom:
76  std::vector<G4double>& coeff) const;
77 
78  void GetSandiaCofWater(G4double energy,
79  std::vector<G4double>& coeff) const;
80 
83 
84  static G4double GetZtoA(G4int Z);
85 
86  //per volume of a material:
87  G4int GetMatNbOfIntervals() const;
90  const G4double* GetSandiaCofForMaterial(G4double energy) const;
91 
93  const G4double* GetSandiaCofForMaterialPAI(G4double energy) const;
94 
95  inline void SetVerbose(G4int ver) { fVerbose = ver; };
96 
97 public: // without description
98 
99  G4SandiaTable(__void__&);
100  // Fake default constructor for usage restricted to direct object
101  // persistency for clients requiring preallocation of memory for
102  // persistifiable objects.
103 
104 private:
105 
106  void ComputeMatSandiaMatrix();
107  void ComputeMatSandiaMatrixPAI();
108 
109  // methods per atom
110  G4double GetSandiaPerAtom(G4int Z, G4int, G4int) const;
111 
112 #ifdef G4VERBOSE
113  static G4int PrintErrorZ(G4int Z, const G4String&);
114  static void PrintErrorV(const G4String&);
115 #endif
116 
117  // computed once
118  static G4int fCumulInterval[101];
119  static const G4double funitc[5];
120 
121  // used at initialisation
122  std::vector<G4double> fSandiaCofPerAtom;
123 
124  // members of the class
125  G4Material* fMaterial;
126  G4int fMatNbOfIntervals;
127  G4OrderedTable* fMatSandiaMatrix;
128  G4OrderedTable* fMatSandiaMatrixPAI;
129 
131 //
132 // Methods for implementation of PAI model
133 //
135 
136 public: // without description
137 
138  G4SandiaTable(G4int matIndex);
139 
140  G4SandiaTable();
141 
142  void Initialize(G4Material*);
143 
144  G4int SandiaIntervals(G4int Z[], G4int el);
145 
146  G4int SandiaMixing(G4int Z[], const G4double* fractionW,
147  G4int el, G4int mi);
148 
149  G4double GetPhotoAbsorpCof(G4int i , G4int j) const;
150 
151  G4int GetMaxInterval() const;
152 
153  inline G4bool GetLowerI1() {return fLowerI1;};
154  inline void SetLowerI1(G4bool flag) {fLowerI1=flag;};
155 
156 private:
157 
158  void ComputeMatTable();
159 
160  void SandiaSwap(G4double** da, G4int i, G4int j);
161 
162  void SandiaSort(G4double** da, G4int sz);
163 
164  G4double** GetPointerToCof();
165 
166  // copy constructor and hide assignment operator
167  G4SandiaTable(G4SandiaTable &) = delete;
168  G4SandiaTable & operator=(const G4SandiaTable &right) = delete;
169 
170  static const G4double fSandiaTable[981][5];
171  static const G4int fNumberOfElements;
172  static const G4int fIntervalLimit;
173  static const G4int fNumberOfIntervals;
174  static const G4int fH2OlowerInt;
175 
176  // data members for PAI model
177  G4double** fPhotoAbsorptionCof; // SandiaTable for mixture
178 
179  G4int fMaxInterval ;
180  G4int fVerbose;
181  G4bool fLowerI1;
182 };
183 
184 #endif
const G4double * GetSandiaCofForMaterialPAI(G4double energy) const
G4double GetSandiaCofForMaterial(G4int, G4int) const
G4int GetMaxInterval() const
G4double GetSandiaMatTablePAI(G4int, G4int) const
int G4int
Definition: G4Types.hh:78
G4int SandiaMixing(G4int Z[], const G4double *fractionW, G4int el, G4int mi)
G4double GetWaterCofForMaterial(G4int, G4int) const
bool G4bool
Definition: G4Types.hh:79
G4bool GetLowerI1()
G4int GetMatNbOfIntervals() const
G4int SandiaIntervals(G4int Z[], G4int el)
void SetLowerI1(G4bool flag)
G4double energy(const ThreeVector &p, const G4double m)
static G4double GetZtoA(G4int Z)
G4double GetPhotoAbsorpCof(G4int i, G4int j) const
G4double GetSandiaMatTable(G4int, G4int) const
void GetSandiaCofWater(G4double energy, std::vector< G4double > &coeff) const
double G4double
Definition: G4Types.hh:76
void SetVerbose(G4int ver)
void GetSandiaCofPerAtom(G4int Z, G4double energy, std::vector< G4double > &coeff) const
G4double GetWaterEnergyLimit() const
void Initialize(G4Material *)