Changeset 1058 for trunk/source/materials/include/G4IronStoppingICRU73.hh
- Timestamp:
- May 29, 2009, 3:55:14 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/materials/include/G4IronStoppingICRU73.hh
r986 r1058 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4IronStoppingICRU73.hh,v 1. 3 2008/11/02 12:22:19 vnivanchExp $27 // GEANT4 tag $Name: geant4-09-0 2-ref-02$26 // $Id: G4IronStoppingICRU73.hh,v 1.4 2009/03/18 10:14:48 alechner Exp $ 27 // GEANT4 tag $Name: geant4-09-03-beta-cand-01 $ 28 28 29 29 #ifndef G4IronStoppingICRU73_h … … 51 51 52 52 #include "globals.hh" 53 #include "G4VIonDEDXTable.hh" 53 54 #include "G4LPhysicsFreeVector.hh" 54 55 #include <vector> 55 56 56 class G4IronStoppingICRU73 57 58 class G4IronStoppingICRU73 : public G4VIonDEDXTable 57 59 { 58 60 public: … … 62 64 ~G4IronStoppingICRU73(); 63 65 64 G4double GetDEDX(G4int idxMaterial, G4double kinEnergy); 66 G4bool IsApplicable(G4int ionZ, 67 G4int matZ); 65 68 66 inline G4double GetDEDX(const G4String& NameMaterial, G4double kinEnergy); 69 G4bool IsApplicable(G4int ionZ, 70 const G4String& matName); 67 71 68 inline G4int GetMaterialIndex(const G4String& NameMaterial); 72 G4PhysicsVector* GetPhysicsVector(G4int ionZ, 73 G4int matZ); 69 74 70 // Function returns an unique index (>=0) for each ion-material couple (the 71 // return value is -1 if the couple is not found): 72 inline G4int GetIonMaterialCoupleIndex( 73 G4int atomicNumber, // Atomic number of ion 74 const G4String& materialName); // Material name 75 G4PhysicsVector* GetPhysicsVector(G4int ionZ, 76 const G4String& matName); 75 77 76 inline G4double GetDensity(G4int idx); 78 G4double GetDEDX(G4double kinEnergyPerNucleon, 79 G4int ionZ, 80 const G4String& matName); 77 81 78 inline G4String GetMaterialName(G4int idx); 79 80 inline G4PhysicsVector* GetPhysicsVector(G4int idx); 81 82 inline G4PhysicsVector* GetPhysicsVector(const G4String& NameMaterial); 83 84 inline G4double GetLowerEnergyBoundary(); 85 86 inline G4double GetUpperEnergyBoundary(); 82 G4double GetDEDX(G4double kinEnergyPerNucleon, 83 G4int ionZ, 84 G4int matZ); 87 85 88 86 private: 87 // Function for creating a physics vector 88 G4PhysicsVector* CreatePhysicsVector(G4double* energy, 89 G4double* stoppower, 90 G4double factor); 89 91 90 void AddData(G4double* energy, G4double* stoppower, G4double factor); 92 // Assignment operator and copy constructor 93 G4IronStoppingICRU73 & operator=(const G4IronStoppingICRU73 &right); 94 G4IronStoppingICRU73(const G4IronStoppingICRU73&); 91 95 92 void Initialise(); 96 // Flag indicating the use of spline interpolation for dE/dx vectors 97 G4bool spline; 93 98 94 // hide assignment operator95 G4IronStoppingICRU73 & operator=(const G4IronStoppingICRU73 &right);96 G4IronStoppingICRU73(const G4IronStoppingICRU73&);99 // Vectors containing the atomic numbers and names of the materials 100 std::vector<G4int> atomicNumbersMat; 101 std::vector<G4String> namesMat; 97 102 98 G4bool spline; 99 G4String MatName[16]; 100 G4double Density[16]; 103 // Keys (material names) corresponding to created dE/dx vectors 104 std::vector<G4String> dedxKeys; 101 105 102 // Lower and upper energy boundaries for dE/dx vectors:103 G4double lowerEnergyBoundary;104 G4double upperEnergyBoundary;106 // Vector of dE/dx vectors 107 std::vector<G4PhysicsVector*> dedx; 108 }; 105 109 106 std::vector<G4LPhysicsFreeVector*> dedx; 107 }; 110 108 111 109 112 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 110 113 111 inline G4double G4IronStoppingICRU73::GetDEDX(const G4String& NameMaterial,112 G4double kinEnergy)113 {114 return GetDEDX(GetMaterialIndex(NameMaterial), kinEnergy);115 }116 117 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......118 119 inline G4int120 G4IronStoppingICRU73::GetMaterialIndex(const G4String& NameMaterial)121 {122 G4int idx = -1;123 for (G4int idxMaterial=0; idxMaterial<16; idxMaterial++){124 if(MatName[idxMaterial] == NameMaterial) {125 idx = idxMaterial;126 break;127 }128 }129 return idx;130 }131 132 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......133 134 inline G4int135 G4IronStoppingICRU73::GetIonMaterialCoupleIndex(G4int atomicNumber,136 const G4String& materialName)137 {138 G4int idx = -1;139 if(atomicNumber == 26) idx = GetMaterialIndex(materialName);140 return idx;141 }142 143 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......144 145 inline G4double G4IronStoppingICRU73::GetDensity(G4int idxMaterial)146 {147 G4double d = 0.0;148 if( idxMaterial >= 0 && idxMaterial <= 15) d = Density[idxMaterial];149 return d;150 }151 152 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......153 154 inline G4String G4IronStoppingICRU73::GetMaterialName(G4int idxMaterial)155 {156 G4String s = "";157 if( idxMaterial >= 0 && idxMaterial <= 15) s = MatName[idxMaterial];158 return s;159 }160 161 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......162 163 inline164 G4PhysicsVector* G4IronStoppingICRU73::GetPhysicsVector(G4int idxMaterial)165 {166 G4PhysicsVector* v = 0;167 if(idxMaterial >= 0 && idxMaterial <= 15) v = dedx[idxMaterial];168 return v;169 }170 171 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......172 173 inline G4PhysicsVector*174 G4IronStoppingICRU73::GetPhysicsVector(const G4String& NameMaterial)175 {176 return GetPhysicsVector(GetMaterialIndex(NameMaterial));177 }178 179 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......180 181 inline G4double182 G4IronStoppingICRU73::GetLowerEnergyBoundary() {183 184 return lowerEnergyBoundary;185 }186 187 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......188 189 inline G4double190 G4IronStoppingICRU73::GetUpperEnergyBoundary() {191 192 return upperEnergyBoundary;193 }194 195 196 114 #endif 197 115
Note: See TracChangeset
for help on using the changeset viewer.