246{
248 G4cout <<
"### G4VEmProcess::BuildPhysicsTable() for "
252 }
254 thePhotoElectric->SetEmMasterProcess(theHandler->GetMasterProcess(0));
255 baseMat = theHandler->GetMasterProcess(0)->UseBaseMaterial();
256 }
257 thePhotoElectric->BuildPhysicsTable(part);
258
260 theCompton->SetEmMasterProcess(theHandler->GetMasterProcess(1));
261 }
262 theCompton->BuildPhysicsTable(part);
263
265 theConversionEE->SetEmMasterProcess(theHandler->GetMasterProcess(2));
266 }
267 theConversionEE->BuildPhysicsTable(part);
268
269 if(theRayleigh != nullptr) {
271 theRayleigh->SetEmMasterProcess(theHandler->GetMasterProcess(3));
272 }
273 theRayleigh->BuildPhysicsTable(part);
274 }
276 if(theConversionMM != nullptr) { theConversionMM->BuildPhysicsTable(part); }
277
279 const G4ProductionCutsTable* theCoupleTable=
282
284 const std::vector<G4PhysicsTable*>& tables = theHandler->GetTables();
285
288 G4DynamicParticle* dynParticle =
290
291 G4double sigComp(0.), sigPE(0.), sigConv(0.), sigR(0.),
292 sigN(0.), sigM(0.), val(0.);
293
294 for(
G4int i=0; i<numOfCouples; ++i) {
295
298 const G4MaterialCutsCouple* couple =
300 const G4Material* material = couple->
GetMaterial();
301
302
303 std::size_t
nn = (*(tables[0]))[idx]->GetVectorLength();
305 G4cout <<
"======= Zone 0 ======= N= " <<
nn
307 }
308 for(std::size_t j=0; j<
nn; ++j) {
309 G4double e = (*(tables[0]))[idx]->Energy(j);
311 sigComp = theCompton->GetLambda(e, couple, loge);
312 sigR = (nullptr != theRayleigh) ?
313 theRayleigh->GetLambda(e, couple, loge) : 0.0;
316 G4cout << j <<
". E= " << e <<
" xs= " << sum
317 <<
" compt= " << sigComp <<
" Rayl= " << sigR <<
G4endl;
318 }
319 (*(tables[0]))[idx]->PutValue(j, sum);
320 if(theT[1]) {
321 val = sigR/sum;
322 (*(tables[1]))[idx]->PutValue(j, val);
323 }
324 }
325
326
327 nn = (*(tables[2]))[idx]->GetVectorLength();
330 }
331 for(std::size_t j=0; j<
nn; ++j) {
332 G4double e = (*(tables[2]))[idx]->Energy(j);
334 sigComp = theCompton->GetLambda(e, couple, loge);
335 sigR = (nullptr != theRayleigh) ?
336 theRayleigh->GetLambda(e, couple, loge) : 0.0;
337 sigPE = thePhotoElectric->GetLambda(e, couple, loge);
338 G4double sum = sigComp + sigR + sigPE;
340 G4cout << j <<
". E= " << e <<
" xs= " << sum
341 << " compt= " << sigComp << " conv= " << sigConv
342 << " PE= " << sigPE << " Rayl= " << sigR
343 <<
" GN= " << sigN <<
G4endl;
344 }
345 (*(tables[2]))[idx]->PutValue(j, sum);
346
347 val = sigPE/sum;
348 (*(tables[3]))[idx]->PutValue(j, val);
349
350 val = (sigR > 0.0) ? (sigComp + sigPE)/sum : 1.0;
351 (*(tables[4]))[idx]->PutValue(j, val);
352 }
353
354
355 nn = (*(tables[6]))[idx]->GetVectorLength();
358 }
359 for(std::size_t j=0; j<
nn; ++j) {
360 G4double e = (*(tables[6]))[idx]->Energy(j);
362 sigComp = theCompton->GetLambda(e, couple, loge);
363 sigConv = theConversionEE->GetLambda(e, couple, loge);
364 sigPE = thePhotoElectric->GetLambda(e, couple, loge);
365 sigN = 0.0;
366 if(nullptr != gn) {
369 }
370 G4double sum = sigComp + sigConv + sigPE + sigN;
372 G4cout << j <<
". E= " << e <<
" xs= " << sum
373 << " compt= " << sigComp << " conv= " << sigConv
374 << " PE= " << sigPE
375 <<
" GN= " << sigN <<
G4endl;
376 }
377 (*(tables[6]))[idx]->PutValue(j, sum);
378
379 val = sigConv/sum;
380 (*(tables[7]))[idx]->PutValue(j, val);
381
382 val = (sigConv + sigComp)/sum;
383 (*(tables[8]))[idx]->PutValue(j, val);
384
385 val = (sigN > 0.0) ? (sigConv + sigComp + sigPE)/sum : 1.0;
386 (*(tables[9]))[idx]->PutValue(j, val);
387 }
388
389
390 nn = (*(tables[10]))[idx]->GetVectorLength();
392 G4cout <<
"======= Zone 3 ======= N= " <<
nn
394 }
395 for(std::size_t j=0; j<
nn; ++j) {
396 G4double e = (*(tables[10]))[idx]->Energy(j);
398 sigComp = theCompton->GetLambda(e, couple, loge);
399 sigConv = theConversionEE->GetLambda(e, couple, loge);
400 sigPE = thePhotoElectric->GetLambda(e, couple, loge);
401 sigN = 0.0;
402 if(nullptr != gn) {
405 }
406 sigM = 0.0;
407 if(nullptr != theConversionMM) {
408 val = theConversionMM->ComputeMeanFreePath(e, material);
409 sigM = (val <
DBL_MAX) ? 1./val : 0.0;
410 }
411 G4double sum = sigComp + sigConv + sigPE + sigN + sigM;
413 G4cout << j <<
". E= " << e <<
" xs= " << sum
414 << " compt= " << sigComp << " conv= " << sigConv
415 << " PE= " << sigPE
416 <<
" GN= " << sigN <<
G4endl;
417 }
418 (*(tables[10]))[idx]->PutValue(j, sum);
419
420 val = (sigComp + sigPE + sigN + sigM)/sum;
421 (*(tables[11]))[idx]->PutValue(j, val);
422
423 val = (sigPE + sigN + sigM)/sum;
424 (*(tables[12]))[idx]->PutValue(j, val);
425
426 val = (sigN + sigM)/sum;
427 (*(tables[13]))[idx]->PutValue(j, val);
428
429 val = sigM/sum;
430 (*(tables[14]))[idx]->PutValue(j, val);
431 }
432 for(std::size_t k=0; k<nTables; ++k) {
433 if(theT[k] && (k <= 1 || k >= 10)) {
434
435 (*(tables[k]))[idx]->FillSecondDerivatives();
436 }
437 }
438 }
439 }
440 delete dynParticle;
441 }
442
444 G4cout <<
"### G4VEmProcess::BuildPhysicsTable() done for "
448 }
449}
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