Garfield++ v1r0
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 Stringname (void) const
 
const Stringnotation (void) const
 
const DynLinArr< long > & qatom_ps (void) const
 
long qatom_ps (long n) const
 
long Z_total (void) const
 
double A_total (void) const
 
long tqatom (void) const
 
const ActivePtr< VanDerVaals > & awls (void) const
 
 MoleculeDef (void)
 
 MoleculeDef (const String &fname, const String &fnotation, long fqatom, const DynLinArr< String > &fatom_not, const DynLinArr< long > &fqatom_ps, ActivePtr< VanDerVaals > fawls=ActivePtr< VanDerVaals >())
 
 MoleculeDef (const String &fname, const String &fnotation, const String &fatom_not, long fqatom_ps, ActivePtr< VanDerVaals > fawls=ActivePtr< VanDerVaals >())
 
 MoleculeDef (const String &fname, const String &fnotation, const String &fatom_not1, long fqatom_ps1, const String &fatom_not2, long fqatom_ps2, ActivePtr< VanDerVaals > fawls=ActivePtr< VanDerVaals >())
 
 MoleculeDef (const String &fname, const String &fnotation, const String &fatom_not1, long fqatom_ps1, const String &fatom_not2, long fqatom_ps2, const String &fatom_not3, long fqatom_ps3, ActivePtr< VanDerVaals > fawls=ActivePtr< VanDerVaals >())
 
 ~MoleculeDef ()
 
void print (std::ostream &file, int l) const
 
void verify (void)
 
 macro_copy_total (MoleculeDef)
 
- Public Member Functions inherited from Heed::AtomMixDef
 AtomMixDef (void)
 
 AtomMixDef (long fqatom, const DynLinArr< String > &fatom_not, const DynLinArr< double > &fweight_quan)
 
 AtomMixDef (long fqatom, const DynLinArr< String > &fatom_not, const DynLinArr< long > &fweight_quan)
 
 AtomMixDef (const String &fatom_not)
 
 AtomMixDef (const String &fatom_not1, double fweight_quan1, const String &fatom_not2, double fweight_quan2)
 
 AtomMixDef (const String &fatom_not1, double fweight_quan1, const String &fatom_not2, double fweight_quan2, const String &fatom_not3, double fweight_quan3)
 
 AtomMixDef (const String &fatom_not1, double fweight_quan1, const String &fatom_not2, double fweight_quan2, const String &fatom_not3, double fweight_quan3, const String &fatom_not4, double fweight_quan4)
 
void print (std::ostream &file, int l) const
 
long qatom (void) const
 
const DynLinArr< PassivePtr< AtomDef > > & atom (void) const
 
PassivePtr< AtomDefatom (long n) const
 
const DynLinArr< double > & weight_quan (void) const
 
const DynLinArr< double > & weight_mass (void) const
 
double weight_quan (long n) const
 
double weight_mass (long n) const
 
double Z_mean (void) const
 
double A_mean (void) const
 
double inv_A_mean (void) const
 
double mean_ratio_Z_to_A (void) const
 
double NumberOfElectronsInGram (void) const
 

Static Public Member Functions

static void printall (std::ostream &file)
 
static AbsList< MoleculeDef * > & get_logbook (void)
 
static const AbsList< MoleculeDef * > & get_const_logbook (void)
 
static MoleculeDefget_MoleculeDef (const String &fnotation)
 

Detailed Description

Definition at line 51 of file MoleculeDef.h.

Constructor & Destructor Documentation

◆ MoleculeDef() [1/5]

Heed::MoleculeDef::MoleculeDef ( void  )

Definition at line 84 of file MoleculeDef.cpp.

84 : nameh("none"), notationh("none") {
85 MoleculeDef::get_logbook().append(this);
86}
static AbsList< MoleculeDef * > & get_logbook(void)

◆ MoleculeDef() [2/5]

Heed::MoleculeDef::MoleculeDef ( const String fname,
const String fnotation,
long  fqatom,
const DynLinArr< String > &  fatom_not,
const DynLinArr< long > &  fqatom_ps,
ActivePtr< VanDerVaals >  fawls = ActivePtr<VanDerVaals>() 
)

