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::PairProd Class Reference

#include <PairProd.h>

Public Member Functions

 PairProd ()=default
 
 PairProd (const std::string &file_name, double fw, double ffano=0.19)
 
double get_eloss () const
 Calculate energy loss (in eV).
 
double get_eloss (const double ecur) const
 Calculate energy loss (in eV) assuming V = wa / 2.
 
void print (std::ostream &file, int l) const
 

Detailed Description

Production of electron-ion pairs by delta-electrons. All energies are assumed in eV. But it seems that it is not strict requirement. If to change this in file "file_name" and in interface, the energies could be in any units.

2003, I. Smirnov

Definition at line 16 of file PairProd.h.

Constructor & Destructor Documentation

◆ PairProd() [1/2]

Heed::PairProd::PairProd ( )
default

◆ PairProd() [2/2]

Heed::PairProd::PairProd ( const std::string &  file_name,
double  fw,
double  ffano = 0.19 
)

Definition at line 16 of file PairProd.cpp.

17 : m_w(fw), m_f(ffano) {
18 mfunnamep("PairProd::PairProd(const std::string&, double, double)");
19
20 std::ifstream file(file_name.c_str());
21 if (!file) {
22 funnw.ehdr(mcerr);
23 mcerr << "cannot open file " << file_name << std::endl;
25 }
26 long q;
27 file >> m_wtable >> m_i >> m_j >> m_ftable >> q;
28 if (!file.good()) {
29 funnw.ehdr(mcerr);
30 mcerr << "error at reading file" << std::endl;
32 }
33 std::vector<double> xx(q);
34 std::vector<double> yy(q);
35 for (long n = 0; n < q; n++) file >> xx[n] >> yy[n];
36 pran = PointsRan(xx, yy, m_i, m_j);
37 m_k = sqrt(m_f * m_w * m_w / (m_ftable * m_wtable * m_wtable));
38 m_s = m_w - m_k * m_wtable;
39 // m_s = m_w - m_w / m_f * (2. * m_f - m_ftable);
40 // m_k = m_w / (m_f * m_wtable) * (2. * m_f - m_ftable);
41}
#define mfunnamep(string)
Definition: FunNameStack.h:49
#define spexit(stream)
Definition: FunNameStack.h:256
DoubleAc sqrt(const DoubleAc &f)
Definition: DoubleAc.cpp:314
#define mcerr
Definition: prstream.h:128

Member Function Documentation

◆ get_eloss() [1/2]

double Heed::PairProd::get_eloss ( ) const

Calculate energy loss (in eV).

Definition at line 43 of file PairProd.cpp.

43 {
44 mfunname("double PairProd::get_eloss() const");
45 return m_k * pran.ran(SRANLUX()) + m_s;
46}
#define mfunname(string)
Definition: FunNameStack.h:45
double ran(double flat_ran) const
Definition: PointsRan.cpp:91

◆ get_eloss() [2/2]

double Heed::PairProd::get_eloss ( const double  ecur) const

Calculate energy loss (in eV) assuming V = wa / 2.

Definition at line 59 of file PairProd.cpp.

59 {
60 mfunname("double PairProd::get_eloss(const double ecur) const");
61 const double e_loss = m_k * pran.ran(SRANLUX()) + m_s;
62 constexpr double V_ratio = 0.5;
63 const double v = V_ratio * m_w / e_cur;
64 // const double c = 1. / (1. - v);
65 const double c = v < 1. ? 1. / (1. - v * v) : DBL_MAX;
66 return e_loss * c;
67}

◆ print()

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

Definition at line 71 of file PairProd.cpp.

71 {
72 if (l <= 0) return;
73 Ifile << "PairProd:\n";
74 indn.n += 2;
75 Ifile << "W=" << m_w << " Fano factor=" << m_f << '\n';
76 Ifile << "W table=" << m_wtable << " Fano factor table=" << m_ftable << '\n';
77 Ifile << "I=" << m_i << " J=" << m_j << " k=" << m_k << " s=" << m_s << '\n';
78 pran.print(file);
79 indn.n -= 2;
80}
void print(std::ostream &file) const
Definition: PointsRan.cpp:120
indentation indn
Definition: prstream.cpp:15
#define Ifile
Definition: prstream.h:195

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