RooParticle
Particle scattering simulator with ROOT
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | List of all members
force Class Reference

Base class of the pairwise forces. More...

#include <force.hpp>

Inheritance diagram for force:
coulombForce universalForce woodsSaxonForce yukawaForce

Public Member Functions

virtual ~force ()
 Virtual : a force deleted through force* must run the subclass destructor.
 
virtual TVector3 Evaluate (particle *p1_, particle *p2_)
 Force on the first particle by the second.
 
virtual Double_t Potential (particle *p1_, particle *p2_)
 Potential energy of the pair (amu c^2).
 

Protected Member Functions

 force ()
 Only subclasses can be made.
 

Detailed Description

Base class of the pairwise forces.

Evaluate(p1, p2) is the force on p1 by p2 in amu c^2/fm and Potential(p1, p2) the potential energy of the pair in amu c^2. Every subclass keeps \(\vec F_1 = -\nabla_{x_1} U\), so that the energy monitors (event::GetPE(), the "EDG" inspector, ...) are consistent with the dynamics.

A force added to an event with event::AddForce() acts on every pair of particles of the event, whatever their number: with N bodies the force on a particle is the sum of the force by each of the other N-1 bodies, and of every force added. The force does not know which pair it is asked about, so it must depend only on the two particles (position, mass, charge). The event may call Evaluate(p1, p2) once per pair (in the order of addition) and give the opposite to p2 (event::SetPairSymmetric()), so a force which is not antisymmetric must turn that off. Forces are not owned by the event.

To make a new force, inherit it and define both functions.

Definition at line 24 of file force.hpp.

Constructor & Destructor Documentation

◆ ~force()

virtual force::~force ( )
inlinevirtual

Virtual : a force deleted through force* must run the subclass destructor.

Definition at line 27 of file force.hpp.

◆ force()

force::force ( )
inlineprotected

Only subclasses can be made.

Definition at line 48 of file force.hpp.

Member Function Documentation

◆ Evaluate()

virtual TVector3 force::Evaluate ( particle *  p1_,
particle *  p2_ 
)
inlinevirtual

Force on the first particle by the second.

Parameters
p1_particle which feels the force
p2_particle which exerts the force
Returns
force vector in amu c^2/fm. The base class prints "NULL Force" and returns the zero vector.

Reimplemented in coulombForce, universalForce, yukawaForce, and woodsSaxonForce.

Definition at line 33 of file force.hpp.

◆ Potential()

virtual Double_t force::Potential ( particle *  p1_,
particle *  p2_ 
)
inlinevirtual

Potential energy of the pair (amu c^2).

Parameters
p1_first particle
p2_second particle
Returns
the energy. The base class prints "NULL Force, Potential" and returns 0.

Reimplemented in coulombForce, universalForce, yukawaForce, and woodsSaxonForce.

Definition at line 42 of file force.hpp.


The documentation for this class was generated from the following file: