65 :
G4VEmModel(nam),fParticleChange(0),fParticle(0),
66 isInitialised(
false),energyGrid(0),
67 XSTableElectron(0),XSTablePositron(0),fPenelopeFSHelper(0),
68 fPenelopeAngular(0),fLocalTable(
false)
117 G4cout <<
"Calling G4PenelopeBremsstrahlungModel::Initialise()" <<
G4endl;
146 std::map< std::pair<const G4Material*,G4double>, G4PenelopeCrossSection*>;
165 G4cout <<
"Penelope Bremsstrahlung model v2008 is initialized " << G4endl
183 G4cout <<
"Calling G4PenelopeBremsstrahlungModel::InitialiseLocal()" <<
G4endl;
241 G4cout <<
"Calling CrossSectionPerVolume() of G4PenelopeBremsstrahlungModel" <<
G4endl;
257 G4cout <<
"Material " << material->
GetName() <<
" has " << atPerMol <<
258 "atoms per molecule" <<
G4endl;
262 moleculeDensity = atomDensity/atPerMol;
264 G4double crossPerVolume = crossPerMolecule*moleculeDensity;
269 G4cout <<
"Mean free path for gamma emission > " << cutEnergy/
keV <<
" keV at " <<
270 energy/
keV <<
" keV = " << (1./crossPerVolume)/
mm <<
" mm" << G4endl;
273 return crossPerVolume;
288 G4cout <<
"*** G4PenelopeBremsstrahlungModel -- WARNING ***" <<
G4endl;
289 G4cout <<
"Penelope Bremsstrahlung model v2008 does not calculate cross section _per atom_ " <<
G4endl;
290 G4cout <<
"so the result is always zero. For physics values, please invoke " <<
G4endl;
291 G4cout <<
"GetCrossSectionPerVolume() or GetMeanFreePath() via the G4EmCalculator" <<
G4endl;
303 G4cout <<
"Calling ComputeDEDX() of G4PenelopeBremsstrahlungModel" <<
G4endl;
317 moleculeDensity = atomDensity/atPerMol;
319 G4double sPowerPerVolume = sPowerPerMolecule*moleculeDensity;
324 G4cout <<
"Stopping power < " << cutEnergy/
keV <<
" keV at " <<
325 kineticEnergy/
keV <<
" keV = " <<
326 sPowerPerVolume/(
keV/
mm) <<
" keV/mm" << G4endl;
328 return sPowerPerVolume;
340 G4cout <<
"Calling SampleSecondaries() of G4PenelopeBremsstrahlungModel" <<
G4endl;
357 if (kineticEnergy < cutG)
361 G4cout <<
"Going to sample gamma energy for: " <<material->
GetName() <<
" " <<
362 "energy = " << kineticEnergy/
keV <<
", cut = " << cutG/
keV <<
G4endl;
369 G4cout <<
"Sampled gamma energy: " << gammaEnergy/
keV <<
" keV" <<
G4endl;
379 G4double residualPrimaryEnergy = kineticEnergy-gammaEnergy;
380 if (residualPrimaryEnergy < 0)
383 gammaEnergy += residualPrimaryEnergy;
384 residualPrimaryEnergy = 0.0;
388 G4ThreeVector particleDirection1 = initialMomentum - gammaEnergy*gammaDirection1;
389 particleDirection1 = particleDirection1.
unit();
392 if (residualPrimaryEnergy > 0.)
406 fvect->push_back(theGamma);
410 G4cout <<
"-----------------------------------------------------------" <<
G4endl;
411 G4cout <<
"Energy balance from G4PenelopeBremsstrahlung" <<
G4endl;
412 G4cout <<
"Incoming primary energy: " << kineticEnergy/
keV <<
" keV" <<
G4endl;
413 G4cout <<
"-----------------------------------------------------------" <<
G4endl;
414 G4cout <<
"Outgoing primary energy: " << residualPrimaryEnergy/
keV <<
" keV" <<
G4endl;
415 G4cout <<
"Bremsstrahlung photon " << gammaEnergy/
keV <<
" keV" <<
G4endl;
416 G4cout <<
"Total final state: " << (residualPrimaryEnergy+gammaEnergy)/
keV
418 G4cout <<
"-----------------------------------------------------------" <<
G4endl;
423 G4double energyDiff = std::fabs(residualPrimaryEnergy+gammaEnergy-kineticEnergy);
424 if (energyDiff > 0.05*
keV)
425 G4cout <<
"Warning from G4PenelopeBremsstrahlung: problem with energy conservation: "
427 (residualPrimaryEnergy+gammaEnergy)/
keV <<
428 " keV (final) vs. " <<
429 kineticEnergy/
keV <<
" keV (initial)" << G4endl;
440 G4Exception(
"G4PenelopeBremsstrahlungModel::ClearTables()",
465 G4cout <<
"G4PenelopeBremsstrahlungModel: cleared tables" <<
G4endl;
484 G4Exception(
"G4PenelopeBremsstrahlungModel::BuildXSTable()",
488 std::pair<const G4Material*,G4double> theKey = std::make_pair(mat,cut);
501 G4cout <<
"G4PenelopeBremsstrahlungModel: going to build cross section table " <<
G4endl;
502 G4cout <<
"for e+/e- in " << mat->
GetName() <<
" for Ecut(gamma)= " <<
510 ed <<
"Energy Grid looks not initialized" <<
G4endl;
512 G4Exception(
"G4PenelopeBremsstrahlungModel::BuildXSTable()",
541 for (
size_t ix=0;ix<nBinsX;ix++)
544 G4double val = (*table)[ix]->Value(logene);
545 tempData[ix] =
G4Exp(val);
549 if (restrictedCut <= 1)
557 if (restrictedCut <=1)
569 XS2 = XS2A*fact*energy*
energy;
570 XH2 = XH2A*fact*energy*
energy;
603 G4Exception(
"G4PenelopeBremsstrahlungModel::GetCrossSectionTableForCouple()",
616 G4String excep =
"The Cross Section Table for e- was not initialized correctly!";
617 G4Exception(
"G4PenelopeBremsstrahlungModel::GetCrossSectionTableForCouple()",
629 std::pair<const G4Material*,G4double> theKey = std::make_pair(mat,cut);
640 ed <<
"Unable to find e- table for " << mat->
GetName() <<
" at Ecut(gamma)= "
642 ed <<
"This can happen only in Unit Tests or via G4EmCalculator" <<
G4endl;
643 G4Exception(
"G4PenelopeBremsstrahlungModel::GetCrossSectionTableForCouple()",
647 G4AutoLock lock(&PenelopeBremsstrahlungModelMutex);
662 G4String excep =
"The Cross Section Table for e+ was not initialized correctly!";
663 G4Exception(
"G4PenelopeBremsstrahlungModel::GetCrossSectionTableForCouple()",
675 std::pair<const G4Material*,G4double> theKey = std::make_pair(mat,cut);
686 ed <<
"Unable to find e+ table for " << mat->
GetName() <<
" at Ecut(gamma)= "
688 ed <<
"This can happen only in Unit Tests or via G4EmCalculator" <<
G4endl;
689 G4Exception(
"G4PenelopeBremsstrahlungModel::GetCrossSectionTableForCouple()",
693 G4AutoLock lock(&PenelopeBremsstrahlungModelMutex);
719 (3.1516
e-2-t*(7.7446
e-3-t*(1.0595
e-3-t*