194 if (
nullptr != theRayleigh) { theT[1] =
true; }
196 theHandler->SetMasterProcess(thePhotoElectric);
197 theHandler->SetMasterProcess(theCompton);
198 theHandler->SetMasterProcess(theConversionEE);
199 theHandler->SetMasterProcess(theRayleigh);
205 std::size_t numOfCouples = theCoupleTable->
GetTableSize();
210 std::size_t nbin1 = std::max(5, nd*
G4lrint(std::log10(minPEEnergy/mine)));
211 std::size_t nbin2 = std::max(5, nd*
G4lrint(std::log10(maxe/minMMEnergy)));
219 for(std::size_t i=0; i<nTables; ++i) {
220 if(!theT[i]) {
continue; }
224 for(std::size_t j=0; j<numOfCouples; ++j) {
226 if (bld->GetFlag(j) &&
nullptr == vec) {
248 G4cout <<
"### G4VEmProcess::BuildPhysicsTable() for "
254 thePhotoElectric->SetEmMasterProcess(theHandler->GetMasterProcess(0));
255 baseMat = theHandler->GetMasterProcess(0)->UseBaseMaterial();
257 thePhotoElectric->BuildPhysicsTable(part);
260 theCompton->SetEmMasterProcess(theHandler->GetMasterProcess(1));
262 theCompton->BuildPhysicsTable(part);
265 theConversionEE->SetEmMasterProcess(theHandler->GetMasterProcess(2));
267 theConversionEE->BuildPhysicsTable(part);
269 if(theRayleigh !=
nullptr) {
271 theRayleigh->SetEmMasterProcess(theHandler->GetMasterProcess(3));
273 theRayleigh->BuildPhysicsTable(part);
276 if(theConversionMM !=
nullptr) { theConversionMM->BuildPhysicsTable(part); }
284 const std::vector<G4PhysicsTable*>& tables = theHandler->GetTables();
291 G4double sigComp(0.), sigPE(0.), sigConv(0.), sigR(0.),
292 sigN(0.), sigM(0.), val(0.);
294 for(
G4int i=0; i<numOfCouples; ++i) {
303 std::size_t nn = (*(tables[0]))[idx]->GetVectorLength();
305 G4cout <<
"======= Zone 0 ======= N= " << nn
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;
319 (*(tables[0]))[idx]->PutValue(j, sum);
322 (*(tables[1]))[idx]->PutValue(j, val);
327 nn = (*(tables[2]))[idx]->GetVectorLength();
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;
345 (*(tables[2]))[idx]->PutValue(j, sum);
348 (*(tables[3]))[idx]->PutValue(j, val);
350 val = (sigR > 0.0) ? (sigComp + sigPE)/sum : 1.0;
351 (*(tables[4]))[idx]->PutValue(j, val);
355 nn = (*(tables[6]))[idx]->GetVectorLength();
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);
370 G4double sum = sigComp + sigConv + sigPE + sigN;
372 G4cout << j <<
". E= " << e <<
" xs= " << sum
373 <<
" compt= " << sigComp <<
" conv= " << sigConv
375 <<
" GN= " << sigN <<
G4endl;
377 (*(tables[6]))[idx]->PutValue(j, sum);
380 (*(tables[7]))[idx]->PutValue(j, val);
382 val = (sigConv + sigComp)/sum;
383 (*(tables[8]))[idx]->PutValue(j, val);
385 val = (sigN > 0.0) ? (sigConv + sigComp + sigPE)/sum : 1.0;
386 (*(tables[9]))[idx]->PutValue(j, val);
390 nn = (*(tables[10]))[idx]->GetVectorLength();
392 G4cout <<
"======= Zone 3 ======= N= " << nn
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);
407 if(
nullptr != theConversionMM) {
408 val = theConversionMM->ComputeMeanFreePath(e, material);
409 sigM = (val <
DBL_MAX) ? 1./val : 0.0;
411 G4double sum = sigComp + sigConv + sigPE + sigN + sigM;
413 G4cout << j <<
". E= " << e <<
" xs= " << sum
414 <<
" compt= " << sigComp <<
" conv= " << sigConv
416 <<
" GN= " << sigN <<
G4endl;
418 (*(tables[10]))[idx]->PutValue(j, sum);
420 val = (sigComp + sigPE + sigN + sigM)/sum;
421 (*(tables[11]))[idx]->PutValue(j, val);
423 val = (sigPE + sigN + sigM)/sum;
424 (*(tables[12]))[idx]->PutValue(j, val);
426 val = (sigN + sigM)/sum;
427 (*(tables[13]))[idx]->PutValue(j, val);
430 (*(tables[14]))[idx]->PutValue(j, val);
432 for(std::size_t k=0; k<nTables; ++k) {
433 if(theT[k] && (k <= 1 || k >= 10)) {
435 (*(tables[k]))[idx]->FillSecondDerivatives();
444 G4cout <<
"### G4VEmProcess::BuildPhysicsTable() done for "
662 if(!thePhotoElectric->StorePhysicsTable(part, directory, ascii))
664 if(!theCompton->StorePhysicsTable(part, directory, ascii))
666 if(!theConversionEE->StorePhysicsTable(part, directory, ascii))
668 if(theRayleigh !=
nullptr &&
669 !theRayleigh->StorePhysicsTable(part, directory, ascii))
672 for(std::size_t i=0; i<nTables; ++i) {
674 G4String nam = (0==i || 2==i || 6==i || 10==i)
675 ?
"LambdaGeneral" + nameT[i] :
"ProbGeneral" + nameT[i];
677 if(!theHandler->StorePhysicsTable(i, part, fnam, ascii)) { yes =
false; }
692 G4cout <<
"G4GammaGeneralProcess::RetrievePhysicsTable() for "
697 if(!thePhotoElectric->RetrievePhysicsTable(part, directory, ascii))
699 if(!theCompton->RetrievePhysicsTable(part, directory, ascii))
701 if(!theConversionEE->RetrievePhysicsTable(part, directory, ascii))
703 if(theRayleigh !=
nullptr &&
704 !theRayleigh->RetrievePhysicsTable(part, directory, ascii))
707 for(std::size_t i=0; i<nTables; ++i) {
709 G4String nam = (0==i || 2==i || 6==i || 10==i)
710 ?
"LambdaGeneral" + nameT[i] :
"ProbGeneral" + nameT[i];
712 G4bool spline = (i <= 1 || i >= 10);
713 if(!theHandler->RetrievePhysicsTable(i, part, fnam, ascii, spline))