Garfield++ v2r0
A toolkit for the detailed simulation of particle detectors based on ionisation measurement in gases and semiconductors
Loading...
Searching...
No Matches
Heed::MoleculeDef Class Reference

#include <MoleculeDef.h>

+ Inheritance diagram for Heed::MoleculeDef:

Public Member Functions

const std::string & name () const
 
const std::string & notation () const
 
const std::vector< long > & qatom_ps () const
 
long qatom_ps (long n) const
 
long Z_total () const
 
double A_total () const
 
long tqatom () const
 
const ActivePtr< VanDerWaals > & awls () const
 
 MoleculeDef ()
 
 MoleculeDef (const std::string &fname, const std::string &fnotation, long fqatom, const std::vector< std::string > &fatom_not, const std::vector< long > &fqatom_ps, ActivePtr< VanDerWaals > fawls=ActivePtr< VanDerWaals >())
 
 MoleculeDef (const std::string &fname, const std::string &fnotation, const std::string &fatom_not, long fqatom_ps, ActivePtr< VanDerWaals > fawls=ActivePtr< VanDerWaals >())
 
 MoleculeDef (const std::string &fname, const std::string &fnotation, const std::string &fatom_not1, long fqatom_ps1, const std::string &fatom_not2, long fqatom_ps2, ActivePtr< VanDerWaals > fawls=ActivePtr< VanDerWaals >())
 
 MoleculeDef (const std::string &fname, const std::string &fnotation, const std::string &fatom_not1, long fqatom_ps1, const std::string &fatom_not2, long fqatom_ps2, const std::string &fatom_not3, long fqatom_ps3, ActivePtr< VanDerWaals > fawls=ActivePtr< VanDerWaals >())
 
 ~MoleculeDef ()
 
void print (std::ostream &file, int l) const
 
void verify ()
 Check that there is no molecule with the same name in the container.
 
virtual MoleculeDefcopy () const
 
- Public Member Functions inherited from Heed::AtomMixDef
 AtomMixDef ()
 Default constructor.
 
 AtomMixDef (unsigned long fqatom, const std::vector< std::string > &fatom_not, const std::vector< double > &fweight_quan)
 
 AtomMixDef (unsigned long fqatom, const std::vector< std::string > &fatom_not, const std::vector< long > &fweight_quan)
 
 AtomMixDef (const std::string &fatom_not)
 
 AtomMixDef (const std::string &fatom_not1, double fweight_quan1, const std::string &fatom_not2, double fweight_quan2)
 
 AtomMixDef (const std::string &fatom_not1, double fweight_quan1, const std::string &fatom_not2, double fweight_quan2, const std::string &fatom_not3, double fweight_quan3)
 
 AtomMixDef (const std::string &fatom_not1, double fweight_quan1, const std::string &fatom_not2, double fweight_quan2, const std::string &fatom_not3, double fweight_quan3, const std::string &fatom_not4, double fweight_quan4)
 
void print (std::ostream &file, int l) const
 
long qatom () const
 
const std::vector< PassivePtr< AtomDef > > & atom () const
 
PassivePtr< AtomDefatom (long n) const
 
const std::vector< double > & weight_quan () const
 
const std::vector< double > & weight_mass () const
 
double weight_quan (long n) const
 
double weight_mass (long n) const
 
double Z_mean () const
 
double A_mean () const
 
double inv_A_mean () const
 
double mean_ratio_Z_to_A () const
 
double NumberOfElectronsInGram () const
 
- Public Member Functions inherited from Heed::RegPassivePtr
 RegPassivePtr (void)
 
 RegPassivePtr (char fs_ban_del, char fs_ban_sub, char fs_ban_cop=0)
 
 RegPassivePtr (const RegPassivePtr &f)
 
RegPassivePtroperator= (const RegPassivePtr &f)
 
CountPP_ns::CountPassivePtrbook (void) const
 
void clear_pointers (void) const
 
virtual RegPassivePtrcopy () const
 
virtual ~RegPassivePtr ()
 
virtual void print (std::ostream &file, int l=1) const
 
void set_s_ban_del (char fs_ban_del)
 
char get_s_ban_del (void) const
 
void set_s_ban_sub (char fs_ban_sub)
 
char get_s_ban_sub (void) const
 
