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;
122 void 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)) {
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)