Geant4 10.7.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4TablesForExtrapolator Class Reference

#include <G4TablesForExtrapolator.hh>

Public Member Functions

 G4TablesForExtrapolator (G4int verb, G4int bins, G4double e1, G4double e2)
 
 ~G4TablesForExtrapolator ()
 
const G4PhysicsTableGetPhysicsTable (ExtTableType type) const
 
void Initialisation ()
 

Detailed Description

Definition at line 74 of file G4TablesForExtrapolator.hh.

Constructor & Destructor Documentation

◆ G4TablesForExtrapolator()

G4TablesForExtrapolator::G4TablesForExtrapolator ( G4int  verb,
G4int  bins,
G4double  e1,
G4double  e2 
)
explicit

Definition at line 72 of file G4TablesForExtrapolator.cc.

74 : builder(nullptr), verbose(verb), nbins(bins), nmat(0), emin(e1), emax(e2)
75{
76 electron = G4Electron::Electron();
77 positron = G4Positron::Positron();
78 proton = G4Proton::Proton();
79 muonPlus = G4MuonPlus::MuonPlus();
80 muonMinus= G4MuonMinus::MuonMinus();
81 dedxElectron = dedxPositron = dedxProton = dedxMuon = rangeElectron =
82 rangePositron = rangeProton = rangeMuon = invRangeElectron =
83 invRangePositron = invRangeProton = invRangeMuon = mscElectron = nullptr;
84 pcuts = nullptr;
86}
static G4Electron * Electron()
Definition: G4Electron.cc:93
static G4MuonMinus * MuonMinus()
Definition: G4MuonMinus.cc:99
static G4MuonPlus * MuonPlus()
Definition: G4MuonPlus.cc:98
static G4Positron * Positron()
Definition: G4Positron.cc:93
static G4Proton * Proton()
Definition: G4Proton.cc:92

◆ ~G4TablesForExtrapolator()

G4TablesForExtrapolator::~G4TablesForExtrapolator ( )

Definition at line 90 of file G4TablesForExtrapolator.cc.

91{
92 for(G4int i=0; i<nmat; i++) { delete couples[i]; }
93
94 dedxElectron->clearAndDestroy();
95 dedxPositron->clearAndDestroy();
96 dedxProton->clearAndDestroy();
97 dedxMuon->clearAndDestroy();
98 rangeElectron->clearAndDestroy();
99 rangePositron->clearAndDestroy();
100 rangeProton->clearAndDestroy();
101 rangeMuon->clearAndDestroy();
102 invRangeElectron->clearAndDestroy();
103 invRangePositron->clearAndDestroy();
104 invRangeProton->clearAndDestroy();
105 invRangeMuon->clearAndDestroy();
106 mscElectron->clearAndDestroy();
107
108 delete dedxElectron;
109 delete dedxPositron;
110 delete dedxProton;
111 delete dedxMuon;
112 delete rangeElectron;
113 delete rangePositron;
114 delete rangeProton;
115 delete rangeMuon;
116 delete invRangeElectron;
117 delete invRangePositron;
118 delete invRangeProton;
119 delete invRangeMuon;
120 delete mscElectron;
121 delete pcuts;
122 delete builder;
123}
int G4int
Definition: G4Types.hh:85
void clearAndDestroy()

Member Function Documentation

◆ GetPhysicsTable()

const G4PhysicsTable * G4TablesForExtrapolator::GetPhysicsTable ( ExtTableType  type) const

Definition at line 128 of file G4TablesForExtrapolator.cc.

129{
130 const G4PhysicsTable* table = nullptr;
131 switch (type)
132 {
133 case fDedxElectron:
134 table = dedxElectron;
135 break;
136 case fDedxPositron:
137 table = dedxPositron;
138 break;
139 case fDedxProton:
140 table = dedxProton;
141 break;
142 case fDedxMuon:
143 table = dedxMuon;
144 break;
145 case fRangeElectron:
146 table = rangeElectron;
147 break;
148 case fRangePositron:
149 table = rangePositron;
150 break;
151 case fRangeProton:
152 table = rangeProton;
153 break;
154 case fRangeMuon:
155 table = rangeMuon;
156 break;
158 table = invRangeElectron;
159 break;
161 table = invRangePositron;
162 break;
163 case fInvRangeProton:
164 table = invRangeProton;
165 break;
166 case fInvRangeMuon:
167 table = invRangeMuon;
168 break;
169 case fMscElectron:
170 table = mscElectron;
171 }
172 return table;
173}
@ fInvRangeElectron
@ fInvRangePositron

