57 xercesc::DOMElement* atomElement =
NewElement(
"atom");
58 atomElement->setAttributeNode(
NewAttribute(
"unit",
"g/mole"));
60 element->appendChild(atomElement);
66 xercesc::DOMElement* DElement =
NewElement(
"D");
67 DElement->setAttributeNode(
NewAttribute(
"unit",
"g/cm3"));
69 element->appendChild(DElement);
75 xercesc::DOMElement* PElement =
NewElement(
"P");
76 PElement->setAttributeNode(
NewAttribute(
"unit",
"pascal"));
78 element->appendChild(PElement);
84 xercesc::DOMElement* TElement =
NewElement(
"T");
87 element->appendChild(TElement);
93 xercesc::DOMElement* PElement =
NewElement(
"MEE");
96 element->appendChild(PElement);
104 xercesc::DOMElement* isotopeElement =
NewElement(
"isotope");
105 isotopeElement->setAttributeNode(
NewAttribute(
"name",name));
116 xercesc::DOMElement* elementElement =
NewElement(
"element");
117 elementElement->setAttributeNode(
NewAttribute(
"name",name));
121 if (NumberOfIsotopes>0)
123 const G4double* RelativeAbundanceVector =
125 for (
size_t i=0;i<NumberOfIsotopes;i++)
129 xercesc::DOMElement* fractionElement =
NewElement(
"fraction");
131 RelativeAbundanceVector[i]));
132 fractionElement->setAttributeNode(
NewAttribute(
"ref",fractionref));
133 elementElement->appendChild(fractionElement);
151 if (state==
kStateSolid) { state_str =
"solid"; }
else
153 if (state==
kStateGas) { state_str =
"gas"; }
157 xercesc::DOMElement* materialElement =
NewElement(
"material");
158 materialElement->setAttributeNode(
NewAttribute(
"name",name));
159 materialElement->setAttributeNode(
NewAttribute(
"state",state_str));
180 if ( (NumberOfElements>1)
186 for (
size_t i=0;i<NumberOfElements;i++)
191 xercesc::DOMElement* fractionElement =
NewElement(
"fraction");
193 MassFractionVector[i]));
194 fractionElement->setAttributeNode(
NewAttribute(
"ref",fractionref));
195 materialElement->appendChild(fractionElement);
214 xercesc::DOMElement* matrixElement =
NewElement(
"matrix");
215 matrixElement->setAttributeNode(
NewAttribute(
"name", matrixref));
216 matrixElement->setAttributeNode(
NewAttribute(
"coldim",
"2"));
217 std::ostringstream pvalues;
220 if (i!=0) { pvalues <<
" "; }
221 pvalues << pvec->
Energy(i) <<
" " << (*pvec)[i];
223 matrixElement->setAttributeNode(
NewAttribute(
"values", pvalues.str()));
231 xercesc::DOMElement* propElement;
238 std::map<
G4int, G4PhysicsOrderedFreeVector*,
239 std::less<G4int> >::const_iterator mpos;
241 std::less<G4int> >::const_iterator cpos;
244 for (mpos=pmap->begin(); mpos!=pmap->end(); mpos++)
256 matElement->appendChild(propElement);
260 G4String warn_message =
"Null pointer for material property -"
263 G4Exception(
"G4GDMLWriteMaterials::PropertyWrite()",
"NullPointer",
269 for (cpos=cmap->begin(); cpos!=cmap->end(); cpos++)
276 xercesc::DOMElement* constElement =
NewElement(
"constant");
279 constElement->setAttributeNode(
NewAttribute(
"value", cpos->second));
281 matElement->appendChild(propElement);
static constexpr double kelvin
G4double Energy(size_t index) const
const std::map< G4int, G4double, std::less< G4int > > * GetConstPropertyMap() const
static constexpr double hep_pascal
void PropertyVectorWrite(const G4String &, const G4PhysicsOrderedFreeVector *const)
virtual ~G4GDMLWriteMaterials()
const G4double * GetFractionVector() const
std::vector< ExP01TrackerHit * > a
const std::map< G4int, G4MaterialPropertyVector *, std::less< G4int > > * GetPropertyMap() const
G4double * GetRelativeAbundanceVector() const
const G4String & GetName() const
static constexpr double STP_Temperature
const G4String & GetName() const
G4String GenerateName(const G4String &, const void *const)
std::vector< const G4Isotope * > isotopeList
xercesc::DOMElement * NewElement(const G4String &)
std::vector< G4String > GetMaterialPropertyNames() const
void MEEWrite(xercesc::DOMElement *, const G4double &)
static constexpr double electronvolt
void MaterialWrite(const G4Material *const)
static constexpr double STP_Pressure
void AtomWrite(xercesc::DOMElement *, const G4double &)
const G4String & GetName() const
static constexpr double g
void PropertyWrite(xercesc::DOMElement *, const G4Material *const)
xercesc::DOMElement * defineElement
void AddMaterial(const G4Material *const)
void AddIsotope(const G4Isotope *const)
void AddElement(const G4Element *const)
virtual void MaterialsWrite(xercesc::DOMElement *)
G4double GetMeanExcitationEnergy() const
void DWrite(xercesc::DOMElement *, const G4double &)
void PWrite(xercesc::DOMElement *, const G4double &)
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
G4double GetPressure() const
void IsotopeWrite(const G4Isotope *const)
std::vector< G4String > GetMaterialConstPropertyNames() const
xercesc::DOMElement * materialsElement
G4IonisParamMat * GetIonisation() const
std::vector< const G4Material * > materialList
std::vector< const G4Element * > elementList
G4GLOB_DLL std::ostream G4cout
xercesc::DOMAttr * NewAttribute(const G4String &, const G4String &)
const G4Isotope * GetIsotope(G4int iso) const
static constexpr double mole
static constexpr double cm3
const G4Element * GetElement(G4int iel) const
void TWrite(xercesc::DOMElement *, const G4double &)
void ElementWrite(const G4Element *const)
size_t GetNumberOfElements() const
G4MaterialPropertiesTable * GetMaterialPropertiesTable() const
size_t GetVectorLength() const
G4double GetTemperature() const
G4double GetDensity() const
size_t GetNumberOfIsotopes() const