RooParticle
Particle scattering simulator with ROOT
Loading...
Searching...
No Matches
asymptote.hpp
Go to the documentation of this file.
1
3
4#ifndef H_ASYMPTOTE
5#define H_ASYMPTOTE 1
6
7#include "TROOT.h"
8#include "TString.h"
9#include "TVector3.h"
10
11class particle;
12
103public:
115
124 asymptote(particle* p1, particle* p2, Double_t kappa);
135 asymptote(TVector3 x1, TVector3 v1, Double_t m1, Bool_t fixed1,
136 TVector3 x2, TVector3 v2, Double_t m2, Bool_t fixed2,
137 Double_t kappa);
148 asymptote(TVector3 r, TVector3 v, Double_t mu, Double_t kappa);
149
152 Bool_t Compute(particle* p1, particle* p2, Double_t kappa);
155 Bool_t Compute(TVector3 x1, TVector3 v1, Double_t m1, Bool_t fixed1,
156 TVector3 x2, TVector3 v2, Double_t m2, Bool_t fixed2,
157 Double_t kappa);
160 Bool_t Compute(TVector3 r, TVector3 v, Double_t mu, Double_t kappa);
161
164 status GetStatus() const {return st;}
166 TString GetStatusName() const;
167 Bool_t HasAsymptote() const {return st==kUnbound || st==kHeadOn || st==kFree;}
168 Bool_t IsFixedCentre() const {return fixedCentre;}
169 Bool_t IsOutgoing() const {return r.Dot(v) > 0.;}
171
174 Double_t GetKappa() const {return kappa;}
175 Double_t GetMu() const {return mu;}
176 TVector3 GetR() const {return r;}
177 TVector3 GetV() const {return v;}
178 TVector3 GetVcm() const {return vcm;}
180
183 Double_t GetEnergy() const {return energy;}
184 TVector3 GetL() const {return lvec;}
185 Double_t GetLMag() const {return lvec.Mag();}
186 TVector3 GetLRL() const {return avec;}
187 TVector3 GetEccentricityVector() const {return evec;}
188 Double_t GetEccentricity() const {return ecc;}
189 TVector3 GetPeriapsisDirection() const {return phat;}
190 Double_t GetClosestApproach() const {return rmin;}
192
195 Double_t GetVinf() const {return vinf;}
196 TVector3 GetVInRel() const {return vinRel;}
197 TVector3 GetVOutRel() const {return voutRel;}
198 Double_t GetThetaCM() const {return thetaCM;}
199 Double_t GetImpactParameter() const {return bimp;}
201
207 TVector3 GetV1In() const {return v1in;}
208 TVector3 GetV1Out() const {return v1out;}
209 TVector3 GetV2In() const {return v2in;}
210 TVector3 GetV2Out() const {return v2out;}
224 Double_t GetThetaLab1() const {return thetaLab1;}
226 Double_t GetThetaLab2() const {return thetaLab2;}
227
231 TString Print(Bool_t mute=kFALSE) const;
232
236
248 static Double_t RutherfordAngle(Double_t b, Double_t vinf, Double_t mu, Double_t kappa);
257 static Double_t RutherfordImpactParameter(Double_t theta, Double_t vinf, Double_t mu, Double_t kappa);
266 static Double_t RutherfordClosestApproach(Double_t b, Double_t vinf, Double_t mu, Double_t kappa);
274 static Double_t HeadOnClosestApproach(Double_t vinf, Double_t mu, Double_t kappa);
281 static Double_t LabAngle(Double_t thetaCM, Double_t m1, Double_t m2);
284 static Double_t RecoilAngle(Double_t thetaCM);
287 static Double_t Angle(const TVector3 & a, const TVector3 & b);
289
290private:
291 void Reset();
292 void Solve();
293 void SetLab();
294
296 Bool_t fixedCentre = kFALSE;
297 Bool_t fixed1 = kFALSE;
298 Bool_t fixed2 = kFALSE;
299 Double_t m1 = 0.;
300 Double_t m2 = 0.;
301 Double_t mu = 0.;
302 Double_t kappa = 0.;
303 TVector3 r, v, vcm;
304
305 Double_t energy = 0.;
306 TVector3 lvec, avec, evec, phat;
307 Double_t ecc = 0.;
308 Double_t rmin = 0.;
309
310 Double_t vinf = 0.;
311 TVector3 vinRel, voutRel;
312 Double_t thetaCM = 0.;
313 Double_t bimp = 0.;
314
315 TVector3 v1in, v1out, v2in, v2out;
316 Double_t thetaLab1 = 0.;
317 Double_t thetaLab2 = 0.;
318};
319
320#endif
Analytic two-body 1/r asymptote calculator.
TVector3 lvec
TVector3 v2out
lab asymptotic velocities
Double_t GetThetaCM() const
scattering angle in the relative (CM) frame (rad)
status GetStatus() const
TVector3 GetL() const
TVector3 v
TVector3 phat
angular momentum, Laplace-Runge-Lenz, eccentricity vector, periapsis direction
Double_t thetaLab2
lab angle of particle 2
TVector3 GetLRL() const
Laplace-Runge-Lenz vector .
TVector3 vinRel
Bool_t IsOutgoing() const
the given state is past closest approach ( ); no check of the status
static Double_t RecoilAngle(Double_t thetaCM)
Lab angle of the recoiling target at rest, .
Double_t energy
orbital energy
Double_t GetThetaLab1() const
Lab scattering angle of particle 1 (rad).
Bool_t fixed2
particle 2 is a fixed centre
Double_t GetMu() const
reduced (or moving) mass (amu)
Double_t rmin
closest approach
Double_t GetVinf() const
relative speed at infinity (c)
Double_t ecc
eccentricity
Double_t vinf
relative speed at infinity
TVector3 GetEccentricityVector() const
toward periapsis,
TString GetStatusName() const
Name of the status as text: "UNBOUND", "HEADON", "FREE", "RADIAL_ATTRACTIVE", "PARABOLIC",...
Double_t GetKappa() const
interaction constant of
Double_t kappa
interaction constant
static Double_t RutherfordClosestApproach(Double_t b, Double_t vinf, Double_t mu, Double_t kappa)
Closest approach for impact parameter b.
Double_t bimp
effective impact parameter
Bool_t Compute(particle *p1, particle *p2, Double_t kappa)
Recompute from two particles (arguments as the matching constructor); all previous results are discar...
Definition asymptote.cpp:43
Bool_t fixed1
particle 1 is a fixed centre
Double_t GetImpactParameter() const
effective (fm)
Double_t GetThetaLab2() const
Lab scattering angle of particle 2 (rad); same rules as GetThetaLab1().
Bool_t IsFixedCentre() const
exactly one of the two bodies is fixed
Double_t GetClosestApproach() const
distance of closest approach (fm)
status
Classification of the relative orbit. Only kUnbound, kHeadOn and kFree have asymptotes (see HasAsympt...
@ kHeadOn
, , : straight back-scattering, , ,
@ kBound
: ellipse, no asymptote (E, L, A, e, are set)
@ kInvalid
zero distance, non-positive mass (of a moving particle), both particles fixed, or null/identical part...
@ kRadialAttractive
, (whatever the sign of E): falls into the singularity, no asymptote ( )
@ kUnbound
, : hyperbola, every asymptotic quantity is set
@ kFree
: straight line, , (with the relative velocity zero too it is reported as kParabolic with )
@ kParabolic
(within round-off): , no direction
TVector3 GetVcm() const
centre-of-mass velocity (c; 0 for a fixed centre)
TVector3 v1out
TVector3 vcm
relative position, relative velocity, centre-of-mass velocity
Double_t m1
mass of particle 1 (amu)
Double_t mu
reduced (or moving) mass (amu)
TVector3 GetVInRel() const
incoming relative velocity at
TVector3 v1in
TVector3 voutRel
incoming / outgoing relative velocity
Double_t m2
mass of particle 2 (amu)
Double_t GetEccentricity() const
eccentricity; 0 for kFree / kInvalid
TVector3 avec
TVector3 GetV1Out() const
particle 1, outgoing
Double_t thetaCM
CM scattering angle.
TVector3 GetV1In() const
particle 1, incoming
Bool_t HasAsymptote() const
true for kUnbound, kHeadOn, kFree
static Double_t HeadOnClosestApproach(Double_t vinf, Double_t mu, Double_t kappa)
Head-on ( ) closest approach, repulsive.
TVector3 v2in
TVector3 GetV() const
(c)
TVector3 r
TVector3 GetV2Out() const
particle 2, outgoing
asymptote()
Empty object; the status is kInvalid until Compute() is called.
TVector3 GetVOutRel() const
outgoing relative velocity at
static Double_t Angle(const TVector3 &a, const TVector3 &b)
Angle between two vectors, , accurate at 0 and .
TVector3 GetPeriapsisDirection() const
unit vector, centre to closest approach
Bool_t fixedCentre
exactly one body fixed
TVector3 GetV2In() const
particle 2, incoming
status st
orbit classification
static Double_t RutherfordImpactParameter(Double_t theta, Double_t vinf, Double_t mu, Double_t kappa)
Inverse of RutherfordAngle().
Double_t thetaLab1
lab angle of particle 1
Double_t GetLMag() const
static Double_t RutherfordAngle(Double_t b, Double_t vinf, Double_t mu, Double_t kappa)
Rutherford scattering angle in the CM frame.
void Reset()
set every result and input to its empty value (status kInvalid)
Definition asymptote.cpp:28
Double_t GetEnergy() const
(amu c^2)
TString Print(Bool_t mute=kFALSE) const
Text summary (status, kappa, mu, E, |L|, e, rmin, b, vinf, theta, outgoing velocities).
void Solve()
from r, v, mu, kappa (set by Compute)
Definition asymptote.cpp:86
static Double_t LabAngle(Double_t thetaCM, Double_t m1, Double_t m2)
Lab angle of the projectile (mass m1) on a target (mass m2) at rest, from the CM angle.
TVector3 GetR() const
(fm)
void SetLab()
lab velocities and angles from the relative asymptotes
TVector3 evec
A point body with mass, position, velocity, step count, time and an optional recorded path.
Definition particle.hpp:36