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

#include <AtomDef.h>

+ Inheritance diagram for Heed::AtomDef:

Public Member Functions

 AtomDef (void)
 
 AtomDef (const String &fnameh, const String &fnotationh, int fZh, double fAh)
 
 ~AtomDef ()
 
void print (std::ostream &file, int l=0) const
 
const Stringname (void) const
 
const Stringnotation (void) const
 
int Z (void) const
 
double A (void) const
 
void verify (void)
 
 macro_copy_total (AtomDef)
 

Static Public Member Functions

static void printall (std::ostream &file)
 
static AbsList< AtomDef * > & get_logbook (void)
 
static const AbsList< AtomDef * > & get_const_logbook (void)
 
static AtomDefget_AtomDef (const String &fnotation)
 
static double get_A (int fZ)
 
static AtomDefget_AtomDef (int fZ)
 

Detailed Description

Definition at line 61 of file AtomDef.h.

Constructor & Destructor Documentation

◆ AtomDef() [1/2]

Heed::AtomDef::AtomDef ( void  )

Definition at line 25 of file AtomDef.cpp.

25 : nameh("none"), notationh("none") {
26 AtomDef::get_logbook().append(this);
27}
static AbsList< AtomDef * > & get_logbook(void)
Definition: AtomDef.cpp:87

◆ AtomDef() [2/2]

Heed::AtomDef::AtomDef ( const String fnameh,
const String fnotationh,
int  fZh,
double  fAh 
)

Definition at line 29 of file AtomDef.cpp.

31 : nameh(fnameh), notationh(fnotationh), Zh(fZh), Ah(fAh) {
32 mfunname("AtomDef::AtomDef(...)");
33 check_econd21(fZh, < 1 ||, > max_poss_atom_z, mcerr);
34 verify();
35 AtomDef::get_logbook().append(this);
36}
#define check_econd21(a, sign1_b1_sign0, sign2_b2, stream)
Definition: FunNameStack.h:428
#define mfunname(string)
Definition: FunNameStack.h:67
void verify(void)
Definition: AtomDef.cpp:64
const int max_poss_atom_z
Definition: AtomDef.h:59
#define mcerr
Definition: prstream.h:135

◆ ~AtomDef()

Heed::AtomDef::~AtomDef ( )

Definition at line 105 of file AtomDef.cpp.

105{ AtomDef::get_logbook().remove(this); }

Member Function Documentation

◆ A()

double Heed::AtomDef::A ( void  ) const
inline

Definition at line 76 of file AtomDef.h.

76{ return Ah; }

Referenced by Heed::operator<<().

◆ get_A()

double Heed::AtomDef::get_A ( int  fZ)
static

Definition at line 38 of file AtomDef.cpp.

38 {
39 mfunnamep("double AtomDef::get_A(int fZ)");
42 while ((an = logbook.get_next_node(an)) != NULL) {
43 if (an->el->Z() == fZ) return an->el->A();
44 }
45 funnw.ehdr(mcerr);
46 mcerr << "Atom is not found, Z=" << fZ << '\n';
48 return 0.0; // to quiet compiler
49}
#define mfunnamep(string)
Definition: FunNameStack.h:77
#define spexit(stream)
Definition: FunNameStack.h:536
AbsListNode< T > * get_next_node(AbsListNode< T > *an) const
Definition: AbsList.h:175

Referenced by Heed::ElElasticScat::fill_hist().

◆ get_AtomDef() [1/2]

AtomDef * Heed::AtomDef::get_AtomDef ( const String fnotation)
static

Definition at line 96 of file AtomDef.cpp.

96 {
99 while ((an = logbook.get_next_node(an)) != NULL) {
100 if (an->el->notation() == fnotation) return an->el;
101 }
102 return NULL;
103}

Referenced by Heed::AtomMixDef::AtomMixDef().

◆ get_AtomDef() [2/2]

AtomDef * Heed::AtomDef::get_AtomDef ( int  fZ)
static

Definition at line 51 of file AtomDef.cpp.

51 {
52 mfunnamep("AtomDef* AtomDef::get_AtomDef(int fZ)");
55 while ((an = logbook.get_next_node(an)) != NULL) {
56 if (an->el->Z() == fZ) return an->el;
57 }
58 funnw.ehdr(mcerr);
59 mcerr << "Atom is not found, Z=" << fZ << '\n';
61 return NULL; // to quiet compiler
62}

◆ get_const_logbook()

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

Definition at line 92 of file AtomDef.cpp.

92 {
93 return AtomDef::get_logbook();
94}

◆ get_logbook()

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

Definition at line 87 of file AtomDef.cpp.

87 {
88 static AbsList<AtomDef*> logbook;
89 return logbook;
90}

Referenced by AtomDef(), get_A(), get_AtomDef(), get_const_logbook(), printall(), verify(), and ~AtomDef().

◆ macro_copy_total()

Heed::AtomDef::macro_copy_total ( AtomDef  )

◆ name()

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

Definition at line 73 of file AtomDef.h.

73{ return nameh; }

Referenced by Heed::operator<<().

◆ notation()

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

Definition at line 74 of file AtomDef.h.

74{ return notationh; }

Referenced by Heed::operator<<().

◆ print()

void Heed::AtomDef::print ( std::ostream &  file,
int  l = 0 
) const

Definition at line 12 of file AtomDef.cpp.

12 {
13 if (l > 0) file << (*this);
14}

◆ printall()

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

Definition at line 16 of file AtomDef.cpp.

16 {
17 Ifile << "AtomDef::printall:\n";
20 while ((an = logbook.get_next_node(an)) != NULL) {
21 file << (*(an->el));
22 }
23}
#define Ifile
Definition: prstream.h:207

◆ verify()

void Heed::AtomDef::verify ( void  )

Definition at line 64 of file AtomDef.cpp.

64 {
65 mfunnamep("void AtomDef::verify(void)");
66 if (nameh == "none" && notationh == "none") return;
69 while ((an = logbook.get_next_node(an)) != NULL) {
70 if (an->el->nameh == nameh || an->el->notationh == notationh) {
71 funnw.ehdr(mcerr);
72 mcerr << "cannot initialize two atoms with the same name or notation\n";
73 mcerr << "name=" << nameh << " notation=" << notationh << '\n';
75 }
76 }
77}

Referenced by AtomDef().

◆ Z()

int Heed::AtomDef::Z ( void  ) const
inline

Definition at line 75 of file AtomDef.h.

75{ return Zh; }

Referenced by Heed::operator<<().


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