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

#include <MatterDef.h>

+ Inheritance diagram for Heed::MatterDef:

Public Member Functions

 MatterDef ()
 
 MatterDef (const std::string &fname, const std::string &fnotation, long fqatom, const std::vector< std::string > &fatom_not, const std::vector< double > &fweight_quan, double fdensity, double ftemperature)
 
 MatterDef (const std::string &fname, const std::string &fnotation, const std::string &fatom_not, double fdensity, double ftemperature)
 
 MatterDef (const std::string &fname, const std::string &fnotation, const std::string &fatom_not1, double fweight_quan1, const std::string &fatom_not2, double fweight_quan2, double fdensity, double ftemperature)
 
 MatterDef (const std::string &fname, const std::string &fnotation, const std::string &fatom_not1, double fweight_quan1, const std::string &fatom_not2, double fweight_quan2, const std::string &fatom_not3, double fweight_quan3, double fdensity, double ftemperature)
 
 ~MatterDef ()
 
const std::string & name () const
 
const std::string & notation () const
 
double density () const
 
double temperature () const
 
double I_eff () const
 
void verify ()
 Check that there is no matter with the same name in the container.
 
virtual void print (std::ostream &file, int l) const
 
virtual MatterDefcopy () 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 void verify (const std::string &fname, const std::string &fnotation)
 
static std::list< MatterDef * > & get_logbook ()
 
static const std::list< MatterDef * > & get_const_logbook ()
 
