Geant4 11.1.1
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4ICRU90StoppingData.hh
Go to the documentation of this file.
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
27#ifndef G4ICRU90StoppingData_h
28#define G4ICRU90StoppingData_h 1
29
30//----------------------------------------------------------------------
31//
32// File name: G4ICRU90StoppingData
33//
34// Description: Data on electroninc stopping power from ICRU 90
35//
36// Author: Lucas Norberto Burigo
37//
38// Creation date: 03.09.2018
39//
40// Modifications: 25.09.2018 V.Ivanchenko adopted for material sub-library
41//
42//----------------------------------------------------------------------------
43//
44// Class Description:
45//
46// Data on electonic stopping powers from ICRU 90 report
47//
48//
49
50//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
51
52#include "globals.hh"
53#include "G4Material.hh"
55
57{
58public:
59
60 explicit G4ICRU90StoppingData();
61
63
64 void Initialise();
65
67 GetElectronicDEDXforProton(const G4Material*, G4double kinEnergy) const;
68
70 GetElectronicDEDXforAlpha(const G4Material*, G4double scaledKinEnergy) const;
71
72 inline G4int GetIndex(const G4Material*) const;
73
74 inline G4int GetIndex(const G4String&) const;
75
76 inline G4double
77 GetElectronicDEDXforProton(G4int idx, G4double kinEnergy) const;
78
79 inline G4double
80 GetElectronicDEDXforAlpha(G4int idx, G4double scaledKinEnergy) const;
81
82 inline G4bool IsApplicable(const G4Material*) const;
83
84 // hide assignment operator
86 (const G4ICRU90StoppingData &right) = delete;
88
89private:
90
91 inline G4double GetDEDX(G4PhysicsFreeVector*, G4double e) const;
92
93 void FillData();
94
95 G4PhysicsFreeVector* AddData(G4int n, const G4double* e, const G4float* dedx);
96
97 static constexpr G4int nvectors = 3;
98 const G4Material* materials[nvectors];
99 G4PhysicsFreeVector* sdata_proton[nvectors];
100 G4PhysicsFreeVector* sdata_alpha[nvectors];
101 G4bool isInitialized;
102};
103
104//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
105
107{
108 return (mat == materials[0] || mat == materials[1] || mat == materials[2]);
109}
110
112{
113 G4int idx = -1;
114 if (mat == materials[0]) { idx = 0; }
115 else if(mat == materials[1]) { idx = 1; }
116 else if(mat == materials[2]) { idx = 2; }
117 return idx;
118}
119
120//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
121
123{
124 G4int idx = -1;
125 if (nam == materials[0]->GetName()) { idx = 0; }
126 else if(nam == materials[1]->GetName()) { idx = 1; }
127 else if(nam == materials[2]->GetName()) { idx = 2; }
128 return idx;
129}
130
131//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
132
133inline G4double
134G4ICRU90StoppingData::GetDEDX(G4PhysicsFreeVector* data, G4double e) const
135{
136 G4double emin = data->Energy(0);
137 return (e <= emin) ? (*data)[0]*std::sqrt(e/emin) : data->Value(e);
138}
139
140//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
141
143 G4int idx, G4double kinEnergy) const
144{
145 return (idx < 0 || idx >= nvectors) ? 0.0
146 : GetDEDX(sdata_proton[idx], kinEnergy);
147}
148
149//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
150
152 G4int idx, G4double scaledKinEnergy) const
153{
154 return (idx < 0 || idx >= nvectors) ? 0.0
155 : GetDEDX(sdata_alpha[idx], scaledKinEnergy);
156}
157
158//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
159
160#endif
float G4float
Definition: G4Types.hh:84
double G4double
Definition: G4Types.hh:83
bool G4bool
Definition: G4Types.hh:86
int G4int
Definition: G4Types.hh:85
G4bool IsApplicable(const G4Material *) const
G4ICRU90StoppingData(const G4ICRU90StoppingData &)=delete
G4double GetElectronicDEDXforProton(const G4Material *, G4double kinEnergy) const
G4int GetIndex(const G4Material *) const
G4double GetElectronicDEDXforAlpha(const G4Material *, G4double scaledKinEnergy) const
G4double Energy(const std::size_t index) const