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

#include <HeedMatterDef.h>

Public Member Functions

 HeedMatterDef ()=default
 Default constructor.
 
 HeedMatterDef (EnergyMesh *fenergy_mesh, MatterDef *amatter, const std::vector< AtomPhotoAbsCS * > &faapacs, double fW=0.0, double fF=standard_factor_Fano)
 
 HeedMatterDef (EnergyMesh *fenergy_mesh, GasDef *agas, const std::vector< MolecPhotoAbsCS * > &fampacs, double fW=0.0, double fF=standard_factor_Fano)
 
 HeedMatterDef (EnergyMesh *fenergy_mesh, const std::string &gas_notation, const std::vector< MolecPhotoAbsCS * > &fampacs, double fW=0.0, double fF=standard_factor_Fano)
 
void replace_epsi12 (const std::string &file_name)
 
void print (std::ostream &file, int l) const
 
HeedMatterDefcopy () const
 

Public Attributes

MatterDefmatter = nullptr
 
std::vector< const AtomPhotoAbsCS * > apacs
 
double eldens_cm_3 = 0.
 Electron density cm**-3.
 
double eldens = 0.
 Electron density MeV**3.
 
double xeldens = 0.
 Long. electron density MeV**2/cm (for x=1 cm).
 
double wpla = 0.
 Squared plasma energy;.
 
double radiation_length = 0.
 Radiation Length.
 
double Rutherford_const = 0.
 Const for Rutherford cross section (1/cm3).
 
double W = 0.
 Mean work per pair production, MeV.
 
double F = 0.
 Fano factor.
 
EnergyMeshenergy_mesh = nullptr
 
std::vector< double > ACS
 Photoabsorption cross section per one atom(Mb).
 
std::vector< double > ICS
 
std::vector< double > epsip
 Some plasma dielectric constant (not used, but just initialized for print)
 
std::vector< double > epsi1
 Real part of dielectric constant (e_1 - 1).
 
std::vector< double > epsi2
 Imaginary part of dielectric constant.
 
double min_ioniz_pot = 0.
 

Static Public Attributes

static constexpr int s_use_mixture_thresholds = 0
 

Detailed Description

Definition of matter parameters necessary for HEED. This is photoabsorption cross section, dielectric constant and other parameters related to these. All the parameters depending on energy are kept in arrays associated with specific energy mesh, which should be defined.

The principle is ordinary: definition of just a class. To the contrary with wcpplib/matter, there is no any global "database" and no formal ban to duplicate these definitions (although there would not be sense in duplication).

Definition at line 26 of file HeedMatterDef.h.

Constructor & Destructor Documentation

◆ HeedMatterDef() [1/4]

Heed::HeedMatterDef::HeedMatterDef ( )
default

Default constructor.

Referenced by copy().

◆ HeedMatterDef() [2/4]

Heed::HeedMatterDef::HeedMatterDef ( EnergyMesh fenergy_mesh,
MatterDef amatter,
const std::vector< AtomPhotoAbsCS * > &  faapacs,
double  fW = 0.0,
double  fF = standard_factor_Fano 
)

Constructor. If fW == 0.0, the program takes mean W from molecules for gas or from atoms for matters. If fF is input as 0.0, it is assigned to be mean for gas. For matters this is the terminating error.

Definition at line 19 of file HeedMatterDef.cpp.

