15using CLHEP::electron_mass_c2;
28 double fmlambda,
double fmthetac)
36 mfunname(
"HeedDeltaElectronCS::HeedDeltaElectronCS(...)");
42 std::vector<double> beta2(qe, 0.);
43 std::vector<double> momentum2(qe, 0.);
48 const double ZA = zmean / amean;
49 const double I_eff = 15.8 * eV * zmean;
51 for (
long ne = 0; ne < qe; ne++) {
53 const double gamma_1 = ec / electron_mass_c2;
56 const double en = electron_mass_c2 + ec;
58 (en * en - electron_mass_c2 * electron_mass_c2) / (MeV * MeV);
60 const double dedx =
e_cont_enloss(ZA, I_eff, rho, ec, DBL_MAX, -1);
61 if (smax < dedx) smax = dedx;
62 eLoss[ne] = dedx / (MeV / cm);
64 smax = smax / (MeV / cm);
66 double deriv_min = 0.0;
68 for (
long ne = 1; ne < qe; ne++) {
77 for (
long ne = 0; ne < n_deriv_min - 1; ne++) {
88 const double amin = 0.3;
89 const double amax = 180.0;
104 coef_low_sigma.resize(qes);
106 for (
long ne = 0; ne < qes; ne++) {
109 for (
long nat = 0; nat < qat; nat++) {
121 coef_low_sigma[ne] = s;
126 for (
long ne = 0; ne < qe; ne++) {
130 rr = 1.0e-3 * amean / (gram / mole) / zmean * 3.872e-3 *
pow(ek, 1.492);
132 rr = 1.0e-3 * 6.97e-3 *
pow(ek, 1.6);
134 rr = rr / (rho / (gram / cm3));
145 double k = b / ((x - a) * (x - a));
147 double r = b - k * (x - a) * (x - a);
159 double mT = 2.0 *
asin(1.0 / (2.0 *
momentum[ne] * zmean * 5.07e2));
165 double B =
lambda[ne] * A;
166 B =
sqrt(B / (B + 1.0));
168 double thetac = 2.0 *
asin(B);
175 double r =
sin(0.5 * B);
176 lambda[ne] = 1 / A * 2.0 * r * r / (1 +
cos(B));
186 }
else if (
sruth == 0) {
196 }
else if (
sruth == 2) {
204 for (
long nat = 0; nat < qat; nat++) {
213 smat[nan] = s * twopi *
sin(angle);
220 Avogadro * rho / (gram / cm3) / (amean / (gram / mole));
230 mfunname(
"double HeedDeltaElectronCS::get_sigma(...)");
235 double energyKeV = energy * 1000.0;
240 while (n2 - n1 > 1) {
241 const long n3 = n1 + (n2 - n1) / 2;
242 if (energyKeV < ees->get_energy_mesh(n3))
253 const double v1 = nscat * coef_low_sigma[n1];
254 const double v2 = nscat * coef_low_sigma[n2];
256 return v1 + (v2 - v1) / (e2 - e1) * (energyKeV - e1);
261 Ifile <<
"HeedDeltaElectronCS(l=" << l <<
"):";
268 Ifile <<
" get_ec, beta, momentum, eLoss, lambda, "
269 " low_lambda:" << std::endl;
271 for (
long ne = 0; ne < qe; ne++) {
272 Ifile << std::setw(3) << ne <<
' ' << std::setw(12)
274 <<
' ' << std::setw(12) <<
momentum[ne] <<
' ' << std::setw(12)
275 <<
eLoss[ne] <<
' ' << std::setw(12) <<
lambda[ne] <<
' '
279 Ifile <<
"na, angular_mesh_c:" << std::endl;
288 Ifile <<
"ne, energy_mesh(ne), mean_coef_low_sigma:" << std::endl;
289 for (
long ne = 0; ne <
eesls->
get_ees()->get_qe(); ne++) {
290 Ifile << std::setw(3) << ne <<
' ' << std::setw(12)
295 Ifile <<
"ne, energy_mesh(ne), coef_low_sigma:" << std::endl;
296 for (
long ne = 0; ne <
eesls->
get_ees()->get_qe(); ne++) {
297 Ifile << std::setw(3) << ne <<
' ' << std::setw(12)
299 << coef_low_sigma[ne] <<
'\n';
#define check_econd11(a, signb, stream)
const std::vector< double > & weight_quan() const
const std::vector< AtomDef * > & atom() const
ElElasticScat * get_ees() const
double get_coef(const long Z, const long ne) const
double get_mean_coef(const long Z, const long ne) const
double get_CS(long Z, double energy, double angle, int s_interp=0)
double get_energy_mesh(long ne) const
long get_q() const
Return number of bins.
double get_ec(long n) const
Return center of a given bin.
void print(std::ostream &file, int l) const
double get_sigma(double energy, double nscat) const
std::vector< PointsRan > low_angular_points_ran
ElElasticScatLowSigma * eesls
HeedDeltaElectronCS()
Default constructor.
std::vector< double > beta
Table of velocities.
static constexpr long q_angular_mesh
static constexpr double low_cut_angle_deg
std::vector< double > momentum
Table of momenta [MeV/c].
std::vector< double > eLoss
std::vector< double > angular_mesh_c
Angular mesh, centers, angles in degrees.
std::vector< double > lambda
std::vector< PointsRan > angular_points_ran
std::vector< double > mean_coef_low_sigma
std::vector< double > low_lambda
double Rutherford_const
Const for Rutherford cross section (1/cm3).
double radiation_length
Radiation Length.
DoubleAc cos(const DoubleAc &f)
double lorbeta(const double gamma_1)
as function of .
DoubleAc pow(const DoubleAc &f, double p)
double e_cont_enloss(double ratio_Z_to_A, double I_eff, double density, double Ekin, double Ecut, double z)
DoubleAc sin(const DoubleAc &f)
DoubleAc asin(const DoubleAc &f)
DoubleAc sqrt(const DoubleAc &f)
#define Iprintn(file, name)