41 :
G4VEmModel(
"LivermoreRayleigh"),isInitialised(false),maxZ(100)
44 lowEnergyLimit = 10 * eV;
46 dataCS.resize(maxZ+1,0);
58 G4cout <<
"G4LivermoreRayleighModel is constructed " <<
G4endl;
67 for(
G4int i=0; i<=maxZ; ++i) {
delete dataCS[i]; }
77 G4cout <<
"Calling Initialise() of G4LivermoreRayleighModel." <<
G4endl
89 char* path = getenv(
"G4LEDATA");
94 for(
G4int i=0; i<numOfCouples; ++i)
102 for (
G4int j=0; j<nelm; ++j)
106 else if(Z > maxZ) { Z = maxZ; }
107 if( (!dataCS[Z]) ) { ReadData(Z, path); }
114 if(isInitialised) {
return; }
116 isInitialised =
true;
122void G4LivermoreRayleighModel::ReadData(
size_t Z,
const char* path)
124 if (verboseLevel > 1)
126 G4cout <<
"Calling ReadData() of G4LivermoreRayleighModel"
130 if(dataCS[Z]) {
return; }
132 const char* datadir = path;
136 datadir = getenv(
"G4LEDATA");
139 G4Exception(
"G4LivermoreRayleighModelModel::ReadData()",
"em0006",
141 "Environment variable G4LEDATA not defined");
153 std::ostringstream ostCS;
154 ostCS << datadir <<
"/livermore/rayl/re-cs-" << Z <<
".dat";
155 std::ifstream finCS(ostCS.str().c_str());
157 if( !finCS .is_open() )
160 ed <<
"G4LivermoreRayleighModel data file <" << ostCS.str().c_str()
161 <<
"> is not opened!" <<
G4endl;
163 ed,
"G4LEDATA version should be G4EMLOW6.27 or later.");
168 if(verboseLevel > 3) {
169 G4cout <<
"File " << ostCS.str()
170 <<
" is opened by G4LivermoreRayleighModel" <<
G4endl;
172 dataCS[Z]->Retrieve(finCS,
true);
184 if (verboseLevel > 1)
186 G4cout <<
"Calling ComputeCrossSectionPerAtom() of G4LivermoreRayleighModel"
190 if(GammaEnergy < lowEnergyLimit) {
return 0.0; }
196 if(intZ < 1 || intZ > maxZ) {
return xs; }
203 char* path = getenv(
"G4LEDATA");
204 ReadData(intZ, path);
206 if(!pv) {
return xs; }
213 }
else if(e >= pv->
Energy(0)) {
214 xs = pv->
Value(e)/(e*e);
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;
231 std::vector<G4DynamicParticle*>*,
236 if (verboseLevel > 1) {
237 G4cout <<
"Calling SampleSecondaries() of G4LivermoreRayleighModel"
243 if (photonEnergy0 <= lowEnergyLimit)
std::vector< G4Element * > G4ElementVector
G4DLLIMPORT std::ostream G4cout
G4ParticleDefinition * GetDefinition() const
G4double GetKineticEnergy() const
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 &)
const G4Material * GetMaterial() const
const G4ElementVector * GetElementVector() const
size_t GetNumberOfElements() const
void SetProposedKineticEnergy(G4double proposedKinEnergy)
void ProposeMomentumDirection(G4double Px, G4double Py, G4double Pz)
G4double Value(G4double theEnergy)
size_t GetVectorLength() const
G4double Energy(size_t index) const
const G4MaterialCutsCouple * GetMaterialCutsCouple(G4int i) const
size_t GetTableSize() const
static G4ProductionCutsTable * GetProductionCutsTable()
virtual G4ThreeVector & SampleDirection(const G4DynamicParticle *dp, G4double finalTotalEnergy, G4int Z, const G4Material *)=0
G4VEmAngularDistribution * GetAngularDistribution()
G4ParticleChangeForGamma * GetParticleChangeForGamma()
G4double LowEnergyLimit() const
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 &)
void ProposeTrackStatus(G4TrackStatus status)
void ProposeLocalEnergyDeposit(G4double anEnergyPart)
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
std::ostringstream G4ExceptionDescription