22 : matter(amatter), W(fW), F(fF), energy_mesh(fenergy_mesh) {
23 mfunname("HeedMatterDef::HeedMatterDef(...)");
24 check_econd11(matter, == nullptr, mcerr);
26 const long q = matter->qatom();
27 apacs.resize(q, nullptr);
28 for (long n = 0; n < q; ++n) {
29 apacs[n] = faapacs[n];
30 check_econd12(matter->atom(n)->Z(), !=, apacs[n]->get_Z(), mcerr);
31 }
32 check_econd11(F, == 0.0, mcerr);
33 if (W == 0.0) {
34#ifdef CALC_W_USING_CHARGES
35 double mean_I = 0.0;
36 double d = 0.0;
37 for (long n = 0; n < q; ++n) {
38 const double w = matter->weight_quan(n) * apacs[n]->get_Z();
39 mean_I += w * apacs[n]->get_I_min();
40 d += w;
41 }
42 W = coef_I_to_W * mean_I / d;
43#else
44 double mean_I = 0.0;
45 for (long n = 0; n < q; ++n) {
46 mean_I += matter->weight_quan(n) * apacs[n]->get_I_min();
47 }
48 W = coef_I_to_W * mean_I;
49#endif
50 }
51 inite_HeedMatterDef();
52}
#define check_econd11(a, signb, stream)
Definition: FunNameStack.h:155
#define check_econd12(a, sign, b, stream)
Definition: FunNameStack.h:163
#define mfunname(string)
Definition: FunNameStack.h:45
const std::vector< double > & weight_quan() const
Definition: AtomDef.h:136
long qatom() const
Definition: AtomDef.h:133
const std::vector< AtomDef * > & atom() const
Definition: AtomDef.h:134
double W
Mean work per pair production, MeV.
Definition: HeedMatterDef.h:37
std::vector< const AtomPhotoAbsCS * > apacs
Definition: HeedMatterDef.h:29
MatterDef * matter
Definition: HeedMatterDef.h:28
double F
Fano factor.
Definition: HeedMatterDef.h:38
EnergyMesh * energy_mesh
Definition: HeedMatterDef.h:39
constexpr double coef_I_to_W
Definition: PhotoAbsCS.h:585
#define mcerr
Definition: prstream.h:128

◆ HeedMatterDef() [3/4]

Heed::HeedMatterDef::HeedMatterDef ( EnergyMesh fenergy_mesh,
GasDef agas,
const std::vector< MolecPhotoAbsCS * > &  fampacs,
double  fW = 0.0,
double  fF = standard_factor_Fano 
)

Definition at line 54 of file HeedMatterDef.cpp.

57 : matter(agas), W(fW), F(fF), energy_mesh(fenergy_mesh) {
58 mfunname("HeedMatterDef::HeedMatterDef(...)");
59 check_econd11(agas, == nullptr, mcerr);
60 check_econd11(agas->qmolec(), <= 0, mcerr);
61 const long qat = agas->qatom();
62 apacs.resize(qat, nullptr);
63 const long qmol = agas->qmolec();
64 long nat = 0;
65 for (long nmol = 0; nmol < qmol; ++nmol) {
66 check_econd12(agas->molec(nmol)->tqatom(), !=, fampacs[nmol]->get_qatom(),
67 mcerr);
68 // number of different atoms in mol
69 const long qa = agas->molec(nmol)->qatom();
70 for (long na = 0; na < qa; ++na) {
71 apacs[nat] = fampacs[nmol]->get_atom(na);
72 check_econd12(apacs[nat]->get_Z(), !=, agas->molec(nmol)->atom(na)->Z(),
73 mcerr);
74 nat++;
75 }
76 }
77 if (F == 0.0) {
78#ifdef CALC_W_USING_CHARGES
79 double u = 0.0;
80 double d = 0.0;
81 for (long n = 0; n < qmol; ++n) {
82 const double w = agas->weight_quan_molec(n) * fampacs[n]->get_total_Z();
83 u += w * fampacs[n]->get_F();
84 d += w;
85 }
86 F = u / d;
87#else
88 for (long n = 0; n < qmol; ++n) {
89 F += agas->weight_quan_molec(n) * fampacs[n]->get_F();
90 }
91#endif
92 }
93
94 if (W == 0.0) {
95#ifdef CALC_W_USING_CHARGES
96 double u = 0.0;
97 double d = 0.0;
98 for (long n = 0; n < qmol; ++n) {
99 const double w = agas->weight_quan_molec(n) * fampacs[n]->get_total_Z();
100 u += w * fampacs[n]->get_W();
101 d += w;
102 }
103 W = u / d;
104#else
105 for (long n = 0; n < qmol; ++n) {
106 W += agas->weight_quan_molec(n) * fampacs[n]->get_W();
107 }
108#endif
109 }
110 inite_HeedMatterDef();
111}

◆ HeedMatterDef() [4/4]

Heed::HeedMatterDef::HeedMatterDef ( EnergyMesh fenergy_mesh,
const std::string &  gas_notation,
const std::vector< MolecPhotoAbsCS * > &  fampacs,
double  fW = 0.0,
double  fF = standard_factor_Fano 
)

Definition at line 113 of file HeedMatterDef.cpp.

