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; }
141 return "/livermore/brem/br";
152 const char* datadir = path;
155 datadir = getenv(
"G4LEDATA");
157 G4Exception(
"G4LivermoreBremsstrahlungModel::ReadData()",
"em0006",
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!";
169 G4Exception(
"G4LivermoreBremsstrahlungModel::ReadData()",
"em0003",
171 "G4LEDATA version should be G4EMLOW6.23 or later.");
183 ed <<
"Bremsstrahlung data file <" << ost.str().c_str()
184 <<
"> is not retrieved!";
185 G4Exception(
"G4LivermoreBremsstrahlungModel::ReadData()",
"em0005",
187 "G4LEDATA version should be G4EMLOW6.23 or later.");
199 if(gammaEnergy < 0.0 ||
kinEnergy <= 0.0) {
return 0.0; }
227 else { cross *=
G4Exp(xxx); }
240 std::vector<G4DynamicParticle*>* vdp,
249 if(cut >= emax) {
return; }
282 if(ylim > vmax) { vmax = ylim; }
284 if(x0 < 0.05) { vmax *= 1.2; }
292 if(x < 0.0) { x = 0.0; }
293 gammaEnergy = sqrt(x);
301 G4double e2 = kineticEnergy - gammaEnergy;
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);
G4double G4Exp(G4double initial_x)
Exponential Function double precision.
virtual G4ThreeVector & SampleDirection(const G4DynamicParticle *dp, G4double finalTotalEnergy, G4int Z, const G4Material *)=0
std::ostringstream G4ExceptionDescription
const G4ParticleDefinition * particle
static constexpr double MeV
static const G4double elowlimit
static G4Physics2DVector * dataSB[101]
Float_t x1[n_points_granero]
virtual ~G4LivermoreBremsstrahlungModel()
const G4ThreeVector & GetMomentumDirection() const
virtual void Initialise(const G4ParticleDefinition *, const G4DataVector &)
const G4String & GetParticleName() const
G4bool Retrieve(std::ifstream &fIn)
virtual G4String DirectoryPath() const
const G4Element * SelectRandomAtom(const G4MaterialCutsCouple *, const G4ParticleDefinition *, G4double kineticEnergy, G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX)
static const G4double emax
void SetProposedMomentumDirection(const G4ThreeVector &dir)
static const G4double emaxlog
static G4double ylimit[101]
G4double G4Log(G4double x)
static const G4double epeaklimit
void SetCurrentElement(G4int)
virtual G4double ComputeDXSectionPerAtom(G4double gammaEnergy)
void SetLPMFlag(G4bool val)
#define G4MUTEX_INITIALIZER
static constexpr double millibarn
virtual void SampleSecondaries(std::vector< G4DynamicParticle * > *, const G4MaterialCutsCouple *, const G4DynamicParticle *, G4double cutEnergy, G4double maxEnergy)
static constexpr double electron_mass_c2
std::vector< G4Element * > G4ElementTable
static const G4double alpha
static constexpr double MeV
static constexpr double twopi
static constexpr double eV
void SetAngularDistribution(G4VEmAngularDistribution *)
static G4double expnumlim
G4double Value(G4double x, G4double y, size_t &lastidx, size_t &lastidy) const
static constexpr double twopi
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
G4ParticleDefinition * theGamma
void SetLowEnergyLimit(G4double)
void SetProposedKineticEnergy(G4double proposedKinEnergy)
G4double SecondaryThreshold() const
void ReadData(G4int Z, const char *path=0)
G4bool useBicubicInterpolation
G4double GetKineticEnergy() const
G4VEmAngularDistribution * GetAngularDistribution()
G4LivermoreBremsstrahlungModel(const G4ParticleDefinition *p=0, const G4String &nam="LowEnBrem")
const G4Material * GetMaterial() const
static size_t GetNumberOfElements()
G4ParticleChangeForLoss * fParticleChange
static constexpr double fine_structure_const
static constexpr double keV
virtual void SetupForMaterial(const G4ParticleDefinition *, const G4Material *, G4double) override
void ProposeTrackStatus(G4TrackStatus status)
virtual void InitialiseForElement(const G4ParticleDefinition *, G4int Z)
virtual G4double Value(const G4MaterialCutsCouple *, const G4ParticleDefinition *, G4double kineticEnergy)
virtual void Initialise(const G4ParticleDefinition *, const G4DataVector &) override
void SetBicubicInterpolation(G4bool)
T min(const T t1, const T t2)
brief Return the smallest of the two arguments
static G4ElementTable * GetElementTable()