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

#include <AtomDef.h>

+ Inheritance diagram for Heed::AtomMixDef:

Public Member Functions

 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
 

Additional Inherited Members

- 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 atomic mixtures. Pointers to atoms, weights and various mean parameters.

Definition at line 101 of file AtomDef.h.

Constructor & Destructor Documentation

◆ AtomMixDef() [1/7]

Heed::AtomMixDef::AtomMixDef ( )
inline

Default constructor.

Definition at line 121 of file AtomDef.h.

122 : qatomh(0),
123 Z_meanh(0.0),
124 A_meanh(0.0),
125 inv_A_meanh(0.0),
126 mean_ratio_Z_to_Ah(0.0),
127 NumberOfElectronsInGramh(0.0) {}

◆ AtomMixDef() [2/7]

Heed::AtomMixDef::AtomMixDef ( unsigned long  fqatom,
const std::vector< std::string > &  fatom_not,
const std::vector< double > &  fweight_quan 
)

Definition at line 112 of file AtomDef.cpp.

115 : qatomh(fqatom),
116 atomh(fqatom),
117 weight_quanh(fqatom, 0.0),
118 weight_massh(fqatom, 0.0),
119 Z_meanh(0.0),
120 A_meanh(0.0),
121 inv_A_meanh(0.0),
122 mean_ratio_Z_to_Ah(0.0) {
123 mfunnamep("AtomMixDef::AtomMixDef(...)");
124 check_econd11(fqatom, <= 0, mcerr);
125 check_econd12(fqatom, >, fatom_not.size(), mcerr);
126 check_econd12(fqatom, >, fweight_quan.size(), mcerr);
127
128 for (long n = 0; n < qatomh; ++n) {
129 AtomDef* ad = AtomDef::get_AtomDef(fatom_not[n]);
130 if (!ad) {
131 funnw.ehdr(mcerr);
132 mcerr << "cannot find atom with notation " << fatom_not[n]
133 << "\nIn particular, check the sequence of initialization\n";
134 spexit(mcerr);
135 }
136 atomh[n].put(ad);
137 }
138 double s = 0.0;
139 for (long n = 0; n < qatomh; n++) {
140 weight_quanh[n] = fweight_quan[n];
141 check_econd11(weight_quanh[n], <= 0, mcerr);
142 s += weight_quanh[n];
143 }
144 check_econd11(s, <= 0, mcerr);
145 if (s != 1.0) {
146 for (long n = 0; n < qatomh; n++) {
147 weight_quanh[n] /= s;
148 }
149 }
150 for (long n = 0; n < qatomh; n++) {
151 weight_massh[n] = weight_quanh[n] * atomh[n]->A();
152 }
153 s = 0.0;
154 for (long n = 0; n < qatomh; n++) {
155 s += weight_massh[n];
156 }
157 check_econd11(s, <= 0, mcerr);
158 if (s != 1.0) {
159 for (long n = 0; n < qatomh; n++) {
160 weight_massh[n] /= s;
161 }
162 }
163 for (long n = 0; n < qatomh; n++) {
164 Z_meanh += atomh[n]->Z() * weight_quanh[n];
165 A_meanh += atomh[n]->A() * weight_quanh[n];
166 inv_A_meanh += (1.0 / atomh[n]->A()) * weight_quanh[n];
167 }
168 mean_ratio_Z_to_Ah = Z_meanh / A_meanh;
169 NumberOfElectronsInGramh = mean_ratio_Z_to_Ah * (gram / mole) * Avogadro;
170}
#define check_econd11(a, signb, stream)
Definition: FunNameStack.h:155
#define mfunnamep(string)
Definition: FunNameStack.h:49
#define spexit(stream)
Definition: FunNameStack.h:256
#define check_econd12(a, sign, b, stream)
Definition: FunNameStack.h:163
static AtomDef * get_AtomDef(const std::string &fnotation)
Definition: AtomDef.cpp:100
#define mcerr
Definition: prstream.h:128

◆ AtomMixDef() [3/7]

Heed::AtomMixDef::AtomMixDef ( unsigned long  fqatom,
const std::vector< std::string > &  fatom_not,
const std::vector< long > &  fweight_quan 
)

Definition at line 172 of file AtomDef.cpp.

