Garfield++ v1r0
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 (void)
 
 PairProd (const String &file_name, double fwa, double ffactorFano=0.19)
 
double get_eloss (void) const
 
double get_eloss (double ecur) const
 
virtual void print (std::ostream &file, int l) const
 

Detailed Description

Definition at line 21 of file PairProd.h.

Constructor & Destructor Documentation

◆ PairProd() [1/2]

Heed::PairProd::PairProd ( void  )
inline

Definition at line 23 of file PairProd.h.

23{ ; }

◆ PairProd() [2/2]

Heed::PairProd::PairProd ( const String file_name,
double  fwa,
double  ffactorFano = 0.19 
)

Definition at line 19 of file PairProd.cpp.

20 : wa(fwa), factorFano(ffactorFano) {
21 mfunnamep("PairProd::PairProd(const String& file_name, double fwa, double "
22 "ffactorFano)");
23
24#ifdef USE_STLSTRING
25 std::ifstream file(file_name.c_str());
26#else
27 std::ifstream file(file_name);
28#endif
29 if (!file) {
30 funnw.ehdr(mcerr);
31 mcerr << "cannot open file " << file_name << std::endl;
33 }
34 long q;
35 file >> wa_table >> I_table >> J_table >> factorFano_table >> q;
36 if (!file.good()) {
37 funnw.ehdr(mcerr);
38 mcerr << "error at reading file" << std::endl;
40 }
43 for (long n = 0; n < q; n++) {
44 file >> xx[n] >> yy[n];
45 }
46 pran = PointsRan(xx, yy, I_table, J_table);
47 k = sqrt(factorFano * wa * wa / (factorFano_table * wa_table * wa_table));
48 s = wa - k * wa_table;
49 //s = wa - wa / factorFano * ( 2.0 * factorFano - factorFano_table);
50 //k = wa / (factorFano * wa_table) * ( 2.0 * factorFano - factorFano_table);
51}
DoubleAc sqrt(const DoubleAc &f)
Definition: DoubleAc.cpp:313
#define mfunnamep(string)
Definition: FunNameStack.h:77
#define spexit(stream)
Definition: FunNameStack.h:536
#define mcerr
Definition: prstream.h:135

Member Function Documentation

◆ get_eloss() [1/2]

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

Definition at line 70 of file PairProd.cpp.

70 {
71 mfunname("double PairProd::get_eloss(double ecur) const");
72 double e_loss = k * pran.ran(SRANLUX()) + s;
73 double c;
74 if (e_cur <= V_ratio * wa) {
75 c = DBL_MAX;
76 } else {
77 //c = 1.0 / (1.0 - V_ratio * wa / e_cur);
78 c = 1.0 / (1.0 - pow(V_ratio * wa / e_cur, 2.0));
79 }
80 return e_loss * c;
81}
DoubleAc pow(const DoubleAc &f, double p)
Definition: DoubleAc.cpp:336
#define mfunname(string)
Definition: FunNameStack.h:67
const double V_ratio
Definition: PairProd.cpp:14
double ran(double flat_ran) const
Definition: PointsRan.cpp:114
ffloat SRANLUX(void)
Definition: ranluxint.h:262

◆ get_eloss() [2/2]

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

Definition at line 53 of file PairProd.cpp.

53 {
54 mfunname("double PairProd::get_eloss(void) const");
55 const double e_loss = k * pran.ran(SRANLUX()) + s;
56 return e_loss;
57}

◆ print()

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

Definition at line 85 of file PairProd.cpp.

85 {
86 if (l <= 0) return;
87 Ifile << "PairProd:\n";
88 indn.n += 2;
89 Ifile << "wa=" << wa << " factorFano=" << factorFano << '\n';
90 Ifile << "wa_table=" << wa_table << " factorFano_table=" << factorFano_table
91 << '\n';
92 Ifile << " I_table=" << I_table << " J_table=" << J_table << " k=" << k
93 << " s=" << s << '\n';
94 pran.print(file);
95 indn.n -= 2;
96}
void print(std::ostream &file) const
Definition: PointsRan.cpp:143
indentation indn
Definition: prstream.cpp:13
#define Ifile
Definition: prstream.h:207

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