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.10 2001/10/17 07:59:52 gcosmo Exp $ >> 25 // GEANT4 tag $Name: geant4-04-00 $ 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 // 32 // History: << 33 >> 34 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo.... 33 // 35 // 34 // 10.06.97 created. V. Grichine << 36 // 03.04.01 fnulcof[4] added; returned if energy < emin 35 // 18.11.98 simplified public interface; new m << 36 // 30.01.01 major bug in the computation of Ao 37 // 30.01.01 major bug in the computation of AoverAvo and in the units (/g!) 37 // in GetSandiaCofPerAtom(). mma 38 // in GetSandiaCofPerAtom(). mma 38 // 03.04.01 fnulcof[4] added; returned if ener << 39 // 18.11.98 simplified public interface; new methods for materials. mma 39 // 05.03.04 V.Grichine, new methods for old so << 40 // 10.06.97 created. V. Grichine 40 // 21.21.13 V.Ivanchenko, changed signature of << 41 // static variables, me << 42 // 41 // >> 42 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo.... 43 43 44 #ifndef G4SANDIATABLE_HH 44 #ifndef G4SANDIATABLE_HH 45 #define G4SANDIATABLE_HH 45 #define G4SANDIATABLE_HH 46 46 47 #include "G4OrderedTable.hh" << 47 #include "G4OrderedTable.hh" 48 #include "G4ios.hh" 48 #include "G4ios.hh" 49 #include "globals.hh" 49 #include "globals.hh" 50 << 51 #include <CLHEP/Units/PhysicalConstants.h> << 52 #include <assert.h> 50 #include <assert.h> 53 51 54 #include <vector> << 55 << 56 class G4Material; 52 class G4Material; 57 53 >> 54 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo.... >> 55 58 class G4SandiaTable 56 class G4SandiaTable 59 { 57 { 60 public: // with description << 58 public: // with description 61 G4SandiaTable(); << 62 G4SandiaTable(const G4Material*); << 63 G4SandiaTable(G4int matIndex); << 64 ~G4SandiaTable(); << 65 << 66 G4SandiaTable(G4SandiaTable&) = delete; << 67 G4SandiaTable& operator=(const G4SandiaTable << 68 << 69 // main computation per atom: << 70 void GetSandiaCofPerAtom(G4int Z, G4double e << 71 << 72 void GetSandiaCofWater(G4double energy, std: << 73 << 74 G4double GetWaterEnergyLimit() const; << 75 G4double GetWaterCofForMaterial(G4int, G4int << 76 59 77 static G4double GetZtoA(G4int Z); << 60 G4SandiaTable(G4int); >> 61 G4SandiaTable(G4Material*); >> 62 ~G4SandiaTable(); >> 63 >> 64 //per atom of an Element: >> 65 static G4int GetNbOfIntervals (G4int Z); >> 66 static G4double GetSandiaCofPerAtom(G4int Z, G4int, G4int); >> 67 static G4double* GetSandiaCofPerAtom(G4int Z, G4double energy); >> 68 static G4double GetIonizationPot (G4int Z); >> 69 static G4double GetZtoA (G4int Z); >> 70 >> 71 //per volume of a material: >> 72 G4int GetMatNbOfIntervals() {return fMatNbOfIntervals;}; >> 73 G4double GetSandiaCofForMaterial(G4int,G4int); >> 74 G4double* GetSandiaCofForMaterial(G4double energy); >> 75 >> 76 >> 77 private: >> 78 >> 79 void ComputeMatSandiaMatrix(); >> 80 >> 81 private: >> 82 >> 83 static const G4double fSandiaTable[981][5]; >> 84 static const G4int fNbOfIntervals[101]; >> 85 static G4int fCumulInterval[101]; >> 86 static const G4double fZtoAratio[101]; >> 87 static const G4double fIonizationPotentials[101]; >> 88 >> 89 static G4double fSandiaCofPerAtom[4]; >> 90 >> 91 G4Material* fMaterial; >> 92 G4int fMatNbOfIntervals; >> 93 G4OrderedTable* fMatSandiaMatrix; >> 94 >> 95 G4double fnulcof[4]; >> 96 78 97 79 // per volume of a material: << 98 ///////////////////////////////////////////////////////////////////// 80 G4int GetMatNbOfIntervals() const; << 99 // 81 G4double GetSandiaCofForMaterial(G4int, G4in << 100 // Methods for PAI model 82 G4double GetSandiaMatTable(G4int, G4int) con << 83 const G4double* GetSandiaCofForMaterial(G4do << 84 101 85 G4double GetSandiaMatTablePAI(G4int, G4int) << 102 public: // without description 86 const G4double* GetSandiaCofForMaterialPAI(G << 87 103 88 inline void SetVerbose(G4int ver) { fVerbose << 104 inline void SandiaSwap( G4double** da, >> 105 G4int i, >> 106 G4int j ); 89 107 90 //////////////////////////////////////////// << 108 void SandiaSort( G4double** da, 91 // << 109 G4int sz ); 92 // Methods for implementation of PAI model << 93 // << 94 //////////////////////////////////////////// << 95 110 96 void Initialize(const G4Material*); << 111 G4int SandiaIntervals( G4int Z[], >> 112 G4int el ); 97 113 98 G4int SandiaIntervals(G4int Z[], G4int el); << 114 G4int SandiaMixing( G4int Z[], >> 115 const G4double fractionW[], >> 116 G4int el, >> 117 G4int mi ); 99 118 100 G4int SandiaMixing(G4int Z[], const G4double << 119 inline G4double GetPhotoAbsorpCof(G4int i , G4int j)const ; 101 120 102 G4double GetPhotoAbsorpCof(G4int i, G4int j) << 121 inline G4int GetMaxInterval() const ; 103 122 104 G4int GetMaxInterval() const; << 105 123 106 inline G4bool GetLowerI1() { return fLowerI1 << 107 inline void SetLowerI1(G4bool flag) { fLower << 108 124 109 // operators << 125 ////////////////////////////////////////////////////////////////////////// 110 G4bool operator==(const G4SandiaTable&) cons << 126 // 111 G4bool operator!=(const G4SandiaTable&) cons << 127 // data members for PAI model 112 128 113 private: << 129 private: 114 void ComputeMatSandiaMatrix(); << 130 static const G4int fNumberOfElements ; 115 void ComputeMatSandiaMatrixPAI(); << 131 static const G4int fIntervalLimit ; >> 132 static const G4int fNumberOfIntervals ; >> 133 >> 134 // G4double fPhotoAbsorptionCof[101][5] ; // SandiaTable for mixture 116 135 117 // methods per atom << 136 G4double** fPhotoAbsorptionCof ; // SandiaTable for mixture 118 G4double GetSandiaPerAtom(G4int Z, G4int, G4 << 119 137 120 #ifdef G4VERBOSE << 138 // G4OrderedTable* 121 static G4int PrintErrorZ(G4int Z, const G4St << 139 G4int fMaxInterval ; 122 static void PrintErrorV(const G4String&); << 123 #endif << 124 140 125 void ComputeMatTable(); << 141 // >> 142 // >> 143 ////////////////////////////////////////////////////////////////////////// >> 144 >> 145 }; >> 146 >> 147 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo.... 126 148 127 void SandiaSwap(G4double** da, G4int i, G4in << 149 /////////////////////////////////////////////////////////////////////// >> 150 // >> 151 // Inline methods for PAI model 128 152 129 void SandiaSort(G4double** da, G4int sz); << 153 inline >> 154 void >> 155 G4SandiaTable::SandiaSwap( G4double** da , >> 156 G4int i, >> 157 G4int j ) >> 158 { >> 159 G4double tmp = da[i][0] ; >> 160 da[i][0] = da[j][0] ; >> 161 da[j][0] = tmp ; >> 162 } 130 163 131 G4double** GetPointerToCof(); << 164 ///////////////////////////////////////////////////////////////////////// >> 165 // >> 166 // 132 167 133 // computed once << 168 inline 134 static G4int fCumulInterval[101]; << 169 G4double G4SandiaTable::GetPhotoAbsorpCof(G4int i, G4int j) const 135 static const G4double funitc[5]; << 170 { >> 171 G4double unitCof ; >> 172 if(j == 0) >> 173 { >> 174 unitCof = keV ; >> 175 } >> 176 else >> 177 { >> 178 unitCof = (cm2/g)*pow(keV,(G4double)j) ; >> 179 } >> 180 return fPhotoAbsorptionCof[i][j]*unitCof ; >> 181 } 136 182 137 // used at initialisation << 183 ///////////////////////////////////////////////////////////////////// 138 std::vector<G4double> fSandiaCofPerAtom; << 184 // >> 185 // 139 186 140 // members of the class << 187 inline 141 const G4Material* fMaterial; << 188 G4int G4SandiaTable::GetMaxInterval() const 142 G4int fMatNbOfIntervals; << 189 { 143 G4OrderedTable* fMatSandiaMatrix; << 190 return fMaxInterval ; 144 G4OrderedTable* fMatSandiaMatrixPAI; << 191 } 145 192 146 static const G4double fSandiaTable[981][5]; << 193 // 147 static const G4int fNumberOfElements; << 194 // 148 static const G4int fIntervalLimit; << 195 //////////////////////////////////////////////////////////////////////////// 149 static const G4int fNumberOfIntervals; << 150 static const G4int fH2OlowerInt; << 151 196 152 // data members for PAI model << 153 G4double** fPhotoAbsorptionCof; // SandiaTa << 154 197 155 G4int fMaxInterval; << 198 #endif 156 G4int fVerbose; << 157 G4bool fLowerI1; << 158 }; << 159 199 160 #endif << 161 200