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

+ Inheritance diagram for Heed::PairProd:

Public Member Functions

 PairProd ()
 
 PairProd (const std::string &file_name, double fwa, double ffactorFano=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.
 
virtual void print (std::ostream &file, int l) 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
 

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

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 17 of file PairProd.h.

Constructor & Destructor Documentation

◆ PairProd() [1/2]

Heed::PairProd::PairProd ( )
inline

Definition at line 19 of file PairProd.h.

19{}

◆ PairProd() [2/2]

Heed::PairProd::PairProd ( const std::string &  file_name,
double  fwa,
double  ffactorFano = 0.19 
)

Definition at line 14 of file PairProd.cpp.

15 : wa(fwa), factorFano(ffactorFano) {
17 "PairProd::PairProd(const std::string& file_name, double fwa, double "
18 "ffactorFano)");
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 >> wa_table >> I_table >> J_table >> factorFano_table >> 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, I_table, J_table);
37 k = sqrt(factorFano * wa * wa / (factorFano_table * wa_table * wa_table));
38 s = wa - k * wa_table;
39 // s = wa - wa / factorFano * ( 2.0 * factorFano - factorFano_table);
40 // k = wa / (factorFano * wa_table) * ( 2.0 * factorFano - factorFano_table);
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 k * pran.ran(SRANLUX()) + 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 = k * pran.ran(SRANLUX()) + s;
62 const double V_ratio = 0.5;
63 const double v = V_ratio * wa / 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
virtual

Reimplemented from Heed::RegPassivePtr.

Definition at line 71 of file PairProd.cpp.

71 {
72 if (l <= 0) return;
73 Ifile << "PairProd:\n";
74 indn.n += 2;
75 Ifile << "wa=" << wa << " factorFano=" << factorFano << '\n';
76 Ifile << "wa_table=" << wa_table << " factorFano_table=" << factorFano_table
77 << '\n';
78 Ifile << " I_table=" << I_table << " J_table=" << J_table << " k=" << k
79 << " s=" << s << '\n';
80 pran.print(file);
81 indn.n -= 2;
82}
void print(std::ostream &file) const
Definition: PointsRan.cpp:120
indentation indn
Definition: prstream.cpp:15
#define Ifile
Definition: prstream.h:196

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