18using CLHEP::c_squared;
25 const bool fprint_listing)
26 :
eparticle(primvol, pt, vel, ftime, fpardef, fieldmap),
27 m_print_listing(fprint_listing),
29 m_loss_only(floss_only) {
31 mfunname(
"HeedParticle::HeedParticle(...)");
32 m_etransf.reserve(100);
34 m_nshell.reserve(100);
38 mfunname(
"void HeedParticle::physics()");
39 if (m_print_listing) {
40 mcout <<
"HeedParticle::physics is started\n";
49 auto etcs =
dynamic_cast<const EnTransfCS*
>(av);
54 const double* aetemp = emesh->
get_ae();
56 const long qa = matter->
qatom();
59 for (
long na = 0; na < qa; ++na) {
61 const long qs = hmd->
apacs[na]->get_qshell();
62 for (
long ns = 0; ns < qs; ++ns) {
64 if (etcs->quan[na][ns] <= 0.0)
continue;
69 " etcs->quan[na][ns]=" << etcs->quan[na][ns]
70 <<
" currpos.prange/cm="
74 if (qt <= 0)
continue;
79 for (
long nt = 0; nt < qt; ++nt) {
81 const double rn = SRANLUX();
82 if (m_print_listing)
Iprint3n(
mcout, rn, etcs, etcs->fadda[na][ns][1]);
85 pcm, etcs->fadda[na][ns], rn);
88 const double et = r * MeV;
89 m_etransf.push_back(et);
90 m_natom.push_back(na);
91 m_nshell.push_back(ns);
94 const double arange = SRANLUX() * range;
95 point pt = curpt + dir * arange;
98 if (m_loss_only)
continue;
99 if (m_print_listing)
mcout <<
"generating new cluster\n";
100 if (m_store_clusters) {
101 m_clusterBank.emplace_back(
106 const double Ep1 = Ep0 - m_etransf.back();
107 const double Mp =
m_mass * c_squared;
109 double theta_p, theta_t;
116 if (m_print_listing)
mcout <<
"generating new virtual photon\n";
123 secondaries.push_back(hp);
127 if (m_print_listing) {
128 const double sum = std::accumulate(m_etransf.begin(), m_etransf.end(), 0.);
130 mcout <<
"Exiting HeedParticle::physics\n";
136 Ifile <<
"HeedParticle (l=" << l <<
"): particle_number=" << m_particle_number
142 const double sum = std::accumulate(m_etransf.begin(), m_etransf.end(), 0.);
146 Ifile <<
" nt natom nshell transferred energy\n";
147 const long qt = m_etransf.size();
148 for (
long nt = 0; nt < qt; nt++) {
149 Ifile << std::setw(3) << nt <<
' ' << std::setw(3) << m_natom[nt] <<
' '
150 << std::setw(3) << m_nshell[nt] <<
' '
151 << std::setw(12) << m_etransf[nt] <<
'\n';
#define check_econd11a(a, signb, add, stream)
const double * get_ae(void) const
Return all left sides.
long get_q() const
Return number of bins.
Retrieve electric and magnetic field from Sensor.
std::vector< const AtomPhotoAbsCS * > apacs
void print(std::ostream &file, int l) const override
Print-out.
void physics(std::vector< gparticle * > &secondaries) override
Apply any other processes (turn the trajectory, kill the particle, ...).
HeedParticle()
Default constructor.
long m_na_absorbing
Index of absorbing atom.
long m_ns_absorbing
Index of absorbing shell.
bool m_delta_generated
Flag that delta-electrons are already generated (or cannot be created).
HeedFieldMap * m_fieldMap
Pointer to field map.
stvpoint m_prevpos
Previous point.
stvpoint m_currpos
Current point.
void up_absref(absref *f)
std::vector< manip_absvol * > eid
List of volumes.
absvol * G_lavol() const
Get last address of volume.
Abstract base classs for volume "manipulators".
double m_curr_ekin
Current kinetic energy.
void print(std::ostream &file, int l) const override
Print-out.
double m_mass
Mass (not mass * speed_of_light^2)
void print_notation(std::ostream &file) const
vec dir
Unit vector, in the first system in the tree.
vfloat prange
Range from previous point.
vfloat speed
Longitudinal velocity.
point pt
Coordinates in the first system in the tree.
void random_conic_vec(double theta)
void down(const basis *fabas)
long last_particle_number
long pois(const double amu, int &ierror)
void theta_two_part(const double Ep0, const double Ep1, const double Mp, const double Mt, double &theta_p, double &theta_t)
Scattering angles as function of incident and final projectile energy.
T t_hisran_step_ar(const M &mesh, const D &integ_y, T rannum)
DoubleAc fabs(const DoubleAc &f)
particle_def electron_def("electron", "e-", electron_mass_c2/c_squared, electron_charge, 1, 0, 0.5, spin_def(0.0, 0.0))
#define Iprint3n(file, name1, name2, name3)
#define Iprintn(file, name)
#define Iprint2n(file, name1, name2)