Garfield++ v1r0
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 (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
 

Detailed Description

Definition at line 101 of file AtomDef.h.

Constructor & Destructor Documentation

◆ AtomMixDef() [1/7]

Heed::AtomMixDef::AtomMixDef ( void  )
inline

Definition at line 118 of file AtomDef.h.

119 : qatomh(0),
120 Z_meanh(0.0),
121 A_meanh(0.0),
122 inv_A_meanh(0.0),
123 mean_ratio_Z_to_Ah(0.0),
124 NumberOfElectronsInGramh(0.0) {
125 ;
126 }

◆ AtomMixDef() [2/7]

Heed::AtomMixDef::AtomMixDef ( long  fqatom,
const DynLinArr< String > &  fatom_not,
const DynLinArr< double > &  fweight_quan 
)

Definition at line 107 of file AtomDef.cpp.

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

◆ AtomMixDef() [3/7]

Heed::AtomMixDef::AtomMixDef ( long  fqatom,
const DynLinArr< String > &  fatom_not,
const DynLinArr< long > &  fweight_quan 
)

Definition at line 168 of file AtomDef.cpp.

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

◆ AtomMixDef() [4/7]

Heed::AtomMixDef::AtomMixDef ( const String fatom_not)

Definition at line 231 of file AtomDef.cpp.

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

◆ AtomMixDef() [5/7]

Heed::AtomMixDef::AtomMixDef ( const String fatom_not1,
double  fweight_quan1,
const String fatom_not2,
double  fweight_quan2 
)

Definition at line 262 of file AtomDef.cpp.

264 : qatomh(2),
265 atomh(2),
266 weight_quanh(2),
267 weight_massh(2),
268 Z_meanh(0.0),
269 A_meanh(0.0),
270 inv_A_meanh(0.0),
271 mean_ratio_Z_to_Ah(0.0) {
272 mfunnamep("AtomMixDef::AtomMixDef(...)");
273 DynLinArr<String> fatom_not(2);
274 fatom_not[0] = fatom_not1;
275 fatom_not[1] = fatom_not2;
276
277 long n;
278 for (n = 0; n < qatomh; ++n) {
279 AtomDef* ad = AtomDef::get_AtomDef(fatom_not[n]);
280 if (ad == NULL) {
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 (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 (n = 0; n < qatomh; n++) {
298 weight_quanh[n] /= s;
299 }
300 }
301 for (n = 0; n < qatomh; n++) {
302 weight_massh[n] = weight_quanh[n] * atomh[n]->A();
303 }
304 s = 0.0;
305 for (n = 0; n < qatomh; n++) {
306 s += weight_massh[n];
307 }
308 check_econd11(s, <= 0, mcerr);
309 if (s != 1.0) {
310 for (n = 0; n < qatomh; n++) {
311 weight_massh[n] /= s;
312 }
313 }
314 for (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
322}

◆ AtomMixDef() [6/7]

Heed::AtomMixDef::AtomMixDef ( const String fatom_not1,
double  fweight_quan1,
const String fatom_not2,
double  fweight_quan2,
const String fatom_not3,
double  fweight_quan3 
)

Definition at line 325 of file AtomDef.cpp.

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

◆ AtomMixDef() [7/7]

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

Definition at line 392 of file AtomDef.cpp.

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

Member Function Documentation

◆ A_mean()

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

Definition at line 150 of file AtomDef.h.

150{ return A_meanh; }

Referenced by Heed::eiparticle::Bethe_Bloch_en_loss(), and Heed::operator<<().

◆ atom() [1/2]

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

Definition at line 144 of file AtomDef.h.

144{ return atomh[n]; }

◆ atom() [2/2]

const DynLinArr< PassivePtr< AtomDef > > & Heed::AtomMixDef::atom ( void  ) const
inline

Definition at line 143 of file AtomDef.h.

143{ return atomh; }

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

◆ inv_A_mean()

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

Definition at line 151 of file AtomDef.h.

151{ return inv_A_meanh; }

Referenced by Heed::operator<<().

◆ mean_ratio_Z_to_A()

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

Definition at line 152 of file AtomDef.h.

152{ return mean_ratio_Z_to_Ah; }

Referenced by Heed::operator<<().

◆ NumberOfElectronsInGram()

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

Definition at line 153 of file AtomDef.h.

153 {
154 return NumberOfElectronsInGramh;
155 }

Referenced by Heed::operator<<().

◆ print()

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

Definition at line 459 of file AtomDef.cpp.

459 {
460 if (l > 0) file << (*this);
461}

◆ qatom()

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

◆ weight_mass() [1/2]

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

Definition at line 148 of file AtomDef.h.

148{ return weight_massh[n]; }

◆ weight_mass() [2/2]

const DynLinArr< double > & Heed::AtomMixDef::weight_mass ( void  ) const
inline

Definition at line 146 of file AtomDef.h.

146{ return weight_massh; }

Referenced by Heed::operator<<().

◆ weight_quan() [1/2]

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

Definition at line 147 of file AtomDef.h.

147{ return weight_quanh[n]; }

◆ weight_quan() [2/2]

const DynLinArr< double > & Heed::AtomMixDef::weight_quan ( void  ) const
inline

Definition at line 145 of file AtomDef.h.

145{ return weight_quanh; }

Referenced by Heed::operator<<().

◆ Z_mean()

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

Definition at line 149 of file AtomDef.h.

149{ return Z_meanh; }

Referenced by Heed::eiparticle::Bethe_Bloch_en_loss(), and Heed::operator<<().


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