117 : W(fW), F(fF), energy_mesh(fenergy_mesh) {
118 mfunnamep("HeedMatterDef::HeedMatterDef(...)");
119 MatterDef* amat = MatterDef::get_MatterDef(gas_notation);
120 GasDef* agas = dynamic_cast<GasDef*>(amat);
121 if (!agas) {
122 funnw.ehdr(mcerr);
123 mcerr << "notation supplied as the gas notation is not appear "
124 << "to be related to gas \n";
125 mcerr << "gas_notation=" << gas_notation << '\n';
126 spexit(mcerr);
127 }
128
129 matter = agas;
130 check_econd11(agas->qmolec(), <= 0, mcerr);
131 const long qat = agas->qatom();
132 apacs.resize(qat);
133 const long qmol = agas->qmolec();
134 long nat = 0;
135 for (long nmol = 0; nmol < qmol; ++nmol) {
136 check_econd12(agas->molec(nmol)->tqatom(), !=, fampacs[nmol]->get_qatom(),
137 mcerr);
138 // quantity of different atoms in molecule.
139 const long qa = agas->molec(nmol)->qatom();
140 for (long na = 0; na < qa; ++na) {
141 apacs[nat] = fampacs[nmol]->get_atom(na);
142 check_econd12(apacs[nat]->get_Z(), !=, agas->molec(nmol)->atom(na)->Z(),
143 mcerr);
144 nat++;
145 }
146 }
147 if (F == 0.0) {
148#ifdef CALC_W_USING_CHARGES
149 double u = 0.0;
150 double d = 0.0;
151 for (long n = 0; n < qmol; ++n) {
152 const double w = agas->weight_quan_molec(n) * fampacs[n]->get_total_Z();
153 u += w * fampacs[n]->get_F();
154 d += w;
155 }
156 F = u / d;
157#else
158 for (long n = 0; n < qmol; ++n) {
159 F += agas->weight_quan_molec(n) * fampacs[n]->get_F();
160 }
161#endif
162 }
163
164 if (W == 0.0) {
165#ifdef CALC_W_USING_CHARGES
166 double u = 0.0;
167 double d = 0.0;
168 for (long n = 0; n < qmol; ++n) {
169 const double w = agas->weight_quan_molec(n) * fampacs[n]->get_total_Z();
170 u += w * fampacs[n]->get_W();
171 d += w;
172 }
173 W = u / d;
174#else
175 for (long n = 0; n < qmol; ++n) {
176 W += agas->weight_quan_molec(n) * fampacs[n]->get_W();
177 }
178#endif
179 }
180 inite_HeedMatterDef();
181}
#define mfunnamep(string)
Definition: FunNameStack.h:49
#define spexit(stream)
Definition: FunNameStack.h:256
static MatterDef * get_MatterDef(const std::string &fnotation)
Definition: MatterDef.cpp:120

Member Function Documentation

◆ copy()

HeedMatterDef * Heed::HeedMatterDef::copy ( ) const
inline

Definition at line 82 of file HeedMatterDef.h.

82{ return new HeedMatterDef(*this); }
HeedMatterDef()=default
Default constructor.

◆ print()

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

Definition at line 354 of file HeedMatterDef.cpp.