Definition at line 108 of file MoleculeDef.cpp.

112 : AtomMixDef(fqatom, fatom_not, fqatom_ps),
113 nameh(fname),
114 notationh(fnotation),
115 qatom_psh(fqatom_ps),
116 Z_totalh(0),
117 A_totalh(0.0),
118 tqatomh(0),
119 awlsh(fawls) {
120 mfunname("MoleculeDef::MoleculeDef(...)");
121 long n;
122 for (n = 0; n < qatom(); n++) {
123 Z_totalh += qatom_psh[n] * atom(n)->Z();
124 A_totalh += qatom_psh[n] * atom(n)->A();
125 tqatomh += qatom_psh[n];
126 check_econd11(qatom_psh[n], <= 0, mcerr);
127 }
128 check_econd11(s, <= 0, mcerr);
129 verify();
130 MoleculeDef::get_logbook().append(this);
131}
#define check_econd11(a, signb, stream)
Definition: FunNameStack.h:366
#define mfunname(string)
Definition: FunNameStack.h:67
AtomMixDef(void)
Definition: AtomDef.h:118
long qatom(void) const
Definition: AtomDef.h:142
const DynLinArr< PassivePtr< AtomDef > > & atom(void) const
Definition: AtomDef.h:143
#define mcerr
Definition: prstream.h:135

◆ MoleculeDef() [3/5]

Heed::MoleculeDef::MoleculeDef ( const String fname,
const String fnotation,
const String fatom_not,
long  fqatom_ps,
ActivePtr< VanDerVaals >  fawls = ActivePtr<VanDerVaals>() 
)

Definition at line 134 of file MoleculeDef.cpp.

137 : AtomMixDef(fatom_not),
138 nameh(fname),
139 notationh(fnotation),
140 qatom_psh(1, fqatom_ps),
141 Z_totalh(0),
142 A_totalh(0.0),
143 tqatomh(fqatom_ps),
144 awlsh(fawls) {
145 mfunname("MoleculeDef::MoleculeDef(...)");
146 Z_totalh = atom(0)->Z() * fqatom_ps;
147 A_totalh = atom(0)->A() * fqatom_ps;
148 verify();
149 MoleculeDef::get_logbook().append(this);
150}

◆ MoleculeDef() [4/5]

Heed::MoleculeDef::MoleculeDef ( const String fname,
const String fnotation,
const String fatom_not1,
long  fqatom_ps1,
const String fatom_not2,
long  fqatom_ps2,
ActivePtr< VanDerVaals >  fawls = ActivePtr<VanDerVaals>() 
)

Definition at line 153 of file MoleculeDef.cpp.

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

◆ MoleculeDef() [5/5]

Heed::MoleculeDef::MoleculeDef ( const String fname,
const String fnotation,
const String fatom_not1,
long  fqatom_ps1,
const String fatom_not2,
long  fqatom_ps2,
const String fatom_not3,
long  fqatom_ps3,
ActivePtr< VanDerVaals >  fawls = ActivePtr<VanDerVaals>() 
)

Definition at line 180 of file MoleculeDef.cpp.

185 : AtomMixDef(fatom_not1, fqatom_ps1, fatom_not2, fqatom_ps2, fatom_not3,
186 fqatom_ps3),
187 nameh(fname),
188 notationh(fnotation),
189 qatom_psh(3),
190 Z_totalh(0),
191 A_totalh(0.0),
192 tqatomh(0),
193 awlsh(fawls) {
194 mfunname("MoleculeDef::MoleculeDef(...)");
195 qatom_psh[0] = fqatom_ps1;
196 qatom_psh[1] = fqatom_ps2;
197 qatom_psh[2] = fqatom_ps3;
198 long n;
199 for (n = 0; n < qatom(); n++) {
200 check_econd11(qatom_psh[n], <= 0, mcerr);
201 Z_totalh += qatom_psh[n] * atom(n)->Z();
202 A_totalh += qatom_psh[n] * atom(n)->A();
203 tqatomh += qatom_psh[n];
204 }
205 verify();
206 MoleculeDef::get_logbook().append(this);
207}

