252{
253
254
256 for (auto a_material : *materialTable) {
257 auto N = a_material->GetTotNbOfAtomsPerVolume();
260 G4cout << std::left << std::setw(12) << __FILE__ <<
" " << __FUNCTION__ <<
" line "
261 << std::right << std::setw(4) << __LINE__ << " " << a_material->GetName()
262 <<
" NbOfAtomsPerVolume()=" <<
N
263 <<
" NumberOfElements()=" << a_material->GetNumberOfElements() <<
G4endl;
264
265
266 if (a_material->GetNumberOfElements() == 1 && a_material->GetDensity() > 1) {
267 G4double factor =
N * CLHEP::classic_electr_radius / CLHEP::twopi;
268 std::vector<G4double> Ephot, f1, f2;
271 if (iret) {
273 G4cout << std::left << std::setw(12) << __FILE__ <<
" " << __FUNCTION__ <<
" line "
274 << std::right << std::setw(4) << __LINE__ << " no Henke data found for "
275 << a_material->GetName() <<
" " << theElement->
GetName() <<
G4endl;
276 }
277 else {
278 std::vector<G4double> RealIndex(Ephot.size()), ImagIndex(Ephot.size());
279 for (std::size_t i = 0; i < Ephot.size(); ++i) {
282 RealIndex[i] = fmax(0, factor * lambda_sqr * f1[i]);
283 ImagIndex[i] = factor * lambda_sqr * f2[i];
285 G4cout <<
"Ephot=" << std::setw(10) << Ephot[i] / eV <<
" eV delta=" << std::setw(10)
286 << RealIndex[i] <<
" beta=" << std::setw(10) << ImagIndex[i] <<
G4endl;
287 }
289 if(proptab == nullptr) {
291 a_material->SetMaterialPropertiesTable(proptab);
292 }
293 proptab->
AddProperty(
"REALRINDEX", Ephot, RealIndex);
294 proptab->
AddProperty(
"IMAGINARYRINDEX", Ephot, ImagIndex);
296 G4cout << std::left << std::setw(12) << __FILE__ <<
" " << __FUNCTION__ <<
" line "
297 << std::right << std::setw(4) << __LINE__ << " " << a_material->GetName()
298 <<
" " << theElement->
GetName()
299 <<
" reflection data saved in PropertiesTable" <<
G4endl;
300 }
301 }
302 }
303}
const G4String & GetName() const
static G4Element * GetElement(const G4String &name, G4bool warning=true)
G4MaterialPropertyVector * AddProperty(const G4String &key, const std::vector< G4double > &photonEnergies, const std::vector< G4double > &propertyValues, G4bool createNewKey=false, G4bool spline=false)
static G4MaterialTable * GetMaterialTable()
G4int ReadHenkeXrayData(std::string ElName, std::vector< G4double > &Ephot, std::vector< G4double > &f1, std::vector< G4double > &f2)