18using CLHEP::c_squared;
25 const bool fs_print_listing)
26 :
eparticle(primvol, pt, vel, time, fpardef, fieldmap),
27 s_print_listing(fs_print_listing),
29 s_loss_only(fs_loss_only),
30 s_store_clusters(false) {
32 mfunname(
"HeedParticle::HeedParticle(...)");
39 mfunname(
"void HeedParticle::physics()");
40 if (s_print_listing) {
41 mcout <<
"HeedParticle::physics is started\n";
57 const long qa = matter->
qatom();
60 for (
long na = 0; na < qa; ++na) {
62 const long qs = hmd->
apacs[na]->get_qshell();
63 for (
long ns = 0; ns < qs; ++ns) {
65 if (etcs->
quan[na][ns] <= 0.0)
continue;
70 " etcs->quan[na][ns]=" << etcs->
quan[na][ns]
71 <<
" currpos.prange/cm="
75 if (qt <= 0)
continue;
80 for (
long nt = 0; nt < qt; ++nt) {
82 const double rn = SRANLUX();
86 pcm, etcs->
fadda[na][ns], rn);
89 const double et = r * MeV;
90 etransf.push_back(et);
95 const double arange = SRANLUX() * range;
96 point pt = curpt + dir * arange;
99 if (s_loss_only)
continue;
100 if (s_print_listing)
mcout <<
"generating new cluster\n";
101 if (s_store_clusters) {
102 m_clusterBank.push_back(
107 const double Ep1 = Ep0 - etransf.back();
108 const double Mp =
mass * c_squared;
110 double theta_p, theta_t;
117 double speed = vel.
length();
118 double time = arange / speed;
119 if (s_print_listing)
mcout <<
"generating new virtual photon\n";
126 secondaries.push_back(hp);
130 if (s_print_listing) {
131 const double sum = std::accumulate(etransf.begin(), etransf.end(), 0.);
133 mcout <<
"Exiting HeedParticle::physics\n";
139 Ifile <<
"HeedParticle (l=" << l <<
"): particle_number=" << particle_number
145 const double sum = std::accumulate(etransf.begin(), etransf.end(), 0.);
149 Ifile <<
" nt natom nshell transferred energy\n";
150 const long qt = etransf.size();
151 for (
long nt = 0; nt < qt; nt++) {
152 Ifile << std::setw(3) << nt <<
' ' << std::setw(3) << natom[nt] <<
' '
153 << std::setw(3) << nshell[nt] <<
' ' << std::setw(12) << etransf[nt]
#define check_econd11a(a, signb, add, stream)
std::vector< std::vector< double > > quan
std::vector< std::vector< std::vector< double > > > fadda
Integral, normalised to unity.
PassivePtr< HeedMatterDef > hmd
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()
Default constructor.
virtual void print(std::ostream &file, int l) const
virtual void physics(std::vector< gparticle * > &secondaries)
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.
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))
#define Iprint3n(file, name1, name2, name3)
#define Iprintn(file, name)
#define Iprint2n(file, name1, name2)