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.13 2005/11/09 15:38:43 gcosmo Exp $ >> 25 // GEANT4 tag $Name: geant4-08-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 public: // without description >> 83 >> 84 G4SandiaTable(__void__&); >> 85 // Fake default constructor for usage restricted to direct object >> 86 // persistency for clients requiring preallocation of memory for >> 87 // persistifiable objects. >> 88 >> 89 private: >> 90 >> 91 void ComputeMatSandiaMatrix(); >> 92 >> 93 private: >> 94 >> 95 static const G4double fSandiaTable[981][5]; >> 96 static const G4int fNbOfIntervals[101]; >> 97 static G4int fCumulInterval[101]; >> 98 static const G4double fZtoAratio[101]; >> 99 static const G4double fIonizationPotentials[101]; >> 100 >> 101 static G4double fSandiaCofPerAtom[4]; >> 102 >> 103 G4Material* fMaterial; >> 104 G4int fMatNbOfIntervals; >> 105 G4OrderedTable* fMatSandiaMatrix; >> 106 >> 107 G4double fnulcof[4]; >> 108 73 109 74 G4double GetWaterEnergyLimit() const; << 110 ///////////////////////////////////////////////////////////////////// 75 G4double GetWaterCofForMaterial(G4int, G4int << 111 // >> 112 // Methods for PAI model 76 113 77 static G4double GetZtoA(G4int Z); << 114 public: // without description 78 115 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 116 85 G4double GetSandiaMatTablePAI(G4int, G4int) << 117 inline void SandiaSwap( G4double** da, 86 const G4double* GetSandiaCofForMaterialPAI(G << 118 G4int i, >> 119 G4int j ); 87 120 88 inline void SetVerbose(G4int ver) { fVerbose << 121 void SandiaSort( G4double** da, >> 122 G4int sz ); 89 123 90 //////////////////////////////////////////// << 124 G4int SandiaIntervals( G4int Z[], 91 // << 125 G4int el ); 92 // Methods for implementation of PAI model << 93 // << 94 //////////////////////////////////////////// << 95 126 96 void Initialize(const G4Material*); << 127 G4int SandiaMixing( G4int Z[], >> 128 const G4double fractionW[], >> 129 G4int el, >> 130 G4int mi ); 97 131 98 G4int SandiaIntervals(G4int Z[], G4int el); << 132 inline G4double GetPhotoAbsorpCof(G4int i , G4int j) const; 99 133 100 G4int SandiaMixing(G4int Z[], const G4double << 134 inline G4int GetMaxInterval() const { return fMaxInterval;}; 101 135 102 G4double GetPhotoAbsorpCof(G4int i, G4int j) << 136 G4OrderedTable* GetSandiaMatTable() const {return fMatSandiaMatrix;}; >> 137 inline G4double GetSandiaMatTable(G4int,G4int) const; 103 138 104 G4int GetMaxInterval() const; << 139 private: 105 140 106 inline G4bool GetLowerI1() { return fLowerI1 << 141 void ComputeMatTable(); 107 inline void SetLowerI1(G4bool flag) { fLower << 108 142 109 // operators << 110 G4bool operator==(const G4SandiaTable&) cons << 111 G4bool operator!=(const G4SandiaTable&) cons << 112 143 113 private: << 144 ////////////////////////////////////////////////////////////////////////// 114 void ComputeMatSandiaMatrix(); << 145 // 115 void ComputeMatSandiaMatrixPAI(); << 146 // data members for PAI model >> 147 >> 148 private: >> 149 static const G4int fNumberOfElements ; >> 150 static const G4int fIntervalLimit ; >> 151 static const G4int fNumberOfIntervals ; >> 152 >> 153 // G4double fPhotoAbsorptionCof[101][5] ; // SandiaTable for mixture 116 154 117 // methods per atom << 155 G4double** fPhotoAbsorptionCof ; // SandiaTable for mixture 118 G4double GetSandiaPerAtom(G4int Z, G4int, G4 << 119 156 120 #ifdef G4VERBOSE << 157 // G4OrderedTable* 121 static G4int PrintErrorZ(G4int Z, const G4St << 158 G4int fMaxInterval ; 122 static void PrintErrorV(const G4String&); << 123 #endif << 124 159 125 void ComputeMatTable(); << 160 // >> 161 // >> 162 ////////////////////////////////////////////////////////////////////////// >> 163 >> 164 }; >> 165 >> 166 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo.... 126 167 127 void SandiaSwap(G4double** da, G4int i, G4in << 168 /////////////////////////////////////////////////////////////////////// >> 169 // >> 170 // Inline methods for PAI model 128 171 129 void SandiaSort(G4double** da, G4int sz); << 172 inline >> 173 void >> 174 G4SandiaTable::SandiaSwap( G4double** da , >> 175 G4int i, >> 176 G4int j ) >> 177 { >> 178 G4double tmp = da[i][0] ; >> 179 da[i][0] = da[j][0] ; >> 180 da[j][0] = tmp ; >> 181 } 130 182 131 G4double** GetPointerToCof(); << 183 ///////////////////////////////////////////////////////////////////////// >> 184 // >> 185 // 132 186 133 // computed once << 187 inline 134 static G4int fCumulInterval[101]; << 188 G4double G4SandiaTable::GetPhotoAbsorpCof(G4int i, G4int j) const 135 static const G4double funitc[5]; << 189 { >> 190 G4double unitCof ; >> 191 if(j == 0) unitCof = keV ; >> 192 else unitCof = (cm2/g)*std::pow(keV,(G4double)j) ; >> 193 >> 194 return fPhotoAbsorptionCof[i][j]*unitCof ; >> 195 } 136 196 137 // used at initialisation << 197 /////////////////////////////////////////////////////////////////////// 138 std::vector<G4double> fSandiaCofPerAtom; << 198 // >> 199 // 139 200 140 // members of the class << 201 inline G4double G4SandiaTable::GetSandiaMatTable(G4int interval, G4int j) const 141 const G4Material* fMaterial; << 202 { 142 G4int fMatNbOfIntervals; << 203 assert (interval >= 0 && interval < fMaxInterval && j >= 0 && j < 5 ); 143 G4OrderedTable* fMatSandiaMatrix; << 204 G4double unitCof ; 144 G4OrderedTable* fMatSandiaMatrixPAI; << 205 if(j == 0) unitCof = keV ; >> 206 else unitCof = (cm2/g)*std::pow(keV,(G4double)j); >> 207 return ( (*(*fMatSandiaMatrix)[interval])[j] )*unitCof; >> 208 } 145 209 146 static const G4double fSandiaTable[981][5]; << 210 // 147 static const G4int fNumberOfElements; << 211 // 148 static const G4int fIntervalLimit; << 212 //////////////////////////////////////////////////////////////////////////// 149 static const G4int fNumberOfIntervals; << 150 static const G4int fH2OlowerInt; << 151 213 152 // data members for PAI model << 153 G4double** fPhotoAbsorptionCof; // SandiaTa << 154 214 155 G4int fMaxInterval; << 215 #endif 156 G4int fVerbose; << 157 G4bool fLowerI1; << 158 }; << 159 216 160 #endif << 161 217