57 :
G4VEmModel(nam),fParticleChange(0),fParticle(0),
58 logAtomicCrossSection(0),
59 fEffectiveCharge(0),fMaterialInvScreeningRadius(0),
60 fScreeningFunction(0),isInitialised(
false),fLocalTable(
false)
94 if (item.second)
delete item.second;
113 G4cout <<
"Calling G4PenelopeGammaConversionModel::Initialise()" <<
G4endl;
156 G4int iZ = (
G4int) theElementVector->at(j)->GetZ();
169 G4cout <<
"Penelope Gamma Conversion model v2008 is initialized " << G4endl
190 G4cout <<
"Calling G4PenelopeGammaConversionModel::InitialiseLocal()" <<
G4endl;
254 ed <<
"Unable to retrieve the cross section table for Z=" << iZ <<
G4endl;
255 ed <<
"This can happen only in Unit Tests or via G4EmCalculator" <<
G4endl;
256 G4Exception(
"G4PenelopeGammaConversionModel::ComputeCrossSectionPerAtom()",
260 G4AutoLock lock(&PenelopeGammaConversionModelMutex);
274 G4cout <<
"Gamma conversion cross section at " << energy/
MeV <<
" MeV for Z=" << Z <<
301 G4cout <<
"Calling SamplingSecondaries() of G4PenelopeGammaConversionModel" <<
G4endl;
338 ed <<
"Unable to allocate the EffectiveCharge data for " <<
340 ed <<
"This can happen only in Unit Tests" <<
G4endl;
341 G4Exception(
"G4PenelopeGammaConversionModel::SampleSecondaries()",
345 G4AutoLock lock(&PenelopeGammaConversionModelMutex);
363 G4double F00=(-1.774-1.210e1*alz+1.118e1*alz*alz)*T
364 +(8.523+7.326
e1*alz-4.441
e1*alz*alz)*T*T
365 -(1.352e1+1.211e2*alz-9.641e1*alz*alz)*T*T*T
366 +(8.946+6.205
e1*alz-6.341
e1*alz*alz)*T*T*T*
T;
389 eps = 0.5-xr*std::pow(
std::abs(ru2m1),1./3.);
391 eps = 0.5+xr*std::pow(ru2m1,1./3.);
415 G4double electronTotEnergy = eps*photonEnergy;
416 G4double positronTotEnergy = (1.0-
eps)*photonEnergy;
424 costheta_el = (costheta_el*electronTotEnergy+kk)/(electronTotEnergy+costheta_el*kk);
426 G4double dirX_el = std::sqrt(1.-costheta_el*costheta_el) * std::cos(phi_el);
427 G4double dirY_el = std::sqrt(1.-costheta_el*costheta_el) * std::sin(phi_el);
433 kk = std::sqrt(positronKineEnergy*(positronKineEnergy+2.*
electron_mass_c2));
434 costheta_po = (costheta_po*positronTotEnergy+kk)/(positronTotEnergy+costheta_po*kk);
436 G4double dirX_po = std::sqrt(1.-costheta_po*costheta_po) * std::cos(phi_po);
437 G4double dirY_po = std::sqrt(1.-costheta_po*costheta_po) * std::sin(phi_po);
445 if (electronKineEnergy > 0.0)
447 G4ThreeVector electronDirection ( dirX_el, dirY_el, dirZ_el);
448 electronDirection.
rotateUz(photonDirection);
452 fvect->push_back(electron);
456 localEnergyDeposit += electronKineEnergy;
457 electronKineEnergy = 0;
462 if (positronKineEnergy < 0.0)
464 localEnergyDeposit += positronKineEnergy;
465 positronKineEnergy = 0;
468 positronDirection.
rotateUz(photonDirection);
470 positronDirection, positronKineEnergy);
471 fvect->push_back(positron);
478 G4cout <<
"-----------------------------------------------------------" <<
G4endl;
479 G4cout <<
"Energy balance from G4PenelopeGammaConversion" <<
G4endl;
480 G4cout <<
"Incoming photon energy: " << photonEnergy/
keV <<
" keV" <<
G4endl;
481 G4cout <<
"-----------------------------------------------------------" <<
G4endl;
482 if (electronKineEnergy)
483 G4cout <<
"Electron (explicitely produced) " << electronKineEnergy/
keV <<
" keV"
485 if (positronKineEnergy)
486 G4cout <<
"Positron (not at rest) " << positronKineEnergy/
keV <<
" keV" <<
G4endl;
488 if (localEnergyDeposit)
489 G4cout <<
"Local energy deposit " << localEnergyDeposit/
keV <<
" keV" <<
G4endl;
490 G4cout <<
"Total final state: " << (electronKineEnergy+positronKineEnergy+
493 G4cout <<
"-----------------------------------------------------------" <<
G4endl;
497 G4double energyDiff = std::fabs(electronKineEnergy+positronKineEnergy+
499 if (energyDiff > 0.05*
keV)
500 G4cout <<
"Warning from G4PenelopeGammaConversion: problem with energy conservation: "
501 << (electronKineEnergy+positronKineEnergy+
503 <<
" keV (final) vs. " << photonEnergy/
keV <<
" keV (initial)" << G4endl;
513 G4Exception(
"G4PenelopeGammaConversionModel::ReadDataFile()",
518 G4cout <<
"G4PenelopeGammaConversionModel::ReadDataFile()" <<
G4endl;
519 G4cout <<
"Going to read Gamma Conversion data files for Z=" << Z <<
G4endl;
522 char* path = std::getenv(
"G4LEDATA");
526 "G4PenelopeGammaConversionModel - G4LEDATA environment variable not set!";
527 G4Exception(
"G4PenelopeGammaConversionModel::ReadDataFile()",
535 std::ostringstream ost;
537 ost << path <<
"/penelope/pairproduction/pdgpp" << Z <<
".p08";
539 ost << path <<
"/penelope/pairproduction/pdgpp0" << Z <<
".p08";
540 std::ifstream
file(ost.str().c_str());
543 G4String excep =
"G4PenelopeGammaConversionModel - data file " +
544 G4String(ost.str()) +
" not found!";
545 G4Exception(
"G4PenelopeGammaConversionModel::ReadDataFile()",
553 while( getline(
file, line) )
560 file.open(ost.str().c_str());
571 ed <<
"Corrupted data file for Z=" << Z <<
G4endl;
572 G4Exception(
"G4PenelopeGammaConversionModel::ReadDataFile()",
578 for (
size_t i=0;i<ndata;i++)
586 theVec->
PutValue(i,std::log(ene),std::log(xs));
593 ed <<
"Problem with allocation of logAtomicCrossSection data table " <<
G4endl;
594 G4Exception(
"G4PenelopeGammaConversionModel::ReadDataFile()",
609 G4double temp[99] = {1.2281e+02,7.3167e+01,6.9228e+01,6.7301e+01,6.4696e+01,
610 6.1228e+01,5.7524e+01,5.4033e+01,5.0787e+01,4.7851e+01,4.6373e+01,
611 4.5401e+01,4.4503e+01,4.3815e+01,4.3074e+01,4.2321e+01,4.1586e+01,
612 4.0953e+01,4.0524e+01,4.0256e+01,3.9756e+01,3.9144e+01,3.8462e+01,
613 3.7778e+01,3.7174e+01,3.6663e+01,3.5986e+01,3.5317e+01,3.4688e+01,
614 3.4197e+01,3.3786e+01,3.3422e+01,3.3068e+01,3.2740e+01,3.2438e+01,
615 3.2143e+01,3.1884e+01,3.1622e+01,3.1438e+01,3.1142e+01,3.0950e+01,
616 3.0758e+01,3.0561e+01,3.0285e+01,3.0097e+01,2.9832e+01,2.9581e+01,
617 2.9411e+01,2.9247e+01,2.9085e+01,2.8930e+01,2.8721e+01,2.8580e+01,
618 2.8442e+01,2.8312e+01,2.8139e+01,2.7973e+01,2.7819e+01,2.7675e+01,
619 2.7496e+01,2.7285e+01,2.7093e+01,2.6911e+01,2.6705e+01,2.6516e+01,
620 2.6304e+01,2.6108e+01,2.5929e+01,2.5730e+01,2.5577e+01,2.5403e+01,
621 2.5245e+01,2.5100e+01,2.4941e+01,2.4790e+01,2.4655e+01,2.4506e+01,
622 2.4391e+01,2.4262e+01,2.4145e+01,2.4039e+01,2.3922e+01,2.3813e+01,
623 2.3712e+01,2.3621e+01,2.3523e+01,2.3430e+01,2.3331e+01,2.3238e+01,
624 2.3139e+01,2.3048e+01,2.2967e+01,2.2833e+01,2.2694e+01,2.2624e+01,
625 2.2545e+01,2.2446e+01,2.2358e+01,2.2264e+01};
628 for (
G4int i=0;i<99;i++)
655 zeff = (*elementVector)[0]->GetZ();
663 for (
G4int i=0;i<nElements;i++)
665 G4double Zelement = (*elementVector)[i]->GetZ();
666 G4double Aelement = (*elementVector)[i]->GetAtomicMassAmu();
667 atot += Aelement*fractionVector[i];
668 zeff += Zelement*Aelement*fractionVector[i];
673 intZ = (
G4int) (zeff+0.25);
688 G4double fc = alzSquared*(0.202059-alzSquared*
690 (0.00835-alzSquared*(0.00201-alzSquared*
692 (0.00012-alzSquared*0.00003)))))
693 +1.0/(alzSquared+1.0));
701 std::pair<G4double,G4double> myPair(0,0);
712 G4cout <<
"Average Z for material " << material->
GetName() <<
" = " <<
714 G4cout <<
"Effective radius for material " << material->
GetName() <<
" = " <<
717 G4cout <<
"Screening parameters F0 for material " << material->
GetName() <<
" = " <<
718 f0a <<
"," << f0b <<
G4endl;
725 std::pair<G4double,G4double>
733 std::pair<G4double,G4double> result(0.,0.);
743 f2 += 2.0*BSquared*(4.0-a0-3.0*std::log((1.0+BSquared)/BSquared));