◆ Initialisation()

void G4TablesForExtrapolator::Initialisation ( )

Definition at line 177 of file G4TablesForExtrapolator.cc.

178{
179 if(verbose>1) {
180 G4cout << "### G4TablesForExtrapolator::Initialisation" << G4endl;
181 }
182 currentParticle = nullptr;
183 mass = charge2 = 0.0;
184
187 if(!pcuts) { pcuts = new G4ProductionCuts(); }
188
189 G4int i0 = couples.size();
190 if(0 == i0) {
191 couples.reserve(nmat);
192 cuts.reserve(nmat);
193 }
194 for(G4int i=i0; i<nmat; ++i) {
195 couples.push_back(new G4MaterialCutsCouple((*mtable)[i],pcuts));
196 cuts.push_back(DBL_MAX);
197 }
198
199 splineFlag = G4EmParameters::Instance()->Spline();
200
201 dedxElectron = PrepareTable(dedxElectron);
202 dedxPositron = PrepareTable(dedxPositron);
203 dedxMuon = PrepareTable(dedxMuon);
204 dedxProton = PrepareTable(dedxProton);
205 rangeElectron = PrepareTable(rangeElectron);
206 rangePositron = PrepareTable(rangePositron);
207 rangeMuon = PrepareTable(rangeMuon);
208 rangeProton = PrepareTable(rangeProton);
209 invRangeElectron = PrepareTable(invRangeElectron);
210 invRangePositron = PrepareTable(invRangePositron);
211 invRangeMuon = PrepareTable(invRangeMuon);
212 invRangeProton = PrepareTable(invRangeProton);
213 mscElectron = PrepareTable(mscElectron);
214
215 if(!builder) { builder = new G4LossTableBuilder(); }
216 builder->InitialiseBaseMaterials();
217
218 if(verbose>1) {
219 G4cout << "### G4TablesForExtrapolator Builds electron tables"
220 << G4endl;
221 }
222 ComputeElectronDEDX(electron, dedxElectron);
223 builder->BuildRangeTable(dedxElectron,rangeElectron);
224 builder->BuildInverseRangeTable(rangeElectron, invRangeElectron);
225
226 if(verbose>1) {
227 G4cout << "### G4TablesForExtrapolator Builds positron tables"
228 << G4endl;
229 }
230 ComputeElectronDEDX(positron, dedxPositron);
231 builder->BuildRangeTable(dedxPositron, rangePositron);
232 builder->BuildInverseRangeTable(rangePositron, invRangePositron);
233
234 if(verbose>1) {
235 G4cout << "### G4TablesForExtrapolator Builds muon tables" << G4endl;
236 }
237 ComputeMuonDEDX(muonPlus, dedxMuon);
238 builder->BuildRangeTable(dedxMuon, rangeMuon);
239 builder->BuildInverseRangeTable(rangeMuon, invRangeMuon);
240 /*
241 G4cout << "DEDX MUON" << G4endl
242 G4cout << *dedxMuon << G4endl;
243 G4cout << "RANGE MUON" << G4endl
244 G4cout << *rangeMuon << G4endl;
245 G4cout << "INVRANGE MUON" << G4endl
246 G4cout << *invRangeMuon << G4endl;
247 */
248 if(verbose>1) {
249 G4cout << "### G4TablesForExtrapolator Builds proton tables"
250 << G4endl;
251 }
252 ComputeProtonDEDX(proton, dedxProton);
253 builder->BuildRangeTable(dedxProton, rangeProton);
254 builder->BuildInverseRangeTable(rangeProton, invRangeProton);
255
256 ComputeTrasportXS(electron, mscElectron);
257}
std::vector< G4Material * > G4MaterialTable
#define G4endl
Definition: G4ios.hh:57
G4GLOB_DLL std::ostream G4cout
static G4EmParameters * Instance()
G4bool Spline() const
void BuildInverseRangeTable(const G4PhysicsTable *rangeTable, G4PhysicsTable *invRangeTable, G4bool useBM=false)
void BuildRangeTable(const G4PhysicsTable *dedxTable, G4PhysicsTable *rangeTable, G4bool useBM=false)
void InitialiseBaseMaterials(const G4PhysicsTable *table=nullptr)
static size_t GetNumberOfMaterials()
Definition: G4Material.cc:644
static G4MaterialTable * GetMaterialTable()
Definition: G4Material.cc:637
#define DBL_MAX
Definition: templates.hh:62

Referenced by G4TablesForExtrapolator().


The documentation for this class was generated from the following files: