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