11#ifdef USE_GET_ELOSS_CUT
12const double w_cut_ratio = 0.2;
20 : wa(fwa), factorFano(ffactorFano) {
21 mfunnamep(
"PairProd::PairProd(const String& file_name, double fwa, double "
25 std::ifstream file(file_name.c_str());
27 std::ifstream file(file_name);
31 mcerr <<
"cannot open file " << file_name << std::endl;
35 file >> wa_table >> I_table >> J_table >> factorFano_table >> q;
38 mcerr <<
"error at reading file" << std::endl;
43 for (
long n = 0; n < q; n++) {
44 file >> xx[n] >> yy[n];
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;
54 mfunname(
"double PairProd::get_eloss(void) const");
55 const double e_loss = k * pran.
ran(
SRANLUX()) + s;
59#ifdef USE_GET_ELOSS_CUT
62 mfunname(
"double PairProd::get_eloss(double ecur) const");
64 if (e_cur - e_loss < w_cut_ratio * wa) e_loss = 1.0e20;
71 mfunname(
"double PairProd::get_eloss(double ecur) const");
78 c = 1.0 / (1.0 -
pow(
V_ratio * wa / e_cur, 2.0));
87 Ifile <<
"PairProd:\n";
89 Ifile <<
"wa=" << wa <<
" factorFano=" << factorFano <<
'\n';
90 Ifile <<
"wa_table=" << wa_table <<
" factorFano_table=" << factorFano_table
92 Ifile <<
" I_table=" << I_table <<
" J_table=" << J_table <<
" k=" << k
93 <<
" s=" << s <<
'\n';
DoubleAc pow(const DoubleAc &f, double p)
DoubleAc sqrt(const DoubleAc &f)
#define mfunnamep(string)
virtual void print(std::ostream &file, int l) const
double get_eloss(void) const
double ran(double flat_ran) const
void print(std::ostream &file) const