RooParticle
Particle scattering simulator with ROOT
Loading...
Searching...
No Matches
force.hpp
Go to the documentation of this file.
1#ifndef H_FORCE
2#define H_FORCE 1;
3
4#include "TROOT.h"
5#include "TVector3.h"
6#include "particle.hpp"
7
24class force{
25public:
27 virtual ~force(){}
28
33 virtual TVector3 Evaluate(particle* p1_, particle* p2_){
34 TVector3 a_;
35 std::cout<<"NULL Force"<<endl; return a_;
36 }
37
42 virtual Double_t Potential(particle* p1_, particle* p2_){
43 Double_t a_ = 0.;
44 std::cout<<"NULL Force, Potential"<<endl; return a_;
45 };
46protected:
49private:
50};
51
66class coulombForce: public force{
67public:
71 TVector3 Evaluate(particle* p1_, particle* p2_);
73 Double_t Potential(particle* p1_, particle* p2_);
74
76 void SetK(Double_t k_){coulombK = k_;}
78 Double_t GetK(){return coulombK;}
80 void SetSoftening(Double_t eps_){softening = eps_;}
82 Double_t GetSoftening(){return softening;}
83protected:
84 Double_t coulombK = 0.00154629;
85 Double_t softening = 0.;
86private:
87};
88
104class universalForce: public force{ //Gravity
105public:
109 TVector3 Evaluate(particle* p1_, particle* p2_);
111 Double_t Potential(particle* p1_, particle* p2_);
112
114 void SetG(Double_t g_){gravityG = g_;}
116 Double_t GetG(){return gravityG;}
118 void SetSoftening(Double_t eps_){softening = eps_;}
120 Double_t GetSoftening(){return softening;}
121protected:
122 Double_t gravityG = 1.2331e-39;
123 Double_t softening = 0.;
124private:
125};
126
139class yukawaForce: public force{
140public:
144 yukawaForce(Double_t g_ = 0.1, Double_t a_ = 1.4138):force(){g = g_; a = a_;}
146 TVector3 Evaluate(particle* p1_, particle* p2_);
148 Double_t Potential(particle* p1_, particle* p2_);
149
151 void SetCoupling(Double_t g_){g = g_;}
153 Double_t GetCoupling(){return g;}
155 void SetRange(Double_t a_){a = a_;}
157 Double_t GetRange(){return a;}
158protected:
159 Double_t g = 0.1;
160 Double_t a = 1.4138;
161private:
162};
163
175class woodsSaxonForce: public force{
176public:
181 woodsSaxonForce(Double_t V0_ = 0.0536772, Double_t R_ = 8.886, Double_t a_ = 0.65):force(){
182 V0 = V0_; R = R_; a = a_;
183 }
185 TVector3 Evaluate(particle* p1_, particle* p2_);
187 Double_t Potential(particle* p1_, particle* p2_);
188
190 void SetDepth(Double_t V0_){V0 = V0_;}
192 Double_t GetDepth(){return V0;}
194 void SetRadius(Double_t R_){R = R_;}
196 Double_t GetRadius(){return R;}
198 void SetDiffuseness(Double_t a_){a = a_;}
200 Double_t GetDiffuseness(){return a;}
201protected:
202 Double_t V0 = 0.0536772;
203 Double_t R = 8.886;
204 Double_t a = 0.65;
205private:
206};
207
208#endif
Electric (Coulomb) force between the charges of two particles.
Definition force.hpp:66
Double_t softening
softening length in fm
Definition force.hpp:85
Double_t GetSoftening()
The softening length eps in fm.
Definition force.hpp:82
TVector3 Evaluate(particle *p1_, particle *p2_)
Coulomb force on p1_ by p2_ (amu c^2/fm), see the class description.
Definition force.cpp:12
Double_t Potential(particle *p1_, particle *p2_)
Coulomb potential energy of the pair (amu c^2), see the class description.
Definition force.cpp:30
Double_t GetK()
k in amu c^2 fm / e^2.
Definition force.hpp:78
void SetK(Double_t k_)
Set k in amu c^2 fm / e^2.
Definition force.hpp:76
coulombForce()
Make the force with k = 0.00154629 and no softening.
Definition force.hpp:69
Double_t coulombK
k in amu c^2 fm / e^2
Definition force.hpp:84
void SetSoftening(Double_t eps_)
Set the softening length eps in fm (0 : none).
Definition force.hpp:80
Base class of the pairwise forces.
Definition force.hpp:24
virtual TVector3 Evaluate(particle *p1_, particle *p2_)
Force on the first particle by the second.
Definition force.hpp:33
force()
Only subclasses can be made.
Definition force.hpp:48
virtual Double_t Potential(particle *p1_, particle *p2_)
Potential energy of the pair (amu c^2).
Definition force.hpp:42
virtual ~force()
Virtual : a force deleted through force* must run the subclass destructor.
Definition force.hpp:27
A point body with mass, position, velocity, step count, time and an optional recorded path.
Definition particle.hpp:36
Newtonian gravity between the rest masses of two particles. Always attractive.
Definition force.hpp:104
Double_t GetSoftening()
The softening length eps in fm.
Definition force.hpp:120
Double_t Potential(particle *p1_, particle *p2_)
Gravitational potential energy of the pair (amu c^2).
Definition force.cpp:53
Double_t gravityG
gravitational constant (amu^-1 c^2 fm)
Definition force.hpp:122
universalForce()
Make the force with G = 1.2331e-39 and no softening.
Definition force.hpp:107
Double_t softening
softening length in fm
Definition force.hpp:123
TVector3 Evaluate(particle *p1_, particle *p2_)
Gravitational force on p1_ by p2_ (amu c^2/fm).
Definition force.cpp:43
void SetSoftening(Double_t eps_)
Set the softening length eps in fm (0 : none).
Definition force.hpp:118
void SetG(Double_t g_)
Set the gravitational constant G.
Definition force.hpp:114
Double_t GetG()
The gravitational constant G.
Definition force.hpp:116
Woods-Saxon potential (nucleus-nucleus optical potential, real part).
Definition force.hpp:175
void SetDepth(Double_t V0_)
Set the depth V0 in amu c^2.
Definition force.hpp:190
Double_t GetRadius()
The radius R in fm.
Definition force.hpp:196
Double_t GetDiffuseness()
The diffuseness a in fm.
Definition force.hpp:200
void SetDiffuseness(Double_t a_)
Set the diffuseness a in fm.
Definition force.hpp:198
Double_t Potential(particle *p1_, particle *p2_)
Woods-Saxon potential energy of the pair (amu c^2).
Definition force.cpp:91
Double_t V0
depth in amu c^2
Definition force.hpp:202
void SetRadius(Double_t R_)
Set the radius R in fm.
Definition force.hpp:194
TVector3 Evaluate(particle *p1_, particle *p2_)
Woods-Saxon force on p1_ by p2_ (amu c^2/fm).
Definition force.cpp:81
woodsSaxonForce(Double_t V0_=0.0536772, Double_t R_=8.886, Double_t a_=0.65)
Make the force.
Definition force.hpp:181
Double_t GetDepth()
The depth V0 in amu c^2.
Definition force.hpp:192
Double_t R
radius in fm
Definition force.hpp:203
Double_t a
diffuseness in fm
Definition force.hpp:204
Yukawa (meson exchange) potential, central, independent of charge and mass.
Definition force.hpp:139
Double_t a
range in fm
Definition force.hpp:160
Double_t g
coupling in amu c^2 fm
Definition force.hpp:159
TVector3 Evaluate(particle *p1_, particle *p2_)
Yukawa force on p1_ by p2_ (amu c^2/fm).
Definition force.cpp:60
void SetRange(Double_t a_)
Set the range a in fm.
Definition force.hpp:155
yukawaForce(Double_t g_=0.1, Double_t a_=1.4138)
Make the force.
Definition force.hpp:144
Double_t GetRange()
The range a in fm.
Definition force.hpp:157
Double_t Potential(particle *p1_, particle *p2_)
Yukawa potential energy of the pair (amu c^2).
Definition force.cpp:69
Double_t GetCoupling()
The coupling g in amu c^2 fm.
Definition force.hpp:153
void SetCoupling(Double_t g_)
Set the coupling g in amu c^2 fm.
Definition force.hpp:151