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

Electric (Coulomb) force between the charges of two particles. More...

#include <force.hpp>

Inheritance diagram for coulombForce:
force

Public Member Functions

 coulombForce ()
 Make the force with k = 0.00154629 and no softening.
 
TVector3 Evaluate (particle *p1_, particle *p2_)
 Coulomb force on p1_ by p2_ (amu c^2/fm), see the class description.
 
Double_t Potential (particle *p1_, particle *p2_)
 Coulomb potential energy of the pair (amu c^2), see the class description.
 
void SetK (Double_t k_)
 Set k in amu c^2 fm / e^2.
 
Double_t GetK ()
 k in amu c^2 fm / e^2.
 
void SetSoftening (Double_t eps_)
 Set the softening length eps in fm (0 : none).
 
Double_t GetSoftening ()
 The softening length eps in fm.
 
- Public Member Functions inherited from force
virtual ~force ()
 Virtual : a force deleted through force* must run the subclass destructor.
 

Protected Attributes

Double_t coulombK = 0.00154629
 k in amu c^2 fm / e^2
 
Double_t softening = 0.
 softening length in fm
 

Additional Inherited Members

- Protected Member Functions inherited from force
 force ()
 Only subclasses can be made.
 

Detailed Description

Electric (Coulomb) force between the charges of two particles.

\[ U = \frac{k q_1 q_2}{r} \]

with the charges q1, q2 in e (particle::GetQ()) and \(k = 0.00154629\) amu c^2 fm / e^2 (about 1.44 MeV fm). Like charges repel, opposite charges attract; a particle with charge 0 feels nothing. The force is \(\vec F_1 = k q_1 q_2 (\vec x_1 - \vec x_2)/r^3\), pointing from p2 to p1 when repulsive.

With softening eps [fm]:

\[ U = \frac{k q_1 q_2}{\sqrt{r^2 + \epsilon^2}} \]

and the force is its exact gradient. It keeps the force finite at r -> 0. eps = 0 (default) runs the original unsoftened code, bit for bit, and diverges (inf or NaN) when two particles coincide. With many charged bodies the force on each is the vector sum of the Coulomb forces by all the others.

Definition at line 66 of file force.hpp.

Constructor & Destructor Documentation

◆ coulombForce()

coulombForce::coulombForce ( )
inline

Make the force with k = 0.00154629 and no softening.

Definition at line 69 of file force.hpp.

Member Function Documentation

◆ Evaluate()

TVector3 coulombForce::Evaluate ( particle *  p1_,
particle *  p2_ 
)
virtual

Coulomb force on p1_ by p2_ (amu c^2/fm), see the class description.

Reimplemented from force.

Definition at line 12 of file force.cpp.

◆ GetK()

Double_t coulombForce::GetK ( )
inline

k in amu c^2 fm / e^2.

Definition at line 78 of file force.hpp.

◆ GetSoftening()

Double_t coulombForce::GetSoftening ( )
inline

The softening length eps in fm.

Definition at line 82 of file force.hpp.

◆ Potential()

Double_t coulombForce::Potential ( particle *  p1_,
particle *  p2_ 
)
virtual

Coulomb potential energy of the pair (amu c^2), see the class description.

Reimplemented from force.

Definition at line 30 of file force.cpp.

◆ SetK()

void coulombForce::SetK ( Double_t  k_)
inline

Set k in amu c^2 fm / e^2.

Definition at line 76 of file force.hpp.

◆ SetSoftening()

void coulombForce::SetSoftening ( Double_t  eps_)
inline

Set the softening length eps in fm (0 : none).

Definition at line 80 of file force.hpp.

Member Data Documentation

◆ coulombK

Double_t coulombForce::coulombK = 0.00154629
protected

k in amu c^2 fm / e^2

Definition at line 84 of file force.hpp.

◆ softening

Double_t coulombForce::softening = 0.
protected

softening length in fm

Definition at line 85 of file force.hpp.


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