Garfield++ v2r0
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>

+ Inheritance diagram for Heed::HeedMatterDef:

Public Member Functions

 HeedMatterDef ()
 Default constructor.
 
 HeedMatterDef (EnergyMesh *fenergy_mesh, MatterDef *amatter, AtomPhotoAbsCS *faapacs[], double fW=0.0, double fF=standard_factor_Fano)
 
 HeedMatterDef (EnergyMesh *fenergy_mesh, GasDef *agas, MolecPhotoAbsCS *fampacs[], double fW=0.0, double fF=standard_factor_Fano)
 
 HeedMatterDef (EnergyMesh *fenergy_mesh, const std::string &gas_notation, MolecPhotoAbsCS *fampacs[], double fW=0.0, double fF=standard_factor_Fano)
 
void replace_epsi12 (const std::string &file_name)
 
virtual void print (std::ostream &file, int l) const
 
virtual HeedMatterDefcopy () 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
 

Public Attributes

PassivePtr< MatterDefmatter
 
std::vector< PassivePtr< const AtomPhotoAbsCS > > apacs
 
double eldens_cm_3
 Electron density cm**-3.
 
double eldens
 Electron density MeV**3.
 
double xeldens
 Long. electron density MeV**2/cm (for x=1 cm).
 
double wpla
 Squared plasma energy;.
 
double radiation_length
 Radiation Length.
 
double Rutherford_const
 Const for Rutherford cross section (1/cm3).
 
double W
 Mean work per pair production, MeV.
 
double F
 Fano factor.
 
PassivePtr< EnergyMeshenergy_mesh
 
std::vector< double > ACS
 Photoabsorbtion 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
 

Static Public Attributes

static const int s_use_mixture_thresholds = 0
 

Additional Inherited Members

- 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 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 27 of file HeedMatterDef.h.

Constructor & Destructor Documentation

◆ HeedMatterDef() [1/4]

Heed::HeedMatterDef::HeedMatterDef ( )

Default constructor.

Definition at line 19 of file HeedMatterDef.cpp.

20 : eldens_cm_3(0.0),
21 eldens(0.0),
22 xeldens(0.0),
23 wpla(0.0),
26 W(0.0),
27 F(0.0) {}
double eldens
Electron density MeV**3.
Definition: HeedMatterDef.h:33
double W
Mean work per pair production, MeV.
Definition: HeedMatterDef.h:38
double wpla
Squared plasma energy;.
Definition: HeedMatterDef.h:35
double xeldens
Long. electron density MeV**2/cm (for x=1 cm).
Definition: HeedMatterDef.h:34
double eldens_cm_3
Electron density cm**-3.
Definition: HeedMatterDef.h:32
double Rutherford_const
Const for Rutherford cross section (1/cm3).
Definition: HeedMatterDef.h:37
double F
Fano factor.
Definition: HeedMatterDef.h:39
double radiation_length
Radiation Length.
Definition: HeedMatterDef.h:36

Referenced by copy().

◆ HeedMatterDef() [2/4]