175 : qatomh(fqatom),
176 atomh(fqatom),
177 weight_quanh(fqatom, 0.0),
178 weight_massh(fqatom, 0.0),
179 Z_meanh(0.0),
180 A_meanh(0.0),
181 inv_A_meanh(0.0),
182 mean_ratio_Z_to_Ah(0.0) {
183 mfunnamep("AtomMixDef::AtomMixDef(...)");
184 check_econd11(fqatom, <= 0, mcerr);
185 check_econd12(fqatom, >, fatom_not.size(), mcerr);
186 check_econd12(fqatom, >, fweight_quan.size(), mcerr);
187
188 for (long n = 0; n < qatomh; ++n) {
189 AtomDef* ad = AtomDef::get_AtomDef(fatom_not[n]);
190 if (!ad) {
191 funnw.ehdr(mcerr);
192 mcerr << "cannot find atom with notation " << fatom_not[n]
193 << "\nIn particular, check the sequence of initialization\n";
194 spexit(mcerr);
195 }
196 atomh[n].put(ad);
197 }
198 double s = 0.0;
199 for (long n = 0; n < qatomh; n++) {
200 weight_quanh[n] = fweight_quan[n];
201 check_econd11(weight_quanh[n], <= 0, mcerr);
202 s += weight_quanh[n];
203 }
204 check_econd11(s, <= 0, mcerr);
205 if (s != 1.0) {
206 for (long n = 0; n < qatomh; n++) {
207 weight_quanh[n] /= s;
208 }
209 }
210 for (long n = 0; n < qatomh; n++) {
211 weight_massh[n] = weight_quanh[n] * atomh[n]->A();
212 }
213 s = 0.0;
214 for (long n = 0; n < qatomh; n++) {
215 s += weight_massh[n];
216 }
217 check_econd11(s, <= 0, mcerr);
218 if (s != 1.0) {
219 for (long n = 0; n < qatomh; n++) {
220 weight_massh[n] /= s;
221 }
222 }
223 for (long n = 0; n < qatomh; n++) {
224 Z_meanh += atomh[n]->Z() * weight_quanh[n];
225 A_meanh += atomh[n]->A() * weight_quanh[n];
226 inv_A_meanh += (1.0 / atomh[n]->A()) * weight_quanh[n];
227 }
228 mean_ratio_Z_to_Ah = Z_meanh / A_meanh;
229 NumberOfElectronsInGramh = mean_ratio_Z_to_Ah * (gram / mole) * Avogadro;
230}

◆ AtomMixDef() [4/7]

Heed::AtomMixDef::AtomMixDef ( const std::string &  fatom_not)

Definition at line 233 of file AtomDef.cpp.

234 : qatomh(1),
235 atomh(1),
236 weight_quanh(1),
237 weight_massh(1),
238 Z_meanh(0.0),
239 A_meanh(0.0),
240 inv_A_meanh(0.0),
241 mean_ratio_Z_to_Ah(0.0) {
242 mfunnamep("AtomMixDef::AtomMixDef(...)");
243 AtomDef* ad = AtomDef::get_AtomDef(fatom_not);
244 if (!ad) {
245 funnw.ehdr(mcerr);
246 mcerr << "cannot find atom with notation " << fatom_not
247 << "\nIn particular, check the sequence of initialization\n";
248 spexit(mcerr);
249 }
250 atomh[0].put(ad);
251
252 weight_quanh[0] = 1.0;
253 weight_massh[0] = 1.0;
254
255 Z_meanh += atomh[0]->Z();
256 A_meanh += atomh[0]->A();
257 inv_A_meanh += (1.0 / atomh[0]->A());
258 mean_ratio_Z_to_Ah = Z_meanh / A_meanh;
259 NumberOfElectronsInGramh = mean_ratio_Z_to_Ah * (gram / mole) * Avogadro;
260}

◆ AtomMixDef() [5/7]

Heed::AtomMixDef::AtomMixDef ( const std::string &  fatom_not1,
double  fweight_quan1,
const std::string &  fatom_not2,
double  fweight_quan2 
)

Definition at line 263 of file AtomDef.cpp.

265 : qatomh(2),
266 atomh(2),
267 weight_quanh(2),
268 weight_massh(2),
269 Z_meanh(0.0),
270 A_meanh(0.0),
271 inv_A_meanh(0.0),
272 mean_ratio_Z_to_Ah(0.0) {
273 mfunnamep("AtomMixDef::AtomMixDef(...)");
274 std::vector<std::string> fatom_not(2);
275 fatom_not[0] = fatom_not1;
276 fatom_not[1] = fatom_not2;
277
278 for (long n = 0; n < qatomh; ++n) {
279 AtomDef* ad = AtomDef::get_AtomDef(fatom_not[n]);
280 if (!ad) {
281 funnw.ehdr(mcerr);
282 mcerr << "cannot find atom with notation " << fatom_not[n]
283 << "\nIn particular, check the sequence of initialization\n";
284 spexit(mcerr);
285 }
286 atomh[n].put(ad);
287 }
288 weight_quanh[0] = fweight_quan1;
289 weight_quanh[1] = fweight_quan2;
290 double s = 0.0;
291 for (long n = 0; n < qatomh; n++) {
292 check_econd11(weight_quanh[n], <= 0, mcerr);
293 s += weight_quanh[n];
294 }
295 check_econd11(s, <= 0, mcerr);
296 if (s != 1.0) {
297 for (long n = 0; n < qatomh; n++) {
298 weight_quanh[n] /= s;
299 }
300 }
301 for (long n = 0; n < qatomh; n++) {
302 weight_massh[n] = weight_quanh[n] * atomh[n]->A();
303 }
304 s = 0.0;
305 for (long n = 0; n < qatomh; n++) {
306 s += weight_massh[n];
307 }
308 check_econd11(s, <= 0, mcerr);
309 if (s != 1.0) {
310 for (long n = 0; n < qatomh; n++) {
311 weight_massh[n] /= s;
312 }
313 }
314 for (long n = 0; n < qatomh; n++) {
315 Z_meanh += atomh[n]->Z() * weight_quanh[n];
316 A_meanh += atomh[n]->A() * weight_quanh[n];
317 inv_A_meanh += (1.0 / atomh[n]->A()) * weight_quanh[n];
318 }
319 mean_ratio_Z_to_Ah = Z_meanh / A_meanh;
320 NumberOfElectronsInGramh = mean_ratio_Z_to_Ah * (gram / mole) * Avogadro;
321}

