|
RooParticle
Particle scattering simulator with ROOT
|
One simulated system: particles, pairwise forces, inspectors and the time integration. More...
#include <event.hpp>
Public Types | |
| enum | integrator { kTaylor = 0 , kSymplecticEuler , kVelocityVerlet , kRK4 , kRK45 } |
| Integration scheme used by DeriveDT(). More... | |
| enum | inspectMode { kInspectAND = 0 , kInspectOR } |
| How the non-abort inspectors are combined in Inspect(). More... | |
| enum | stopReason { kStopNone = 0 , kStopInspector , kStopAbort , kStopMaxSteps , kStopInvalid , kStopFailed } |
| Why the last DeriveInspect() returned. More... | |
Public Member Functions | |
| event () | |
| Make an empty event: no particles, forces, inspectors nor volume. | |
| event (event &e) | |
| Make a copy of an event, to run many events from one template. | |
| virtual | ~event () |
| Delete the particles, the inspectors and the pre-derived copy (not the forces nor the volume). | |
| event & | operator= (const event &)=delete |
| Deleted: the default assignment would copy the pointers and delete them twice. | |
| particle * | AddParticle (particle *particle_) |
| Add a particle to the event. | |
| void | AddForce (force *force_) |
| Add a force that acts on every pair of particles of the event. | |
| void | AddInspector (inspector *inspector_) |
| Add an inspector (a terminating condition for DeriveInspect()). | |
| void | SetVolume (eventVolume *volume_) |
| Set the volume used by IsInsideVolume() and the "VOUT"/"VOUTA" inspectors. | |
| void | SetIntegrator (integrator integ_) |
| Select the integrator by enumerator (see integrator). | |
| Bool_t | SetIntegrator (TString name) |
| Select the integrator by name. | |
| integrator | GetIntegrator () |
| The integrator in use (default kTaylor). | |
| TString | GetIntegratorName () |
| Name of the integrator in use, as accepted by SetIntegrator(TString). | |
| void | SetTolerance (Double_t rel, Double_t abs) |
| Set the tolerances of kRK45. | |
| Double_t | GetRelTolerance () |
| Relative tolerance of kRK45. | |
| Double_t | GetAbsTolerance () |
| Absolute tolerance of kRK45 (fm for positions, c for velocities). | |
| Double_t | GetRK45Substep () |
| Substep suggested for the next kRK45 DeriveDT, in fm/c (0 : none yet). | |
| Long_t | GetRK45NSubsteps () |
| Number of accepted kRK45 substeps so far. | |
| Long_t | GetRK45NRejected () |
| Number of rejected kRK45 substeps so far. | |
| void | SetPairSymmetric (Bool_t sym_=kTRUE) |
| Use Newton's third law to evaluate each pair once (default on). | |
| Bool_t | IsPairSymmetric () |
| Whether the pair symmetry is in use (default kTRUE). | |
| void | SetRelativistic (Bool_t rel_=kTRUE) |
| Switch the dynamics to special relativity (default off). | |
| Bool_t | IsRelativistic () |
| Whether the relativistic flag is set (the flag only; kTaylor ignores it). | |
| void | SetInspectMode (inspectMode mode_) |
| Set how the non-abort inspectors are combined in Inspect() (default kInspectAND). | |
| inspectMode | GetInspectMode () |
| The way the non-abort inspectors are combined. | |
| void | SetMaxInspectSteps (Long_t n) |
| Set the safety cap of DeriveInspect(). | |
| Long_t | GetMaxInspectSteps () |
| The safety cap of steps of DeriveInspect() (0 : unlimited). | |
| stopReason | GetStopReason () |
| Why the last DeriveInspect() ended (kStopNone before the first call). | |
| TString | GetStopReasonName () |
| Name of the last stop reason: "NONE", "INSPECTOR", "ABORT", "MAXSTEPS", "INVALID" or "FAILED". | |
| Bool_t | HasIntegratorFailed () |
| True once the integrator has given up. | |
| void | CalibrateVelocity () |
| Correct the speed of every non-invincible particle so that the given velocity is the velocity far from the others. | |
| virtual void | DeriveDT (Double_t dt=1) |
| Advance the event by one time step with the selected integrator. | |
| void | DeriveDTN (Int_t n=1, Double_t dt=1) |
| Call DeriveDT() n times. | |
| void | DeriveMAX (Double_t dt=1) |
| Call DeriveDT() MAXSTEPS times (100,000, RPConfig.hpp), ignoring the inspectors. | |
| Bool_t | DeriveInspect (Int_t iperiod=1, Double_t dt=1) |
| Derive until Inspect() is satisfied. | |
| particle * | getParticle (Int_t index) |
| Get a particle by the order of addition. | |
| force * | getForce (Int_t index) |
| Get a force by the order of addition (index as in getParticle(); the force is not owned). | |
| inspector * | getInspector (Int_t index) |
| Get an inspector by the order of addition (index as in getParticle(); owned by the event). | |
| Int_t | getNParticle () |
| Number of particles. | |
| Int_t | getNForce () |
| Number of forces. | |
| Int_t | getNInspector () |
| Number of inspectors. | |
| Long_t | GetDeriveN (const Bool_t minima=kFALSE) |
| Number of derived steps (particle::GetECNT()) over all particles, invincible ones included. | |
| Double_t | GetPE (Int_t index, Bool_t OnlyInvincibles=kFALSE) |
| Potential energy of one particle with the other particles (amu c^2). | |
| Double_t | GetPE (particle *p, Bool_t OnlyInvincibles=kFALSE) |
| Same as GetPE(Int_t, Bool_t) for a particle pointer. | |
| Double_t | GetNetKE (const Bool_t SR=kFALSE) |
| Kinetic energy of the non-invincible particles (amu c^2). | |
| Double_t | GetNetPE () |
| Potential energy of the whole event (amu c^2). | |
| Double_t | GetNetE (const Bool_t SR=kFALSE) |
| GetNetKE(SR) + GetNetPE(); conserved in the non-relativistic mode only (see GetNetERel()). | |
| Double_t | GetNetKERel () |
| Relativistic kinetic energy, the sum of \((\gamma-1) m_0\) over the non-invincible particles (amu c^2). | |
| Double_t | GetNetERel () |
| GetNetKERel() + GetNetPE(); the conserved energy of the relativistic mode. | |
| TVector3 | GetNetMomentum () |
| Total momentum of the non-invincible particles (amu c). | |
| TVector3 | GetNetAngularMomentum (TVector3 origin=TVector3()) |
| Total angular momentum \(\sum (\vec x - \vec o) \times \vec p\) of the non-invincible particles (amu c fm). | |
| Double_t | GetTime () |
| The largest evolved time among the particles (fm/c). Invincible particles do not advance their time, so it is 0 if all are invincible. | |
| Double_t | GetMinDistance () |
| The smallest distance between two particles, invincible ones included (fm). The largest double for fewer than two particles. | |
| Double_t | GetMaxAcceleration () |
| The largest acceleration (force / rest mass) of the non-invincible particles (amu c^2/fm/amu = c^2/fm). | |
| Bool_t | IsInsideVolume (Bool_t all=kTRUE) |
| Whether the non-invincible particles are inside the volume (SetVolume()). | |
| void | preDerive () |
| Make a copy of the event and derive it until its inspectors are satisfied (pre-derivation). | |
| void | preDeriveSetup () |
| Placeholder for the set-up after preDerive(). | |
| Bool_t | resetPreDerive () |
| Delete the pre-derived copy. | |
| Bool_t | Inspect () |
| Evaluate the terminating condition once, without deriving. | |
| TString | Print (Bool_t onlymechanic=kFALSE, Bool_t mute=kFALSE, Bool_t pprint=kFALSE) |
| Describe the event (particles and inspectors) as text. | |
| Bool_t | SetInitial () |
| Set the initial condition from the present one. | |
Protected Member Functions | |
| void | DeriveTaylor (Double_t dt) |
| The original scheme: all forces are evaluated for the present state of every moving particle (every ordered pair), then every particle is moved. | |
| void | DeriveSymplecticEuler (Double_t dt) |
Symplectic Euler step, v += a dt then x += v dt (momentum in the relativistic mode). | |
| void | DeriveVelocityVerlet (Double_t dt) |
| Velocity-Verlet step (kick-drift-kick on the momentum in the relativistic mode). | |
| void | DeriveRK4 (Double_t dt) |
| Classical 4th order Runge-Kutta step. | |
| void | DeriveRK45 (Double_t dt) |
| Dormand-Prince 5(4) with adaptive substeps, advancing exactly dt (see integrator). | |
| void | ComputeForce (std::vector< TVector3 > &frc) |
| Net force on every particle at the present state, in amu c^2/fm (zero for invincibles). | |
| void | ComputeAcceleration (std::vector< TVector3 > &acc) |
| Acceleration F/m0 of every particle at the present state, in c^2/fm (zero for invincibles). | |
| void | FinishStep (Double_t dt) |
| Close one step: every particle counts the step, the moving ones advance their time, paths are recorded. | |
| virtual Bool_t | UseRelativistic () |
| Whether the relativistic option is really in effect: set, and not kTaylor. | |
| TVector3 | MomentumOf (particle *p, const TVector3 &v) |
| The state variable u of the velocity v: v itself, or \(\gamma m_0 v\) when relativistic. | |
| TVector3 | VelocityOf (particle *p, const TVector3 &u) |
| The velocity v of the state variable u (inverse of MomentumOf()). | |
| void | GetState (std::vector< TVector3 > &x, std::vector< TVector3 > &u) |
| Read the positions x and state variables u of all particles. | |
| void | SetState (const std::vector< TVector3 > &x, const std::vector< TVector3 > &u) |
| Write positions and state variables back to the non-invincible particles. | |
| void | ComputeDerivative (std::vector< TVector3 > &dx, std::vector< TVector3 > &du) |
| Time derivatives dx/dt = v and du/dt (F/m0, or F when relativistic) at the present state. | |
Protected Attributes | |
| std::vector< particle * > | particles |
| the particles, in the order of addition (owned) | |
| std::vector< force * > | forces |
| the forces (not owned) | |
| Int_t | nparticle = 0 |
| number of particles | |
| Int_t | nforce = 0 |
| number of forces | |
Private Attributes | |
| eventVolume * | volume = nullptr |
| not owned | |
| event * | pEvent = nullptr |
| pre-derived copy (owned) | |
| Bool_t | preDerived = kFALSE |
| whether pEvent is valid | |
| std::vector< inspector * > | inspectors |
| owned | |
| integrator | integ = kTaylor |
| selected integrator | |
| inspectMode | imode = kInspectAND |
| how the inspectors are combined | |
| Long_t | maxInspectSteps = MAXINSPECTSTEPS |
| safety cap of DeriveInspect() | |
| stopReason | lastStop = kStopNone |
| reason of the last DeriveInspect() | |
| Bool_t | pairSymmetric = kTRUE |
| Newton's third law in use. | |
| Bool_t | relativistic = kFALSE |
| relativistic flag | |
| Double_t | rk45Rel = RK45RELTOL |
| relative tolerance | |
| Double_t | rk45Abs = RK45ABSTOL |
| absolute tolerance | |
| Double_t | rk45H = 0. |
| substep suggested for the next call | |
| Long_t | rk45NAccept = 0 |
| accepted substeps | |
| Long_t | rk45NReject = 0 |
| rejected substeps | |
| Bool_t | rk45Warned = kFALSE |
| the minimum-substep warning was printed | |
| Bool_t | integFailed = kFALSE |
| the integrator gave up (see HasIntegratorFailed()) | |
| std::vector< TVector3 > | accCache |
| acceleration (or force) at the end of the last step | |
| std::vector< TVector3 > | accCacheX |
| positions for which accCache is valid | |
One simulated system: particles, pairwise forces, inspectors and the time integration.
An event is filled with AddParticle(), AddForce() and AddInspector(), and is then advanced with DeriveDT(), DeriveDTN(), DeriveMAX() or DeriveInspect(). Units are fm, amu, c, e and time in fm/c (energies in amu c^2, momenta in amu c).
Evaluate(p1, p2), the force on p1 by p2.So particles and inspectors must be made with new, and one of them must not be given to two events (a copied event makes its own copies). The event does NOT own the forces (AddForce()) nor the volume (SetVolume()): they are shared with the copies of the event and may live on the stack. The pointers returned by AddParticle(), getParticle() and getInspector() stay valid until the event is deleted.
event(event &e) makes a new event from a template event, to run many events with the same setup. It copies the particles (state, step count, time, charge, path, as plain particle objects), makes new inspectors of the same method, criterion and abort flag that watch the new particles (inspectorP) or the new event (inspectorE), and copies the settings: integrator, inspect mode, step cap, pair symmetry, relativistic flag, RK45 tolerances, and the volume and force pointers (shared, not duplicated). It does not copy the RK45 suggested substep and statistics, the last stop reason, the pre-derived copy, the Velocity-Verlet cache, the reference energy of the "EDG"/"EDL" inspectors, nor inspectors that are neither inspectorP nor inspectorE (they are dropped). The copy of an oddevent is a plain event with the default integrator, not an oddevent. The default assignment is deleted.| enum event::inspectMode |
How the non-abort inspectors are combined in Inspect().
The AND default is the design: a typical condition is "the particle reached the asymptote AND went through a minimum number of steps".
| Enumerator | |
|---|---|
| kInspectAND | stop when all of them are satisfied (default) |
| kInspectOR | stop when any of them is satisfied |
| enum event::integrator |
Integration scheme used by DeriveDT().
All of them evaluate every force before any particle is moved (oddevent does not). They are non-relativistic (rest mass) unless SetRelativistic(kTRUE) is called, which kTaylor ignores. The default is kTaylor, the original scheme.
| Enumerator | Name | Scheme | Order | |
|---|---|---|---|---|
| kTaylor | "TAYLOR" | x += v dt + a dt^2/2 ; v += a dt (original scheme, default) | 1 | |
| kSymplecticEuler | "SEULER" | v += a dt ; x += v dt (symplectic) | 1 | |
| kVelocityVerlet | "VERLET" | x += v dt + a dt^2/2 ; ‘v += (a + a’) dt/2(symplectic) \ilinebr </td> <td class="markdownTableBodyNone"> 2 \ilinebr </td> </tr> <tr class="markdownTableRowEven"> <td class="markdownTableBodyNone"> kRK4 \ilinebr </td> <td class="markdownTableBodyNone">"RK4"\ilinebr </td> <td class="markdownTableBodyNone"> classical Runge-Kutta \ilinebr </td> <td class="markdownTableBodyNone"> 4 \ilinebr </td> </tr> <tr class="markdownTableRowOdd"> <td class="markdownTableBodyNone"> kRK45 \ilinebr </td> <td class="markdownTableBodyNone">"RK45"` | Dormand-Prince 5(4), adaptive | 5 |
kRK45: DeriveDT(dt) still advances exactly dt and counts one step; inside, it takes as many substeps as the tolerance needs (SetTolerance()) and remembers the last suggested substep for the next call. It costs 6 force evaluations per substep plus 1 per call, so give it a dt larger than the substep.
| enum event::stopReason |
Why the last DeriveInspect() returned.
| Enumerator | |
|---|---|
| kStopNone | DeriveInspect() was not called yet (or is running) |
| kStopInspector | the inspectors were satisfied (normal end) |
| kStopAbort | an abort inspector fired |
| kStopMaxSteps | the safety cap of steps (SetMaxInspectSteps()) was reached |
| kStopInvalid | an inspector has an undefined method; nothing was derived |
| kStopFailed | the integrator gave up (kRK45 on a singular force, see HasIntegratorFailed()) |
| event::event | ( | ) |
Make an empty event: no particles, forces, inspectors nor volume.
Defaults: kTaylor, AND mode, pair symmetry on, non-relativistic, step cap MAXINSPECTSTEPS, RK45 tolerances RK45RELTOL and RK45ABSTOL (see RPConfig.hpp).
| event::event | ( | event & | e | ) |
Make a copy of an event, to run many events from one template.
See "Copying" in the class description for what is copied (particles, inspectors, settings), what is shared (forces, volume) and what is not copied. The inspectors of the source must refer to particles of the source event; an inspectorP whose particle is not in the source event is linked to a wrong particle of the copy. The argument is a non-const reference, so a const event cannot be copied.
|
virtual |
|
inline |
Add a force that acts on every pair of particles of the event.
| force_ | force object; NOT owned and NOT copied by the event (it must outlive the event, and is shared with copies of the event). |
Several forces are summed. Invalidates the Velocity-Verlet cache.
|
inline |
Add an inspector (a terminating condition for DeriveInspect()).
| inspector_ | inspector made with new; the event takes the ownership and deletes it. |
Add a particle to the event.
| particle_ | particle made with new; the event takes the ownership and deletes it. |
The particles are indexed by the order of addition (getParticle()).
| void event::CalibrateVelocity | ( | ) |
Correct the speed of every non-invincible particle so that the given velocity is the velocity far from the others.
For every non-invincible particle the speed is changed along its present direction to \( v'^2 = v^2 - (U_{all} + U_{inv})/m_0 \), where \(U_{all}\) is the potential energy of the particle with all the other particles and \(U_{inv}\) the part with the invincible ones (see particle::calibrateVelocity()). So the interaction with an invincible particle is removed completely and the one with a moving particle by half (it is shared). Uses the rest mass and the non-relativistic kinetic energy. A particle at rest stays at rest. If the radicand is negative (the potential barrier is higher than the kinetic energy) the velocity becomes NaN.
|
protected |
|
protected |
|
protected |
|
virtual |
Advance the event by one time step with the selected integrator.
| dt | time step in fm/c (a negative value runs backwards in time) |
Every non-invincible particle is moved and its time advances by dt. Every particle, invincible or not, counts one step (particle::GetECNT()) and records its path according to its record period. With kRK45 the call advances exactly dt and counts one step, but takes internal substeps. oddevent overrides this.
Reimplemented in oddevent.
| void event::DeriveDTN | ( | Int_t | n = 1, |
| Double_t | dt = 1 |
||
| ) |
Call DeriveDT() n times.
| n | number of steps |
| dt | time step in fm/c |
| Bool_t event::DeriveInspect | ( | Int_t | iperiod = 1, |
| Double_t | dt = 1 |
||
| ) |
Derive until Inspect() is satisfied.
| iperiod | the inspectors are checked every iperiod steps, the first time before any step (values below 1 are taken as 1) |
| dt | time step in fm/c |
| void event::DeriveMAX | ( | Double_t | dt = 1 | ) |
Call DeriveDT() MAXSTEPS times (100,000, RPConfig.hpp), ignoring the inspectors.
| dt | time step in fm/c |
|
protected |
|
protected |
Dormand-Prince 5(4) with adaptive substeps, advancing exactly dt (see integrator).
| dt | time step in fm/c ; may be negative |
The 5th order solution is kept and the embedded 4th order one gives the error. The substep suggested at the end of a call is used as the first substep of the next call. If the substep reaches 1e-12 of dt without meeting the tolerance (for example at a singular force), the step is accepted anyway with a warning on stderr (once per event). Counts one step for every particle per call, whatever the number of substeps.
|
protected |
|
protected |
|
protected |
Velocity-Verlet step (kick-drift-kick on the momentum in the relativistic mode).
| dt | time step in fm/c |
The acceleration (the force in the relativistic mode) at the end of the step is reused at the start of the next one, as long as every particle is at the position where the last step left it. Only the positions are compared: changing a force parameter or a particle velocity between two steps is not noticed. AddForce(), SetIntegrator(), SetPairSymmetric() and SetRelativistic() clear the cache.
|
protected |
|
inline |
| Long_t event::GetDeriveN | ( | const Bool_t | minima = kFALSE | ) |
Number of derived steps (particle::GetECNT()) over all particles, invincible ones included.
| minima | kFALSE : the largest count ; kTRUE : the smallest count. |
| force * event::getForce | ( | Int_t | index | ) |
Get a force by the order of addition (index as in getParticle(); the force is not owned).
|
inline |
| inspector * event::getInspector | ( | Int_t | index | ) |
Get an inspector by the order of addition (index as in getParticle(); owned by the event).
|
inline |
| TString event::GetIntegratorName | ( | ) |
Name of the integrator in use, as accepted by SetIntegrator(TString).
| Double_t event::GetMaxAcceleration | ( | ) |
The largest acceleration (force / rest mass) of the non-invincible particles (amu c^2/fm/amu = c^2/fm).
Evaluates the forces at the present state without changing it. It uses the rest mass also in the relativistic mode, and honors SetPairSymmetric(). 0 if nobody moves.
|
inline |
The safety cap of steps of DeriveInspect() (0 : unlimited).
| Double_t event::GetMinDistance | ( | ) |
| TVector3 event::GetNetAngularMomentum | ( | TVector3 | origin = TVector3() | ) |
Total angular momentum \(\sum (\vec x - \vec o) \times \vec p\) of the non-invincible particles (amu c fm).
| origin | the point \(\vec o\) in fm (default the origin) |
The momentum is the same as in GetNetMomentum().
|
inline |
GetNetKE(SR) + GetNetPE(); conserved in the non-relativistic mode only (see GetNetERel()).
|
inline |
GetNetKERel() + GetNetPE(); the conserved energy of the relativistic mode.
| Double_t event::GetNetKE | ( | const Bool_t | SR = kFALSE | ) |
Kinetic energy of the non-invincible particles (amu c^2).
| SR | kFALSE (default) : \(\frac12 m_0 v^2\) . kTRUE : \(\frac12 \gamma m_0 v^2\), which is not the relativistic kinetic energy and is not conserved (use GetNetKERel()). |
| Double_t event::GetNetKERel | ( | ) |
| TVector3 event::GetNetMomentum | ( | ) |
Total momentum of the non-invincible particles (amu c).
The momentum is the one of the integrated dynamics: \(\gamma m_0 v\) when the relativistic mode is really in effect (SetRelativistic() with an integrator other than kTaylor, never in oddevent), \(m_0 v\) otherwise. With an invincible particle it is not conserved, because the invincible particle takes the recoil.
| Double_t event::GetNetPE | ( | ) |
Potential energy of the whole event (amu c^2).
Every pair counts once, as half the sum of GetPE() over the particles (so the potential must be symmetric). The pairs with an invincible particle and between invincible particles are included (the latter is a constant).
|
inline |
| particle * event::getParticle | ( | Int_t | index | ) |
Get a particle by the order of addition.
| index | from 0 to getNParticle() - 1 |
| Double_t event::GetPE | ( | Int_t | index, |
| Bool_t | OnlyInvincibles = kFALSE |
||
| ) |
Potential energy of one particle with the other particles (amu c^2).
| index | index of the particle (as in getParticle(); it must be valid, otherwise the call dereferences a null pointer) |
| OnlyInvincibles | kTRUE : count only the interaction with the invincible particles |
Potential(p, other).The energy of a pair appears in the value of both particles, so the sum over all particles counts every pair twice (GetNetPE() corrects it).
| Double_t event::GetPE | ( | particle * | p, |
| Bool_t | OnlyInvincibles = kFALSE |
||
| ) |
Same as GetPE(Int_t, Bool_t) for a particle pointer.
| p | particle (it needs not be in the event; every particle of the event except p itself counts) |
| OnlyInvincibles | kTRUE : count only the interaction with the invincible particles |
|
inline |
|
inline |
|
inline |
|
inline |
|
protected |
|
inline |
Why the last DeriveInspect() ended (kStopNone before the first call).
| TString event::GetStopReasonName | ( | ) |
| Double_t event::GetTime | ( | ) |
|
inline |
True once the integrator has given up.
kRK45 gives up when one call of DeriveDT() needs more than RK45MAXSUBSTEPS substeps, which happens when two bodies fall into an unsoftened attractive singularity. The particles are left at the last accepted state and DeriveInspect() ends with kStopFailed. The flag is never cleared: the state is not usable any more.
| Bool_t event::Inspect | ( | ) |
Evaluate the terminating condition once, without deriving.
The abort inspectors are checked first: if one is satisfied it returns kTRUE at once and sets the stop reason to kStopAbort. Otherwise the non-abort inspectors are combined by the inspect mode (AND or OR). With only abort inspectors it returns kFALSE (go on); with no inspector at all it returns kTRUE. The stop reason is only ever set to kStopAbort here; it is reset by DeriveInspect().
| Bool_t event::IsInsideVolume | ( | Bool_t | all = kTRUE | ) |
Whether the non-invincible particles are inside the volume (SetVolume()).
| all | kTRUE : all of them are inside ; kFALSE : at least one is inside. |
|
inline |
|
inline |
|
protected |
Deleted: the default assignment would copy the pointers and delete them twice.
| void event::preDerive | ( | ) |
Make a copy of the event and derive it until its inspectors are satisfied (pre-derivation).
| void event::preDeriveSetup | ( | ) |
Placeholder for the set-up after preDerive().
| TString event::Print | ( | Bool_t | onlymechanic = kFALSE, |
| Bool_t | mute = kFALSE, |
||
| Bool_t | pprint = kFALSE |
||
| ) |
Describe the event (particles and inspectors) as text.
| onlymechanic | passed to particle::Print() (which ignores it) |
| mute | kFALSE (default) also prints the text to stdout |
| pprint | kTRUE puts line breaks |
| Bool_t event::resetPreDerive | ( | ) |
| Bool_t event::SetInitial | ( | ) |
|
inline |
|
inline |
| Bool_t event::SetIntegrator | ( | TString | name | ) |
|
inline |
Set the safety cap of DeriveInspect().
| n | maximum number of steps; 0 means unlimited. The default is MAXINSPECTSTEPS (100,000,000, RPConfig.hpp). |
|
inline |
Use Newton's third law to evaluate each pair once (default on).
| sym_ | kTRUE : each pair is evaluated once, Evaluate(p1, p2), and the opposite force is given to p2. kFALSE : every ordered pair is evaluated; use it for a force whose Evaluate(p2, p1) is not -Evaluate(p1, p2). |
With many bodies the force on particle i is the sum over all j of Evaluate(i, j); with the symmetry on, the pair (i, j) with i < j is evaluated once and its opposite is added to j, which halves the evaluations and makes the total force of the moving particles vanish exactly. Invincible particles never get a force either way. Used by kSymplecticEuler, kVelocityVerlet, kRK4, kRK45 and GetMaxAcceleration(). Ignored by kTaylor and by oddevent, which always evaluate every ordered pair. Invalidates the Velocity-Verlet cache.
|
inline |
Switch the dynamics to special relativity (default off).
| rel_ | kTRUE to switch on. |
With c = 1:
\[ \vec p = \gamma m_0 \vec v, \qquad \frac{d\vec p}{dt} = \vec F, \qquad \vec v = \frac{\vec p}{\sqrt{m_0^2 + p^2}} \]
The integrators kSymplecticEuler, kVelocityVerlet, kRK4 and kRK45 then integrate the momentum. kTaylor (and oddevent) ignore it and stay non-relativistic. The speeds must stay below 1 (c); otherwise the result is NaN. Retardation (finite speed of the fields) is not included. Invalidates the Velocity-Verlet cache.
Only some quantities follow the setting: GetNetMomentum() and GetNetAngularMomentum() use \(\gamma m_0 v\) and the energy inspector "EDG"/"EDL" uses GetNetERel(). The others stay non-relativistic: GetNetKE() (default argument), GetNetE(), GetMaxAcceleration() (force / rest mass), the "KEG"/"KEL"/"PKG"/"PKL" inspectors, and particle::GetP().
|
protected |
| void event::SetTolerance | ( | Double_t | rel, |
| Double_t | abs | ||
| ) |
Set the tolerances of kRK45.
| rel | relative tolerance (default RK45RELTOL = 1e-8 in RPConfig.hpp) |
| abs | absolute tolerance, in fm for positions and in c for velocities (default RK45ABSTOL = 1e-10) |
A substep is accepted when, for every moving particle, the estimated error is about below abs + rel * |value| (RMS over the moving particles and over position and velocity parts), where the value is the position (fm) and the velocity (c). In the relativistic mode the momentum divided by the rest mass is used instead of the velocity. Invalid values (negative, or both zero) are refused with a message on stderr and the previous tolerances are kept.
|
inline |
Set the volume used by IsInsideVolume() and the "VOUT"/"VOUTA" inspectors.
| volume_ | volume object; NOT owned (may be a null pointer, which means no volume). |
|
inlineprotectedvirtual |
|
protected |
The velocity v of the state variable u (inverse of MomentumOf()).
|
private |
|
private |
|
protected |
|
private |
|
private |
|
private |
the integrator gave up (see HasIntegratorFailed())
|
private |
reason of the last DeriveInspect()
|
private |
safety cap of DeriveInspect()
|
private |
|
protected |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |