17 double fmlambda,
double fmthetac)
25 mfunname(
"HeedDeltaElectronCS::HeedDeltaElectronCS(...)");
27 long qe =
hmd->energy_mesh->get_q();
35 for (ne = 0; ne < qe; ne++) {
36 double ec =
hmd->energy_mesh->get_ec(ne);
37 double gamma_1 = ec * MeV / electron_mass_c2;
41 electron_mass_c2 * electron_mass_c2) / (MeV * MeV);
43 double ZA =
hmd->matter->Z_mean() /
hmd->matter->A_mean();
44 double I_eff = 15.8 * eV *
hmd->matter->Z_mean();
47 if (smax < dedx) smax = dedx;
48 eLoss[ne] = dedx / (MeV / cm);
51 smax = smax / (MeV / cm);
52 double deriv_min = 0.0;
55 for (ne = 1; ne < qe; ne++) {
58 (
hmd->energy_mesh->get_ec(ne) -
hmd->energy_mesh->get_ec(ne - 1));
65 for (ne = 0; ne < n_deriv_min - 1; ne++) {
67 (
eLoss[n_deriv_min - 1] *
beta[n_deriv_min - 1] +
68 deriv_min * (
hmd->energy_mesh->get_ec(ne) -
69 hmd->energy_mesh->get_ec(n_deriv_min - 1))) /
beta[ne];
115 for (ne = 0; ne <
eesls->get_ees()->get_qe(); ne++) {
117 long qat =
hmd->matter->qatom();
121 for (nat = 0; nat < qat; nat++) {
125 s +=
eesls->get_mean_coef(
hmd->matter->atom(nat)->Z(), ne) *
126 hmd->matter->weight_quan(nat);
128 s +=
eesls->get_coef(
hmd->matter->atom(nat)->Z(), ne) *
129 hmd->matter->weight_quan(nat);
136 coef_low_sigma[ne] = s;
140 for (ne = 0; ne < qe; ne++) {
142 double ek =
hmd->energy_mesh->get_ec(ne) * 1000.0;
144 rr = 1.0e-3 *
hmd->matter->A_mean() / (g / mole) /
hmd->matter->Z_mean() *
145 3.872e-3 *
pow(ek, 1.492);
146 rr = rr / (
hmd->matter->density() / (gram / cm3));
148 rr = 1.0e-3 * 6.97e-3 *
pow(ek, 1.6);
149 rr = rr / (
hmd->matter->density() / (gram / cm3));
161 double k = b / ((x - a) * (x - a));
163 double r = b - k * (x - a) * (x - a);
186 double B =
lambda[ne] * A;
187 B =
sqrt(B / (B + 1.0));
195 double r =
sin(B / 2.0);
196 lambda[ne] = 1 / A * 2.0 * r * r / (1 +
cos(B));
212 }
else if (
sruth == 0) {
220 x = x *
hmd->radiation_length * cor;
232 }
else if (
sruth == 2) {
235 double energy =
hmd->energy_mesh->get_ec(ne);
236 long qat =
hmd->matter->qatom();
242 for (nat = 0; nat < qat; nat++) {
243 s +=
ees->get_CS(
hmd->matter->atom(nat)->Z(), energy, angle) *
244 hmd->matter->weight_quan(nat);
250 s = s * 2.0 * M_PI *
sin(angle);
264 hmd->matter->density() / (gram / cm3) /
265 (
hmd->matter->A_mean() / (gram / mole)));
272 hmd->matter->density() / (gram / cm3) /
273 (
hmd->matter->A_mean() / (gram / mole)));
283 mfunname(
"double HeedDeltaElectronCS::get_sigma(...)");
287 double energyKeV = energy * 1000.0;
288 if (energyKeV < ees->get_energy_mesh(0)) energyKeV =
ees->get_energy_mesh(0);
289 if (energyKeV >
ees->get_energy_mesh(
ees->get_qe() - 1))
290 energyKeV =
ees->get_energy_mesh(
ees->get_qe() - 1);
292 long n2 =
ees->get_qe() - 1;
294 while (n2 - n1 > 1) {
295 n3 = n1 + (n2 - n1) / 2;
296 if (energyKeV < ees->get_energy_mesh(n3))
307 double v1 = nscat * coef_low_sigma[n1];
308 double v2 = nscat * coef_low_sigma[n2];
313 v1 + (v2 - v1) / (
ees->get_energy_mesh(n2) -
ees->get_energy_mesh(n1)) *
314 (energyKeV -
ees->get_energy_mesh(n1));
320 Ifile <<
"HeedDeltaElectronCS(l=" << l <<
"):";
321 long qe =
hmd->energy_mesh->get_q();
328 Ifile <<
" get_ec, beta, momentum, eLoss, lambda, "
329 " low_lambda:" << std::endl;
331 for (ne = 0; ne < qe; ne++) {
332 Ifile << std::setw(3) << ne <<
' ' << std::setw(12)
333 <<
hmd->energy_mesh->get_ec(ne) <<
' ' << std::setw(12) <<
beta[ne]
334 <<
' ' << std::setw(12) <<
momentum[ne] <<
' ' << std::setw(12)
335 <<
eLoss[ne] <<
' ' << std::setw(12) <<
lambda[ne] <<
' '
339 Ifile <<
" get_ec, rthetac, thetac, sisfera, msig:"
342 for (ne = 0; ne < qe; ne++) {
343 Ifile << std::setw(3) << ne <<
' ' << std::setw(12)
344 <<
hmd->energy_mesh->get_ec(ne) <<
' ' << std::setw(12) <<
rthetac[ne]
345 <<
' ' << std::setw(12) <<
thetac[ne] <<
' ' << std::setw(12)
346 <<
sisfera[ne] <<
' ' << std::setw(12) <<
msig[ne] <<
'\n';
349 Ifile <<
"na, angular_mesh_c:" << std::endl;
359 Ifile <<
"ne, energy_mesh(ne), mean_coef_low_sigma:" << std::endl;
360 for (ne = 0; ne <
eesls->get_ees()->get_qe(); ne++) {
361 Ifile << std::setw(3) << ne <<
' ' << std::setw(12)
362 <<
eesls->get_ees()->get_energy_mesh(ne) <<
" KeV " << std::setw(12)
366 Ifile <<
"ne, energy_mesh(ne), coef_low_sigma:" << std::endl;
367 for (ne = 0; ne <
eesls->get_ees()->get_qe(); ne++) {
368 Ifile << std::setw(3) << ne <<
' ' << std::setw(12)
369 <<
eesls->get_ees()->get_energy_mesh(ne) <<
" KeV " << std::setw(12)
370 << coef_low_sigma[ne] <<
'\n';
377 mfunname(
"std::ostream& operator << (std::ostream& file, const "
378 "HeedDeltaElectronCSType& f)");
379 if (f.
hdecs.get() == NULL) {
380 Ifile <<
"HeedDeltaElectronCSType: type is not initialized\n";
382 Ifile <<
"HeedDeltaElectronCSType: =";
383 f.
hdecs->print(file, 1);
DoubleAc cos(const DoubleAc &f)
DoubleAc asin(const DoubleAc &f)
DoubleAc pow(const DoubleAc &f, double p)
DoubleAc sqrt(const DoubleAc &f)
DoubleAc sin(const DoubleAc &f)
#define check_econd11(a, signb, stream)
PassivePtr< HeedDeltaElectronCS > hdecs
HeedDeltaElectronCS(void)
DynLinArr< DynLinArr< double > > smat
PassivePtr< ElElasticScat > ees
DynLinArr< double > momentum
virtual void print(std::ostream &file, int l) const
DynLinArr< double > angular_mesh_c
DynLinArr< double > rthetac
double get_sigma(double energy, double nscat) const
PassivePtr< HeedMatterDef > hmd
DynLinArr< double > momentum2
DynLinArr< double > SinThetac12
DynLinArr< double > eLoss
DynLinArr< double > thetac
DynLinArr< double > lambda
DynLinArr< double > mean_coef_low_sigma
DynLinArr< double > beta2
DynLinArr< PointsRan > angular_points_ran
DynLinArr< double > CosThetac12
PassivePtr< ElElasticScatLowSigma > eesls
DynLinArr< PointsRan > low_angular_points_ran
DynLinArr< double > low_lambda
const double low_cut_angle_deg
const long q_angular_mesh
std::ostream & operator<<(std::ostream &file, const BGMesh &bgm)
double lorbeta(const double gamma_1)
double e_cont_enloss(double ratio_Z_to_A, double I_eff, double density, double Ekin, double Ecut, double z)
#define Iprintn(file, name)