354 {
355 if (l <= 0) return;
356 Ifile << "HeedMatterDef:\n";
357 indn.n += 2;
358 matter->print(file, 1);
359 if (l >= 2) {
360 long q = matter->qatom();
361 Ifile << "Printing " << q << " photoabsorption cross sections:\n";
362 indn.n += 2;
363 for (long n = 0; n < q; ++n) {
364 apacs[n]->print(file, l - 1);
365 }
366 indn.n -= 2;
367 }
368 Iprintan(file, eldens_cm_3, "1/cm^3");
369 Iprintan(file, eldens, "MeV^3");
370 Iprintan(file, xeldens, "MeV^2/cm");
371 Iprintn(file, wpla);
373 Iprintan(file, Rutherford_const, "1/cm^3");
374 Iprintn(file, W);
375 Iprintn(file, F);
376 Iprintn(file, min_ioniz_pot);
377 Iprintn(file, energy_mesh->get_q());
378 if (l >= 2) {
379 long qe = energy_mesh->get_q();
380 long ne;
381 indn.n += 2;
382 Ifile << " ne energy ACS(Mb) ICS(Mb) ACS(1/MeV^2) "
383 "ICS(1/MeV^2) epsip epsi1 epsi2 "
384 "(1+epsi1)^2+epsi2^2\n";
385 for (ne = 0; ne < qe; ne++) {
386 Ifile << std::setw(3) << ne << ' ' << std::setw(12)
387 << energy_mesh->get_e(ne) << ' ' << std::setw(12) << ACS[ne] << ' '
388 << std::setw(12) << ICS[ne] << ' ' << std::setw(12)
389 << ACS[ne] * C1_MEV2_MBN << ' ' << std::setw(12)
390 << ICS[ne] * C1_MEV2_MBN << ' ' << std::setw(12) << epsip[ne] << ' '
391 << std::setw(12) << epsi1[ne] << ' ' << std::setw(12) << epsi2[ne]
392 << ' ' << std::setw(12)
393 << pow((1 + epsi1[ne]), 2) + pow(epsi2[ne], 2) << " \n";
394 }
395 indn.n -= 2;
396 }
397 indn.n -= 2;
398}
long get_q() const
Return number of bins.
Definition: EnergyMesh.h:42
double get_e(long n) const
Return left side of a given bin.
Definition: EnergyMesh.h:48
double eldens
Electron density MeV**3.
Definition: HeedMatterDef.h:32
double wpla
Squared plasma energy;.
Definition: HeedMatterDef.h:34
double xeldens
Long. electron density MeV**2/cm (for x=1 cm).
Definition: HeedMatterDef.h:33
double eldens_cm_3
Electron density cm**-3.
Definition: HeedMatterDef.h:31
std::vector< double > ACS
Photoabsorption cross section per one atom(Mb).
Definition: HeedMatterDef.h:43
std::vector< double > epsip
Some plasma dielectric constant (not used, but just initialized for print)
Definition: HeedMatterDef.h:48
std::vector< double > epsi1
Real part of dielectric constant (e_1 - 1).
Definition: HeedMatterDef.h:50
double Rutherford_const
Const for Rutherford cross section (1/cm3).
Definition: HeedMatterDef.h:36
std::vector< double > ICS
Definition: HeedMatterDef.h:44
std::vector< double > epsi2
Imaginary part of dielectric constant.
Definition: HeedMatterDef.h:52
double radiation_length
Radiation Length.
Definition: HeedMatterDef.h:35
void print(std::ostream &file, int l) const
Definition: MatterDef.cpp:100
DoubleAc pow(const DoubleAc &f, double p)
Definition: DoubleAc.cpp:337
constexpr double C1_MEV2_MBN
indentation indn
Definition: prstream.cpp:15
#define Iprintan(file, name, addition)
Definition: prstream.h:211
#define Ifile
Definition: prstream.h:195
#define Iprintn(file, name)
Definition: prstream.h:204

Referenced by Heed::EnTransfCS::print(), and Heed::EnTransfCS_BGM::print().

◆ replace_epsi12()

void Heed::HeedMatterDef::replace_epsi12 ( const std::string &  file_name)

Definition at line 304 of file HeedMatterDef.cpp.

304 {
305 mfunnamep("void HeedMatterDef::replace_epsi12(const std::string& file_name)");
306
307 std::ifstream file(file_name.c_str());
308 if (!file) {
309 funnw.ehdr(mcerr);
310 mcerr << "cannot open file " << file_name << std::endl;
311 spexit(mcerr);
312 } else {
313 mcout << "file " << file_name << " is opened" << std::endl;
314 }
315 long qe = 0; // number of points in input mesh
316 file >> qe;
317 check_econd11(qe, <= 2, mcerr);
318
319 std::vector<double> ener(qe);
320 std::vector<double> eps1(qe);
321 std::vector<double> eps2(qe);
322
323 for (long ne = 0; ne < qe; ++ne) {
324 file >> ener[ne] >> eps1[ne] >> eps2[ne];
325 check_econd11(eps2[ne], < 0.0, mcerr);
326 if (ne > 0) {
327 check_econd12(ener[ne], <, ener[ne - 1], mcerr);
328 }
329 }
330
331 PointCoorMesh<double, std::vector<double> > pcmd(qe, &(ener));
332 double emin = ener[0] - 0.5 * (ener[1] - ener[0]);
333 double emax = ener[qe - 1] + 0.5 * (ener[qe - 1] - ener[qe - 2]);
334
335 qe = energy_mesh->get_q();
336 for (long ne = 0; ne < qe; ++ne) {
337 double ec = energy_mesh->get_ec(ne);
338 epsi1[ne] =
339 t_value_straight_point_ar<double, std::vector<double>,
340 PointCoorMesh<double, std::vector<double> > >(
341 pcmd, // dimension q
342 eps1, // dimension q-1
343 ec, 0, 1, emin, 1, emax);
344 epsi2[ne] =
345 t_value_straight_point_ar<double, std::vector<double>,
346 PointCoorMesh<double, std::vector<double> > >(
347 pcmd, // dimension q
348 eps2, // dimension q-1
349 ec, 1, 1, emin, 1, emax);
350 // Iprint3n(mcout, ec, epsi1[ne], epsi2[ne]);
351 }
352}
double get_ec(long n) const
Return center of a given bin.
Definition: EnergyMesh.h:50
#define mcout
Definition: prstream.h:126