void set_s_ban_cop (char fs_ban_cop)
 
char get_s_ban_cop (void) const
 
void set_s_allow_del_at_zero_count (char fs_allow_del_at_zero_count)
 
char get_s_allow_del_at_zero_count (void) const
 
long get_total_number_of_references (void) const
 

Static Public Member Functions

static void printall (std::ostream &file)
 
static std::list< MoleculeDef * > & get_logbook ()
 
static const std::list< MoleculeDef * > & get_const_logbook ()
 
static MoleculeDefget_MoleculeDef (const std::string &fnotation)
 
- Static Public Member Functions inherited from Heed::RegPassivePtr
static void set_s_ban_del_ignore (char fs_ban_del_ignore)
 
static char get_s_ban_del_ignore (void)
 
static void set_s_print_adr_cpp (char fs_print_adr_cpp)
 
static char get_s_print_adr_cpp (void)
 

Detailed Description

Definition of molecule as a mixture of atoms. Only the basic information: the name, the notation, the mean charge and atomic weight and the parameters of mixture class.

The principle of definitions of matters is the same as for atoms: a dictionary or a database. See details there. But the logbook is different, of course.

1998-2004 I. Smirnov

Definition at line 50 of file MoleculeDef.h.

Constructor & Destructor Documentation

◆ MoleculeDef() [1/5]

Heed::MoleculeDef::MoleculeDef ( )

Definition at line 75 of file MoleculeDef.cpp.

75 : nameh("none"), notationh("none") {
76 MoleculeDef::get_logbook().push_back(this);
77}
static std::list< MoleculeDef * > & get_logbook()

Referenced by copy().

◆ MoleculeDef() [2/5]

Heed::MoleculeDef::MoleculeDef ( const std::string &  fname,
const std::string &  fnotation,
long  fqatom,
const std::vector< std::string > &  fatom_not,
const std::vector< long > &  fqatom_ps,
ActivePtr< VanDerWaals fawls = ActivePtr<VanDerWaals>() 
)

Definition at line 79 of file MoleculeDef.cpp.

83 : AtomMixDef(fqatom, fatom_not, fqatom_ps),
84 nameh(fname),
85 notationh(fnotation),
86 qatom_psh(fqatom_ps),
87 Z_totalh(0),
88 A_totalh(0.0),
89 tqatomh(0),
90 awlsh(fawls) {
91 mfunname("MoleculeDef::MoleculeDef(...)");
92 for (long n = 0; n < qatom(); n++) {
93 Z_totalh += qatom_psh[n] * atom(n)->Z();
94 A_totalh += qatom_psh[n] * atom(n)->A();
95 tqatomh += qatom_psh[n];
96 check_econd11(qatom_psh[n], <= 0, mcerr);
97 }
98 verify();
99 MoleculeDef::get_logbook().push_back(this);
100}
#define check_econd11(a, signb, stream)
Definition: FunNameStack.h:155
#define mfunname(string)
Definition: FunNameStack.h:45
const std::vector< PassivePtr< AtomDef > > & atom() const
Definition: AtomDef.h:144
long qatom() const
Definition: AtomDef.h:143
AtomMixDef()
Default constructor.
Definition: AtomDef.h:121
void verify()
Check that there is no molecule with the same name in the container.
#define mcerr
Definition: prstream.h:128

◆ MoleculeDef() [3/5]

Heed::MoleculeDef::MoleculeDef ( const std::string &  fname,
const std::string &  fnotation,
const std::string &  fatom_not,
long  fqatom_ps,
ActivePtr< VanDerWaals fawls = ActivePtr<VanDerWaals>() 
)

Definition at line 103 of file MoleculeDef.cpp.

106 : AtomMixDef(fatom_not),
107 nameh(fname),
108 notationh(fnotation),
109 qatom_psh(1, fqatom_ps),
110 Z_totalh(0),
111 A_totalh(0.0),
112 tqatomh(fqatom_ps),
113 awlsh(fawls) {
114 mfunname("MoleculeDef::MoleculeDef(...)");
115 Z_totalh = atom(0)->Z() * fqatom_ps;
116 A_totalh = atom(0)->A() * fqatom_ps;
117 verify();
118 MoleculeDef::get_logbook().push_back(this);
119}

