Garfield++ 3.0
A toolkit for the detailed simulation of particle detectors based on ionisation measurement in gases and semiconductors
|
#include <AtomDef.h>
Public Member Functions | |
AtomDef () | |
Default constructor. | |
AtomDef (const std::string &fnameh, const std::string &fnotationh, int fZh, double fAh) | |
Constructor. | |
~AtomDef () | |
Destructor. | |
const std::string & | name () const |
const std::string & | notation () const |
int | Z () const |
double | A () const |
void | verify () |
Check that there is no atom with the same name in the container. | |
void | print (std::ostream &file, int l=0) const |
AtomDef * | copy () const |
Static Public Member Functions | |
static void | printall (std::ostream &file) |
Print all registered atoms. | |
static std::list< AtomDef * > & | get_logbook () |
static const std::list< AtomDef * > & | get_const_logbook () |
static AtomDef * | get_AtomDef (const std::string &fnotation) |
static double | get_A (int fZ) |
static AtomDef * | get_AtomDef (int fZ) |
Definition of atoms. Only the basic information: name, notation, atomic weight and charge.
The principle of definitions of atoms is dictionary or a database: the atoms are not repeated, each atom is presented in the total system no more than one time. The system knows each atom presented in it. The atom characteristics can be obtained by literal notation. The system declines the secondary initialization. The copying is not declined. When the user program wants to refer to atom, it has to use either char* (string) notation, or pointer (or reference) to one of these objects. The user pogram can initialize the new atoms. The standard atoms are initiated in files GasLib.h and GasLib.c.
In principle I am going to initiate all atoms from Mendeleev's table, but I haven't finished yet. Only its first half is filled at the moment.
The atoms are registered in the static element of class AtomDef private: static std::list<AtomDef*> logbook; The can be obtained by notations by: public: static const std::list<AtomDef*>& get_AtomDefLogbook(); static AtomDef* get_AtomDef(const std::string& fnotation); returns the address of atom with this name if it is registered in system, or NULL otherwise.
In these files and in the other components of the matter package the principles are similar. This is the principle of database, the principle of the strict protection of internal data (variables marked by suffix 'h') and granting access though the functions which have similar names without this suffix 'h'.
1998-2004, I. Smirnov.
Heed::AtomDef::AtomDef | ( | ) |
Heed::AtomDef::AtomDef | ( | const std::string & | fnameh, |
const std::string & | fnotationh, | ||
int | fZh, | ||
double | fAh | ||
) |
Constructor.
Definition at line 27 of file AtomDef.cpp.
Heed::AtomDef::~AtomDef | ( | ) |
|
inline |
|
static |
Return the atomic number corresponding to a given Z. If the atom is not registered, the current version terminates the program through spexit(). Be careful!
Definition at line 36 of file AtomDef.cpp.
|
static |
Return the address of atom with this name if it is registered in system, or NULL otherwise
Definition at line 87 of file AtomDef.cpp.
Referenced by Heed::AtomMixDef::AtomMixDef().
|
static |
Return the address of atom corresponding to a given Z. If the atom is not registered, the current version terminates the program through spexit(). Be careful!
Definition at line 47 of file AtomDef.cpp.
|
static |
Definition at line 83 of file AtomDef.cpp.
|
static |
Initialize the logbook at the first request and keep it as internal static variable.
Definition at line 78 of file AtomDef.cpp.
Referenced by AtomDef(), get_A(), get_AtomDef(), get_const_logbook(), printall(), verify(), and ~AtomDef().
|
inline |
|
inline |
void Heed::AtomDef::print | ( | std::ostream & | file, |
int | l = 0 |
||
) | const |
Definition at line 14 of file AtomDef.cpp.
|
static |
void Heed::AtomDef::verify | ( | ) |
Check that there is no atom with the same name in the container.
Definition at line 58 of file AtomDef.cpp.
Referenced by AtomDef().
|
inline |