19 <<
" time=" <<
time <<
'\n';
24 if (
tid.eid.empty()) {
25 Ifile <<
"point is outside universe\n";
34 Ifile <<
"next volume name " << s <<
'\n';
46 mfunname(
"gparticle::gparticle(...)");
63 if (
m_origin.tid.eid.empty())
return;
80 "too many zero steps, possible infinite loop\n",
mcerr);
114 pvecerror(
"stvpoint gparticle::calc_step_to_bord()");
122 curvature(curved, relcen, mrange, m_max_straight_arange);
132 trajestep ts(m_max_range, m_rad_for_straight,
133 m_max_straight_arange, m_max_circ_arange,
135 m_currpos.tid.eid.back()->Gavol()->prec);
144 m_currpos.volume()->range(ts, 1, sb, faeid);
157 basis temp(dir,
"temp");
160 vturn = vturn * stheta;
161 vec new_dir(vturn.
x, vturn.
y, ctheta);
170 mfunname(
"stvpoint gparticle::switch_new_vol(void)");
182 nextp.
tid.
eid[0]->m_find_embed_vol(pth, nextp.
dir, &tidl);
183 if (tidl.
eid.empty()) {
189 if (tidl == nextp.
tid) {
196 vec additional_dist = nextp.
dir * curprec;
197 pth = pth + additional_dist;
216 Ifile <<
"origin point:\n";
222 Ifile <<
"previous point:\n";
228 Ifile <<
"current point:\n";
234 Ifile <<
"next point:\n";
#define check_econd12a(a, sign, b, add, stream)
virtual void print(std::ostream &file, int l) const
Print-out.
virtual void physics_mrange(double &fmrange)
virtual void physics_after_new_speed(std::vector< gparticle * > &)
Apply any other processes (turn the trajectory, kill the particle, ...).
stvpoint m_nextpos
Next point.
double m_total_range_from_origin
Range from origin to current position.
virtual stvpoint calc_step_to_bord()
Determine next position.
stvpoint m_prevpos
Previous point.
static constexpr long m_max_qzero_step
Max. number of zero-steps allowed.
virtual void step(std::vector< gparticle * > &secondaries)
gparticle()=default
Default constructor.
void turn(const double ctheta, const double stheta)
Change the direction of the particle.
stvpoint m_currpos
Current point.
virtual void change_vol()
Move from one volume to another.
stvpoint switch_new_vol()
Generate next position in new volume.
long m_nzero_step
Number of previous steps with zero range (including this step).
stvpoint m_origin
Original point.
bool m_alive
Status flag whether the particle is active.
static std::atomic< long > s_counter
Instance counter.
virtual void curvature(bool &curved, vec &frelcen, vfloat &fmrange, vfloat prec)
Service class (array of manip_absvol).
std::vector< manip_absvol * > eid
List of volumes.
Abstract base classs for volume "manipulators".
virtual int m_find_embed_vol(const point &fpt, const vec &fdir, manip_absvol_treeid *atid) const
Point in space, time and velocity.
void print(std::ostream &file, int l) const
vec dirloc
Unit vector, in the local system (last system in the tree).
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.
point ptloc
Coordinates in the local system (last system in the tree).
vfloat mrange
Maximal possible range.
void down(const basis *fabas)
void random_round_vec()
Generate random unit vector in plane perpendicular to z-axis.
#define pvecerror(string)