◆ MoleculeDef() [4/5]

Heed::MoleculeDef::MoleculeDef ( const std::string &  fname,
const std::string &  fnotation,
const std::string &  fatom_not1,
long  fqatom_ps1,
const std::string &  fatom_not2,
long  fqatom_ps2,
ActivePtr< VanDerWaals fawls = ActivePtr<VanDerWaals>() 
)

Definition at line 122 of file MoleculeDef.cpp.

126 : AtomMixDef(fatom_not1, fqatom_ps1, fatom_not2, fqatom_ps2),
127 nameh(fname),
128 notationh(fnotation),
129 qatom_psh(2),
130 Z_totalh(0),
131 A_totalh(0.0),
132 tqatomh(0),
133 awlsh(fawls) {
134 mfunname("MoleculeDef::MoleculeDef(...)");
135 qatom_psh[0] = fqatom_ps1;
136 qatom_psh[1] = fqatom_ps2;
137 for (long n = 0; n < qatom(); n++) {
138 check_econd11(qatom_psh[n], <= 0, mcerr);
139 Z_totalh += qatom_psh[n] * atom(n)->Z();
140 A_totalh += qatom_psh[n] * atom(n)->A();
141 tqatomh += qatom_psh[n];
142 }
143 verify();
144 MoleculeDef::get_logbook().push_back(this);
145}

◆ MoleculeDef() [5/5]

Heed::MoleculeDef::MoleculeDef ( const std::string &  fname,
const std::string &  fnotation,
const std::string &  fatom_not1,
long  fqatom_ps1,
const std::string &  fatom_not2,
long  fqatom_ps2,
const std::string &  fatom_not3,
long  fqatom_ps3,
ActivePtr< VanDerWaals fawls = ActivePtr<VanDerWaals>() 
)

Definition at line 148 of file MoleculeDef.cpp.

153 : AtomMixDef(fatom_not1, fqatom_ps1, fatom_not2, fqatom_ps2, fatom_not3,
154 fqatom_ps3),
155 nameh(fname),
156 notationh(fnotation),
157 qatom_psh(3),
158 Z_totalh(0),
159 A_totalh(0.0),
160 tqatomh(0),
161 awlsh(fawls) {
162 mfunname("MoleculeDef::MoleculeDef(...)");
163 qatom_psh[0] = fqatom_ps1;
164 qatom_psh[1] = fqatom_ps2;
165 qatom_psh[2] = fqatom_ps3;
166 for (long n = 0; n < qatom(); n++) {
167 check_econd11(qatom_psh[n], <= 0, mcerr);
168 Z_totalh += qatom_psh[n] * atom(n)->Z();
169 A_totalh += qatom_psh[n] * atom(n)->A();
170 tqatomh += qatom_psh[n];
171 }
172 verify();
173 MoleculeDef::get_logbook().push_back(this);
174}

◆ ~MoleculeDef()

Heed::MoleculeDef::~MoleculeDef ( )

Definition at line 259 of file MoleculeDef.cpp.

259{ MoleculeDef::get_logbook().remove(this); }

Member Function Documentation

◆ A_total()

double Heed::MoleculeDef::A_total ( ) const
inline

Definition at line 71 of file MoleculeDef.h.

71{ return A_totalh; }

Referenced by Heed::operator<<().

◆ awls()

const ActivePtr< VanDerWaals > & Heed::MoleculeDef::awls ( ) const
inline

Definition at line 73 of file MoleculeDef.h.

73{ return awlsh; }

Referenced by Heed::operator<<().

◆ copy()

virtual MoleculeDef * Heed::MoleculeDef::copy ( ) const
inlinevirtual

Reimplemented from Heed::RegPassivePtr.

Definition at line 106 of file MoleculeDef.h.

106{ return new MoleculeDef(*this); }

◆ get_const_logbook()

const std::list< MoleculeDef * > & Heed::MoleculeDef::get_const_logbook ( )
static

Initialize the logbook at the first request and keep it as internal static variable.

Definition at line 210 of file MoleculeDef.cpp.

210 {
212}

◆ get_logbook()

std::list< MoleculeDef * > & Heed::MoleculeDef::get_logbook ( )
static

Definition at line 205 of file MoleculeDef.cpp.

