74 :
G4VEmModel(nam),fParticleChange(0),isInitialised(false),
75 crossSectionHandler(0),energySpectrum(0)
77 fIntrinsicLowEnergyLimit = 10.0*
eV;
78 fIntrinsicHighEnergyLimit = 100.0*
GeV;
79 fNBinEnergyLoss = 360;
97 if (crossSectionHandler)
delete crossSectionHandler;
98 if (energySpectrum)
delete energySpectrum;
112 G4Exception(
"G4LivermoreBremsstrahlungModel::Initialise",
113 "em0002",
FatalException,
"Livermore Bremsstrahlung Model is applicable only to electrons");
118 delete energySpectrum;
123 for(
size_t i=0; i<15; i++)
127 if(i == 10) x = 0.95;
128 if(i == 11) x = 0.97;
129 if(i == 12) x = 0.99;
130 if(i == 13) x = 0.995;
132 energyBins.push_back(x);
134 const G4String dataName(
"/brem/br-sp.dat");
137 if (verboseLevel > 0)
138 G4cout <<
"G4eBremsstrahlungSpectrum is initialized" <<
G4endl;
141 if (crossSectionHandler)
143 delete crossSectionHandler;
144 crossSectionHandler = 0;
150 crossSectionHandler->
Clear();
156 if (verboseLevel > 0)
158 G4cout <<
"Livermore Bremsstrahlung model is initialized " << G4endl
165 if (verboseLevel > 1)
173 if(isInitialised)
return;
175 isInitialised =
true;
196 if (!crossSectionHandler)
198 G4Exception(
"G4LivermoreBremsstrahlungModel::ComputeCrossSectionPerAtom",
199 "em1007",
FatalException,
"The cross section handler is not correctly initialized");
207 if (verboseLevel > 1)
210 G4cout <<
"Cross section for gamma emission > " << cutEnergy/
keV <<
" keV at " <<
211 energy/
keV <<
" keV and Z = " << iZ <<
" --> " << cs/
barn <<
" barn" <<
G4endl;
228 const G4double* theAtomicNumDensityVector =
232 for (
size_t iel=0; iel<NumberOfElements; iel++ )
234 G4int iZ = (
G4int)((*theElementVector)[iel]->GetZ());
238 sPower += e * cs * theAtomicNumDensityVector[iel];
241 if (verboseLevel > 2)
244 G4cout <<
"Stopping power < " << cutEnergy/
keV <<
" keV at " <<
245 kineticEnergy/
keV <<
" keV = " << sPower/(
keV/
mm) <<
" keV/mm" << G4endl;
263 if (kineticEnergy <= fIntrinsicLowEnergyLimit)
276 if (tGamma == 0.) {
return; }
279 G4double finalEnergy = kineticEnergy - tGamma;
291 if (finalEnergy < 0.)
294 tGamma = kineticEnergy;
299 G4double momentum = std::sqrt((totalEnergy + electron_mass_c2)*kineticEnergy);
300 G4double finalX = momentum*electronDirection.
x() - tGamma*gammaDirection.
x();
301 G4double finalY = momentum*electronDirection.
y() - tGamma*gammaDirection.
y();
302 G4double finalZ = momentum*electronDirection.
z() - tGamma*gammaDirection.
z();
303 G4double norm = 1./std::sqrt(finalX*finalX + finalY*finalY + finalZ*finalZ);
311 gammaDirection, tGamma);
312 fvect->push_back(aGamma);
314 if (verboseLevel > 1)
316 G4cout <<
"-----------------------------------------------------------" <<
G4endl;
317 G4cout <<
"Energy balance from G4LivermoreBremsstrahlung" <<
G4endl;
318 G4cout <<
"Incoming primary energy: " << kineticEnergy/
keV <<
" keV" <<
G4endl;
319 G4cout <<
"-----------------------------------------------------------" <<
G4endl;
320 G4cout <<
"Outgoing primary energy: " << finalEnergy/
keV <<
" keV" <<
G4endl;
322 G4cout <<
"Total final state: " << (finalEnergy+tGamma)/
keV <<
" keV" << G4endl;
323 G4cout <<
"-----------------------------------------------------------" <<
G4endl;
325 if (verboseLevel > 0)
327 G4double energyDiff = std::fabs(finalEnergy+tGamma-kineticEnergy);
328 if (energyDiff > 0.05*
keV)
329 G4cout <<
"G4LivermoreBremsstrahlung WARNING: problem with energy conservation: "
330 << (finalEnergy+tGamma)/
keV <<
" keV (final) vs. "
331 << kineticEnergy/
keV <<
" keV (initial)" <<
G4endl;