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