205 {
206 static std::list<MoleculeDef*> logbook;
207 return logbook;
208}

Referenced by get_const_logbook(), get_MoleculeDef(), MoleculeDef(), printall(), verify(), and ~MoleculeDef().

◆ get_MoleculeDef()

MoleculeDef * Heed::MoleculeDef::get_MoleculeDef ( const std::string &  fnotation)
static

Return the address of the molecule with this name. If there is no molecule with this notation, the function returns NULL but does not terminate the program as that for AtomDef. Be careful.

Definition at line 214 of file MoleculeDef.cpp.

214 {
215 std::list<MoleculeDef*>& logbook = MoleculeDef::get_logbook();
216 std::list<MoleculeDef*>::const_iterator it;
217 std::list<MoleculeDef*>::const_iterator end = logbook.end();
218 for (it = logbook.begin(); it != end; ++it) {
219 if ((*it)->notation() == fnotation) return *it;
220 }
221 return NULL;
222}

Referenced by Heed::GasDef::GasDef().

◆ name()

const std::string & Heed::MoleculeDef::name ( ) const
inline

Definition at line 66 of file MoleculeDef.h.

66{ return nameh; }

Referenced by Heed::operator<<().

◆ notation()

const std::string & Heed::MoleculeDef::notation ( ) const
inline

Definition at line 67 of file MoleculeDef.h.

67{ return notationh; }

Referenced by Heed::operator<<().

◆ print()

void Heed::MoleculeDef::print ( std::ostream &  file,
int  l 
) const
virtual

Reimplemented from Heed::AtomMixDef.

Definition at line 176 of file MoleculeDef.cpp.

176 {
177 if (l > 0) file << (*this);
178}

◆ printall()

void Heed::MoleculeDef::printall ( std::ostream &  file)
static

Definition at line 180 of file MoleculeDef.cpp.

180 {
181 Ifile << "MoleculeDef::printall:\n";
182 std::list<MoleculeDef*>& logbook = MoleculeDef::get_logbook();
183 std::list<MoleculeDef*>::const_iterator it;
184 std::list<MoleculeDef*>::const_iterator end = logbook.end();
185 for (it = logbook.begin(); it != end; ++it) file << (*it);
186}
#define Ifile
Definition: prstream.h:196

◆ qatom_ps() [1/2]

const std::vector< long > & Heed::MoleculeDef::qatom_ps ( ) const
inline

Definition at line 68 of file MoleculeDef.h.

68{ return qatom_psh; }

Referenced by Heed::operator<<().

◆ qatom_ps() [2/2]

long Heed::MoleculeDef::qatom_ps ( long  n) const
inline

Definition at line 69 of file MoleculeDef.h.

69{ return qatom_psh[n]; }

◆ tqatom()

long Heed::MoleculeDef::tqatom ( ) const
inline

Definition at line 72 of file MoleculeDef.h.

72{ return tqatomh; }

Referenced by Heed::operator<<().

◆ verify()

void Heed::MoleculeDef::verify ( )

Check that there is no molecule with the same name in the container.

Definition at line 188 of file MoleculeDef.cpp.

188 {
189 mfunnamep("void MoleculeDef::verify()");
190 if (nameh == "none" && notationh == "none") return;
191 std::list<MoleculeDef*>& logbook = MoleculeDef::get_logbook();
192 std::list<MoleculeDef*>::const_iterator it;
193 std::list<MoleculeDef*>::const_iterator end = logbook.end();
194 for (it = logbook.begin(); it != end; ++it) {
195 if ((*it)->nameh == nameh || (*it)->notationh == notationh) {
196 funnw.ehdr(mcerr);
197 mcerr << "can not initialize two molecules "
198 << "with the same name or notation\n";
199 mcerr << "name=" << nameh << " notation=" << notationh << '\n';
200 spexit(mcerr);
201 }
202 }
203}
#define mfunnamep(string)
Definition: FunNameStack.h:49
#define spexit(stream)
Definition: FunNameStack.h:256

Referenced by MoleculeDef().

◆ Z_total()

long Heed::MoleculeDef::Z_total ( ) const
inline

Definition at line 70 of file MoleculeDef.h.

70{ return Z_totalh; }

Referenced by Heed::operator<<().


The documentation for this class was generated from the following files: