Geant4 Cross Reference |
1 // 1 // 2 // ******************************************* 2 // ******************************************************************** 3 // * License and Disclaimer 3 // * License and Disclaimer * 4 // * 4 // * * 5 // * The Geant4 software is copyright of th 5 // * The Geant4 software is copyright of the Copyright Holders of * 6 // * the Geant4 Collaboration. It is provided 6 // * the Geant4 Collaboration. It is provided under the terms and * 7 // * conditions of the Geant4 Software License 7 // * conditions of the Geant4 Software License, included in the file * 8 // * LICENSE and available at http://cern.ch/ 8 // * LICENSE and available at http://cern.ch/geant4/license . These * 9 // * include a list of copyright holders. 9 // * include a list of copyright holders. * 10 // * 10 // * * 11 // * Neither the authors of this software syst 11 // * Neither the authors of this software system, nor their employing * 12 // * institutes,nor the agencies providing fin 12 // * institutes,nor the agencies providing financial support for this * 13 // * work make any representation or warran 13 // * work make any representation or warranty, express or implied, * 14 // * regarding this software system or assum 14 // * regarding this software system or assume any liability for its * 15 // * use. Please see the license in the file 15 // * use. Please see the license in the file LICENSE and URL above * 16 // * for the full disclaimer and the limitatio 16 // * for the full disclaimer and the limitation of liability. * 17 // * 17 // * * 18 // * This code implementation is the result 18 // * This code implementation is the result of the scientific and * 19 // * technical work of the GEANT4 collaboratio 19 // * technical work of the GEANT4 collaboration. * 20 // * By using, copying, modifying or distri 20 // * By using, copying, modifying or distributing the software (or * 21 // * any work based on the software) you ag 21 // * any work based on the software) you agree to acknowledge its * 22 // * use in resulting scientific publicati 22 // * use in resulting scientific publications, and indicate your * 23 // * acceptance of all terms of the Geant4 Sof 23 // * acceptance of all terms of the Geant4 Software license. * 24 // ******************************************* 24 // ******************************************************************** >> 25 // >> 26 // >> 27 // $Id: G4SandiaTable.hh,v 1.14 2006/06/29 19:12:33 gunter Exp $ >> 28 // GEANT4 tag $Name: geant4-08-02 $ 25 29 26 // class description 30 // class description 27 // 31 // 28 // This class is an interface to G4StaticSandi 32 // This class is an interface to G4StaticSandiaData. 29 // it provides - Sandia coeff for an element, 33 // it provides - Sandia coeff for an element, given its Z 30 // - sandia coeff for a material, 34 // - sandia coeff for a material, given a pointer to it 31 // 35 // >> 36 >> 37 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo.... >> 38 // 32 // History: 39 // History: 33 // 40 // 34 // 10.06.97 created. V. Grichine << 41 // 05.03.04 V.Grichine, new methods for old sorting algorithm for PAI model 35 // 18.11.98 simplified public interface; new m << 42 // 03.04.01 fnulcof[4] added; returned if energy < emin 36 // 30.01.01 major bug in the computation of Ao 43 // 30.01.01 major bug in the computation of AoverAvo and in the units (/g!) 37 // in GetSandiaCofPerAtom(). mma 44 // in GetSandiaCofPerAtom(). mma 38 // 03.04.01 fnulcof[4] added; returned if ener << 45 // 18.11.98 simplified public interface; new methods for materials. mma 39 // 05.03.04 V.Grichine, new methods for old so << 46 // 10.06.97 created. V. Grichine 40 // 21.21.13 V.Ivanchenko, changed signature of << 41 // static variables, me << 42 // 47 // >> 48 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo.... 43 49 44 #ifndef G4SANDIATABLE_HH 50 #ifndef G4SANDIATABLE_HH 45 #define G4SANDIATABLE_HH 51 #define G4SANDIATABLE_HH 46 52 47 #include "G4OrderedTable.hh" << 53 #include "G4OrderedTable.hh" 48 #include "G4ios.hh" 54 #include "G4ios.hh" 49 #include "globals.hh" 55 #include "globals.hh" 50 << 51 #include <CLHEP/Units/PhysicalConstants.h> << 52 #include <assert.h> 56 #include <assert.h> 53 57 54 #include <vector> << 55 << 56 class G4Material; 58 class G4Material; 57 59 >> 60 >> 61 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo.... >> 62 58 class G4SandiaTable 63 class G4SandiaTable 59 { 64 { 60 public: // with description << 65 public: // with description 61 G4SandiaTable(); << 62 G4SandiaTable(const G4Material*); << 63 G4SandiaTable(G4int matIndex); << 64 ~G4SandiaTable(); << 65 66 66 G4SandiaTable(G4SandiaTable&) = delete; << 67 G4SandiaTable(G4int); 67 G4SandiaTable& operator=(const G4SandiaTable << 68 G4SandiaTable(G4Material*); 68 69 69 // main computation per atom: << 70 70 void GetSandiaCofPerAtom(G4int Z, G4double e << 71 ~G4SandiaTable(); 71 72 72 void GetSandiaCofWater(G4double energy, std: << 73 //per atom of an Element: >> 74 static G4int GetNbOfIntervals (G4int Z); >> 75 static G4double GetSandiaCofPerAtom(G4int Z, G4int, G4int); >> 76 static G4double* GetSandiaCofPerAtom(G4int Z, G4double energy); >> 77 static G4double GetIonizationPot (G4int Z); >> 78 static G4double GetZtoA (G4int Z); >> 79 >> 80 //per volume of a material: >> 81 G4int GetMatNbOfIntervals() {return fMatNbOfIntervals;}; >> 82 G4double GetSandiaCofForMaterial(G4int,G4int); >> 83 G4double* GetSandiaCofForMaterial(G4double energy); >> 84 >> 85 public: // without description >> 86 >> 87 G4SandiaTable(__void__&); >> 88 // Fake default constructor for usage restricted to direct object >> 89 // persistency for clients requiring preallocation of memory for >> 90 // persistifiable objects. >> 91 >> 92 private: >> 93 >> 94 void ComputeMatSandiaMatrix(); >> 95 >> 96 private: >> 97 >> 98 static const G4double fSandiaTable[981][5]; >> 99 static const G4int fNbOfIntervals[101]; >> 100 static G4int fCumulInterval[101]; >> 101 static const G4double fZtoAratio[101]; >> 102 static const G4double fIonizationPotentials[101]; >> 103 >> 104 static G4double fSandiaCofPerAtom[4]; >> 105 >> 106 G4Material* fMaterial; >> 107 G4int fMatNbOfIntervals; >> 108 G4OrderedTable* fMatSandiaMatrix; >> 109 >> 110 G4double fnulcof[4]; >> 111 73 112 74 G4double GetWaterEnergyLimit() const; << 113 ///////////////////////////////////////////////////////////////////// 75 G4double GetWaterCofForMaterial(G4int, G4int << 114 // >> 115 // Methods for PAI model 76 116 77 static G4double GetZtoA(G4int Z); << 117 public: // without description 78 118 79 // per volume of a material: << 80 G4int GetMatNbOfIntervals() const; << 81 G4double GetSandiaCofForMaterial(G4int, G4in << 82 G4double GetSandiaMatTable(G4int, G4int) con << 83 const G4double* GetSandiaCofForMaterial(G4do << 84 119 85 G4double GetSandiaMatTablePAI(G4int, G4int) << 120 inline void SandiaSwap( G4double** da, 86 const G4double* GetSandiaCofForMaterialPAI(G << 121 G4int i, >> 122 G4int j ); 87 123 88 inline void SetVerbose(G4int ver) { fVerbose << 124 void SandiaSort( G4double** da, >> 125 G4int sz ); 89 126 90 //////////////////////////////////////////// << 127 G4int SandiaIntervals( G4int Z[], 91 // << 128 G4int el ); 92 // Methods for implementation of PAI model << 93 // << 94 //////////////////////////////////////////// << 95 129 96 void Initialize(const G4Material*); << 130 G4int SandiaMixing( G4int Z[], >> 131 const G4double fractionW[], >> 132 G4int el, >> 133 G4int mi ); 97 134 98 G4int SandiaIntervals(G4int Z[], G4int el); << 135 inline G4double GetPhotoAbsorpCof(G4int i , G4int j) const; 99 136 100 G4int SandiaMixing(G4int Z[], const G4double << 137 inline G4int GetMaxInterval() const { return fMaxInterval;}; 101 138 102 G4double GetPhotoAbsorpCof(G4int i, G4int j) << 139 G4OrderedTable* GetSandiaMatTable() const {return fMatSandiaMatrix;}; >> 140 inline G4double GetSandiaMatTable(G4int,G4int) const; 103 141 104 G4int GetMaxInterval() const; << 142 private: 105 143 106 inline G4bool GetLowerI1() { return fLowerI1 << 144 void ComputeMatTable(); 107 inline void SetLowerI1(G4bool flag) { fLower << 108 145 109 // operators << 110 G4bool operator==(const G4SandiaTable&) cons << 111 G4bool operator!=(const G4SandiaTable&) cons << 112 146 113 private: << 147 ////////////////////////////////////////////////////////////////////////// 114 void ComputeMatSandiaMatrix(); << 148 // 115 void ComputeMatSandiaMatrixPAI(); << 149 // data members for PAI model >> 150 >> 151 private: >> 152 static const G4int fNumberOfElements ; >> 153 static const G4int fIntervalLimit ; >> 154 static const G4int fNumberOfIntervals ; >> 155 >> 156 // G4double fPhotoAbsorptionCof[101][5] ; // SandiaTable for mixture 116 157 117 // methods per atom << 158 G4double** fPhotoAbsorptionCof ; // SandiaTable for mixture 118 G4double GetSandiaPerAtom(G4int Z, G4int, G4 << 119 159 120 #ifdef G4VERBOSE << 160 // G4OrderedTable* 121 static G4int PrintErrorZ(G4int Z, const G4St << 161 G4int fMaxInterval ; 122 static void PrintErrorV(const G4String&); << 123 #endif << 124 162 125 void ComputeMatTable(); << 163 // >> 164 // >> 165 ////////////////////////////////////////////////////////////////////////// >> 166 >> 167 }; >> 168 >> 169 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo.... 126 170 127 void SandiaSwap(G4double** da, G4int i, G4in << 171 /////////////////////////////////////////////////////////////////////// >> 172 // >> 173 // Inline methods for PAI model 128 174 129 void SandiaSort(G4double** da, G4int sz); << 175 inline >> 176 void >> 177 G4SandiaTable::SandiaSwap( G4double** da , >> 178 G4int i, >> 179 G4int j ) >> 180 { >> 181 G4double tmp = da[i][0] ; >> 182 da[i][0] = da[j][0] ; >> 183 da[j][0] = tmp ; >> 184 } 130 185 131 G4double** GetPointerToCof(); << 186 ///////////////////////////////////////////////////////////////////////// >> 187 // >> 188 // 132 189 133 // computed once << 190 inline 134 static G4int fCumulInterval[101]; << 191 G4double G4SandiaTable::GetPhotoAbsorpCof(G4int i, G4int j) const 135 static const G4double funitc[5]; << 192 { >> 193 G4double unitCof ; >> 194 if(j == 0) unitCof = keV ; >> 195 else unitCof = (cm2/g)*std::pow(keV,(G4double)j) ; >> 196 >> 197 return fPhotoAbsorptionCof[i][j]*unitCof ; >> 198 } 136 199 137 // used at initialisation << 200 /////////////////////////////////////////////////////////////////////// 138 std::vector<G4double> fSandiaCofPerAtom; << 201 // >> 202 // 139 203 140 // members of the class << 204 inline G4double G4SandiaTable::GetSandiaMatTable(G4int interval, G4int j) const 141 const G4Material* fMaterial; << 205 { 142 G4int fMatNbOfIntervals; << 206 assert (interval >= 0 && interval < fMaxInterval && j >= 0 && j < 5 ); 143 G4OrderedTable* fMatSandiaMatrix; << 207 G4double unitCof ; 144 G4OrderedTable* fMatSandiaMatrixPAI; << 208 if(j == 0) unitCof = keV ; >> 209 else unitCof = (cm2/g)*std::pow(keV,(G4double)j); >> 210 return ( (*(*fMatSandiaMatrix)[interval])[j] )*unitCof; >> 211 } 145 212 146 static const G4double fSandiaTable[981][5]; << 213 // 147 static const G4int fNumberOfElements; << 214 // 148 static const G4int fIntervalLimit; << 215 //////////////////////////////////////////////////////////////////////////// 149 static const G4int fNumberOfIntervals; << 150 static const G4int fH2OlowerInt; << 151 216 152 // data members for PAI model << 153 G4double** fPhotoAbsorptionCof; // SandiaTa << 154 217 155 G4int fMaxInterval; << 218 #endif 156 G4int fVerbose; << 157 G4bool fLowerI1; << 158 }; << 159 219 160 #endif << 161 220