Garfield++ 5.0
A toolkit for the detailed simulation of particle detectors based on ionisation measurement in gases and semiconductors
Loading...
Searching...
No Matches
MatterDef.cpp
Go to the documentation of this file.
1#include <iomanip>
5
6// 1998-2004 I. Smirnov
7
8namespace Heed {
9
10void MatterDef::calc_I_eff() { I_effh = Z_mean() * 12.0 * CLHEP::eV; }
11
12MatterDef::MatterDef(const std::string& fname, const std::string& fnotation,
13 long fqatom, const std::vector<std::string>& fatom_not,
14 const std::vector<double>& fweight_quan, double fdensity,
15 double ftemperature)
16 : AtomMixDef(fqatom, fatom_not, fweight_quan),
17 nameh(fname),
18 notationh(fnotation),
19 temperatureh(ftemperature),
20 densityh(fdensity) {
21 mfunname("MatterDef::MatterDef(...)");
22 calc_I_eff();
23}
24
25MatterDef::MatterDef(const std::string& fname, const std::string& fnotation,
26 const std::string& fatom_not, double fdensity,
27 double ftemperature) :
28 MatterDef(fname, fnotation, 1, {fatom_not}, {1.}, fdensity, ftemperature) {
29
30}
31
32MatterDef::MatterDef(const std::string& fname, const std::string& fnotation,
33 const std::string& fatom_not1, double fweight_quan1,
34 const std::string& fatom_not2, double fweight_quan2,
35 double fdensity, double ftemperature) :
36 MatterDef(fname, fnotation, 2, {fatom_not1, fatom_not2},
37 {fweight_quan1, fweight_quan2}, fdensity, ftemperature) {
38
39}
40
41MatterDef::MatterDef(const std::string& fname, const std::string& fnotation,
42 const std::string& fatom_not1, double fweight_quan1,
43 const std::string& fatom_not2, double fweight_quan2,
44 const std::string& fatom_not3, double fweight_quan3,
45 double fdensity, double ftemperature) :
46 MatterDef(fname, fnotation, 3, {fatom_not1, fatom_not2, fatom_not3},
47 {fweight_quan1, fweight_quan2, fweight_quan3},
48 fdensity, ftemperature) {
49
50}
51
52void MatterDef::print(std::ostream& file, int l) const {
53 if (l > 0) file << (*this);
54}
55
56std::ostream& operator<<(std::ostream& file, const MatterDef& f) {
57 mfunname("ostream& operator << (ostream& file, const MatterDef& f)");
58 Ifile << "MatterDef: name=" << std::setw(10) << f.name()
59 << " notation=" << std::setw(3) << f.notation() << '\n';
60 indn.n += 2;
61 Ifile << "density/(gram/cm3)=" << f.density() / (CLHEP::gram / CLHEP::cm3)
62 << " temperature/kelvin=" << f.temperature() / CLHEP::kelvin
63 << " I_eff/eV=" << f.I_eff() / CLHEP::eV << '\n';
64 f.AtomMixDef::print(file, 1);
65 indn.n -= 2;
66 return file;
67}
68
69}
#define mfunname(string)
AtomMixDef()=default
Default constructor.
double Z_mean() const
Definition AtomDef.h:108
const std::string & notation() const
Definition MatterDef.h:45
const std::string & name() const
Definition MatterDef.h:44
double I_eff() const
Definition MatterDef.h:48
MatterDef()=default
double temperature() const
Definition MatterDef.h:47
void print(std::ostream &file, int l) const
Definition MatterDef.cpp:52
double density() const
Definition MatterDef.h:46
Definition BGMesh.cpp:6
std::ostream & operator<<(std::ostream &file, const BGMesh &bgm)
Definition BGMesh.cpp:37
indentation indn
Definition prstream.cpp:15
#define Ifile
Definition prstream.h:195