20using CLHEP::electron_mass_c2;
24 vfloat ftime,
long fparent_particle_number,
26 const bool fs_print_listing)
29 m_parent_particle_number(fparent_particle_number),
34 m_print_listing(fs_print_listing),
35 m_fieldMap(fieldmap) {
36 mfunname(
"HeedPhoton::HeedPhoton(...)");
37 double length_vel = vel.
length();
43 mfunname(
"void HeedPhoton::physics()");
44 if (m_print_listing)
mcout <<
"HeedPhoton::physics() starts\n";
51 auto etcs =
dynamic_cast<const EnTransfCS*
>(av);
56 if (hdecs) hmd = hdecs->hmd;
61 std::vector<double> cs;
62 std::vector<long> nat;
63 std::vector<long> nsh;
66 for (
long na = 0; na < qa; na++) {
67 const long qs = hmd->
apacs[na]->get_qshell();
69 for (
long ns = 0; ns < qs; ns++) {
80 s = s * 1.0e-18 * Avogadro / (hmd->
matter->
A_mean() / (gram / mole)) *
83 const double path_length = 1.0 / s;
86 const double xleng = -path_length * log(1.0 - SRANLUX());
97 const double r =
chisran(SRANLUX(), cs);
98 const long n = std::min(std::max(
long(r), 0L),
long(cs.size() - 1));
110 mfunname(
"void HeedPhoton::physics_after_new_speed()");
111 if (m_print_listing)
mcout <<
"HeedPhoton::physics_after_new_speed starts\n";
119 auto etcs =
dynamic_cast<const EnTransfCS*
>(av);
124 if (hdecs) hmd = hdecs->hmd;
129 std::vector<double> el_energy;
130 std::vector<double> ph_energy;
133 if (m_print_listing) {
134 mcout <<
"The condition:\n";
136 mcout <<
"The decay products:\n";
137 for (
unsigned int k = 0; k < el_energy.size(); ++k)
138 mcout << el_energy[k] <<
"\n";
139 for (
unsigned int k = 0; k < ph_energy.size(); ++k)
140 mcout << ph_energy[k] <<
"\n";
142 const long qel = el_energy.size();
143 for (
long nel = 0; nel < qel; nel++) {
148 if (s_sfer_photoel == 1) {
159 const double gam_1 = el_energy[nel] / electron_mass_c2;
160 const double inv = 1.0 / (gam_1 + 1.0);
161 const double beta =
sqrt(1.0 - inv * inv);
162 const double mod_v = beta * c_light;
164 if (m_print_listing) {
165 mcout <<
"Initializing delta electron\n";
171 secondaries.push_back(hd);
173 const long qph = ph_energy.size();
174 for (
long nph = 0; nph < qph; nph++) {
178 if (m_print_listing) {
179 mcout <<
"Initializing photon\n";
184 ph_energy[nph], m_fieldMap);
185 secondaries.push_back(hp);
189 if (m_print_listing)
mcout <<
"HeedPhoton::physics_after_new_speed exited\n";
195 <<
" energy=" <<
m_energy <<
"MeV\n";
203 <<
" s_sfer_photoel=" << s_sfer_photoel
206 <<
" s_print_listing=" << m_print_listing <<
'\n';
#define check_econd11(a, signb, stream)
const std::vector< double > & weight_quan() const
Retrieve electric and magnetic field from Sensor.
std::vector< const AtomPhotoAbsCS * > apacs
long m_na_absorbing
Index of absorbing atom.
long m_ns_absorbing
Index of absorbing shell.
void physics_after_new_speed(std::vector< gparticle * > &secondaries) override
Apply any other processes (turn the trajectory, kill the particle, ...).
void physics(std::vector< gparticle * > &secondaries) override
Apply any other processes (turn the trajectory, kill the particle, ...).
long m_parent_particle_number
HeedPhoton()=default
Default constructor.
double m_energy
Photon energy [MeV].
void print(std::ostream &file, int l) const override
Print-out.
bool m_delta_generated
Flag that delta-electrons are already generated (or cannot be created).
virtual void print(std::ostream &file, int l) const
Print-out.
stvpoint m_nextpos
Next point.
stvpoint m_currpos
Current point.
bool m_alive
Status flag whether the particle is active.
void up_absref(absref *f)
std::vector< manip_absvol * > eid
List of volumes.
Abstract base classs for volume "manipulators".
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.
point ptloc
Coordinates in the local system (last system in the tree).
long last_particle_number
double chisran(double flat_random_number, const std::vector< double > &f)
DoubleAc fabs(const DoubleAc &f)
DoubleAc sqrt(const DoubleAc &f)
double chispre(std::vector< double > &f, int s_allow_zero_f)
#define Iprintn(file, name)
#define Iprint2n(file, name1, name2)
#define Iprint4n(file, name1, name2, name3, name4)