source: trunk/source/materials/include/G4SimpleMaterialStoppingICRU73.hh@ 1036

Last change on this file since 1036 was 986, checked in by garnier, 17 years ago

fichiers manquants

File size: 6.6 KB
Line 
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//
26// $Id: G4SimpleMaterialStoppingICRU73.hh,v 1.5 2009/02/19 12:19:53 vnivanch Exp $
27// GEANT4 tag $Name: geant4-09-02-ref-02 $
28
29#ifndef G4SimpleMaterialStoppingICRU73_h
30#define G4SimpleMaterialStoppingICRU73_h 1
31
32//---------------------------------------------------------------------------
33//
34// ClassName: G4SimpleMaterialStoppingICRU73
35//
36// Description: Data on stopping powers for light ions in compounds
37//
38// Author: Ivantchenko 10.07.2008
39//
40// Modifications:
41//
42//----------------------------------------------------------------------------
43//
44// Class Description:
45//
46// Data on Stopping Powers from the ICRU73 report
47//
48
49//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
50
51
52#include "globals.hh"
53#include "G4LPhysicsFreeVector.hh"
54#include <vector>
55
56class G4SimpleMaterialStoppingICRU73
57{
58public:
59
60 G4SimpleMaterialStoppingICRU73(G4bool splineFlag = true);
61
62 ~G4SimpleMaterialStoppingICRU73();
63
64 G4double GetDEDX(G4int ionZ, G4int idxMaterial, G4double kinEnergy);
65
66 inline G4double GetDEDX(G4int ionZ, const G4String& NameMaterial,
67 G4double kinEnergy);
68
69 inline G4int GetMaterialIndex(const G4String& NameMaterial);
70
71 // Function returns an unique index (>=0) for each ion-material couple (the
72 // return value is -1 if the couple is not found):
73 inline G4int GetIonMaterialCoupleIndex(
74 G4int atomicNumber, // Atomic number of ion
75 const G4String& materialName); // Material name
76
77 inline G4double GetDensity(G4int idxMaterial);
78
79 inline G4String GetMaterialName(G4int idxMaterial);
80
81 inline G4PhysicsVector* GetPhysicsVector(G4int ionZ, G4int idxMaterial);
82
83 inline G4PhysicsVector* GetPhysicsVector(G4int ionZ,
84 const G4String& NameMaterial);
85
86 inline G4double GetLowerEnergyBoundary();
87
88 inline G4double GetUpperEnergyBoundary();
89
90private:
91
92 void Initialise();
93
94 void AddData(G4double* energy, G4double* stoppower, G4double factor);
95
96 // hide assignment operator
97 G4SimpleMaterialStoppingICRU73 & operator=(const G4SimpleMaterialStoppingICRU73 &right);
98 G4SimpleMaterialStoppingICRU73(const G4SimpleMaterialStoppingICRU73&);
99
100 G4bool spline;
101 G4int Z[16];
102 G4double A[16];
103 G4String MatName[25];
104 G4double Density[25];
105
106 // Lower and upper energy boundaries for dE/dx vectors:
107 G4double lowerEnergyBoundary;
108 G4double upperEnergyBoundary;
109
110 std::vector<G4LPhysicsFreeVector*> dedx;
111};
112
113//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
114
115inline G4double
116G4SimpleMaterialStoppingICRU73::GetDEDX(G4int ionZ, const G4String& NameMaterial,
117 G4double kinEnergy)
118{
119 return GetDEDX(ionZ, GetMaterialIndex(NameMaterial), kinEnergy);
120}
121
122//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
123
124inline G4int
125G4SimpleMaterialStoppingICRU73::GetMaterialIndex(const G4String& NameMaterial)
126{
127 G4int idx = -1;
128 for (G4int i=0; i<25; i++){
129 if(MatName[i] == NameMaterial) {
130 idx = i;
131 break;
132 }
133 }
134 return idx;
135}
136
137//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
138
139inline G4int
140G4SimpleMaterialStoppingICRU73::GetIonMaterialCoupleIndex(
141 G4int atomicNumber,
142 const G4String& materialName)
143{
144 G4int idx = -1;
145 if(atomicNumber >= 3 && atomicNumber <= 18) {
146
147 G4int materialIndex = GetMaterialIndex(materialName);
148 if(materialIndex >= 0) idx = materialIndex * 16 + atomicNumber - 3;
149 }
150
151 return idx;
152}
153
154//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
155
156inline G4double
157G4SimpleMaterialStoppingICRU73::GetDensity(G4int idxMaterial)
158{
159 G4double d = 0.0;
160 if( idxMaterial >= 0 && idxMaterial <= 24) d = Density[idxMaterial];
161 return d;
162}
163
164//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
165
166inline
167G4String G4SimpleMaterialStoppingICRU73::GetMaterialName(G4int idxMaterial)
168{
169 G4String s = "";
170 if( idxMaterial >= 0 && idxMaterial <= 24) s = MatName[idxMaterial];
171 return s;
172}
173
174//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
175
176inline G4PhysicsVector*
177G4SimpleMaterialStoppingICRU73::GetPhysicsVector(G4int ionZ, G4int idxMaterial)
178{
179 G4PhysicsVector* v = 0;
180 if(ionZ >= 3 && ionZ <= 18 && idxMaterial >= 0 && idxMaterial <= 24) {
181 v = dedx[idxMaterial*16 + ionZ - 3];
182 }
183 return v;
184}
185
186//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
187
188inline G4PhysicsVector*
189G4SimpleMaterialStoppingICRU73::GetPhysicsVector(G4int ionZ,
190 const G4String& NameMaterial)
191{
192 return GetPhysicsVector(ionZ, GetMaterialIndex(NameMaterial));
193}
194
195//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
196
197inline G4double
198G4SimpleMaterialStoppingICRU73::GetLowerEnergyBoundary() {
199
200 return lowerEnergyBoundary;
201}
202
203//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
204
205inline G4double
206G4SimpleMaterialStoppingICRU73::GetUpperEnergyBoundary() {
207
208 return upperEnergyBoundary;
209}
210
211
212#endif
Note: See TracBrowser for help on using the repository browser.