Geant4 11.2.2
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 ()
 
G4TablesForExtrapolatoroperator= (const G4TablesForExtrapolator &right)=delete
 
 G4TablesForExtrapolator (const G4TablesForExtrapolator &)=delete
 

Detailed Description

Definition at line 74 of file G4TablesForExtrapolator.hh.

Constructor & Destructor Documentation

◆ G4TablesForExtrapolator() [1/2]

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

Definition at line 74 of file G4TablesForExtrapolator.cc.

76 : emin(e1), emax(e2), verbose(verb), nbins(bins)
77{
78 electron = G4Electron::Electron();
79 positron = G4Positron::Positron();
80 proton = G4Proton::Proton();
81 muonPlus = G4MuonPlus::MuonPlus();
82 muonMinus= G4MuonMinus::MuonMinus();
83}
static G4Electron * Electron()
Definition G4Electron.cc:91
static G4MuonMinus * MuonMinus()
static G4MuonPlus * MuonPlus()
Definition G4MuonPlus.cc:98
static G4Positron * Positron()
Definition G4Positron.cc:90
static G4Proton * Proton()
Definition G4Proton.cc:90

◆ ~G4TablesForExtrapolator()

G4TablesForExtrapolator::~G4TablesForExtrapolator ( )

Definition at line 87 of file G4TablesForExtrapolator.cc.

88{
89 if(nullptr != dedxElectron) {
90 dedxElectron->clearAndDestroy();
91 delete dedxElectron;
92 }
93 if(nullptr != dedxPositron) {
94 dedxPositron->clearAndDestroy();
95 delete dedxPositron;
96 }
97 if(nullptr != dedxProton) {
98 dedxProton->clearAndDestroy();
99 delete dedxProton;
100 }
101 if(nullptr != dedxMuon) {
102 dedxMuon->clearAndDestroy();
103 delete dedxMuon;
104 }
105 if(nullptr != rangeElectron) {
106 rangeElectron->clearAndDestroy();
107 delete rangeElectron;
108 }
109 if(nullptr != rangePositron) {
110 rangePositron->clearAndDestroy();
111 delete rangePositron;
112 }
113 if(nullptr != rangeProton) {
114 rangeProton->clearAndDestroy();
115 delete rangeProton;
116 }
117 if(nullptr != rangeMuon) {
118 rangeMuon->clearAndDestroy();
119 delete rangeMuon;
120 }
121 if(nullptr != invRangeElectron) {
122 invRangeElectron->clearAndDestroy();
123 delete invRangeElectron;
124 }
125 if(nullptr != invRangePositron) {
126 invRangePositron->clearAndDestroy();
127 delete invRangePositron;
128 }
129 if(nullptr != invRangeProton) {
130 invRangeProton->clearAndDestroy();
131 delete invRangeProton;
132 }
133 if(nullptr != invRangeMuon) {
134 invRangeMuon->clearAndDestroy();
135 delete invRangeMuon;
136 }
137 if(nullptr != mscElectron) {
138 mscElectron->clearAndDestroy();
139 delete mscElectron;
140 }
141 delete pcuts;
142 delete builder;
143}
void clearAndDestroy()

◆ G4TablesForExtrapolator() [2/2]

G4TablesForExtrapolator::G4TablesForExtrapolator ( const G4TablesForExtrapolator & )
delete

Member Function Documentation

◆ GetPhysicsTable()

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

Definition at line 148 of file G4TablesForExtrapolator.cc.

149{
150 const G4PhysicsTable* table = nullptr;
151 switch (type)
152 {
153 case fDedxElectron:
154 table = dedxElectron;
155 break;
156 case fDedxPositron:
157 table = dedxPositron;
158 break;
159 case fDedxProton:
160 table = dedxProton;
161 break;
162 case fDedxMuon:
163 table = dedxMuon;
164 break;
165 case fRangeElectron:
166 table = rangeElectron;
167 break;
168 case fRangePositron:
169 table = rangePositron;
170 break;
171 case fRangeProton:
172 table = rangeProton;
173 break;
174 case fRangeMuon:
175 table = rangeMuon;
176 break;
178 table = invRangeElectron;
179 break;
181 table = invRangePositron;
182 break;
183 case fInvRangeProton:
184 table = invRangeProton;
185 break;
186 case fInvRangeMuon:
187 table = invRangeMuon;
188 break;
189 case fMscElectron:
190 table = mscElectron;
191 }
192 return table;
193}

