*/
protected Map<Integer, IMaterialScatterModel> extractMaterials(
Element geometryElement) throws IOException, EPQException {
Map<Integer, IMaterialScatterModel> materials =
new HashMap<Integer, IMaterialScatterModel>();
materials.put(0, new BasicMaterialModel(Material.Null));
Element materialsElement = geometryElement.getChild("materials");
int index;
String name;
double density, absorptionEnergyElectron;
Composition composition;
Material material;
IMaterialScatterModel scatterModel;
for (Element materialElement : materialsElement.getChildren()) {
try {
index =
materialElement.getAttribute("_index")
.getIntValue();
} catch (DataConversionException e) {
throw new IOException(e);
}
name = materialElement.getAttribute("name").getValue();
try {
density =
materialElement.getAttribute("density")
.getDoubleValue();
} catch (DataConversionException e) {
throw new IOException(e);
}
absorptionEnergyElectron = 50.0;
for (Element absEnergyElement : materialElement
.getChildren("absorptionEnergy")) {
if (absEnergyElement.getAttribute("particle").getValue() != "electron")
continue;
absorptionEnergyElectron =
Double.parseDouble(absEnergyElement.getText());
}
composition = extractComposition(materialElement);
material = new Material(composition, density);
material.setName(name);
scatterModel = new BasicMaterialModel(material);
scatterModel.setMinEforTracking(ToSI
.eV(absorptionEnergyElectron));
materials.put(index, scatterModel);
}