253{
255 G4cout <<
"### G4VEmProcess::BuildPhysicsTable() for "
259 }
263 }
265
268 }
270
273 }
275
276 if(theRayleigh != nullptr) {
279 }
281 }
284
289
291 const std::vector<G4PhysicsTable*>& tables = theHandler->
GetTables();
292
297
298 G4double sigComp(0.), sigPE(0.), sigConv(0.), sigR(0.),
299 sigN(0.), sigM(0.), val(0.);
300
301 for(
G4int i=0; i<numOfCouples; ++i) {
302
308
309
310 std::size_t
nn = (*(tables[0]))[idx]->GetVectorLength();
312 G4cout <<
"======= Zone 0 ======= N= " <<
nn
314 }
315 for(std::size_t j=0; j<
nn; ++j) {
316 G4double e = (*(tables[0]))[idx]->Energy(j);
318 sigComp = theCompton->
GetLambda(e, couple, loge);
319 sigR = (nullptr != theRayleigh) ?
320 theRayleigh->
GetLambda(e, couple, loge) : 0.0;
323 G4cout << j <<
". E= " << e <<
" xs= " << sum
324 <<
" compt= " << sigComp <<
" Rayl= " << sigR <<
G4endl;
325 }
326 (*(tables[0]))[idx]->PutValue(j, sum);
327 if(theT[1]) {
328 val = sigR/sum;
329 (*(tables[1]))[idx]->PutValue(j, val);
330 }
331 }
332
333
334 nn = (*(tables[2]))[idx]->GetVectorLength();
337 }
338 for(std::size_t j=0; j<
nn; ++j) {
339 G4double e = (*(tables[2]))[idx]->Energy(j);
341 sigComp = theCompton->
GetLambda(e, couple, loge);
342 sigR = (nullptr != theRayleigh) ?
343 theRayleigh->
GetLambda(e, couple, loge) : 0.0;
344 sigPE = thePhotoElectric->
GetLambda(e, couple, loge);
345 G4double sum = sigComp + sigR + sigPE;
347 G4cout << j <<
". E= " << e <<
" xs= " << sum
348 << " compt= " << sigComp << " conv= " << sigConv
349 << " PE= " << sigPE << " Rayl= " << sigR
350 <<
" GN= " << sigN <<
G4endl;
351 }
352 (*(tables[2]))[idx]->PutValue(j, sum);
353
354 val = sigPE/sum;
355 (*(tables[3]))[idx]->PutValue(j, val);
356
357 val = (sigR > 0.0) ? (sigComp + sigPE)/sum : 1.0;
358 (*(tables[4]))[idx]->PutValue(j, val);
359 }
360
361
362 nn = (*(tables[6]))[idx]->GetVectorLength();
365 }
366 for(std::size_t j=0; j<
nn; ++j) {
367 G4double e = (*(tables[6]))[idx]->Energy(j);
369 sigComp = theCompton->
GetLambda(e, couple, loge);
370 sigConv = theConversionEE->
GetLambda(e, couple, loge);
371 sigPE = thePhotoElectric->
GetLambda(e, couple, loge);
372 sigN = 0.0;
373 if(nullptr != gn) {
376 }
377 G4double sum = sigComp + sigConv + sigPE + sigN;
379 G4cout << j <<
". E= " << e <<
" xs= " << sum
380 << " compt= " << sigComp << " conv= " << sigConv
381 << " PE= " << sigPE
382 <<
" GN= " << sigN <<
G4endl;
383 }
384 (*(tables[6]))[idx]->PutValue(j, sum);
385
386 val = sigConv/sum;
387 (*(tables[7]))[idx]->PutValue(j, val);
388
389 val = (sigConv + sigComp)/sum;
390 (*(tables[8]))[idx]->PutValue(j, val);
391
392 val = (sigN > 0.0) ? (sigConv + sigComp + sigPE)/sum : 1.0;
393 (*(tables[9]))[idx]->PutValue(j, val);
394 }
395
396
397 nn = (*(tables[10]))[idx]->GetVectorLength();
399 G4cout <<
"======= Zone 3 ======= N= " <<
nn
401 }
402 for(std::size_t j=0; j<
nn; ++j) {
403 G4double e = (*(tables[10]))[idx]->Energy(j);
405 sigComp = theCompton->
GetLambda(e, couple, loge);
406 sigConv = theConversionEE->
GetLambda(e, couple, loge);
407 sigPE = thePhotoElectric->
GetLambda(e, couple, loge);
408 sigN = 0.0;
409 if(nullptr != gn) {
412 }
413 sigM = 0.0;
414 if(nullptr != theConversionMM) {
416 sigM = (val <
DBL_MAX) ? 1./val : 0.0;
417 }
418 G4double sum = sigComp + sigConv + sigPE + sigN + sigM;
420 G4cout << j <<
". E= " << e <<
" xs= " << sum
421 << " compt= " << sigComp << " conv= " << sigConv
422 << " PE= " << sigPE
423 <<
" GN= " << sigN <<
G4endl;
424 }
425 (*(tables[10]))[idx]->PutValue(j, sum);
426
427 val = (sigComp + sigPE + sigN + sigM)/sum;
428 (*(tables[11]))[idx]->PutValue(j, val);
429
430 val = (sigPE + sigN + sigM)/sum;
431 (*(tables[12]))[idx]->PutValue(j, val);
432
433 val = (sigN + sigM)/sum;
434 (*(tables[13]))[idx]->PutValue(j, val);
435
436 val = sigN/sum;
437 (*(tables[14]))[idx]->PutValue(j, val);
438 }
439 for(std::size_t k=0; k<nTables; ++k) {
440 if(theT[k] && (k <= 1 || k >= 10)) {
441
442 (*(tables[k]))[idx]->FillSecondDerivatives();
443 }
444 }
445 }
446 }
447 delete dynParticle;
448 }
449
451 G4cout <<
"### G4VEmProcess::BuildPhysicsTable() done for "
455 }
456}
G4double G4Log(G4double x)
CLHEP::Hep3Vector G4ThreeVector
G4GLOB_DLL std::ostream G4cout
G4double ComputeCrossSection(const G4DynamicParticle *, const G4Material *)
void SetKineticEnergy(G4double aEnergy)
const G4VEmProcess * GetMasterProcess(size_t idx) const
const std::vector< G4PhysicsTable * > & GetTables() const
G4double ComputeMeanFreePath(G4double GammaEnergy, const G4Material *aMaterial)
void BuildPhysicsTable(const G4ParticleDefinition &) override
void BuildPhysicsTable(const G4ParticleDefinition &) override
G4CrossSectionDataStore * GetCrossSectionDataStore()
G4bool GetFlag(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()
void BuildPhysicsTable(const G4ParticleDefinition &) override
G4int DensityIndex(G4int idx) const
void SetEmMasterProcess(const G4VEmProcess *)
G4bool UseBaseMaterial() const
G4double GetLambda(G4double kinEnergy, const G4MaterialCutsCouple *couple, G4double logKinEnergy)
const G4String & GetProcessName() const