47 :
G4VEmModel(
"LivermoreRayleigh"),maxZ(100),isInitialised(false)
49 fParticleChange =
nullptr;
50 lowEnergyLimit = 10 * CLHEP::eV;
62 G4cout <<
"G4LivermoreRayleighModel is constructed " <<
G4endl;
73 for(
G4int i = 0; i <= maxZ; ++i)
91 G4cout <<
"Calling Initialise() of G4LivermoreRayleighModel." <<
G4endl
105 std::size_t numElems = (*elemTable).size();
106 for(std::size_t ie = 0; ie < numElems; ++ie)
109 const G4int Z = std::min(maxZ,
elem->GetZasInt());
110 if(dataCS[
Z] ==
nullptr)
116 if(isInitialised) {
return; }
118 isInitialised =
true;
131void G4LivermoreRayleighModel::ReadData(std::size_t
Z,
const char* path)
133 if (verboseLevel > 1)
135 G4cout <<
"Calling ReadData() of G4LivermoreRayleighModel"
139 if(
nullptr != dataCS[
Z]) {
return; }
141 const char* datadir = path;
143 if(datadir ==
nullptr)
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 G4EMLOW8.0 or later.");
176 if(verboseLevel > 3) {
177 G4cout <<
"File " << ostCS.str()
178 <<
" is opened by G4LivermoreRayleighModel" <<
G4endl;
192 if (verboseLevel > 1)
194 G4cout <<
"G4LivermoreRayleighModel::ComputeCrossSectionPerAtom()"
198 if(GammaEnergy < lowEnergyLimit) {
return 0.0; }
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*>*,
245 if (verboseLevel > 1) {
246 G4cout <<
"Calling SampleSecondaries() of G4LivermoreRayleighModel"
271 if(
nullptr == dataCS[
Z]) { ReadData(
Z); }
std::vector< G4Element * > G4ElementTable
const char * G4FindDataDir(const char *)
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
~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
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 &)