255{
257 G4cout <<
"### G4VEmProcess::BuildPhysicsTable() for "
261 }
262 if(thePhotoElectric != nullptr) {
265 }
267 }
268 if(theCompton != nullptr) {
271 }
273 }
274 if(theConversionEE != nullptr) {
277 }
279 }
280 if(theRayleigh != nullptr) {
283 }
285 }
288
293
295 const std::vector<G4PhysicsTable*>& tables = theHandler->
GetTables();
296
301
302 G4double sigComp(0.), sigPE(0.), sigConv(0.), sigR(0.),
303 sigN(0.), sigM(0.), val(0.);
304
305 for(size_t i=0; i<numOfCouples; ++i) {
306
308
309 G4int idx = (*theDensityIdx)[i];
313
314
315 size_t nn = (*(tables[0]))[idx]->GetVectorLength();
317 G4cout <<
"======= Zone 0 ======= N= " <<
nn
319 }
320 for(
size_t j=0; j<
nn; ++j) {
321 G4double e = (*(tables[0]))[idx]->Energy(j);
323 sigComp = (theCompton) ? theCompton->
GetLambda(e, couple, loge) : 0.0;
324 sigR = (theRayleigh) ? theRayleigh->
GetLambda(e, couple, loge) : 0.0;
327 G4cout << j <<
". E= " << e <<
" xs= " << sum
328 <<
" compt= " << sigComp <<
" Rayl= " << sigR <<
G4endl;
329 }
330 (*(tables[0]))[idx]->PutValue(j, sum);
331 if(theT[1]) {
332 val = (sum > 0.0) ? sigComp/sum : 0.0;
333 (*(tables[1]))[idx]->PutValue(j, val);
334 }
335 }
336
337
338 nn = (*(tables[2]))[idx]->GetVectorLength();
341 }
342 for(
size_t j=0; j<
nn; ++j) {
343 G4double e = (*(tables[2]))[idx]->Energy(j);
345 sigComp = (theCompton) ? theCompton->
GetLambda(e, couple, loge) : 0.0;
346 sigR = (theRayleigh) ? theRayleigh->
GetLambda(e, couple, loge) : 0.0;
347 sigPE = (thePhotoElectric)
348 ? thePhotoElectric->
GetLambda(e, couple, loge) : 0.0;
349 sigN = 0.0;
350 if(gn) {
353 }
354 G4double sum = sigComp + sigR + sigPE + sigN;
356 G4cout << j <<
". E= " << e <<
" xs= " << sum
357 << " compt= " << sigComp << " conv= " << sigConv
358 << " PE= " << sigPE << " Rayl= " << sigR
359 <<
" GN= " << sigN <<
G4endl;
360 }
361 (*(tables[2]))[idx]->PutValue(j, sum);
362 val = (sum > 0.0) ? sigPE/sum : 0.0;
363 (*(tables[3]))[idx]->PutValue(j, val);
364 if(theT[4]) {
365 val = (sum > 0.0) ? (sigComp + sigPE)/sum : 0.0;
366 (*(tables[4]))[idx]->PutValue(j, val);
367 }
368 if(theT[5]) {
369 val = (sum > 0.0) ? (sigComp + sigPE + sigR)/sum : 0.0;
370 (*(tables[5]))[idx]->PutValue(j, val);
371 }
372 }
373
374
375 nn = (*(tables[6]))[idx]->GetVectorLength();
378 }
379 for(
size_t j=0; j<
nn; ++j) {
380 G4double e = (*(tables[6]))[idx]->Energy(j);
382 sigComp = (theCompton) ? theCompton->
GetLambda(e, couple, loge) : 0.0;
383 sigConv = (theConversionEE)
384 ? theConversionEE->
GetLambda(e, couple, loge) : 0.0;
385 sigPE = (thePhotoElectric)
386 ? thePhotoElectric->
GetLambda(e, couple, loge) : 0.0;
387 sigN = 0.0;
388 if(gn) {
391 }
392 G4double sum = sigComp + sigConv + sigPE + sigN;
394 G4cout << j <<
". E= " << e <<
" xs= " << sum
395 << " compt= " << sigComp << " conv= " << sigConv
396 << " PE= " << sigPE
397 <<
" GN= " << sigN <<
G4endl;
398 }
399 (*(tables[6]))[idx]->PutValue(j, sum);
400 val = (sum > 0.0) ? sigConv/sum : 0.0;
401 (*(tables[7]))[idx]->PutValue(j, val);
402 val = (sum > 0.0) ? (sigConv + sigComp)/sum : 0.0;
403 (*(tables[8]))[idx]->PutValue(j, val);
404 if(theT[9]) {
405 val = (sum > 0.0) ? (sigConv + sigComp + sigPE)/sum : 0.0;
406 (*(tables[9]))[idx]->PutValue(j, val);
407 }
408 }
409
410
411 nn = (*(tables[10]))[idx]->GetVectorLength();
413 G4cout <<
"======= Zone 3 ======= N= " <<
nn
415 }
416 for(
size_t j=0; j<
nn; ++j) {
417 G4double e = (*(tables[10]))[idx]->Energy(j);
419 sigComp = (theCompton) ? theCompton->
GetLambda(e, couple, loge) : 0.0;
420 sigConv = (theConversionEE)
421 ? theConversionEE->
GetLambda(e, couple, loge) : 0.0;
422 sigPE = (thePhotoElectric)
423 ? thePhotoElectric->
GetLambda(e, couple, loge) : 0.0;
424 sigN = 0.0;
425 if(gn) {
428 }
429 sigM = 0.0;
430 if(theConversionMM) {
432 sigM = (val <
DBL_MAX) ? 1./val : 0.0;
433 }
434 G4double sum = sigComp + sigConv + sigPE + sigN + sigM;
436 G4cout << j <<
". E= " << e <<
" xs= " << sum
437 << " compt= " << sigComp << " conv= " << sigConv
438 << " PE= " << sigPE
439 <<
" GN= " << sigN <<
G4endl;
440 }
441 (*(tables[10]))[idx]->PutValue(j, sum);
442 val = (sum > 0.0) ? 1.0 - sigConv/sum : 1.0;
443 (*(tables[11]))[idx]->PutValue(j, val);
444 val = (sum > 0.0) ? 1.0 - (sigConv + sigComp)/sum : 1.0;
445 (*(tables[12]))[idx]->PutValue(j, val);
446 if(theT[13]) {
447 val = (sum > 0.0) ? 1.0 - (sigConv + sigComp + sigPE)/sum : 1.0;
448 (*(tables[13]))[idx]->PutValue(j, val);
449 }
450 if(theT[14]) {
451 val = (sum > 0.0)
452 ? 1.0 - (sigConv + sigComp + sigPE + sigN)/sum : 1.0;
453 (*(tables[14]))[idx]->PutValue(j, val);
454 }
455 }
456 for(size_t k=0; k<nTables; ++k) {
457 if(theT[k] && splineFlag) {
458 (*(tables[k]))[idx]->FillSecondDerivatives();
459 }
460 }
461 }
462 }
463 delete dynParticle;
464 }
465
467 G4cout <<
"### G4VEmProcess::BuildPhysicsTable() done for "
471 }
472}
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
const G4String & GetProcessName() const
void BuildPhysicsTable(const G4ParticleDefinition &) override
G4CrossSectionDataStore * GetCrossSectionDataStore()
G4bool GetFlag(size_t idx)
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()
G4LossTableManager * lManager
virtual void BuildPhysicsTable(const G4ParticleDefinition &) override
void SetEmMasterProcess(const G4VEmProcess *)
G4double GetLambda(G4double kinEnergy, const G4MaterialCutsCouple *couple)