40 G4int G4LivermoreRayleighModel::maxZ = 100;
44 :
G4VEmModel(
"LivermoreRayleigh"),isInitialised(false)
47 lowEnergyLimit = 10 *
eV;
59 G4cout <<
"G4LivermoreRayleighModel is constructed " <<
G4endl;
76 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); }
112 if(isInitialised) {
return; }
114 isInitialised =
true;
128 void G4LivermoreRayleighModel::ReadData(
size_t Z,
const char* path)
130 if (verboseLevel > 1)
132 G4cout <<
"Calling ReadData() of G4LivermoreRayleighModel"
136 if(dataCS[Z]) {
return; }
138 const char* datadir = path;
142 datadir = getenv(
"G4LEDATA");
145 G4Exception(
"G4LivermoreRayleighModelModel::ReadData()",
"em0006",
147 "Environment variable G4LEDATA not defined");
159 std::ostringstream ostCS;
160 ostCS << datadir <<
"/livermore/rayl/re-cs-" << Z <<
".dat";
161 std::ifstream finCS(ostCS.str().c_str());
163 if( !finCS .is_open() )
166 ed <<
"G4LivermoreRayleighModel data file <" << ostCS.str().c_str()
167 <<
"> is not opened!" <<
G4endl;
169 ed,
"G4LEDATA version should be G4EMLOW6.27 or later.");
174 if(verboseLevel > 3) {
175 G4cout <<
"File " << ostCS.str()
176 <<
" is opened by G4LivermoreRayleighModel" <<
G4endl;
190 if (verboseLevel > 1)
192 G4cout <<
"G4LivermoreRayleighModel::ComputeCrossSectionPerAtom()"
196 if(GammaEnergy < lowEnergyLimit) {
return 0.0; }
202 if(intZ < 1 || intZ > maxZ) {
return xs; }
211 if(!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"
252 if (photonEnergy0 <= lowEnergyLimit)
286 if(!dataCS[Z]) { ReadData(Z); }
G4double LowEnergyLimit() const
std::vector< G4Element * > G4ElementVector
G4LivermoreRayleighModel()
std::ostringstream G4ExceptionDescription
G4double GetKineticEnergy() const
virtual void InitialiseLocal(const G4ParticleDefinition *, G4VEmModel *masterModel)
void InitialiseElementSelectors(const G4ParticleDefinition *, const G4DataVector &)
G4double HighEnergyLimit() const
virtual void InitialiseForElement(const G4ParticleDefinition *, G4int Z)
G4VEmAngularDistribution * GetAngularDistribution()
G4ParticleDefinition * GetDefinition() const
size_t GetVectorLength() const
const G4ElementVector * GetElementVector() const
void ProposeMomentumDirection(G4double Px, G4double Py, G4double Pz)
#define G4MUTEX_INITIALIZER
virtual ~G4LivermoreRayleighModel()
void ProposeLocalEnergyDeposit(G4double anEnergyPart)
G4GLOB_DLL std::ostream G4cout
virtual G4ThreeVector & SampleDirection(const G4DynamicParticle *dp, G4double finalTotalEnergy, G4int Z, const G4Material *)=0
size_t GetTableSize() const
G4double Energy(size_t index) const
std::vector< G4EmElementSelector * > * GetElementSelectors()
G4double Value(G4double theEnergy, size_t &lastidx) const
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
static G4ProductionCutsTable * GetProductionCutsTable()
virtual G4double ComputeCrossSectionPerAtom(const G4ParticleDefinition *, G4double kinEnergy, G4double Z, G4double A=0, G4double cut=0, G4double emax=DBL_MAX)
void SetElementSelectors(std::vector< G4EmElementSelector * > *)
const G4MaterialCutsCouple * GetMaterialCutsCouple(G4int i) const
void SetAngularDistribution(G4VEmAngularDistribution *)
virtual G4bool Retrieve(std::ifstream &fIn, G4bool ascii=false)
virtual void Initialise(const G4ParticleDefinition *, const G4DataVector &)
void SetProposedKineticEnergy(G4double proposedKinEnergy)
size_t GetNumberOfElements() const
virtual void SampleSecondaries(std::vector< G4DynamicParticle * > *, const G4MaterialCutsCouple *, const G4DynamicParticle *, G4double tmin, G4double maxEnergy)
void ProposeTrackStatus(G4TrackStatus status)
const G4Element * SelectRandomAtom(const G4MaterialCutsCouple *, const G4ParticleDefinition *, G4double kineticEnergy, G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX)
G4ParticleChangeForGamma * GetParticleChangeForGamma()
const G4Material * GetMaterial() const