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