62 G4cout <<
"G4LivermoreRayleighModel is constructed " <<
G4endl;
91 G4cout <<
"Calling Initialise() of G4LivermoreRayleighModel." <<
G4endl
103 char* path = std::getenv(
"G4LEDATA");
105 size_t numElems = (*elemTable).size();
106 for(
size_t ie = 0; ie < numElems; ++ie)
135 G4cout <<
"Calling ReadData() of G4LivermoreRayleighModel"
139 if(
nullptr !=
dataCS[
Z]) {
return; }
141 const char* datadir = path;
143 if(datadir ==
nullptr)
145 datadir = std::getenv(
"G4LEDATA");
146 if(datadir ==
nullptr)
148 G4Exception(
"G4LivermoreRayleighModelModel::ReadData()",
"em0006",
150 "Environment variable G4LEDATA not defined");
156 std::ostringstream ostCS;
158 ostCS << datadir <<
"/livermore/rayl/re-cs-" <<
Z <<
".dat";
160 ostCS << datadir <<
"/epics2017/rayl/re-cs-" <<
Z <<
".dat";
163 std::ifstream finCS(ostCS.str().c_str());
165 if( !finCS .is_open() )
168 ed <<
"G4LivermoreRayleighModel data file <" << ostCS.str().c_str()
169 <<
"> is not opened!" <<
G4endl;
171 ed,
"G4LEDATA version should be G4EMLOW6.27 or later.");
177 G4cout <<
"File " << ostCS.str()
178 <<
" is opened by G4LivermoreRayleighModel" <<
G4endl;
194 G4cout <<
"G4LivermoreRayleighModel::ComputeCrossSectionPerAtom()"
202 if(intZ < 1 || intZ >
maxZ) {
return xs; }
211 if(
nullptr == pv) {
return xs; }
218 }
else if(e >= pv->
Energy(0)) {
219 xs = pv->
Value(e)/(e*e);
224 G4cout <<
"****** DEBUG: tcs value for Z=" <<
Z <<
" at energy (MeV)="
226 G4cout <<
" cs (Geant4 internal unit)=" << xs <<
G4endl;
227 G4cout <<
" -> first E*E*cs value in CS data file (iu) =" << (*pv)[0]
229 G4cout <<
" -> last E*E*cs value in CS data file (iu) =" << (*pv)[
n]
231 G4cout <<
"*********************************************************"
240 std::vector<G4DynamicParticle*>*,
246 G4cout <<
"Calling SampleSecondaries() of G4LivermoreRayleighModel"
std::vector< G4Element * > G4ElementTable
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
std::ostringstream G4ExceptionDescription
static constexpr double eV
static constexpr double GeV
static constexpr double MeV
#define G4MUTEX_INITIALIZER
G4GLOB_DLL std::ostream G4cout
G4ParticleDefinition * GetDefinition() const
G4double GetKineticEnergy() const
static G4ElementTable * GetElementTable()
static G4EmParameters * Instance()
G4double ComputeCrossSectionPerAtom(const G4ParticleDefinition *, G4double kinEnergy, G4double Z, G4double A=0, G4double cut=0, G4double emax=DBL_MAX) override
static G4PhysicsFreeVector * dataCS[101]
~G4LivermoreRayleighModel()
void SampleSecondaries(std::vector< G4DynamicParticle * > *, const G4MaterialCutsCouple *, const G4DynamicParticle *, G4double tmin, G4double maxEnergy) override
G4LivermoreRayleighModel()
void Initialise(const G4ParticleDefinition *, const G4DataVector &) override
void InitialiseForElement(const G4ParticleDefinition *, G4int Z) override
G4ParticleChangeForGamma * fParticleChange
void InitialiseLocal(const G4ParticleDefinition *, G4VEmModel *masterModel) override
void ReadData(size_t Z, const char *path=0)
const G4Material * GetMaterial() const
void ProposeMomentumDirection(G4double Px, G4double Py, G4double Pz)
G4double Energy(const std::size_t index) const
G4bool Retrieve(std::ifstream &fIn, G4bool ascii=false)
G4double Value(const G4double energy, std::size_t &lastidx) const
std::size_t GetVectorLength() const
virtual G4ThreeVector & SampleDirection(const G4DynamicParticle *dp, G4double finalTotalEnergy, G4int Z, const G4Material *)=0
void SetElementSelectors(std::vector< G4EmElementSelector * > *)
G4VEmAngularDistribution * GetAngularDistribution()
G4ParticleChangeForGamma * GetParticleChangeForGamma()
G4double LowEnergyLimit() const
std::vector< G4EmElementSelector * > * GetElementSelectors()
G4double HighEnergyLimit() const
const G4Element * SelectRandomAtom(const G4MaterialCutsCouple *, const G4ParticleDefinition *, G4double kineticEnergy, G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX)
void SetAngularDistribution(G4VEmAngularDistribution *)
void InitialiseElementSelectors(const G4ParticleDefinition *, const G4DataVector &)
static constexpr double eV
T min(const T t1, const T t2)
brief Return the smallest of the two arguments
G4Mutex LivermoreRayleighModelMutex