18using CLHEP::c_squared;
26 const bool fs_loss_only,
27 const bool fs_print_listing)
28 :
eparticle(primvol, pt, vel, time, fpardef, fieldmap),
29 s_print_listing(fs_print_listing),
31 s_loss_only(fs_loss_only) {
32 mfunname(
"HeedParticle_BGM::HeedParticle_BGM(...)");
36 m_clusterBank.reserve(100);
40 mfunname(
"void HeedParticle_BGM::physics()");
41 if (s_print_listing) {
42 mcout <<
"HeedParticle_BGM::physics is started\n";
67 mcerr <<
"ERROR in void HeedParticle_BGM::physics()\n";
68 mcerr <<
"beta*gamma is outside range of cross-section table\n";
69 std::streamsize old_prec =
mcerr.precision(15);
71 mcerr.precision(old_prec);
75 mcerr <<
"This particle is:\n";
77 mcerr <<
"This volume is:\n";
83 const long qa = matter->
qatom();
86 for (
long na = 0; na < qa; ++na) {
88 long qs = hmd->
apacs[na]->get_qshell();
89 for (
long ns = 0; ns < qs; ++ns) {
91 const double y1 = etcs->
etcs_bgm[n1].quan[na][ns];
92 const double y2 = etcs->
etcs_bgm[n2].quan[na][ns];
93 const double mean_pois = y1 + (bg - b1) * (y2 - y1) / (b2 - b1);
94 if (mean_pois <= 0.)
continue;
98 <<
" currpos.prange/cm="
102 if (qt <= 0)
continue;
108 for (
long nt = 0; nt < qt; nt++) {
110 double rn = SRANLUX();
113 pcm_e, etcs->
etcs_bgm[n1].fadda[na][ns], rn);
116 pcm_e, etcs->
etcs_bgm[n2].fadda[na][ns], rn);
117 const double r = r1 + (bg - b1) * (r2 - r1) / (b2 - b1);
118 if (s_print_listing) {
123 const double et = r * MeV;
124 etransf.push_back(et);
126 nshell.push_back(ns);
129 const double arange = SRANLUX() * range;
130 point pt = curpt + dir * arange;
133 if (s_loss_only)
continue;
134 if (s_print_listing)
mcout <<
"generating new cluster\n";
135 m_clusterBank.push_back(
139 const double Ep1 = Ep0 - etransf.back();
140 const double Mp =
mass * c_squared;
142 double theta_p, theta_t;
148 if (s_print_listing)
mcout <<
"generating new virtual photon\n";
156 secondaries.push_back(hp);
160 if (s_print_listing) {
161 const double sum = std::accumulate(etransf.begin(), etransf.end(), 0.);
163 mcout <<
"Exiting HeedParticle_BGM::physics\n";
169 Ifile <<
"HeedParticle_BGM (l=" << l
170 <<
"): particle_number=" << particle_number <<
" type=";
175 const double sum = std::accumulate(etransf.begin(), etransf.end(), 0.);
179 Ifile <<
" nt natom nshell etransf\n";
180 const long qt = etransf.size();
181 for (
long nt = 0; nt < qt; nt++) {
182 Ifile << std::setw(3) << nt <<
' ' << std::setw(3) << natom[nt] <<
' '
183 << std::setw(3) << nshell[nt] <<
' ' << std::setw(12) << etransf[nt]
#define check_econd11a(a, signb, add, stream)
Energy transfer cross-section.
std::vector< EnTransfCS > etcs_bgm
PassivePtr< HeedMatterDef > hmd
PassivePtr< BGMesh > mesh
long get_q() const
Return number of bins.
Retrieve electric and magnetic field from Sensor.
std::vector< PassivePtr< const AtomPhotoAbsCS > > apacs
PassivePtr< MatterDef > matter
PassivePtr< EnergyMesh > energy_mesh
HeedParticle_BGM()
Default constructor.
virtual void physics(std::vector< gparticle * > &secondaries)
virtual void print(std::ostream &file, int l) const
bool s_delta_generated
Flag that delta-electrons are already generated (or cannot be created).
long ns_absorbing
Index of absorbing shell.
long na_absorbing
Index of absorbing atom.
virtual int get_interval(long n, T &b1, T &b2) const
virtual void print(std::ostream &file, int l) const
HeedFieldMap * m_fieldMap
void up_absref(absref *f)
std::vector< PassivePtr< manip_absvol > > eid
List of volumes.
absvol * G_lavol() const
Get last address of volume.
Abstract base classs for volume "manipulators".
double mass
Mass (not mass * speed_of_light^2)
virtual void print(std::ostream &file, int l) const
void print_notation(std::ostream &file) const
vec dir
Unit vector, in the first system in the tree.
vfloat prange
Range from previous point.
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))
DoubleAc sqrt(const DoubleAc &f)
#define Iprint3n(file, name1, name2, name3)
#define Iprintn(file, name)
#define Iprint2n(file, name1, name2)