67 #ifndef __ConstantValues_h 71 #ifndef __ElementSet_h 98 m_p_weight_set = aWeightSet;
110 double>& aWeightSet):
123 m_p_weight_set(aMixture.m_p_weight_set),
124 m_molar_mass(aMixture.m_molar_mass),
125 m_density(aMixture.m_density),
126 m_label(aMixture.m_label)
137 m_p_weight_set.clear();
148 m_p_weight_set = aWeightSet;
160 std::map<int, double> mixture;
163 double sum_weight(0.0);
165 for (std::map<std::string, double>::const_iterator ite = aWeightSet.begin();
166 ite != aWeightSet.end();
180 mixture[Z] = ite->second;
181 sum_weight += ite->second;
189 if (sum_weight > 1.0)
191 mixture[balance_Z] = 100.0 - sum_weight;
196 mixture[balance_Z] = 1.0 - sum_weight;
200 m_p_weight_set = mixture;
212 return (m_molar_mass);
220 m_density = aDensity;
236 return (getMassAttenuationTotal(anEnergy) *
245 return (getLinearAttenuationTotal(anEnergy));
261 m_molar_mass = aMixture.m_molar_mass;
262 m_density = aMixture.m_density;
263 m_p_weight_set = aMixture.m_p_weight_set;
264 m_label = aMixture.m_label;
274 return (!(
operator==(aMixture)));
282 return m_p_weight_set;
double getMolarMass() const
Accessor on the molar mass of the material.
AtomicElement & getElement(unsigned short anAtomicNumber)
Get a given element.
Class to manage a table of elements in material.
bool operator!=(const Mixture &aMixture) const
#define EPSILON
Smallest value that can be stored with a real number.
Mixture()
Default Constructor.
static ElementSet & getInstance()
double getLinearAttenuationTotal(double anEnergy) const
void setMixture(const std::map< int, double > &aWeightSet)
const std::string & getLabel() const
double getMu(double anEnergy) const
Mixture & operator=(const Mixture &aMixture)
Copy operator.
Mixture is a class to manage a mixture (e.g. Ti90Al6V4).
Constant values, such as the Z number of different atoms, etc.
void normaliseWeightSet()
Normalise the weight set.
double computeMolarMass()
Update the value of the molar mass of the material.
const std::map< int, double > & getWeightSet() const
double getDensity() const
Get the density of the material.
void setDensity(double aDensity)
unsigned short getZ() const
Accessor on the atomic number (Z) of the element.