◆ AtomMixDef() [6/7]

Heed::AtomMixDef::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 
)

Definition at line 324 of file AtomDef.cpp.

327 : qatomh(3),
328 atomh(3),
329 weight_quanh(3),
330 weight_massh(3),
331 Z_meanh(0.0),
332 A_meanh(0.0),
333 inv_A_meanh(0.0),
334 mean_ratio_Z_to_Ah(0.0) {
335
336 mfunnamep("AtomMixDef::AtomMixDef(...)");
337 std::vector<std::string> fatom_not(3);
338 fatom_not[0] = fatom_not1;
339 fatom_not[1] = fatom_not2;
340 fatom_not[2] = fatom_not3;
341
342 for (long n = 0; n < qatomh; ++n) {
343 AtomDef* ad = AtomDef::get_AtomDef(fatom_not[n]);
344 if (!ad) {
345 funnw.ehdr(mcerr);
346 mcerr << "cannot find atom with notation " << fatom_not[n]
347 << "\nIn particular, check the sequence of initialization\n";
348 spexit(mcerr);
349 }
350 atomh[n].put(ad);
351 }
352 weight_quanh[0] = fweight_quan1;
353 weight_quanh[1] = fweight_quan2;
354 weight_quanh[2] = fweight_quan3;
355 double s = 0.0;
356 for (long n = 0; n < qatomh; n++) {
357 check_econd11(weight_quanh[n], <= 0, mcerr);
358 s += weight_quanh[n];
359 }
360 check_econd11(s, <= 0, mcerr);
361 if (s != 1.0) {
362 for (long n = 0; n < qatomh; n++) {
363 weight_quanh[n] /= s;
364 }
365 }
366 for (long n = 0; n < qatomh; n++) {
367 weight_massh[n] = weight_quanh[n] * atomh[n]->A();
368 }
369 s = 0.0;
370 for (long n = 0; n < qatomh; n++) {
371 s += weight_massh[n];
372 }
373 check_econd11(s, <= 0, mcerr);
374 if (s != 1.0) {
375 for (long n = 0; n < qatomh; n++) {
376 weight_massh[n] /= s;
377 }
378 }
379 for (long n = 0; n < qatomh; n++) {
380 Z_meanh += atomh[n]->Z() * weight_quanh[n];
381 A_meanh += atomh[n]->A() * weight_quanh[n];
382 inv_A_meanh += (1.0 / atomh[n]->A()) * weight_quanh[n];
383 }
384 mean_ratio_Z_to_Ah = Z_meanh / A_meanh;
385 NumberOfElectronsInGramh = mean_ratio_Z_to_Ah * (gram / mole) * Avogadro;
386}

◆ AtomMixDef() [7/7]

Heed::AtomMixDef::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 
)

Definition at line 389 of file AtomDef.cpp.

