251{
253 G4cout <<
"### G4VEmProcess::BuildPhysicsTable() for "
257 }
259 thePhotoElectric->SetEmMasterProcess(theHandler->GetMasterProcess(0));
260 baseMat = theHandler->GetMasterProcess(0)->UseBaseMaterial();
261 }
262 thePhotoElectric->BuildPhysicsTable(part);
263
265 theCompton->SetEmMasterProcess(theHandler->GetMasterProcess(1));
266 }
267 theCompton->BuildPhysicsTable(part);
268
270 theConversionEE->SetEmMasterProcess(theHandler->GetMasterProcess(2));
271 }
272 theConversionEE->BuildPhysicsTable(part);
273
274 if(theRayleigh != nullptr) {
276 theRayleigh->SetEmMasterProcess(theHandler->GetMasterProcess(3));
277 }
278 theRayleigh->BuildPhysicsTable(part);
279 }
281 if(theConversionMM != nullptr) { theConversionMM->BuildPhysicsTable(part); }
282
284 const G4ProductionCutsTable* theCoupleTable=
287
289 const std::vector<G4PhysicsTable*>& tables = theHandler->GetTables();
290
293 G4DynamicParticle* dynParticle =
295
296 G4double sigComp(0.), sigPE(0.), sigConv(0.), sigR(0.),
297 sigN(0.), sigM(0.), val(0.);
298
299 for(
G4int i=0; i<numOfCouples; ++i) {
300
303 const G4MaterialCutsCouple* couple =
305 const G4Material* material = couple->
GetMaterial();
306
307
308 std::size_t
nn = (*(tables[0]))[idx]->GetVectorLength();
310 G4cout <<
"======= Zone 0 ======= N= " <<
nn
312 }
313 for(std::size_t j=0; j<
nn; ++j) {
314 G4double e = (*(tables[0]))[idx]->Energy(j);
316 sigComp = theCompton->GetLambda(e, couple, loge);
317 sigR = (nullptr != theRayleigh) ?
318 theRayleigh->GetLambda(e, couple, loge) : 0.0;
321 G4cout << j <<
". E= " << e <<
" xs= " << sum
322 <<
" compt= " << sigComp <<
" Rayl= " << sigR <<
G4endl;
323 }
324 (*(tables[0]))[idx]->PutValue(j, sum);
325 if(theT[1]) {
326 val = sigR/sum;
327 (*(tables[1]))[idx]->PutValue(j, val);
328 }
329 }
330
331
332 nn = (*(tables[2]))[idx]->GetVectorLength();
335 }
336 for(std::size_t j=0; j<
nn; ++j) {
337 G4double e = (*(tables[2]))[idx]->Energy(j);
339 sigComp = theCompton->GetLambda(e, couple, loge);
340 sigR = (nullptr != theRayleigh) ?
341 theRayleigh->GetLambda(e, couple, loge) : 0.0;
342 sigPE = thePhotoElectric->GetLambda(e, couple, loge);
343 G4double sum = sigComp + sigR + sigPE;
345 G4cout << j <<
". E= " << e <<
" xs= " << sum
346 << " compt= " << sigComp << " conv= " << sigConv
347 << " PE= " << sigPE << " Rayl= " << sigR
348 <<
" GN= " << sigN <<
G4endl;
349 }
350 (*(tables[2]))[idx]->PutValue(j, sum);
351
352 val = sigPE/sum;
353 (*(tables[3]))[idx]->PutValue(j, val);
354
355 val = (sigR > 0.0) ? (sigComp + sigPE)/sum : 1.0;
356 (*(tables[4]))[idx]->PutValue(j, val);
357 }
358
359
360 nn = (*(tables[6]))[idx]->GetVectorLength();
363 }
364 for(std::size_t j=0; j<
nn; ++j) {
365 G4double e = (*(tables[6]))[idx]->Energy(j);
367 sigComp = theCompton->GetLambda(e, couple, loge);
368 sigConv = theConversionEE->GetLambda(e, couple, loge);
369 sigPE = thePhotoElectric->GetLambda(e, couple, loge);
370 sigN = 0.0;
371 if(nullptr != gn) {
374 }
375 G4double sum = sigComp + sigConv + sigPE + sigN;
377 G4cout << j <<
". E= " << e <<
" xs= " << sum
378 << " compt= " << sigComp << " conv= " << sigConv
379 << " PE= " << sigPE
380 <<
" GN= " << sigN <<
G4endl;
381 }
382 (*(tables[6]))[idx]->PutValue(j, sum);
383
384 val = sigConv/sum;
385 (*(tables[7]))[idx]->PutValue(j, val);
386
387 val = (sigConv + sigComp)/sum;
388 (*(tables[8]))[idx]->PutValue(j, val);
389
390 val = (sigN > 0.0) ? (sigConv + sigComp + sigPE)/sum : 1.0;
391 (*(tables[9]))[idx]->PutValue(j, val);
392 }
393
394
395 nn = (*(tables[10]))[idx]->GetVectorLength();
397 G4cout <<
"======= Zone 3 ======= N= " <<
nn
399 }
400 for(std::size_t j=0; j<
nn; ++j) {
401 G4double e = (*(tables[10]))[idx]->Energy(j);
403 sigComp = theCompton->GetLambda(e, couple, loge);
404 sigConv = theConversionEE->GetLambda(e, couple, loge);
405 sigPE = thePhotoElectric->GetLambda(e, couple, loge);
406 sigN = 0.0;
407 if(nullptr != gn) {
410 }
411 sigM = 0.0;
412 if(nullptr != theConversionMM) {
413 val = theConversionMM->ComputeMeanFreePath(e, material);
414 sigM = (val <
DBL_MAX) ? 1./val : 0.0;
415 }
416 G4double sum = sigComp + sigConv + sigPE + sigN + sigM;
418 G4cout << j <<
". E= " << e <<
" xs= " << sum
419 << " compt= " << sigComp << " conv= " << sigConv
420 << " PE= " << sigPE
421 <<
" GN= " << sigN <<
G4endl;
422 }
423 (*(tables[10]))[idx]->PutValue(j, sum);
424
425 val = (sigComp + sigPE + sigN + sigM)/sum;
426 (*(tables[11]))[idx]->PutValue(j, val);
427
428 val = (sigPE + sigN + sigM)/sum;
429 (*(tables[12]))[idx]->PutValue(j, val);
430
431 val = (sigN + sigM)/sum;
432 (*(tables[13]))[idx]->PutValue(j, val);
433
434 val = sigM/sum;
435 (*(tables[14]))[idx]->PutValue(j, val);
436 }
437 for(std::size_t k=0; k<nTables; ++k) {
438 if(theT[k] && (k <= 1 || k >= 10)) {
439
440 (*(tables[k]))[idx]->FillSecondDerivatives();
441 }
442 }
443 }
444 }
445 delete dynParticle;
446 }
447
449 G4cout <<
"### G4VEmProcess::BuildPhysicsTable() done for "
453 }
454}
G4double G4Log(G4double x)
CLHEP::Hep3Vector G4ThreeVector
G4GLOB_DLL std::ostream G4cout
G4double ComputeCrossSection(const G4DynamicParticle *, const G4Material *)
void SetKineticEnergy(G4double aEnergy)
static G4bool GetFlag(std::size_t idx)
static G4LossTableManager * Instance()
G4LossTableBuilder * GetTableBuilder()
const G4Material * GetMaterial() const
const G4String & GetName() const
const G4String & GetParticleName() const
const G4MaterialCutsCouple * GetMaterialCutsCouple(G4int i) const
std::size_t GetTableSize() const
static G4ProductionCutsTable * GetProductionCutsTable()
G4int DensityIndex(G4int idx) const
const G4String & GetProcessName() const