Heed::HeedMatterDef::HeedMatterDef ( EnergyMesh fenergy_mesh,
MatterDef amatter,
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 29 of file HeedMatterDef.cpp.

31 : W(fW), F(fF), energy_mesh(fenergy_mesh) {
32 mfunname("HeedMatterDef::HeedMatterDef(...)");
33 matter.put(amatter);
34 check_econd11(matter->qatom(), <= 0, mcerr);
35 const long q = matter->qatom();
36 apacs.resize(q);
37 for (long n = 0; n < q; ++n) {
38 apacs[n].put(faapacs[n]);
39 check_econd12(matter->atom(n)->Z(), !=, apacs[n]->get_Z(), mcerr);
40 }
41 check_econd11(F, == 0.0, mcerr);
42 if (W == 0.0) {
43#ifdef CALC_W_USING_CHARGES
44 double mean_I = 0.0;
45 double d = 0.0;
46 for (long n = 0; n < q; ++n) {
47 const double w = matter->weight_quan(n) * apacs[n]->get_Z();
48 mean_I += w * apacs[n]->get_I_min();
49 d += w;
50 }
51 W = coef_I_to_W * mean_I / d;
52#else
53 double mean_I = 0.0;
54 for (long n = 0; n < q; ++n) {
55 mean_I += matter->weight_quan(n) * apacs[n]->get_I_min();
56 }
57 W = coef_I_to_W * mean_I;
58#endif
59 }
60 inite_HeedMatterDef();
61}
#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
std::vector< PassivePtr< const AtomPhotoAbsCS > > apacs
Definition: HeedMatterDef.h:30
PassivePtr< MatterDef > matter
Definition: HeedMatterDef.h:29
PassivePtr< EnergyMesh > energy_mesh
Definition: HeedMatterDef.h:40
const double coef_I_to_W
Definition: PhotoAbsCS.h:584
#define mcerr
Definition: prstream.h:128

◆ HeedMatterDef() [3/4]

Heed::HeedMatterDef::HeedMatterDef ( EnergyMesh fenergy_mesh,
GasDef agas,
MolecPhotoAbsCS fampacs[],
double  fW = 0.0,
double  fF = standard_factor_Fano 
)

Definition at line 63 of file HeedMatterDef.cpp.

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

◆ HeedMatterDef() [4/4]

Heed::HeedMatterDef::HeedMatterDef ( EnergyMesh fenergy_mesh,
const std::string &  gas_notation,
MolecPhotoAbsCS fampacs[],
double  fW = 0.0,
double  fF = standard_factor_Fano 
)

Definition at line 121 of file HeedMatterDef.cpp.

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

Member Function Documentation

◆ copy()

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

Reimplemented from Heed::RegPassivePtr.

Definition at line 84 of file HeedMatterDef.h.

84{ return new HeedMatterDef(*this); }
HeedMatterDef()
Default constructor.

◆ print()

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

Reimplemented from Heed::RegPassivePtr.

Definition at line 361 of file HeedMatterDef.cpp.

361 {
362 if (l <= 0) return;
363 Ifile << "HeedMatterDef:\n";
364 indn.n += 2;
365 matter->print(file, 1);
366 if (l >= 2) {
367 long q = matter->qatom();
368 Ifile << "Printing " << q << " photoabsorption cross sections:\n";
369 indn.n += 2;
370 for (long n = 0; n < q; ++n) {
371 apacs[n]->print(file, l - 1);
372 }
373 indn.n -= 2;
374 }
375 Iprintan(file, eldens_cm_3, "1/cm^3");
376 Iprintan(file, eldens, "MeV^3");
377 Iprintan(file, xeldens, "MeV^2/cm");
378 Iprintn(file, wpla);
380 Iprintan(file, Rutherford_const, "1/cm^3");
381 Iprintn(file, W);
382 Iprintn(file, F);
383 Iprintn(file, min_ioniz_pot);
384 Iprintn(file, energy_mesh->get_q());
385 if (l >= 2) {
386 long qe = energy_mesh->get_q();
387 long ne;
388 indn.n += 2;
389 Ifile << " ne energy ACS(Mb) ICS(Mb) ACS(1/MeV^2) "
390 "ICS(1/MeV^2) epsip epsi1 epsi2 "
391 "(1+epsi1)^2+epsi2^2\n";
392 for (ne = 0; ne < qe; ne++) {
393 Ifile << std::setw(3) << ne << ' ' << std::setw(12)
394 << energy_mesh->get_e(ne) << ' ' << std::setw(12) << ACS[ne] << ' '
395 << std::setw(12) << ICS[ne] << ' ' << std::setw(12)
396 << ACS[ne] * C1_MEV2_MBN << ' ' << std::setw(12)
397 << ICS[ne] * C1_MEV2_MBN << ' ' << std::setw(12) << epsip[ne] << ' '
398 << std::setw(12) << epsi1[ne] << ' ' << std::setw(12) << epsi2[ne]
399 << ' ' << std::setw(12)
400 << pow((1 + epsi1[ne]), 2) + pow(epsi2[ne], 2) << " \n";
401 }
402 indn.n -= 2;
403 }
404 indn.n -= 2;
405}
std::vector< double > ACS
Photoabsorbtion cross section per one atom(Mb).
Definition: HeedMatterDef.h:44
std::vector< double > epsip
Some plasma dielectric constant (not used, but just initialized for print)
Definition: HeedMatterDef.h:49
std::vector< double > epsi1
Real part of dielectric constant (e_1 - 1).
Definition: HeedMatterDef.h:51
std::vector< double > ICS
Definition: HeedMatterDef.h:45
std::vector< double > epsi2
Imaginary part of dielectric constant.
Definition: HeedMatterDef.h:53
DoubleAc pow(const DoubleAc &f, double p)
Definition: DoubleAc.cpp:337
const double C1_MEV2_MBN
indentation indn
Definition: prstream.cpp:15
#define Iprintan(file, name, addition)
Definition: prstream.h:212
#define Ifile
Definition: prstream.h:196
#define Iprintn(file, name)
Definition: prstream.h:205

◆ replace_epsi12()

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

Definition at line 311 of file HeedMatterDef.cpp.

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

Member Data Documentation

◆ ACS

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

Photoabsorbtion cross section per one atom(Mb).

Definition at line 44 of file HeedMatterDef.h.

Referenced by print().

◆ apacs

◆ eldens

double Heed::HeedMatterDef::eldens

Electron density MeV**3.

Definition at line 33 of file HeedMatterDef.h.

Referenced by print().

◆ eldens_cm_3

double Heed::HeedMatterDef::eldens_cm_3

Electron density cm**-3.

Definition at line 32 of file HeedMatterDef.h.

Referenced by print().

◆ energy_mesh

PassivePtr<EnergyMesh> Heed::HeedMatterDef::energy_mesh

◆ epsi1

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

Real part of dielectric constant (e_1 - 1).

Definition at line 51 of file HeedMatterDef.h.

Referenced by print(), and replace_epsi12().

◆ epsi2

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

Imaginary part of dielectric constant.

Definition at line 53 of file HeedMatterDef.h.

Referenced by 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 49 of file HeedMatterDef.h.

Referenced by print().

◆ F

double Heed::HeedMatterDef::F

Fano factor.

Definition at line 39 of file HeedMatterDef.h.

Referenced by Garfield::TrackHeed::GetFanoFactor(), HeedMatterDef(), and print().

◆ ICS

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

Photoionization cross section per one atom(Mb).

Definition at line 45 of file HeedMatterDef.h.

Referenced by print().

◆ matter

◆ min_ioniz_pot

double Heed::HeedMatterDef::min_ioniz_pot

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

Definition at line 56 of file HeedMatterDef.h.

Referenced by print().

◆ radiation_length

double Heed::HeedMatterDef::radiation_length

Radiation Length.

Definition at line 36 of file HeedMatterDef.h.

Referenced by print().

◆ Rutherford_const

double Heed::HeedMatterDef::Rutherford_const

Const for Rutherford cross section (1/cm3).

Definition at line 37 of file HeedMatterDef.h.

Referenced by print().

◆ s_use_mixture_thresholds

const int Heed::HeedMatterDef::s_use_mixture_thresholds = 0
static

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 92 of file HeedMatterDef.h.

◆ W

double Heed::HeedMatterDef::W

Mean work per pair production, MeV.

Definition at line 38 of file HeedMatterDef.h.

Referenced by Garfield::TrackHeed::GetW(), HeedMatterDef(), and print().

◆ wpla

double Heed::HeedMatterDef::wpla

Squared plasma energy;.

Definition at line 35 of file HeedMatterDef.h.

Referenced by print().

◆ xeldens

double Heed::HeedMatterDef::xeldens

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

Definition at line 34 of file HeedMatterDef.h.

Referenced by print().


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