18using CLHEP::c_squared;
26 const bool floss_only,
27 const bool fprint_listing)
28 :
eparticle(primvol, pt, vel, ftime, fpardef, fieldmap),
29 m_print_listing(fprint_listing),
30 m_loss_only(floss_only),
34 mfunname(
"void HeedParticle_BGM::physics()");
35 if (m_print_listing) {
36 mcout <<
"HeedParticle_BGM::physics is started\n";
57 const double mp =
m_mass * c_squared;
70 mcerr <<
"ERROR in void HeedParticle_BGM::physics()\n";
71 mcerr <<
"beta*gamma is outside range of cross-section table\n";
72 std::streamsize old_prec =
mcerr.precision(15);
74 mcerr.precision(old_prec);
78 mcerr <<
"This particle is:\n";
80 mcerr <<
"This volume is:\n";
86 const double f2 = (bg - b1) * (b2 - b1);
87 const double f1 = 1. - f2;
88 const long qa = matter->
qatom();
92 const auto sampleTransfer = t_hisran_step_ar<double, std::vector<double>,
94 for (
long na = 0; na < qa; ++na) {
96 long qs = hmd->
apacs[na]->get_qshell();
97 for (
long ns = 0; ns < qs; ++ns) {
99 const double y1 = etcs->etcs_bgm[n1].quan[na][ns];
100 const double y2 = etcs->etcs_bgm[n2].quan[na][ns];
101 const double mean_pois = f1 * y1 + f2 * y2;
102 if (mean_pois <= 0.)
continue;
103 const long qt =
pois(mean_pois *
step);
105 if (qt <= 0)
continue;
106 for (
long nt = 0; nt < qt; nt++) {
108 const double rn = SRANLUX();
109 const double r1 = sampleTransfer(pcm_e, etcs->etcs_bgm[n1].fadda[na][ns], rn);
110 const double r2 = sampleTransfer(pcm_e, etcs->etcs_bgm[n2].fadda[na][ns], rn);
111 const double r = f1 * r1 + f2 * r2;
112 if (m_print_listing) {
117 const double et = r * MeV;
121 const double arange = SRANLUX() * range;
123 if (m_loss_only)
continue;
124 if (m_print_listing)
mcout <<
"generating new cluster\n";
125 m_clusterBank.push_back(
HeedCluster(et, pt, na, ns));
127 double theta_p, theta_t;
134 if (m_print_listing)
mcout <<
"generating new virtual photon\n";
145 secondaries.push_back(hp);
149 if (m_print_listing) {
151 mcout <<
"Exiting HeedParticle_BGM::physics\n";
157 Ifile <<
"HeedParticle_BGM (l=" << l
158 <<
"): particle_number=" << m_particle_number <<
" type=";
Energy transfer cross-section.
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
HeedParticle_BGM()
Default constructor.
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, ...).
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).
virtual int get_interval(long n, T &b1, T &b2) const
virtual void print(std::ostream &file, int l) const
HeedFieldMap * m_fieldMap
Pointer to field map.
stvpoint m_prevpos
Previous point.
stvpoint m_currpos
Current point.
std::vector< manip_absvol * > eid
List of volumes.
Abstract base classs for volume "manipulators".
double m_curr_ekin
Current kinetic energy.
void step(std::vector< gparticle * > &secondaries) override
void print(std::ostream &file, int l) const override
Print-out.
double m_curr_gamma_1
Current .
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
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.
long pois(const double amu)
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))
DoubleAc sqrt(const DoubleAc &f)
#define Iprint3n(file, name1, name2, name3)
#define Iprintn(file, name)
#define Iprint2n(file, name1, name2)