18 radiation_length(0.0),
19 Rutherford_const(0.0),
27 : W(fW), F(fF), energy_mesh(fenergy_mesh) {
28 mfunname(
"HeedMatterDef::HeedMatterDef(...)");
33 for (
long n = 0; n < q; ++n) {
34 apacs[n].put(faapacs[n]);
39#ifdef CALC_W_USING_CHARGES
42 for (
long n = 0; n < q; ++n) {
50 for (
long n = 0; n < q; ++n) {
51 mean_I +=
matter->weight_quan(n) *
apacs[n]->get_I_min();
56 inite_HeedMatterDef();
61 : W(fW), F(fF), energy_mesh(fenergy_mesh) {
62 mfunname(
"HeedMatterDef::HeedMatterDef(...)");
65 long qat = agas->
qatom();
67 const long qmol = agas->
qmolec();
69 for (
long nmol = 0; nmol < qmol; ++nmol) {
73 const long qa = agas->
molec(nmol)->qatom();
74 for (
long na = 0; na < qa; ++na) {
75 apacs[nat].put(fampacs[nmol]->get_atom(na).getver());
82#ifdef CALC_W_USING_CHARGES
85 for (
long n = 0; n < qmol; ++n) {
92 for (
long n = 0; n < qmol; ++n) {
99#ifdef CALC_W_USING_CHARGES
102 for (
long n = 0; n < qmol; ++n) {
109 for (
long n = 0; n < qmol; ++n) {
114 inite_HeedMatterDef();
118 const String& gas_notation,
120 : W(fW), F(fF), energy_mesh(fenergy_mesh) {
121 mfunnamep(
"HeedMatterDef::HeedMatterDef(...)");
126 mcerr <<
"notation supplied as the gas notation is not appear "
127 <<
"to be related to gas \n";
128 mcerr <<
"gas_notation=" << gas_notation <<
'\n';
134 long qat = agas->
qatom();
136 long qmol = agas->
qmolec();
138 for (
long nmol = 0; nmol < qmol; ++nmol) {
141 long qa = agas->
molec(nmol)->qatom();
142 for (
long na = 0; na < qa; ++na) {
143 apacs[nat].put(fampacs[nmol]->get_atom(na).getver());
150#ifdef CALC_W_USING_CHARGES
153 for (
long n = 0; n < qmol; ++n) {
160 for (
long n = 0; n < qmol; ++n) {
167#ifdef CALC_W_USING_CHARGES
170 for (
long n = 0; n < qmol; ++n) {
177 for (
long n = 0; n < qmol; ++n) {
182 inite_HeedMatterDef();
185void HeedMatterDef::inite_HeedMatterDef(
void) {
186 mfunname(
"void HeedMatterDef::inite_HeedMatterDef(void)");
194 long qat =
matter->qatom();
195 for (
long n = 0; n < qat; ++n) {
198 rms = rms / (gram / mole);
202 for (
long n = 0; n < qat; ++n) {
203 RLenAt[n] = 716.4 *
matter->atom(n)->A() / (gram / mole) /
205 log(287. /
sqrt(
double(
matter->atom(n)->Z()))));
206 RuthAt[n] = 4.0 * M_PI *
matter->atom(n)->Z() *
matter->atom(n)->Z() *
210 for (
long n = 0; n < qat; ++n) {
211 rm[n] =
matter->atom(n)->A() / (gram / mole) *
matter->weight_quan(n) / rms;
213 for (
long n = 0; n < qat; ++n) {
220 for (
long n = 0; n < qat; ++n) {
224 (
matter->A_mean() / (gram / mole));
227 for (
long n = 0; n < qat; ++n) {
238 for (
long ne = 0; ne < qe; ++ne) {
243 for (
int na = 0; na < qat; ++na) {
245 sa +=
matter->weight_quan(na)*(t =
apacs[na]->get_integral_ACS(e1, e2)) /
247 check_econd11a(t, < 0,
"ACS: ne=" << ne <<
" e1=" << e1 <<
" e2=" << e2
248 <<
" na=" << na <<
'\n',
251 si +=
matter->weight_quan(na)*(t =
apacs[na]->get_integral_TICS(
255 matter->weight_quan(na)*(t =
apacs[na]->get_integral_ICS(e1, e2)) /
258 check_econd11a(t, < 0,
"ICS: ne=" << ne <<
" e1=" << e1 <<
" e2=" << e2
259 <<
" na=" << na <<
'\n',
268 double ec2 = ec * ec;
274 for (
long ne = 0; ne < qe; ++ne) {
278 double ec2 = ec * ec;
281 for (
long m = 0; m < qe; ++m) {
286 s +=
epsi2[m] * ecm * (em2 - em1) / (ecm * ecm - ec2);
288 double ee1 = (em1 + ecm) / 2.0;
289 double ee2 = (em2 + ecm) / 2.0;
306 s = s + ep1 * ee1 * (ecm - em1) / (ee1 * ee1 - ec2);
307 s = s + ep2 * ee2 * (em2 - ecm) / (ee2 * ee2 - ec2);
310 epsi1[ne] = (2.0 / M_PI) * s;
315 mfunnamep(
"void HeedMatterDef::replace_epsi12(const String& file_name)");
318 std::ifstream file(file_name.c_str());
320 std::ifstream file(hist_file_name);
324 mcerr <<
"cannot open file " << file_name << std::endl;
327 mcout <<
"file " << file_name <<
" is opened" << std::endl;
337 for (
long ne = 0; ne < qe; ++ne) {
338 file >> ener[ne] >> eps1[ne] >> eps2[ne];
346 double emin = ener[0] - 0.5 * (ener[1] - ener[0]);
347 double emax = ener[qe - 1] + 0.5 * (ener[qe - 1] - ener[qe - 2]);
350 for (
long ne = 0; ne < qe; ++ne) {
356 ec, 0, 1, emin, 1, emax);
361 ec, 1, 1, emin, 1, emax);
368 Ifile <<
"HeedMatterDef:\n";
373 Ifile <<
"Printing " << q <<
" photoabsorption cross sections:\n";
375 for (
long n = 0; n < q; ++n) {
376 apacs[n]->print(file, l - 1);
394 Ifile <<
" ne energy ACS(Mb) ICS(Mb) ACS(1/MeV^2) "
395 "ICS(1/MeV^2) epsip epsi1 epsi2 "
396 "(1+epsi1)^2+epsi2^2\n";
397 for (ne = 0; ne < qe; ne++) {
399 Ifile << std::setw(3) << ne <<
' ' << std::setw(12)
400 <<
energy_mesh->get_e(ne) <<
' ' << std::setw(12) <<
ACS[ne] <<
' '
401 << std::setw(12) <<
ICS[ne] <<
' ' << std::setw(12)
404 << std::setw(12) <<
epsi1[ne] <<
' '
407 << std::setw(12) <<
epsi2[ne] <<
' ' << std::setw(12)
DoubleAc pow(const DoubleAc &f, double p)
DoubleAc sqrt(const DoubleAc &f)
#define check_econd11(a, signb, stream)
#define check_econd11a(a, signb, add, stream)
#define mfunnamep(string)
#define check_econd12(a, sign, b, stream)
const DynLinArr< PassivePtr< MoleculeDef > > & molec(void) const
const DynLinArr< double > & weight_quan_molec(void) const
DynLinArr< double > epsi2
DynLinArr< double > epsip
PassivePtr< MatterDef > matter
PassivePtr< EnergyMesh > energy_mesh
void replace_epsi12(const String &file_name)
DynLinArr< double > epsi1
virtual void print(std::ostream &file, int l) const
DynLinArr< PassivePtr< const AtomPhotoAbsCS > > apacs
static MatterDef * get_MatterDef(const String &fnotation)
const int s_use_mixture_thresholds
#define Iprintan(file, name, addition)
#define Iprintn(file, name)
T t_value_straight_point_ar(const M &mesh, const D &y, T x, int s_ban_neg, int s_extrap_left, T left_bond, int s_extrap_right, T right_bond)