10void MatterDef::calc_I_eff() { I_effh =
Z_mean() * 12.0 * CLHEP::eV; }
17 long fqatom,
const std::vector<std::string>& fatom_not,
18 const std::vector<double>& fweight_quan,
double fdensity,
23 temperatureh(ftemperature),
25 mfunname(
"MatterDef::MatterDef(...many atoms...)");
32 const std::string& fatom_not,
double fdensity,
37 temperatureh(ftemperature),
39 mfunname(
"MatterDef::MatterDef(...1 atom...)");
46 const std::string& fatom_not1,
double fweight_quan1,
47 const std::string& fatom_not2,
double fweight_quan2,
48 double fdensity,
double ftemperature)
49 :
AtomMixDef(fatom_not1, fweight_quan1, fatom_not2, fweight_quan2),
52 temperatureh(ftemperature),
54 mfunname(
"MatterDef::MatterDef(...2 atoms...)");
61 const std::string& fatom_not1,
double fweight_quan1,
62 const std::string& fatom_not2,
double fweight_quan2,
63 const std::string& fatom_not3,
double fweight_quan3,
64 double fdensity,
double ftemperature)
65 :
AtomMixDef(fatom_not1, fweight_quan1, fatom_not2, fweight_quan2,
66 fatom_not3, fweight_quan3),
69 temperatureh(ftemperature),
71 mfunname(
"MatterDef::MatterDef(...2 atoms...)");
78 mfunnamep(
"void MatterDef::verify(void)");
79 if (nameh ==
"none" && notationh ==
"none")
return;
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) {
86 mcerr <<
"cannot initialize two matters "
87 <<
"with the same name or notation\n";
88 mcerr <<
"name=" << nameh <<
" notation=" << notationh <<
'\n';
96 "void MatterDef::verify(const std::string& fname, const std::string& "
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) {
104 mcerr <<
"cannot initialize two matters "
105 <<
"with the same name or notation\n";
106 mcerr <<
"name=" << fname <<
" notation=" << fnotation <<
'\n';
113 if (l > 0) file << (*this);
117 Ifile <<
"MatterDef::printall:\n";
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);
127 static std::list<MatterDef*> 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;
146 mfunname(
"ostream& operator << (ostream& file, const MatterDef& f)");
147 Ifile <<
"MatterDef: name=" << std::setw(10) << f.
name()
148 <<
" notation=" << std::setw(3) << f.
notation() <<
'\n';
150 Ifile <<
"density/(gram/cm3)=" << f.
density() / (CLHEP::gram / CLHEP::cm3)
151 <<
" temperature/kelvin=" << f.
temperature() / CLHEP::kelvin
152 <<
" I_eff/eV=" << f.
I_eff() / CLHEP::eV <<
'\n';
153 f.AtomMixDef::print(file, 1);
#define mfunnamep(string)
static const std::list< MatterDef * > & get_const_logbook()
const std::string & notation() const
const std::string & name() const
static std::list< MatterDef * > & get_logbook()
static MatterDef * get_MatterDef(const std::string &fnotation)
double temperature() 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
static void printall(std::ostream &file)
std::ostream & operator<<(std::ostream &file, const BGMesh &bgm)