32 orig_gamma_1(gamma_1),
35 curr_gamma_1(gamma_1) {
44 vfloat time,
double fmass,
double gamma_1)
47 orig_gamma_1(gamma_1),
50 curr_gamma_1(gamma_1) {
52 mfunname(
"mparticle::mparticle(...)");
82 mfunname(
"void mparticle::check_consistency(double speed) const");
96 if (kin_ener > 1000.0 * DBL_MIN) {
99 "kin_ener=" << kin_ener <<
'\n' << (*
this),
mcerr);
102 if (kin_ener > 1000.0 * DBL_MIN) {
105 "kin_ener=" << kin_ener <<
'\n' << (*
this),
mcerr);
108 if (kin_ener > 1000.0 * DBL_MIN) {
111 "kin_ener=" << kin_ener <<
'\n' << (*
this),
mcerr);
117 mfunname(
"void mparticle::step(void)");
128 "too much zero steps, possible infinite loop\n";
147 "void mparticle::curvature(int& fs_cf, vec& frelcen, vfloat& fmrange)");
153 if (i == 0 || f ==
dv0) {
164 if ((j = check_par(
currpos.
dir, f, prec)) != 0) {
170 if (fmrange > ran) fmrange = ran;
175 frelcen = unit_vec(fn);
176 double len = length(fn);
188 f_perp =
vec(0, 0, 0);
194 pvecerror(
"void mparticle::new_speed(void)");
199 vec f1, f2, f_perp1, f_perp2, f_perp_fl1, f_perp_fl2;
208 f_mean = (f1 + f2) / 2.0;
211 if ((i == 0 && j == 0) || f_mean ==
dv0) {
220 if (r !=
dv0) W = f_mean * r;
245 double resten =
mass * c_squared;
251 if (!(i == 0 && j == 0)) {
262 double mean_fn_len = length(mean_fn);
264 if (mean_fn_len > 0.0) {
265 vec relcen = unit_vec(mean_fn);
276 vec mean_f_perp_fl = 0.5 * (f_perp_fl1 + f_perp_fl2);
277 double len_mean_f_perp_fl = length(mean_f_perp_fl);
279 double mean_f_perp = 0.5 * (length(f_perp1) + length(f_perp2));
281 if (len_mean_f_perp_fl > 0.0) {
283 if (
not_apeq(length(fdir_proj), 0.0) == 1) {
290 double new_rad =
pow(mean_speed * length(fdir_proj), 2.0) / acc;
291 double ang = length_proj / new_rad;
292 if (new_rad > 0 && ang > 0) {
293 fdir.
turn(mean_f_perp_fl, -ang);
310 Ifile <<
"mparticle: mass=" <<
mass <<
" (" <<
mass / kg <<
" kg, "
311 <<
mass* c_squared / GeV <<
" GeV)\n";
326 (&f)->print(file, 10);
DoubleAc pow(const DoubleAc &f, double p)
DoubleAc fabs(const DoubleAc &f)
#define check_econd11(a, signb, stream)
#define check_econd11a(a, signb, add, stream)
#define check_econd12a(a, sign, b, add, stream)
virtual void physics_after_new_speed(void)
void check_consistency(void) const
virtual int force(const point &pt, vec &f, vec &f_perp, vfloat &mrange)
double mass
Mass (not mass * speed_of_light^2)
virtual void print(std::ostream &file, int l) const
virtual void curvature(int &fs_cf, vec &frelcen, vfloat &fmrange, vfloat prec)
virtual void print(std::ostream &file, int l) const
virtual stvpoint calc_step_to_bord()
double total_range_from_origin
virtual void change_vol(void)
static long max_q_zero_step
manip_absvol_eid eid[pqamvol]
void up_absref(absref *f)
virtual int m_find_embed_vol(const point &fpt, const vec &fdir, manip_absvol_treeid *atid) const
void turn(const vec &dir, vfloat angle)
std::ostream & operator<<(std::ostream &file, const BGMesh &bgm)
double lorbeta(const double gamma_1)
int not_apeq(vfloat f1, vfloat f2, vfloat prec=vprecision)
double lorgamma_1(double beta)
vec project_to_plane(const vec &r, const vec &normal)
vfloat cos2vec(const vec &r1, const vec &r2)
#define pvecerror(string)