46G4String G4LivermoreRayleighModel::gDataDirectory =
"";
52 fParticleChange =
nullptr;
53 lowEnergyLimit = 10 * CLHEP::eV;
63 if (verboseLevel > 0) {
64 G4cout <<
"G4LivermoreRayleighModel is constructed " <<
G4endl;
73 for (
G4int i = 0; i <= maxZ; ++i) {
74 if (
nullptr != dataCS[i]) {
87 if (verboseLevel > 1) {
88 G4cout <<
"Calling Initialise() of G4LivermoreRayleighModel." <<
G4endl
99 std::size_t numElems = (*elemTable).size();
100 for (std::size_t ie = 0; ie < numElems; ++ie) {
102 const G4int Z = std::min(maxZ,
elem->GetZasInt());
103 if (dataCS[Z] ==
nullptr) {
112 isInitialised =
true;
124const G4String& G4LivermoreRayleighModel::FindDirectoryPath()
127 if (gDataDirectory.empty()) {
129 std::ostringstream ost;
130 if (param->LivermoreDataDir() ==
"livermore") {
131 ost << param->GetDirLEDATA() <<
"/livermore/rayl/";
134 ost << param->GetDirLEDATA() <<
"/epics2017/rayl/";
136 gDataDirectory = ost.str();
138 return gDataDirectory;
143void G4LivermoreRayleighModel::ReadData(
const G4int ZZ)
145 if (verboseLevel > 1) {
146 G4cout <<
"Calling ReadData() of G4LivermoreRayleighModel for Z=" << ZZ <<
G4endl;
148 const G4int Z = std::min(ZZ, maxZ);
150 if (
nullptr != dataCS[Z]) {
156 std::ostringstream ostCS;
157 ostCS << FindDirectoryPath() <<
"re-cs-" << Z <<
".dat";
159 std::ifstream finCS(ostCS.str().c_str());
161 if (!finCS.is_open()) {
163 ed <<
"G4LivermoreRayleighModel data file <" << ostCS.str().c_str() <<
"> is not opened!"
166 "G4LEDATA version should be G4EMLOW8.0 or later.");
170 if (verboseLevel > 3) {
171 G4cout <<
"File " << ostCS.str() <<
" is opened by G4LivermoreRayleighModel" <<
G4endl;
183 if (verboseLevel > 1) {
184 G4cout <<
"G4LivermoreRayleighModel::ComputeCrossSectionPerAtom()" <<
G4endl;
187 if (GammaEnergy < lowEnergyLimit) {
193 if (intZ < 1 || intZ > maxZ) {
212 xs = (*pv)[n] / (e * e);
214 else if (e >= pv->
Energy(0)) {
215 xs = pv->
Value(e) / (e * e);
218 if (verboseLevel > 1) {
219 G4cout <<
"****** DEBUG: tcs value for Z=" << Z <<
" at energy (MeV)=" << e <<
G4endl;
220 G4cout <<
" cs (Geant4 internal unit)=" << xs <<
G4endl;
221 G4cout <<
" -> first E*E*cs value in CS data file (iu) =" << (*pv)[0] <<
G4endl;
222 G4cout <<
" -> last E*E*cs value in CS data file (iu) =" << (*pv)[n] <<
G4endl;
223 G4cout <<
"*********************************************************" <<
G4endl;
235 if (verboseLevel > 1) {
236 G4cout <<
"Calling SampleSecondaries() of G4LivermoreRayleighModel" <<
G4endl;
247 aDynamicGamma, photonEnergy0, Z, couple->
GetMaterial());
255 if (
nullptr != dataCS[Z]) {
259 if (
nullptr == dataCS[Z]) {
std::vector< G4Element * > G4ElementTable
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
std::ostringstream G4ExceptionDescription
#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
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
~G4LivermoreRayleighModel() override
void InitialiseLocal(const G4ParticleDefinition *, G4VEmModel *masterModel) override
const G4Material * GetMaterial() const
void ProposeMomentumDirection(const G4ThreeVector &Pfinal)
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 &)