◆ Initialisation()

void G4TablesForExtrapolator::Initialisation ( )

Definition at line 197 of file G4TablesForExtrapolator.cc.

198{
199 if(verbose>1) {
200 G4cout << "### G4TablesForExtrapolator::Initialisation" << G4endl;
201 }
203 if(nmat == num) { return; }
204 nmat = num;
205 cuts.resize(nmat, DBL_MAX);
206 couples.resize(nmat, nullptr);
207
209 if(!pcuts) { pcuts = new G4ProductionCuts(); }
210
211 for(G4int i=0; i<nmat; ++i) {
212 couples[i] = new G4MaterialCutsCouple((*mtable)[i],pcuts);
213 }
214
215 dedxElectron = PrepareTable(dedxElectron);
216 dedxPositron = PrepareTable(dedxPositron);
217 dedxMuon = PrepareTable(dedxMuon);
218 dedxProton = PrepareTable(dedxProton);
219 rangeElectron = PrepareTable(rangeElectron);
220 rangePositron = PrepareTable(rangePositron);
221 rangeMuon = PrepareTable(rangeMuon);
222 rangeProton = PrepareTable(rangeProton);
223 invRangeElectron = PrepareTable(invRangeElectron);
224 invRangePositron = PrepareTable(invRangePositron);
225 invRangeMuon = PrepareTable(invRangeMuon);
226 invRangeProton = PrepareTable(invRangeProton);
227 mscElectron = PrepareTable(mscElectron);
228
229 builder = new G4LossTableBuilder(true);
230 builder->SetBaseMaterialActive(false);
231
232 if(verbose>1) {
233 G4cout << "### G4TablesForExtrapolator Builds electron tables"
234 << G4endl;
235 }
236 ComputeElectronDEDX(electron, dedxElectron);
237 builder->BuildRangeTable(dedxElectron,rangeElectron);
238 builder->BuildInverseRangeTable(rangeElectron, invRangeElectron);
239
240 if(verbose>1) {
241 G4cout << "### G4TablesForExtrapolator Builds positron tables"
242 << G4endl;
243 }
244 ComputeElectronDEDX(positron, dedxPositron);
245 builder->BuildRangeTable(dedxPositron, rangePositron);
246 builder->BuildInverseRangeTable(rangePositron, invRangePositron);
247
248 if(verbose>1) {
249 G4cout << "### G4TablesForExtrapolator Builds muon tables" << G4endl;
250 }
251 ComputeMuonDEDX(muonPlus, dedxMuon);
252 builder->BuildRangeTable(dedxMuon, rangeMuon);
253 builder->BuildInverseRangeTable(rangeMuon, invRangeMuon);
254
255 if(verbose>2) {
256 G4cout << "DEDX MUON" << G4endl;
257 G4cout << *dedxMuon << G4endl;
258 G4cout << "RANGE MUON" << G4endl;
259 G4cout << *rangeMuon << G4endl;
260 G4cout << "INVRANGE MUON" << G4endl;
261 G4cout << *invRangeMuon << G4endl;
262 }
263 if(verbose>1) {
264 G4cout << "### G4TablesForExtrapolator Builds proton tables"
265 << G4endl;
266 }
267 ComputeProtonDEDX(proton, dedxProton);
268 builder->BuildRangeTable(dedxProton, rangeProton);
269 builder->BuildInverseRangeTable(rangeProton, invRangeProton);
270
271 ComputeTrasportXS(electron, mscElectron);
272}
std::vector< G4Material * > G4MaterialTable
int G4int
Definition G4Types.hh:85
#define G4endl
Definition G4ios.hh:67
G4GLOB_DLL std::ostream G4cout
void BuildRangeTable(const G4PhysicsTable *dedxTable, G4PhysicsTable *rangeTable)
void BuildInverseRangeTable(const G4PhysicsTable *rangeTable, G4PhysicsTable *invRangeTable)
void SetBaseMaterialActive(G4bool flag)
static std::size_t GetNumberOfMaterials()
static G4MaterialTable * GetMaterialTable()
#define DBL_MAX
Definition templates.hh:62

Referenced by G4EnergyLossForExtrapolator::Initialisation().

◆ operator=()

G4TablesForExtrapolator & G4TablesForExtrapolator::operator= ( const G4TablesForExtrapolator & right)
delete

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