75G4double G4SeltzerBergerModel::ylimit[101] = {0.0};
76G4double G4SeltzerBergerModel::expnumlim = -12.;
91 for(
size_t i=0; i<101; ++i) {
106 char* path = getenv(
"G4LEDATA");
112 for(
size_t i=0; i<numOfElm; ++i) {
115 else if(Z > 100) { Z = 100; }
118 if(!dataSB[Z]) { ReadData(Z, path); }
127void G4SeltzerBergerModel::ReadData(
size_t Z,
const char* path)
132 if(dataSB[Z]) {
return; }
133 const char* datadir = path;
136 datadir = getenv(
"G4LEDATA");
139 "Environment variable G4LEDATA not defined");
143 std::ostringstream ost;
144 ost << datadir <<
"/brem_SB/br" << Z;
145 std::ifstream fin(ost.str().c_str());
146 if( !fin.is_open()) {
148 ed <<
"Bremsstrahlung data file <" << ost.str().c_str()
149 <<
"> is not opened!" <<
G4endl;
151 ed,
"G4LEDATA version should be G4EMLOW6.23 or later.");
157 const G4double emaxlog = 4*log(10.);
161 ylimit[Z] = v->
Value(0.97, emaxlog);
164 ed <<
"Bremsstrahlung data file <" << ost.str().c_str()
165 <<
"> is not retrieved!" <<
G4endl;
167 ed,
"G4LEDATA version should be G4EMLOW6.23 or later.");
178 if(gammaEnergy < 0.0 ||
kinEnergy <= 0.0) {
return 0.0; }
184 if(!dataSB[Z]) { ReadData(Z); }
194 if(xxx < expnumlim) { cross = 0.0; }
195 else { cross *= exp(xxx); }
214 G4double cut = std::min(cutEnergy, kineticEnergy);
215 G4double emax = std::min(maxEnergy, kineticEnergy);
216 if(cut >= emax) {
return; }
236 G4double y = log(kineticEnergy/MeV);
250 ((kineticEnergy > epeaklimit) || (kineticEnergy < elowlimit))) {
251 G4double ylim = std::min(ylimit[Z],1.1*dataSB[Z]->
Value(0.97, y));
252 if(ylim > vmax) { vmax = ylim; }
254 if(x0 < 0.05) { vmax *= 1.2; }
261 if(x < 0.0) { x = 0.0; }
262 gammaEnergy = sqrt(x);
263 G4double x1 = gammaEnergy/kineticEnergy;
264 v = dataSB[Z]->
Value(x1, y);
270 G4double e2 = kineticEnergy - gammaEnergy;
274 if(xxx < expnumlim) { v = 0.0; }
275 else { v *= exp(xxx); }
278 if (v > 1.05*vmax && nwarn < 20) {
280 G4cout <<
"### G4SeltzerBergerModel Warning: Majoranta exceeded! "
281 << v <<
" > " << vmax <<
" by " << v/vmax
282 <<
" Egamma(MeV)= " << gammaEnergy
283 <<
" Ee(MeV)= " << kineticEnergy
289 G4cout <<
"### G4SeltzerBergerModel Warnings will not be printed anymore"
307 vdp->push_back(gamma);
310 - gammaEnergy*gammaDirection).unit();
320 G4double finalE = kineticEnergy - gammaEnergy;
std::vector< G4Element * > G4ElementTable
G4DLLIMPORT std::ostream G4cout
const G4ThreeVector & GetMomentumDirection() const
G4double GetKineticEnergy() const
static size_t GetNumberOfElements()
static const G4ElementTable * GetElementTable()
const G4Material * GetMaterial() const
void SetProposedKineticEnergy(G4double proposedKinEnergy)
void SetProposedMomentumDirection(const G4ThreeVector &dir)
const G4String & GetParticleName() const
G4bool Retrieve(std::ifstream &fIn)
G4double Value(G4double x, G4double y)
void SetBicubicInterpolation(G4bool)
virtual void Initialise(const G4ParticleDefinition *, const G4DataVector &)
virtual G4double ComputeDXSectionPerAtom(G4double gammaEnergy)
G4SeltzerBergerModel(const G4ParticleDefinition *p=0, const G4String &nam="eBremSB")
virtual void SampleSecondaries(std::vector< G4DynamicParticle * > *, const G4MaterialCutsCouple *, const G4DynamicParticle *, G4double cutEnergy, G4double maxEnergy)
virtual ~G4SeltzerBergerModel()
virtual G4ThreeVector & SampleDirection(const G4DynamicParticle *dp, G4double finalTotalEnergy, G4int Z, const G4Material *)=0
G4VEmAngularDistribution * GetAngularDistribution()
void SetLPMFlag(G4bool val)
virtual G4double Value(const G4MaterialCutsCouple *, const G4ParticleDefinition *, G4double kineticEnergy)
const G4Element * SelectRandomAtom(const G4MaterialCutsCouple *, const G4ParticleDefinition *, G4double kineticEnergy, G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX)
void SetLowEnergyLimit(G4double)
G4double SecondaryThreshold() const
void ProposeTrackStatus(G4TrackStatus status)
virtual void SetupForMaterial(const G4ParticleDefinition *, const G4Material *, G4double)
virtual void Initialise(const G4ParticleDefinition *, const G4DataVector &)
const G4ParticleDefinition * particle
G4ParticleDefinition * theGamma
void SetCurrentElement(const G4double)
G4ParticleChangeForLoss * fParticleChange
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
std::ostringstream G4ExceptionDescription