static MatterDefget_MatterDef (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 matter (material or any media). Only the basic information: the name, the notation, the atomic mixture, temperature, density, effective ionization potential.

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 18 of file MatterDef.h.

Constructor & Destructor Documentation

◆ MatterDef() [1/5]

Heed::MatterDef::MatterDef ( )

Definition at line 12 of file MatterDef.cpp.

12 : nameh("none"), notationh("none") {
13 MatterDef::get_logbook().push_back(this);
14}
static std::list< MatterDef * > & get_logbook()
Definition: MatterDef.cpp:126

Referenced by copy(), and Heed::GasDef::GasDef().

◆ MatterDef() [2/5]

Heed::MatterDef::MatterDef ( const std::string &  fname,
const std::string &  fnotation,
long  fqatom,
const std::vector< std::string > &  fatom_not,
const std::vector< double > &  fweight_quan,
double  fdensity,
double  ftemperature 
)

Definition at line 16 of file MatterDef.cpp.

20 : AtomMixDef(fqatom, fatom_not, fweight_quan),
21 nameh(fname),
22 notationh(fnotation),
23 temperatureh(ftemperature),
24 densityh(fdensity) {
25 mfunname("MatterDef::MatterDef(...many atoms...)");
26 calc_I_eff();
27 verify();
28 MatterDef::get_logbook().push_back(this);
29}
#define mfunname(string)
Definition: FunNameStack.h:45
AtomMixDef()
Default constructor.
Definition: AtomDef.h:121
void verify()
Check that there is no matter with the same name in the container.
Definition: MatterDef.cpp:77

◆ MatterDef() [3/5]

Heed::MatterDef::MatterDef ( const std::string &  fname,
const std::string &  fnotation,
const std::string &  fatom_not,
double  fdensity,
double  ftemperature 
)

Definition at line 31 of file MatterDef.cpp.

34 : AtomMixDef(fatom_not),
35 nameh(fname),
36 notationh(fnotation),
37 temperatureh(ftemperature),
38 densityh(fdensity) {
39 mfunname("MatterDef::MatterDef(...1 atom...)");
40 calc_I_eff();
41 verify();
42 MatterDef::get_logbook().push_back(this);
43}

◆ MatterDef() [4/5]

Heed::MatterDef::MatterDef ( const std::string &  fname,
const std::string &  fnotation,
const std::string &  fatom_not1,
double  fweight_quan1,
const std::string &  fatom_not2,
double  fweight_quan2,
double  fdensity,
double  ftemperature 
)

Definition at line 45 of file MatterDef.cpp.

49 : AtomMixDef(fatom_not1, fweight_quan1, fatom_not2, fweight_quan2),
50 nameh(fname),
51 notationh(fnotation),
52 temperatureh(ftemperature),
53 densityh(fdensity) {
54 mfunname("MatterDef::MatterDef(...2 atoms...)");
55 calc_I_eff();
56 verify();
57 MatterDef::get_logbook().push_back(this);
58}

◆ MatterDef() [5/5]

Heed::MatterDef::MatterDef ( const std::string &  fname,
const std::string &  fnotation,
const std::string &  fatom_not1,
double  fweight_quan1,
const std::string &  fatom_not2,
double  fweight_quan2,
const std::string &  fatom_not3,
double  fweight_quan3,
double  fdensity,
double  ftemperature 
)

Definition at line 60 of file MatterDef.cpp.

65 : AtomMixDef(fatom_not1, fweight_quan1, fatom_not2, fweight_quan2,
66 fatom_not3, fweight_quan3),
67 nameh(fname),
68 notationh(fnotation),
69 temperatureh(ftemperature),
70 densityh(fdensity) {
71 mfunname("MatterDef::MatterDef(...2 atoms...)");
72 calc_I_eff();
73 verify();
74 MatterDef::get_logbook().push_back(this);
75}

◆ ~MatterDef()

Heed::MatterDef::~MatterDef ( )

Definition at line 158 of file MatterDef.cpp.

158{ MatterDef::get_logbook().remove(this); }

Member Function Documentation

◆ copy()

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

Reimplemented from Heed::RegPassivePtr.

Reimplemented in Heed::GasDef.

Definition at line 66 of file MatterDef.h.

66{ return new MatterDef(*this); }

◆ density()

double Heed::MatterDef::density ( ) const
inline

Definition at line 51 of file MatterDef.h.

51{ return densityh; }

Referenced by Heed::operator<<().

◆ get_const_logbook()

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

Definition at line 131 of file MatterDef.cpp.

131 {
132 return MatterDef::get_logbook();
133}

◆ get_logbook()

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

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

Definition at line 126 of file MatterDef.cpp.

126 {
127 static std::list<MatterDef*> logbook;
128 return logbook;
129}

Referenced by get_const_logbook(), get_MatterDef(), MatterDef(), printall(), verify(), and ~MatterDef().

◆ get_MatterDef()

MatterDef * Heed::MatterDef::get_MatterDef ( const std::string &  fnotation)
static

Return the adress of the matter with this notation if it is registered. Otherwise return NULL.

Definition at line 135 of file MatterDef.cpp.

135 {
136 std::list<MatterDef*>& logbook = MatterDef::get_logbook();
137 std::list<MatterDef*>::const_iterator it;
138 std::list<MatterDef*>::const_iterator end = logbook.end();
139 for (it = logbook.begin(); it != end; ++it) {
140 if ((*it)->notation() == fnotation) return *it;
141 }
142 return NULL;
143}

Referenced by Heed::HeedMatterDef::HeedMatterDef().

◆ I_eff()

double Heed::MatterDef::I_eff ( ) const
inline

Definition at line 53 of file MatterDef.h.

53{ return I_effh; }

Referenced by Heed::operator<<().

◆ name()

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

Definition at line 49 of file MatterDef.h.

49{ return nameh; }

Referenced by Heed::operator<<().

◆ notation()

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

Definition at line 50 of file MatterDef.h.

50{ return notationh; }

Referenced by Heed::operator<<().

◆ print()

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

Reimplemented from Heed::AtomMixDef.

Reimplemented in Heed::GasDef.

Definition at line 112 of file MatterDef.cpp.

112 {
113 if (l > 0) file << (*this);
114}

◆ printall()

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

Definition at line 116 of file MatterDef.cpp.

116 {
117 Ifile << "MatterDef::printall:\n";
118 std::list<MatterDef*>& logbook = MatterDef::get_logbook();
119 std::list<MatterDef*>::const_iterator it;
120 std::list<MatterDef*>::const_iterator end = logbook.end();
121 for (it = logbook.begin(); it != end; ++it) {
122 (*it)->print(file, 1);
123 }
124}
#define Ifile
Definition: prstream.h:196

◆ temperature()

double Heed::MatterDef::temperature ( ) const
inline

Definition at line 52 of file MatterDef.h.

52{ return temperatureh; }

Referenced by Heed::operator<<().

◆ verify() [1/2]

void Heed::MatterDef::verify ( )

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

Definition at line 77 of file MatterDef.cpp.

77 {
78 mfunnamep("void MatterDef::verify(void)");
79 if (nameh == "none" && notationh == "none") return;
80 std::list<MatterDef*>& logbook = MatterDef::get_logbook();
81 std::list<MatterDef*>::const_iterator it;
82 std::list<MatterDef*>::const_iterator end = logbook.end();
83 for (it = logbook.begin(); it != end; ++it) {
84 if ((*it)->nameh == nameh || (*it)->notationh == notationh) {
85 funnw.ehdr(mcerr);
86 mcerr << "cannot initialize two matters "
87 << "with the same name or notation\n";
88 mcerr << "name=" << nameh << " notation=" << notationh << '\n';
90 }
91 }
92}
#define mfunnamep(string)
Definition: FunNameStack.h:49
#define spexit(stream)
Definition: FunNameStack.h:256
#define mcerr
Definition: prstream.h:128

Referenced by Heed::GasDef::GasDef(), and MatterDef().

◆ verify() [2/2]

void Heed::MatterDef::verify ( const std::string &  fname,
const std::string &  fnotation 
)
static

Definition at line 94 of file MatterDef.cpp.

94 {
96 "void MatterDef::verify(const std::string& fname, const std::string& "
97 "fnotation)");
98 std::list<MatterDef*>& logbook = MatterDef::get_logbook();
99 std::list<MatterDef*>::const_iterator it;
100 std::list<MatterDef*>::const_iterator end = logbook.end();
101 for (it = logbook.begin(); it != end; ++it) {
102 if ((*it)->nameh == fname || (*it)->notationh == fnotation) {
103 funnw.ehdr(mcerr);
104 mcerr << "cannot initialize two matters "
105 << "with the same name or notation\n";
106 mcerr << "name=" << fname << " notation=" << fnotation << '\n';
107 spexit(mcerr);
108 }
109 }
110}

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