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; }
278 G4double totalEnergy = kineticEnergy + electron_mass_c2;
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;
321 G4cout <<
"Gamma ray " << tGamma/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;
std::vector< G4Element * > G4ElementVector
G4DLLIMPORT std::ostream G4cout
G4double GetCrossSectionAboveThresholdForElement(G4double energy, G4double cutEnergy, G4int Z)
const G4ThreeVector & GetMomentumDirection() const
G4double GetKineticEnergy() const
static G4Electron * Electron()
virtual ~G4LivermoreBremsstrahlungModel()
virtual G4double ComputeDEDXPerVolume(const G4Material *, const G4ParticleDefinition *, G4double kineticEnergy, G4double cutEnergy)
virtual G4double MinEnergyCut(const G4ParticleDefinition *, const G4MaterialCutsCouple *)
virtual G4double ComputeCrossSectionPerAtom(const G4ParticleDefinition *, G4double kinEnergy, G4double Z, G4double A=0, G4double cut=0, G4double emax=DBL_MAX)
G4ParticleChangeForLoss * fParticleChange
virtual void Initialise(const G4ParticleDefinition *, const G4DataVector &)
G4LivermoreBremsstrahlungModel(const G4ParticleDefinition *p=0, const G4String &processName="LowEnBrem")
virtual void SampleSecondaries(std::vector< G4DynamicParticle * > *, const G4MaterialCutsCouple *, const G4DynamicParticle *, G4double tmin, G4double maxEnergy)
const G4Material * GetMaterial() const
const G4ElementVector * GetElementVector() const
size_t GetNumberOfElements() const
const G4double * GetAtomicNumDensityVector() const
void SetProposedKineticEnergy(G4double proposedKinEnergy)
void ProposeMomentumDirection(G4double Px, G4double Py, G4double Pz)
G4VEMDataSet * BuildMeanFreePathForMaterials(const G4DataVector *energyCuts=0)
void LoadShellData(const G4String &dataFile)
G4double FindValue(G4int Z, G4double e) const
G4int SelectRandomAtom(const G4MaterialCutsCouple *couple, G4double e) const
void Initialise(G4VDataSetAlgorithm *interpolation=0, G4double minE=250 *CLHEP::eV, G4double maxE=100 *CLHEP::GeV, G4int numberOfBins=200, G4double unitE=CLHEP::MeV, G4double unitData=CLHEP::barn, G4int minZ=1, G4int maxZ=99)
virtual G4ThreeVector & SampleDirection(const G4DynamicParticle *dp, G4double finalTotalEnergy, G4int Z, const G4Material *)=0
void SetHighEnergyLimit(G4double)
G4VEmAngularDistribution * GetAngularDistribution()
G4double LowEnergyLimit() const
G4double HighEnergyLimit() const
void SetAngularDistribution(G4VEmAngularDistribution *)
G4ParticleChangeForLoss * GetParticleChangeForLoss()
virtual G4double SampleEnergy(G4int Z, G4double minKineticEnergy, G4double maxKineticEnergy, G4double kineticEnergy, G4int shell=0, const G4ParticleDefinition *pd=0) const =0
virtual void PrintData() const =0
virtual G4double AverageEnergy(G4int Z, G4double minKineticEnergy, G4double maxKineticEnergy, G4double kineticEnergy, G4int shell=0, const G4ParticleDefinition *pd=0) const =0
void ProposeLocalEnergyDeposit(G4double anEnergyPart)
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)