75 G4double G4SeltzerBergerModel::ylimit[] = {0.0};
76 G4double G4SeltzerBergerModel::expnumlim = -12.;
79 static const G4double alpha = CLHEP::twopi*CLHEP::fine_structure_const;
80 static const G4double epeaklimit= 300*CLHEP::MeV;
81 static const G4double elowlimit = 20*CLHEP::keV;
99 for(
size_t i=0; i<101; ++i) {
118 char* path = getenv(
"G4LEDATA");
123 for(
size_t i=0; i<numOfElm; ++i) {
126 else if(Z > 100) { Z = 100; }
129 if(!dataSB[Z]) { ReadData(Z, path); }
141 return "/brem_SB/br";
146 void G4SeltzerBergerModel::ReadData(
G4int Z,
const char* path)
151 if(dataSB[Z]) {
return; }
152 const char* datadir = path;
155 datadir = getenv(
"G4LEDATA");
158 "Environment variable G4LEDATA not defined");
162 std::ostringstream ost;
164 std::ifstream
fin(ost.str().c_str());
165 if( !
fin.is_open()) {
167 ed <<
"Bremsstrahlung data file <" << ost.str().c_str()
168 <<
"> is not opened!";
170 ed,
"G4LEDATA version should be G4EMLOW6.23 or later.");
179 ylimit[
Z] = v->
Value(0.97, emaxlog, idx, idy);
182 ed <<
"Bremsstrahlung data file <" << ost.str().c_str()
183 <<
"> is not retrieved!";
185 ed,
"G4LEDATA version should be G4EMLOW6.23 or later.");
196 if(gammaEnergy < 0.0 ||
kinEnergy <= 0.0) {
return 0.0; }
223 if(xxx < expnumlim) { cross = 0.0; }
224 else { cross *=
G4Exp(xxx); }
245 if(cut >= emax) {
return; }
276 ((kineticEnergy > epeaklimit) || (kineticEnergy < elowlimit))) {
278 if(ylim > vmax) { vmax = ylim; }
280 if(x0 < 0.05) { vmax *= 1.2; }
288 if(x < 0.0) { x = 0.0; }
289 gammaEnergy = sqrt(x);
291 v = dataSB[
Z]->
Value(x1, y, idx, idy);
297 G4double e2 = kineticEnergy - gammaEnergy;
301 if(xxx < expnumlim) { v = 0.0; }
302 else { v *=
G4Exp(xxx); }
305 if (v > 1.05*vmax && nwarn < 5) {
308 ed <<
"### G4SeltzerBergerModel Warning: Majoranta exceeded! "
309 << v <<
" > " << vmax <<
" by " << v/vmax
310 <<
" Egamma(MeV)= " << gammaEnergy
311 <<
" Ee(MeV)= " << kineticEnergy
315 ed <<
"\n ### G4SeltzerBergerModel Warnings stopped";
317 G4Exception(
"G4SeltzerBergerModel::SampleScattering",
"em0044",
335 vdp->push_back(gamma);
338 - gammaEnergy*gammaDirection).unit();
348 G4double finalE = kineticEnergy - gammaEnergy;
375 if(!dataSB[Z]) { ReadData(Z); }
virtual ~G4SeltzerBergerModel()
void SetBicubicInterpolation(G4bool)
G4double SecondaryThreshold() const
virtual void Initialise(const G4ParticleDefinition *, const G4DataVector &)
std::ostringstream G4ExceptionDescription
G4double GetKineticEnergy() const
G4VEmAngularDistribution * GetAngularDistribution()
virtual void SetupForMaterial(const G4ParticleDefinition *, const G4Material *, G4double)
G4double LowestKinEnergy() const
#define G4MUTEX_INITIALIZER
const G4String & GetParticleName() const
const G4ParticleDefinition * particle
G4ParticleDefinition * theGamma
G4SeltzerBergerModel(const G4ParticleDefinition *p=0, const G4String &nam="eBremSB")
G4double Value(G4double x, G4double y, size_t &lastidx, size_t &lastidy) const
virtual G4double ComputeDXSectionPerAtom(G4double gammaEnergy)
static size_t GetNumberOfElements()
virtual G4ThreeVector & SampleDirection(const G4DynamicParticle *dp, G4double finalTotalEnergy, G4int Z, const G4Material *)=0
const G4ThreeVector & GetMomentumDirection() const
void SetLowestKinEnergy(G4double)
void SetProposedKineticEnergy(G4double proposedKinEnergy)
void SetProposedMomentumDirection(const G4ThreeVector &dir)
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
G4double G4Log(G4double x)
G4double G4Exp(G4double initial_x)
Exponential Function double precision.
virtual void InitialiseForElement(const G4ParticleDefinition *, G4int Z)
G4bool Retrieve(std::ifstream &fIn)
void SetLPMFlag(G4bool val)
T min(const T t1, const T t2)
brief Return the smallest of the two arguments
G4ParticleChangeForLoss * fParticleChange
virtual void Initialise(const G4ParticleDefinition *, const G4DataVector &)
std::vector< G4Element * > G4ElementTable
void ProposeTrackStatus(G4TrackStatus status)
void SetLowEnergyLimit(G4double)
static G4ElementTable * GetElementTable()
virtual G4String DirectoryPath() const
virtual void SampleSecondaries(std::vector< G4DynamicParticle * > *, const G4MaterialCutsCouple *, const G4DynamicParticle *, G4double cutEnergy, G4double maxEnergy)
const G4Element * SelectRandomAtom(const G4MaterialCutsCouple *, const G4ParticleDefinition *, G4double kineticEnergy, G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX)
virtual G4double Value(const G4MaterialCutsCouple *, const G4ParticleDefinition *, G4double kineticEnergy)
const G4Material * GetMaterial() const
void SetCurrentElement(const G4double)