16#define DIRECT_LOW_IF_LITTLE
27 long fparent_particle_number,
32 s_print_listing(fs_print_listing),
35 s_mult_low_path_length(0),
36 q_low_path_length(0.0),
38 necessary_energy(0.0),
39 parent_particle_number(fparent_particle_number) {
40 mfunname(
"HeedDeltaElectron::HeedDeltaElectron(...)");
50 mfunname(
"void HeedDeltaElectron::physics_mrange(double& fmrange)");
52 mcout <<
"void HeedDeltaElectron::physics_mrange(double& fmrange)"
58 if (fmrange <= 0.0)
return;
66 if (hmecst == NULL)
return;
73 long qener = emesh->
get_q();
75 if (n1 > qener - 2) n1 = qener - 2;
77 double dedx = hdecs->
eLoss[n1] + (hdecs->
eLoss[n2] - hdecs->
eLoss[n1]) /
81 double eloss = 0.1 * ek;
82 if (eloss < 0.00005) eloss = 0.00005;
89 double mrange = (eloss / dedx) * cm;
90 if (fmrange > mrange) fmrange = mrange;
95 double ek_restricted = ek;
96 if (ek_restricted < 0.0005) ek_restricted = 0.0005;
100 if (n1r < 0) n1r = 0;
101 if (n1r > qener - 2) n1r = qener - 2;
103 double low_path_length = 0.;
108 (ek_restricted - emesh->
get_ec(n1r))) * cm;
110 long qscat = hdecs->
eesls->get_qscat();
111 double sigma_ctheta = hdecs->
get_sigma(ek_restricted, qscat);
113 if (sigma_ctheta > 0.3) qscat = long(qscat * 0.3 / sigma_ctheta);
114 double mult_low_path_length = qscat * low_path_length;
116 if (fmrange > mult_low_path_length) {
117 fmrange = mult_low_path_length;
140 double mean_path_length =
143 (ek_restricted - emesh->
get_ec(n1r))) * cm;
148 double path_length = -mean_path_length * log(1.0 -
SRANLUX());
150 if (fmrange > path_length) {
151 fmrange = path_length;
168 mfunname(
"void HeedDeltaElectron::physics_after_new_speed(void)");
170 mcout <<
"HeedDeltaElectron::physics_after_new_speed is started\n";
181 mcout <<
"HeedDeltaElectron::physics_after_new_speed: \n";
182 mcout <<
"This is converted to conduction\n";
200 mcout <<
"physics_after_new_speed: started" << std::endl;
201 if (hmecst == NULL)
return;
206 long qener = emesh->
get_q();
208 if (n1 > qener - 2) n1 = qener - 2;
236 Eloss = dedx * MeV / cm;
253 double resten =
mass * c_squared;
261 mcout <<
"volume is sensitive\n";
271 mcout <<
"\nstart to leave conduction electrons" << std::endl;
285 double Eloss_left = Eloss;
297 curpt = curpt + dir * step_length;
312 eV * hdecs->
pairprod->get_eloss(curr_kin_energy_for_cond / eV);
335 double ek_restricted = ek;
336 if (ek_restricted < 0.0005) ek_restricted = 0.0005;
346 if (n1r < 0) n1r = 0;
347 if (n1r > qener - 2) n1r = qener - 2;
349 double low_path_length;
354 (ek_restricted - emesh->
get_ec(n1r))) * cm;
364 long random_q_low_path_length = 0;
372 mcout <<
"After pois:\n";
378#ifdef DIRECT_LOW_IF_LITTLE
382 mcout <<
"direct modeling of low scatterings\n";
386 if (n1r < 0) n1r = 0;
387 if (n1r > qener - 1) n1r = qener - 1;
396 basis temp(dir,
"temp");
399 vturn = vturn *
sin(theta_rot);
400 vec new_dir(vturn.
x, vturn.
y,
cos(theta_rot));
409 double sigma_ctheta =
432 double sq2 =
sqrt(2.0);
441 double x = sigma_ctheta * (-log(1.0 - y));
443 double x = sigma_ctheta * 1.0 / sq2 * (-log(1.0 - y));
447 }
while (ctheta <= -1.0);
451 double theta_rot =
acos(ctheta);
457 basis temp(dir,
"temp");
464 vturn = vturn *
sin(theta_rot);
465 vec new_dir(vturn.
x, vturn.
y,
cos(theta_rot));
472#ifdef DIRECT_LOW_IF_LITTLE
477 mcout <<
"\nstarting to rotate by large angle" << std::endl;
481 if (n1r < 0) n1r = 0;
482 if (n1r > qener - 1) n1r = qener - 1;
488 basis temp(dir,
"temp");
491 vturn = vturn *
sin(theta_rot);
492 vec new_dir(vturn.
x, vturn.
y,
cos(theta_rot));
520 Ifile <<
"HeedDeltaElectron (l=" << l
DoubleAc cos(const DoubleAc &f)
DoubleAc sqrt(const DoubleAc &f)
DoubleAc sin(const DoubleAc &f)
DoubleAc acos(const DoubleAc &f)
#define check_econd21(a, sign1_b1_sign0, sign2_b2, stream)
#define check_econd11(a, signb, stream)
#define check_econd11a(a, signb, add, stream)
long get_interval_number_between_centers(double ener)
double get_ec(long n) const
PassivePtr< HeedDeltaElectronCS > hdecs
double get_sigma(double energy, double nscat) const
PassivePtr< HeedMatterDef > hmd
DynLinArr< double > eLoss
DynLinArr< double > lambda
PassivePtr< PairProd > pairprod
DynLinArr< PointsRan > angular_points_ran
PassivePtr< ElElasticScatLowSigma > eesls
DynLinArr< PointsRan > low_angular_points_ran
DynLinArr< double > low_lambda
static int s_low_mult_scattering
virtual void physics_after_new_speed()
static int s_high_mult_scattering
virtual void physics_mrange(double &fmrange)
long parent_particle_number
virtual void print(std::ostream &file, int l) const
int s_mult_low_path_length
BlkArr< HeedCondElectron > conduction_electron_bank
double mass
Mass (not mass * speed_of_light^2)
virtual void print(std::ostream &file, int l) const
void up_absref(absref *f)
void down(const basis *fabas)
void random_round_vec(void)
long last_particle_number
double lorbeta(const double gamma_1)
const long max_q_low_path_length_for_direct
particle_def electron_def("electron", "e-", electron_mass_c2/c_squared, electron_charge, 1, 0, 0.5, spin_def(0.0, 0.0))
long pois(double AMU, int &IERROR)
#define Iprint3nf(file, name1, name2, name3)
#define Iprint3n(file, name1, name2, name3)
#define Iprint(file, name)
#define Iprintn(file, name)
#define Iprintf(file, name)
#define Iprint2nf(file, name1, name2)
#define Iprint2n(file, name1, name2)
#define Iprintnf(file, name)