[1197] | 1 | // |
---|
| 2 | // ******************************************************************** |
---|
| 3 | // * License and Disclaimer * |
---|
| 4 | // * * |
---|
| 5 | // * The Geant4 software is copyright of the Copyright Holders of * |
---|
| 6 | // * the Geant4 Collaboration. It is provided under the terms and * |
---|
| 7 | // * conditions of the Geant4 Software License, included in the file * |
---|
| 8 | // * LICENSE and available at http://cern.ch/geant4/license . These * |
---|
| 9 | // * include a list of copyright holders. * |
---|
| 10 | // * * |
---|
| 11 | // * Neither the authors of this software system, nor their employing * |
---|
| 12 | // * institutes,nor the agencies providing financial support for this * |
---|
| 13 | // * work make any representation or warranty, express or implied, * |
---|
| 14 | // * regarding this software system or assume any liability for its * |
---|
| 15 | // * use. Please see the license in the file LICENSE and URL above * |
---|
| 16 | // * for the full disclaimer and the limitation of liability. * |
---|
| 17 | // * * |
---|
| 18 | // * This code implementation is the result of the scientific and * |
---|
| 19 | // * technical work of the GEANT4 collaboration. * |
---|
| 20 | // * By using, copying, modifying or distributing the software (or * |
---|
| 21 | // * any work based on the software) you agree to acknowledge its * |
---|
| 22 | // * use in resulting scientific publications, and indicate your * |
---|
| 23 | // * acceptance of all terms of the Geant4 Software license. * |
---|
| 24 | // ******************************************************************** |
---|
| 25 | // |
---|
[1228] | 26 | // $Id: G4DensityEffectData.hh,v 1.7 2009/12/01 08:24:21 gcosmo Exp $ |
---|
| 27 | // GEANT4 tag $Name: geant4-09-03 $ |
---|
[1197] | 28 | |
---|
| 29 | //--------------------------------------------------------------------------- |
---|
| 30 | // |
---|
| 31 | // GEANT4 Class file |
---|
| 32 | // |
---|
| 33 | // Description: Data on density effect |
---|
| 34 | // |
---|
| 35 | // Authors: A.Bagulya, A.Ivanchenko 28.10.2009 |
---|
| 36 | // |
---|
| 37 | // Modifications: |
---|
| 38 | // |
---|
| 39 | // |
---|
| 40 | // |
---|
| 41 | //---------------------------------------------------------------------------- |
---|
| 42 | // |
---|
| 43 | // Data are taken from: |
---|
| 44 | // R.M. Sternheimer et al. Density Effect for the Ionization Loss of Charged |
---|
| 45 | // Particles in Various Substances. Atom. Data Nucl. Data Tabl. 30 (1984) 261-271. |
---|
| 46 | |
---|
| 47 | #ifndef DensityEffectData_h |
---|
| 48 | #define DensityEffectData_h 1 |
---|
| 49 | |
---|
| 50 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... |
---|
| 51 | |
---|
| 52 | #include "globals.hh" |
---|
| 53 | #include <vector> |
---|
| 54 | |
---|
| 55 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... |
---|
| 56 | |
---|
| 57 | const G4int NDENSDATA = 278; |
---|
| 58 | const G4int NDENSARRAY = 9; |
---|
| 59 | const G4int NDENSELEM = 98; |
---|
| 60 | |
---|
| 61 | class G4DensityEffectData |
---|
| 62 | { |
---|
| 63 | public: |
---|
| 64 | |
---|
| 65 | G4DensityEffectData(); |
---|
| 66 | |
---|
| 67 | ~G4DensityEffectData(); |
---|
| 68 | |
---|
| 69 | // return index by Z, -1 if material is not in the table |
---|
| 70 | G4int GetIndex(const G4int Z); |
---|
| 71 | |
---|
| 72 | // return index by material name, -1 if material is not in the table |
---|
| 73 | G4int GetIndex(const G4String& matName); |
---|
| 74 | |
---|
| 75 | // printout data for material |
---|
| 76 | void PrintData(const G4String& matName); |
---|
| 77 | |
---|
| 78 | // printout all data |
---|
| 79 | void DumpData(); |
---|
| 80 | |
---|
| 81 | // Access to the data via index |
---|
[1228] | 82 | inline G4double GetPlasmaEnergy(G4int idx); |
---|
| 83 | inline G4double GetAdjustmentFactor(G4int idx); |
---|
| 84 | inline G4double GetCdensity(G4int idx); |
---|
| 85 | inline G4double GetX0density(G4int idx); |
---|
| 86 | inline G4double GetX1density(G4int idx); |
---|
| 87 | inline G4double GetAdensity(G4int idx); |
---|
| 88 | inline G4double GetMdensity(G4int idx); |
---|
| 89 | inline G4double GetDelta0density(G4int idx); |
---|
| 90 | inline G4double GetErrorDensity(G4int idx); |
---|
[1197] | 91 | |
---|
| 92 | private: |
---|
| 93 | |
---|
| 94 | void Initialize(); |
---|
| 95 | |
---|
[1228] | 96 | void AddMaterial(G4double* val, const G4String& matName); |
---|
[1197] | 97 | |
---|
| 98 | // Assignment operator and copy constructor |
---|
| 99 | G4DensityEffectData & operator=(const G4DensityEffectData &right); |
---|
| 100 | G4DensityEffectData(const G4DensityEffectData&); |
---|
| 101 | |
---|
[1228] | 102 | G4double data[NDENSDATA][NDENSARRAY]; |
---|
[1197] | 103 | std::vector<G4String> names; |
---|
| 104 | G4int indexZ[NDENSELEM]; |
---|
| 105 | |
---|
| 106 | G4int index; |
---|
| 107 | |
---|
| 108 | }; |
---|
| 109 | |
---|
[1228] | 110 | inline G4double G4DensityEffectData::GetPlasmaEnergy(G4int idx) |
---|
[1197] | 111 | { |
---|
[1228] | 112 | G4double x = DBL_MAX; |
---|
[1197] | 113 | if(idx >= 0 && idx < NDENSDATA) { x = data[idx][0]; } |
---|
| 114 | return x; |
---|
| 115 | } |
---|
| 116 | |
---|
[1228] | 117 | inline G4double G4DensityEffectData::GetAdjustmentFactor(G4int idx) |
---|
[1197] | 118 | { |
---|
[1228] | 119 | G4double x = DBL_MAX; |
---|
[1197] | 120 | if(idx >= 0 && idx < NDENSDATA) { x = data[idx][1]; } |
---|
| 121 | return x; |
---|
| 122 | } |
---|
| 123 | |
---|
[1228] | 124 | inline G4double G4DensityEffectData::GetCdensity(G4int idx) |
---|
[1197] | 125 | { |
---|
[1228] | 126 | G4double x = DBL_MAX; |
---|
[1197] | 127 | if(idx >= 0 && idx < NDENSDATA) { x = data[idx][2]; } |
---|
| 128 | return x; |
---|
| 129 | } |
---|
| 130 | |
---|
[1228] | 131 | inline G4double G4DensityEffectData::GetX0density(G4int idx) |
---|
[1197] | 132 | { |
---|
[1228] | 133 | G4double x = DBL_MAX; |
---|
[1197] | 134 | if(idx >= 0 && idx < NDENSDATA) { x = data[idx][3]; } |
---|
| 135 | return x; |
---|
| 136 | } |
---|
| 137 | |
---|
[1228] | 138 | inline G4double G4DensityEffectData::GetX1density(G4int idx) |
---|
[1197] | 139 | { |
---|
[1228] | 140 | G4double x = DBL_MAX; |
---|
[1197] | 141 | if(idx >= 0 && idx < NDENSDATA) { x = data[idx][4]; } |
---|
| 142 | return x; |
---|
| 143 | } |
---|
| 144 | |
---|
[1228] | 145 | inline G4double G4DensityEffectData::GetAdensity(G4int idx) |
---|
[1197] | 146 | { |
---|
[1228] | 147 | G4double x = DBL_MAX; |
---|
[1197] | 148 | if(idx >= 0 && idx < NDENSDATA) { x = data[idx][5]; } |
---|
| 149 | return x; |
---|
| 150 | } |
---|
| 151 | |
---|
[1228] | 152 | inline G4double G4DensityEffectData::GetMdensity(G4int idx) |
---|
[1197] | 153 | { |
---|
[1228] | 154 | G4double x = DBL_MAX; |
---|
[1197] | 155 | if(idx >= 0 && idx < NDENSDATA) { x = data[idx][6]; } |
---|
| 156 | return x; |
---|
| 157 | } |
---|
| 158 | |
---|
[1228] | 159 | inline G4double G4DensityEffectData::GetDelta0density(G4int idx) |
---|
[1197] | 160 | { |
---|
[1228] | 161 | G4double x = DBL_MAX; |
---|
[1197] | 162 | if(idx >= 0 && idx < NDENSDATA) { x = data[idx][7]; } |
---|
| 163 | return x; |
---|
| 164 | } |
---|
| 165 | |
---|
[1228] | 166 | inline G4double G4DensityEffectData::GetErrorDensity(G4int idx) |
---|
[1197] | 167 | { |
---|
[1228] | 168 | G4double x = DBL_MAX; |
---|
[1197] | 169 | if(idx >= 0 && idx < NDENSDATA) { x = data[idx][8]; } |
---|
| 170 | return x; |
---|
| 171 | } |
---|
| 172 | |
---|
| 173 | |
---|
| 174 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... |
---|
| 175 | |
---|
| 176 | #endif |
---|
| 177 | |
---|