393 : qatomh(4),
394 atomh(4),
395 weight_quanh(4),
396 weight_massh(4),
397 Z_meanh(0.0),
398 A_meanh(0.0),
399 inv_A_meanh(0.0),
400 mean_ratio_Z_to_Ah(0.0) {
401 mfunnamep("AtomMixDef::AtomMixDef(...)");
402 std::vector<std::string> fatom_not(4);
403 fatom_not[0] = fatom_not1;
404 fatom_not[1] = fatom_not2;
405 fatom_not[2] = fatom_not3;
406 fatom_not[3] = fatom_not4;
407
408 for (long k = 0; k < qatomh; k++) {
409 AtomDef* ad = AtomDef::get_AtomDef(fatom_not[k]);
410 if (!ad) {
411 funnw.ehdr(mcerr);
412 mcerr << "cannot find atom with notation " << fatom_not[k]
413 << "\nIn particular, check the sequence of initialization\n";
414 spexit(mcerr);
415 }
416 atomh[k].put(ad);
417 }
418 weight_quanh[0] = fweight_quan1;
419 weight_quanh[1] = fweight_quan2;
420 weight_quanh[2] = fweight_quan3;
421 weight_quanh[3] = fweight_quan4;
422 double s = 0.0;
423 for (long n = 0; n < qatomh; n++) {
424 check_econd11(weight_quanh[n], <= 0, mcerr);
425 s += weight_quanh[n];
426 }
427 check_econd11(s, <= 0, mcerr);
428 if (s != 1.0) {
429 for (long n = 0; n < qatomh; n++) {
430 weight_quanh[n] /= s;
431 }
432 }
433 for (long n = 0; n < qatomh; n++) {
434 weight_massh[n] = weight_quanh[n] * atomh[n]->A();
435 }
436 s = 0.0;
437 for (long n = 0; n < qatomh; n++) {
438 s += weight_massh[n];
439 }
440 check_econd11(s, <= 0, mcerr);
441 if (s != 1.0) {
442 for (long n = 0; n < qatomh; n++) {
443 weight_massh[n] /= s;
444 }
445 }
446 for (long n = 0; n < qatomh; n++) {
447 Z_meanh += atomh[n]->Z() * weight_quanh[n];
448 A_meanh += atomh[n]->A() * weight_quanh[n];
449 inv_A_meanh += (1.0 / atomh[n]->A()) * weight_quanh[n];
450 }
451 mean_ratio_Z_to_Ah = Z_meanh / A_meanh;
452 NumberOfElectronsInGramh = mean_ratio_Z_to_Ah * (gram / mole) * Avogadro;
453}

Member Function Documentation

◆ A_mean()

double Heed::AtomMixDef::A_mean ( ) const
inline

Definition at line 151 of file AtomDef.h.

151{ return A_meanh; }

Referenced by Heed::operator<<().

◆ atom() [1/2]

const std::vector< PassivePtr< AtomDef > > & Heed::AtomMixDef::atom ( ) const
inline

Definition at line 144 of file AtomDef.h.

144{ return atomh; }

Referenced by Heed::MoleculeDef::MoleculeDef(), and Heed::operator<<().

◆ atom() [2/2]

PassivePtr< AtomDef > Heed::AtomMixDef::atom ( long  n) const
inline

Definition at line 145 of file AtomDef.h.

145{ return atomh[n]; }

◆ inv_A_mean()

double Heed::AtomMixDef::inv_A_mean ( ) const
inline

Definition at line 152 of file AtomDef.h.

152{ return inv_A_meanh; }

Referenced by Heed::operator<<().

◆ mean_ratio_Z_to_A()

double Heed::AtomMixDef::mean_ratio_Z_to_A ( ) const
inline

Definition at line 153 of file AtomDef.h.

153{ return mean_ratio_Z_to_Ah; }

Referenced by Heed::operator<<().

◆ NumberOfElectronsInGram()

double Heed::AtomMixDef::NumberOfElectronsInGram ( ) const
inline

Definition at line 154 of file AtomDef.h.

154 {
155 return NumberOfElectronsInGramh;
156 }

Referenced by Heed::operator<<().

◆ print()

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

Reimplemented from Heed::RegPassivePtr.

Reimplemented in Heed::MatterDef, Heed::MoleculeDef, and Heed::GasDef.

Definition at line 455 of file AtomDef.cpp.

455 {
456 if (l > 0) file << (*this);
457}

◆ qatom()

long Heed::AtomMixDef::qatom ( ) const
inline

◆ weight_mass() [1/2]

const std::vector< double > & Heed::AtomMixDef::weight_mass ( ) const
inline

Definition at line 147 of file AtomDef.h.

147{ return weight_massh; }

Referenced by Heed::operator<<().

◆ weight_mass() [2/2]

double Heed::AtomMixDef::weight_mass ( long  n) const
inline

Definition at line 149 of file AtomDef.h.

149{ return weight_massh[n]; }

◆ weight_quan() [1/2]

const std::vector< double > & Heed::AtomMixDef::weight_quan ( ) const
inline

Definition at line 146 of file AtomDef.h.

146{ return weight_quanh; }

Referenced by Heed::operator<<().

◆ weight_quan() [2/2]

double Heed::AtomMixDef::weight_quan ( long  n) const
inline

Definition at line 148 of file AtomDef.h.

148{ return weight_quanh[n]; }

◆ Z_mean()

double Heed::AtomMixDef::Z_mean ( ) const
inline

Definition at line 150 of file AtomDef.h.

150{ return Z_meanh; }

Referenced by Heed::operator<<().


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