Member Data Documentation

◆ ACS

std::vector<double> Heed::HeedMatterDef::ACS

Photoabsorption cross section per one atom(Mb).

Definition at line 43 of file HeedMatterDef.h.

Referenced by Heed::EnTransfCS::EnTransfCS(), and print().

◆ apacs

◆ eldens

double Heed::HeedMatterDef::eldens = 0.

Electron density MeV**3.

Definition at line 32 of file HeedMatterDef.h.

Referenced by Heed::EnTransfCS::EnTransfCS(), and print().

◆ eldens_cm_3

double Heed::HeedMatterDef::eldens_cm_3 = 0.

Electron density cm**-3.

Definition at line 31 of file HeedMatterDef.h.

Referenced by print().

◆ energy_mesh

◆ epsi1

std::vector<double> Heed::HeedMatterDef::epsi1

Real part of dielectric constant (e_1 - 1).

Definition at line 50 of file HeedMatterDef.h.

Referenced by Heed::EnTransfCS::EnTransfCS(), print(), and replace_epsi12().

◆ epsi2

std::vector<double> Heed::HeedMatterDef::epsi2

Imaginary part of dielectric constant.

Definition at line 52 of file HeedMatterDef.h.

Referenced by Heed::EnTransfCS::EnTransfCS(), print(), and replace_epsi12().

◆ epsip

std::vector<double> Heed::HeedMatterDef::epsip

Some plasma dielectric constant (not used, but just initialized for print)

Definition at line 48 of file HeedMatterDef.h.

Referenced by print().

◆ F

double Heed::HeedMatterDef::F = 0.

Fano factor.

Definition at line 38 of file HeedMatterDef.h.

Referenced by HeedMatterDef(), and print().

◆ ICS

std::vector<double> Heed::HeedMatterDef::ICS

Photoionization cross section per one atom(Mb).

Definition at line 44 of file HeedMatterDef.h.

Referenced by print().

◆ matter

◆ min_ioniz_pot

double Heed::HeedMatterDef::min_ioniz_pot = 0.

Minimum ionization potential. It is used only for switching off the Cherenkov radiation below it.

Definition at line 55 of file HeedMatterDef.h.

Referenced by Heed::EnTransfCS::EnTransfCS(), and print().

◆ radiation_length

double Heed::HeedMatterDef::radiation_length = 0.

Radiation Length.

Definition at line 35 of file HeedMatterDef.h.

Referenced by Heed::HeedDeltaElectronCS::HeedDeltaElectronCS(), and print().

◆ Rutherford_const

double Heed::HeedMatterDef::Rutherford_const = 0.

Const for Rutherford cross section (1/cm3).

Definition at line 36 of file HeedMatterDef.h.

Referenced by Heed::HeedDeltaElectronCS::HeedDeltaElectronCS(), and print().

◆ s_use_mixture_thresholds

constexpr int Heed::HeedMatterDef::s_use_mixture_thresholds = 0
staticconstexpr

Flag affecting mixtures of atoms with different ionization potentials. If 1, all energy transfers what is absorbed even with the energy less than the potential of ionization of single atom, but more than the minimal potential of ionization of the mixture, should ionize. This is emulation of Jesse effect in extreme case. It is likely not realistic. So the recommended value is 0.

Definition at line 90 of file HeedMatterDef.h.

Referenced by Heed::EnTransfCS::EnTransfCS().

◆ W

double Heed::HeedMatterDef::W = 0.

Mean work per pair production, MeV.

Definition at line 37 of file HeedMatterDef.h.

Referenced by HeedMatterDef(), and print().

◆ wpla

double Heed::HeedMatterDef::wpla = 0.

Squared plasma energy;.

Definition at line 34 of file HeedMatterDef.h.

Referenced by print().

◆ xeldens

double Heed::HeedMatterDef::xeldens = 0.

Long. electron density MeV**2/cm (for x=1 cm).

Definition at line 33 of file HeedMatterDef.h.

Referenced by Heed::EnTransfCS::EnTransfCS(), and print().


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