◆ ~MoleculeDef()

Heed::MoleculeDef::~MoleculeDef ( )

Definition at line 290 of file MoleculeDef.cpp.

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

Member Function Documentation

◆ A_total()

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

Definition at line 72 of file MoleculeDef.h.

72{ return A_totalh; }

Referenced by Heed::operator<<().

◆ awls()

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

Definition at line 74 of file MoleculeDef.h.

74{ return awlsh; }

Referenced by Heed::operator<<().

◆ get_const_logbook()

const AbsList< MoleculeDef * > & Heed::MoleculeDef::get_const_logbook ( void  )
static

Definition at line 242 of file MoleculeDef.cpp.

242 {
244}

◆ get_logbook()

AbsList< MoleculeDef * > & Heed::MoleculeDef::get_logbook ( void  )
static

Definition at line 237 of file MoleculeDef.cpp.

237 {
238 static AbsList<MoleculeDef*> logbook;
239 return logbook;
240}

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

◆ get_MoleculeDef()

MoleculeDef * Heed::MoleculeDef::get_MoleculeDef ( const String fnotation)
static

Definition at line 246 of file MoleculeDef.cpp.

246 {
249 while ((an = logbook.get_next_node(an)) != NULL) {
250 if (an->el->notation() == fnotation) return an->el;
251 }
252 return NULL;
253}
AbsListNode< T > * get_next_node(AbsListNode< T > *an) const
Definition: AbsList.h:175

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

◆ macro_copy_total()

Heed::MoleculeDef::macro_copy_total ( MoleculeDef  )

◆ name()

const String & Heed::MoleculeDef::name ( void  ) const
inline

Definition at line 67 of file MoleculeDef.h.

67{ return nameh; }

Referenced by Heed::operator<<().

◆ notation()

const String & Heed::MoleculeDef::notation ( void  ) const
inline

Definition at line 68 of file MoleculeDef.h.

68{ return notationh; }

Referenced by Heed::operator<<().

◆ print()

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

Definition at line 209 of file MoleculeDef.cpp.

209 {
210 if (l > 0) file << (*this);
211}

◆ printall()

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

Definition at line 213 of file MoleculeDef.cpp.

213 {
214 Ifile << "MoleculeDef::printall:\n";
217 while ((an = logbook.get_next_node(an)) != NULL) {
218 file << (*(an->el));
219 }
220}
#define Ifile
Definition: prstream.h:207

◆ qatom_ps() [1/2]

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

Definition at line 70 of file MoleculeDef.h.

70{ return qatom_psh[n]; }

◆ qatom_ps() [2/2]

const DynLinArr< long > & Heed::MoleculeDef::qatom_ps ( void  ) const
inline

Definition at line 69 of file MoleculeDef.h.

69{ return qatom_psh; }

Referenced by Heed::operator<<().

◆ tqatom()

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

Definition at line 73 of file MoleculeDef.h.

73{ return tqatomh; }

Referenced by Heed::operator<<().

◆ verify()

void Heed::MoleculeDef::verify ( void  )

Definition at line 222 of file MoleculeDef.cpp.

222 {
223 mfunnamep("void MoleculeDef::verify(void)");
224 if (nameh == "none" && notationh == "none") return;
226 while ((an = MoleculeDef::get_logbook().get_next_node(an)) != NULL) {
227 if (an->el->nameh == nameh || an->el->notationh == notationh) {
228 funnw.ehdr(mcerr);
229 mcerr << "can not initialize two molecules "
230 << "with the same name or notation\n";
231 mcerr << "name=" << nameh << " notation=" << notationh << '\n';
232 spexit(mcerr);
233 }
234 }
235}
#define mfunnamep(string)
Definition: FunNameStack.h:77
#define spexit(stream)
Definition: FunNameStack.h:536

Referenced by MoleculeDef().

◆ Z_total()

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

Definition at line 71 of file MoleculeDef.h.

71{ return Z_totalh; }

Referenced by Heed::operator<<().


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