74G4double G4LivermoreBremsstrahlungModel::ylimit[] = {0.0};
75G4double G4LivermoreBremsstrahlungModel::expnumlim = -12.;
78static const G4double alpha = CLHEP::twopi*CLHEP::fine_structure_const;
79static const G4double epeaklimit= 300*CLHEP::MeV;
80static const G4double elowlimit = 20*CLHEP::keV;
98 for(
size_t i=0; i<101; ++i) {
117 char* path = std::getenv(
"G4LEDATA");
122 for(
size_t i=0; i<numOfElm; ++i) {
123 G4int Z = (*theElmTable)[i]->GetZasInt();
125 else if(Z > 100) { Z = 100; }
128 if(!dataSB[Z]) { ReadData(Z, path); }
140 return "/livermore/brem/br";
145void G4LivermoreBremsstrahlungModel::ReadData(
G4int Z,
const char* path)
150 if(dataSB[Z]) {
return; }
151 const char* datadir = path;
154 datadir = std::getenv(
"G4LEDATA");
156 G4Exception(
"G4LivermoreBremsstrahlungModel::ReadData()",
"em0006",
161 std::ostringstream ost;
163 std::ifstream fin(ost.str().c_str());
164 if( !fin.is_open()) {
166 ed <<
"Bremsstrahlung data file <" << ost.str().c_str()
167 <<
"> is not opened!";
168 G4Exception(
"G4LivermoreBremsstrahlungModel::ReadData()",
"em0003",
170 "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!";
184 G4Exception(
"G4LivermoreBremsstrahlungModel::ReadData()",
"em0005",
186 "G4LEDATA version should be G4EMLOW6.23 or later.");
226 if(xxx < expnumlim) { cross = 0.0; }
227 else { cross *=
G4Exp(xxx); }
240 std::vector<G4DynamicParticle*>* vdp,
247 G4double cut = std::min(cutEnergy, kineticEnergy);
248 G4double emax = std::min(maxEnergy, kineticEnergy);
249 if(cut >= emax) {
return; }
278 ((kineticEnergy > epeaklimit) || (kineticEnergy < elowlimit))) {
279 G4double ylim = std::min(ylimit[Z],1.1*dataSB[Z]->
Value(0.97,y,idx,idy));
280 if(ylim > vmax) { vmax = ylim; }
282 if(x0 < 0.05) { vmax *= 1.2; }
290 if(x < 0.0) { x = 0.0; }
291 gammaEnergy = sqrt(x);
292 G4double x1 = gammaEnergy/kineticEnergy;
293 v = dataSB[Z]->
Value(x1, y, idx, idy);
300 G4double e2 = kineticEnergy - gammaEnergy;
305 if(xxx < expnumlim) { v = 0.0; }
306 else { v *=
G4Exp(xxx); }
309 if (v > 1.05*vmax && nwarn < 5) {
312 ed <<
"### G4LivermoreBremsstrahlungModel Warning: Majoranta exceeded! "
313 << v <<
" > " << vmax <<
" by " << v/vmax
314 <<
" Egamma(MeV)= " << gammaEnergy
315 <<
" Ee(MeV)= " << kineticEnergy
319 ed <<
"\n ### G4LivermoreBremsstrahlungModel Warnings stopped";
321 G4Exception(
"G4LivermoreBremsstrahlungModel::SampleScattering",
"em0044",
339 vdp->push_back(gamma);
342 - gammaEnergy*gammaDirection).unit();
352 G4double finalE = kineticEnergy - gammaEnergy;
378 G4AutoLock l(&LivermoreBremsstrahlungModelMutex);
381 if(!dataSB[Z]) { ReadData(Z); }
std::vector< G4Element * > G4ElementTable
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
std::ostringstream G4ExceptionDescription
G4double G4Exp(G4double initial_x)
Exponential Function double precision.
G4double G4Log(G4double x)
#define G4MUTEX_INITIALIZER
const G4ThreeVector & GetMomentumDirection() const
G4double GetKineticEnergy() const
static G4ElementTable * GetElementTable()
static size_t GetNumberOfElements()
virtual void InitialiseForElement(const G4ParticleDefinition *, G4int Z)
virtual ~G4LivermoreBremsstrahlungModel()
virtual G4String DirectoryPath() const
virtual G4double ComputeDXSectionPerAtom(G4double gammaEnergy)
G4LivermoreBremsstrahlungModel(const G4ParticleDefinition *p=0, const G4String &nam="LowEnBrem")
virtual void SampleSecondaries(std::vector< G4DynamicParticle * > *, const G4MaterialCutsCouple *, const G4DynamicParticle *, G4double cutEnergy, G4double maxEnergy)
virtual void Initialise(const G4ParticleDefinition *, const G4DataVector &)
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, std::size_t &lastidx, std::size_t &lastidy) const
void SetBicubicInterpolation(G4bool)
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)
void SetAngularDistribution(G4VEmAngularDistribution *)
G4double SecondaryThreshold() const
void ProposeTrackStatus(G4TrackStatus status)
G4double fPrimaryParticleMass
G4double fPrimaryKinEnergy
const G4ParticleDefinition * fPrimaryParticle
static const G4double gBremFactor
G4double fPrimaryTotalEnergy
G4ParticleDefinition * fGammaParticle
virtual void SetupForMaterial(const G4ParticleDefinition *, const G4Material *, G4double) override
G4ParticleChangeForLoss * fParticleChange
virtual void Initialise(const G4ParticleDefinition *, const G4DataVector &) override