40G4int G4LivermoreRayleighModel::maxZ = 100;
44 :
G4VEmModel(
"LivermoreRayleigh"),isInitialised(false)
47 lowEnergyLimit = 10 * eV;
59 G4cout <<
"G4LivermoreRayleighModel is constructed " <<
G4endl;
69 for(
G4int i=0; i<maxZ; ++i) {
85 G4cout <<
"Calling Initialise() of G4LivermoreRayleighModel." <<
G4endl
98 char* path = std::getenv(
"G4LEDATA");
103 for(
G4int i=0; i<numOfCouples; ++i)
111 for (
G4int j=0; j<nelm; ++j)
113 G4int Z = (*theElementVector)[j]->GetZasInt();
115 else if(Z > maxZ) { Z = maxZ; }
116 if( (!dataCS[Z]) ) { ReadData(Z, path); }
121 if(isInitialised) {
return; }
123 isInitialised =
true;
137void G4LivermoreRayleighModel::ReadData(
size_t Z,
const char* path)
139 if (verboseLevel > 1)
141 G4cout <<
"Calling ReadData() of G4LivermoreRayleighModel"
145 if(dataCS[Z]) {
return; }
147 const char* datadir = path;
151 datadir = std::getenv(
"G4LEDATA");
154 G4Exception(
"G4LivermoreRayleighModelModel::ReadData()",
"em0006",
156 "Environment variable G4LEDATA not defined");
168 std::ostringstream ostCS;
169 ostCS << datadir <<
"/livermore/rayl/re-cs-" << Z <<
".dat";
170 std::ifstream finCS(ostCS.str().c_str());
172 if( !finCS .is_open() )
175 ed <<
"G4LivermoreRayleighModel data file <" << ostCS.str().c_str()
176 <<
"> is not opened!" <<
G4endl;
178 ed,
"G4LEDATA version should be G4EMLOW6.27 or later.");
183 if(verboseLevel > 3) {
184 G4cout <<
"File " << ostCS.str()
185 <<
" is opened by G4LivermoreRayleighModel" <<
G4endl;
199 if (verboseLevel > 1)
201 G4cout <<
"G4LivermoreRayleighModel::ComputeCrossSectionPerAtom()"
205 if(GammaEnergy < lowEnergyLimit) {
return 0.0; }
211 if(intZ < 1 || intZ > maxZ) {
return xs; }
220 if(!pv) {
return xs; }
227 }
else if(e >= pv->
Energy(0)) {
228 xs = pv->
Value(e)/(e*e);
233 G4cout <<
"****** DEBUG: tcs value for Z=" << Z <<
" at energy (MeV)="
235 G4cout <<
" cs (Geant4 internal unit)=" << xs <<
G4endl;
236 G4cout <<
" -> first E*E*cs value in CS data file (iu) =" << (*pv)[0]
238 G4cout <<
" -> last E*E*cs value in CS data file (iu) =" << (*pv)[n]
240 G4cout <<
"*********************************************************"
249 std::vector<G4DynamicParticle*>*,
254 if (verboseLevel > 1) {
255 G4cout <<
"Calling SampleSecondaries() of G4LivermoreRayleighModel"
296 if(!dataCS[Z]) { ReadData(Z); }
std::vector< G4Element * > G4ElementVector
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
virtual void InitialiseForElement(const G4ParticleDefinition *, G4int Z)
virtual G4double ComputeCrossSectionPerAtom(const G4ParticleDefinition *, G4double kinEnergy, G4double Z, G4double A=0, G4double cut=0, G4double emax=DBL_MAX)
virtual ~G4LivermoreRayleighModel()
virtual void SampleSecondaries(std::vector< G4DynamicParticle * > *, const G4MaterialCutsCouple *, const G4DynamicParticle *, G4double tmin, G4double maxEnergy)
G4LivermoreRayleighModel()
virtual void Initialise(const G4ParticleDefinition *, const G4DataVector &)
virtual void InitialiseLocal(const G4ParticleDefinition *, G4VEmModel *masterModel)
const G4Material * GetMaterial() const
const G4ElementVector * GetElementVector() const
size_t GetNumberOfElements() const
void ProposeMomentumDirection(G4double Px, G4double Py, G4double Pz)
G4double Energy(std::size_t index) const
G4double Value(G4double theEnergy, std::size_t &lastidx) const
virtual G4bool Retrieve(std::ifstream &fIn, G4bool ascii=false)
std::size_t GetVectorLength() const
const G4MaterialCutsCouple * GetMaterialCutsCouple(G4int i) const
std::size_t GetTableSize() const
static G4ProductionCutsTable * GetProductionCutsTable()
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 &)