RooParticle is a classical scattering simulator built on ROOT for three or more bodies. Charged particles interact through pairwise forces (Coulomb, optionally nuclear or your own), are integrated in time until terminating conditions that you choose are met, and the results (velocities, angles, closest approaches, with the run parameters) go to a ROOT TTree. Because a run must stop at a finite distance, asymptoteN corrects the final velocities of any number of bodies to their values at infinity, with an error estimate (asymptote does it exactly for two bodies). Units: length fm, mass amu, velocity c, charge e, time fm/c, energy amu c \(^2\) (931.494 MeV).
A minimal example
An alpha particle on a fixed gold-like nucleus (from test/main_tutorial_first_check.cpp, which ctest compiles and runs):
event ev;
ev.AddForce(&coulomb);
new EMparticle(197., 79., TVector3(0., 0., 0.), TVector3(0., 0., 0.),
true,
false));
new EMparticle(4., 2., TVector3(-1000., 50., 0.), TVector3(0.05, 0., 0.),
false,
false));
A particle with a charge, for electromagnetic forces (coulombForce).
Electric (Coulomb) force between the charges of two particles.
A point body with mass, position, velocity, step count, time and an optional recorded path.
const Double_t dt = 1.;
const Double_t T = 2. * 1000. / alpha->
GetV().Mag();
const Int_t nsteps = TMath::Nint(T / dt);
const TVector3 vin = alpha->
GetV();
const Double_t E0 = ev.GetNetE();
ev.DeriveDTN(nsteps, dt);
TVector3 GetV()
Velocity in c (a copy).
TVector3 x = alpha->
GetX();
TVector3 v = alpha->
GetV();
std::printf(
"steps, time : %ld steps, %.1f fm/c\n", (
long) alpha->
GetECNT(), alpha->
GetTime());
std::printf("final position (fm) : (%.3f, %.3f, %.3f) r = %.3f fm\n", x.X(), x.Y(), x.Z(), x.Mag());
std::printf("final velocity (c) : (%.6f, %.6f, %.6f) |v| = %.6f c\n", v.X(), v.Y(), v.Z(), v.Mag());
Double_t theta = vin.Angle(v) * TMath::RadToDeg();
std::printf("scattering angle : %.4f deg\n", theta);
Long_t GetECNT()
Number of derived steps ("evolved count"), counted also for an invincible particle.
Double_t GetTime()
Evolved time in fm/c; does not advance for an invincible particle.
TVector3 GetX()
Position in fm (a copy).
Where to go
- Tutorial: from this first event to stopping conditions, exact two-body asymptotes, events with three and more bodies and their asymptotic velocities, Monte Carlo runs with parallel jobs, accuracy, other forces and track recording. Every code block is a tested program.
- Concepts: units and constants, ownership and copying, integrators, terminating conditions in full, the finite-distance problem, forces, reproducibility.
- Validation: physics checks against known results.
- Class reference: event, particle, force, inspectorP, inspectorE, asymptote, asymptoteN (full list under "Classes").
- Build:
cmake <source> && make && ctest; this manual: make doc (0. Build, test, and build this manual). Writers of these pages: docs/README.md in the repository.