DDMaterial is used to define and access material information. More...
#include <DDMaterial.h>
Public Types | |
typedef std::vector< std::pair < DDMaterial, double > > | FractionV |
Public Types inherited from DDBase< DDName, DDI::Material * > | |
typedef std::pair< const DDName *, bool > | def_type |
typedef DDI::Material * | pimpl_type |
typedef DDI::rep_type< DDName, pimpl_type > * | prep_type |
typedef DDI::Singleton < DDI::Store< DDName, DDI::Material * > > | StoreT |
Public Member Functions | |
double | a () const |
returns the atomic mass More... | |
int | addMaterial (const DDMaterial &m, double fm) |
adds a material to the mixture proportional to its fraction-mass fm. More... | |
FractionV::value_type | constituent (int i) const |
returns the i-th compound material and its fraction-mass More... | |
DDMaterial () | |
Creates a uninitialized reference-object (see DDLogicalPart documentation for details on reference objects) More... | |
DDMaterial (const DDName &name) | |
Creates a initialized reference-object or a reference to an allready defined material. More... | |
DDMaterial (const DDName &name, double z, double a, double d) | |
Constructor for construction of an elementary material. More... | |
DDMaterial (const DDName &name, double density) | |
Constructor for mixtures. More... | |
double | density () const |
returns the density More... | |
int | noOfConstituents () const |
returns the number of compound materials or 0 for elementary materials More... | |
double | z () const |
retruns the atomic number More... | |
Public Member Functions inherited from DDBase< DDName, DDI::Material * > | |
DDBase () | |
const DDName & | ddname () const |
def_type | isDefined () const |
bool | isValid () const |
true, if the wrapped pointer is valid More... | |
const DDName & | name () const |
operator bool () const | |
bool | operator< (const DDBase &b) const |
bool | operator== (const DDBase &b) const |
bool | operator> (const DDBase &b) const |
const DDI::rep_traits< DDName, DDI::Material * >::reference | rep () const |
DDI::rep_traits< DDName, DDI::Material * >::reference | rep () |
std::string | toString () const |
const DDI::rep_traits< DDName, DDI::Material * >::reference | val () const |
const DDI::rep_traits< DDName, DDI::Material * >::reference | val () |
virtual | ~DDBase () |
Friends | |
std::ostream & | operator<< (std::ostream &, const DDMaterial &) |
Additional Inherited Members | |
Static Public Member Functions inherited from DDBase< DDName, DDI::Material * > | |
static auto | begin () |
static void | clear () |
static auto | end () |
static size_t | size () |
Protected Attributes inherited from DDBase< DDName, DDI::Material * > | |
prep_type | prep_ |
DDMaterial is used to define and access material information.
An object of this class is a reference-object and thus leightweighted. It is uniquely identified by its DDName. Further details concerning reference-objects can be found in the documentation of DDLogicalPart.
A DDMaterial can recursively consist of compound materials (which are DDMaterials as well). Materials consisting of compound materials are called mixtures. Mixtures are defined by their Materials which do not consist of compound materials are called elementary materials.
To define an elementray material, use it like this:
To define a mixture:
Note the usage of CLHEP/SystemOfUnits to specify the units of the quantities making up a material.
Definition at line 41 of file DDMaterial.h.
typedef std::vector<std::pair<DDMaterial,double> > DDMaterial::FractionV |
Definition at line 46 of file DDMaterial.h.
DDMaterial::DDMaterial | ( | ) |
Creates a uninitialized reference-object (see DDLogicalPart documentation for details on reference objects)
Definition at line 13 of file DDMaterial.cc.
DDMaterial::DDMaterial | ( | const DDName & | name | ) |
Creates a initialized reference-object or a reference to an allready defined material.
If a DDMaterial with name was already defined, this constructor creates a reference object to the defined material. Otherwise it creates a (default) initialized reference-object to a material with DDName name.
For further details concerning the usage of reference-objects refere to the documentation of DDLogicalPart.
Definition at line 24 of file DDMaterial.cc.
References DDI::Singleton< I >::instance(), and DDBase< DDName, DDI::Material * >::prep_.
DDMaterial::DDMaterial | ( | const DDName & | name, |
double | z, | ||
double | a, | ||
double | d | ||
) |
Constructor for construction of an elementary material.
z
atomic number a
atomic mass density
densityExample:
Definition at line 43 of file DDMaterial.cc.
References DDI::Singleton< I >::instance(), and DDBase< DDName, DDI::Material * >::prep_.
DDMaterial::DDMaterial | ( | const DDName & | name, |
double | density | ||
) |
Constructor for mixtures.
For a mixture material it is sufficient to specify the density of the mixture (in addition to the name). The compounds are added by using the addMaterial(..) method.
The result of this constructor is a reference-object. One can use the mixture material immidiately (without specifying the compund materials). Compound materials can be added at any later stage.
For further details concerning the usage of reference-objects refere to the documentation of DDLogicalPart.
Definition at line 62 of file DDMaterial.cc.
References DDI::Singleton< I >::instance(), and DDBase< DDName, DDI::Material * >::prep_.
double DDMaterial::a | ( | ) | const |
returns the atomic mass
Definition at line 97 of file DDMaterial.cc.
References DDBase< DDName, DDI::Material * >::rep().
Referenced by DDG4Builder::convertMaterial(), TGeoMgrFromDdd::createMaterial(), TGeoFromDddService::createMaterial(), DDCheckMaterial(), DDHtmlMaDetails::details(), DDCoreToDDXMLOutput::material(), and DDStreamer::materials_write().
int DDMaterial::addMaterial | ( | const DDMaterial & | m, |
double | fm | ||
) |
adds a material to the mixture proportional to its fraction-mass fm.
The fraction-masses of all compounds must sum up to 1
Definition at line 72 of file DDMaterial.cc.
References DCOUT, DDBase< N, C >::ddname(), DDBase< DDName, DDI::Material * >::ddname(), Exception, DDBase< DDName, DDI::Material * >::rep(), AlCaHLTBitMon_QueryRunRegistry::string, and DDBase< N, C >::toString().
Referenced by DDStreamer::materials_read(), DDLCompositeMaterial::processElement(), and regressionTest_setup().
DDMaterial::FractionV::value_type DDMaterial::constituent | ( | int | i | ) | const |
returns the i-th compound material and its fraction-mass
Definition at line 89 of file DDMaterial.cc.
References DDBase< DDName, DDI::Material * >::rep().
Referenced by OutputDDToDDL::addToMatStore(), OutputMagneticFieldDDToDDL::addToMatStore(), DDG4Builder::convertMaterial(), TGeoMgrFromDdd::createMaterial(), TGeoFromDddService::createMaterial(), DDCheckMaterial(), DDHtmlMaDetails::details(), DDCoreToDDXMLOutput::material(), and DDStreamer::materials_write().
double DDMaterial::density | ( | ) | const |
returns the density
Definition at line 109 of file DDMaterial.cc.
References DDBase< DDName, DDI::Material * >::rep().
Referenced by DDG4Builder::convertMaterial(), TGeoMgrFromDdd::createMaterial(), TGeoFromDddService::createMaterial(), DDCheckMaterial(), DDHtmlMaDetails::details(), DDCoreToDDXMLOutput::material(), DDStreamer::materials_write(), and DDCompactViewImpl::weight().
int DDMaterial::noOfConstituents | ( | ) | const |
returns the number of compound materials or 0 for elementary materials
Definition at line 83 of file DDMaterial.cc.
References DDBase< DDName, DDI::Material * >::rep().
Referenced by OutputDDToDDL::addToMatStore(), OutputMagneticFieldDDToDDL::addToMatStore(), DDG4Builder::convertMaterial(), TGeoMgrFromDdd::createMaterial(), TGeoFromDddService::createMaterial(), DDCheckMaterial(), DDHtmlMaDetails::details(), DDCoreToDDXMLOutput::material(), and DDStreamer::materials_write().
double DDMaterial::z | ( | ) | const |
retruns the atomic number
Definition at line 103 of file DDMaterial.cc.
References DDBase< DDName, DDI::Material * >::rep().
Referenced by DDG4Builder::convertMaterial(), TGeoMgrFromDdd::createMaterial(), TGeoFromDddService::createMaterial(), DDCheckMaterial(), DDHtmlMaDetails::details(), DDCoreToDDXMLOutput::material(), DDStreamer::materials_write(), and geometryXMLparser.Alignable::pos().
|
friend |
Definition at line 148 of file DDMaterial.cc.