REST-for-Physics  v2.3
Rare Event Searches ToolKit for Physics
Functions | Variables
REST_Physics Namespace Reference

This namespace serves to define physics constants and other basic physical operations. More...

Functions

Double_t DistanceToAxis (const TVector3 &axisPoint, const TVector3 &axisVector, const TVector3 &point)
 This method will return the distance from point to the straight defined by axisPoint and axisVector.
 
TMatrixD GetConeMatrix (const TVector3 &d, const Double_t cosTheta)
 It returns the cone matrix M = d^T x d - cosTheta^2 x I, extracted from the document by "David Eberly, Geometric Tools, Redmond WA 98052, Intersection of a Line and a Cone".
 
TVector3 GetConeNormal (const TVector3 &pos, const Double_t alpha, const Double_t R)
 This method will return a vector that is normal to the cone surface. The position pos should be at the cone surface, and the angle alpha should be the angle that defines the cone construction. More...
 
Double_t GetConeVectorIntersection (const TVector3 &pos, const TVector3 &dir, const TMatrixD &M, const TVector3 &axis, const TVector3 &v)
 This method will find the intersection of the trajectory defined by the vector starting at pos and moving in direction dir and the cone defined by its characteristic matrix M, which is built using the cone axis vector d as d^T x d, and the vertexv. The resulting TVector3 will be the position of the particle placed at the cone surface. More...
 
Double_t GetConeVectorIntersection (const TVector3 &pos, const TVector3 &dir, const TVector3 &d, const TVector3 &v, const Double_t cosTheta)
 This method will find the intersection of the trajectory defined by the vector starting at pos and moving in direction dir and the cone defined by its axis vector d and the vertexv. The cosine of the angle defining the cone should be also given inside the cosTheta argument. More...
 
Double_t GetDistance (const TVector3 &v1, const TVector3 &v2)
 This method returns the cartesian distance between vector v2 and v1.
 
Double_t GetDistance2 (const TVector3 &v1, const TVector3 &v2)
 This method returns the squared cartesian distance between vector v2 and v1.
 
TVector3 GetHyperbolicNormal (const TVector3 &pos, const Double_t beta, const Double_t R3, const Double_t focal)
 This method returns the normal vector on a hyperbolic surface pointing towards the inside of the hyperboloid. pos is the origin point of the normal vector on the hyperbolic plane and beta is the angle between the hyperboloid and the z-axis at the plane where the hyperboloid has the radius R3. More...
 
TVector3 GetHyperbolicVectorIntersection (const TVector3 &pos, const TVector3 &dir, const Double_t beta, const Double_t R3, const Double_t focal)
 
TVector3 GetParabolicNormal (const TVector3 &pos, const Double_t alpha, const Double_t R3)
 This method returns the normal vector on a parabolic surface pointing towards the inside of the paraboloid. pos is the origin point of the normal vector on the parabolic plane and alpha is the angle between the paraboloid and the z-axis at the plane where the paraboloid has the radius R3.
 
TVector3 GetParabolicVectorIntersection (const TVector3 &pos, const TVector3 &dir, const Double_t alpha, const Double_t R3)
 
TVector3 GetPlaneVectorIntersection (const TVector3 &pos, const TVector3 &dir, const TVector3 &n, const TVector3 &a)
 This method will find the intersection of the trajectory defined by the vector starting at pos and moving in direction dir and the plane defined by its normal vector n and the point a. This is equivalent to move/translate the position pos to the plane.
 
TVector3 GetVectorReflection (const TVector3 &dir, const TVector3 &n)
 This method will return the reflected vector respect to a plane defined by its normal vector n. The normal vector should be already normalized!
 
Double_t GetVectorsAngle (const TVector3 &v1, const TVector3 &v2)
 This method will return the angle in radians between 2 vectors.
 
TVector3 MoveByDistance (const TVector3 &pos, const TVector3 &dir, Double_t d)
 This method transports a position pos by a distance d in the direction defined by dir.
 
TVector3 MoveByDistanceFast (const TVector3 &pos, const TVector3 &dir, Double_t d)
 This method transports a position pos by a distance d in the direction defined by dir. This method assumes the vector dir is unitary!
 
TVector3 MoveToPlane (const TVector3 &pos, const TVector3 &dir, const TVector3 &n, const TVector3 &a)
 This method will translate the vector with direction dir starting at position pos to the plane defined by the normal vector plane, n that contains the point a in the plane. More...
 

Variables

constexpr double AU = 1.49597870691E11
 Average Sun-Earth distance in m.
 
constexpr double hPlanck = 1.054E-34
 Planck constant in J*s.
 
constexpr double kBoltzman = 1.380E-23
 Boltzman constant in J/K.
 
constexpr double kelvinToeV = 86.172809e-6
 A kelvin in eV.
 
constexpr double lightSpeed = 2.99792458E8
 Speed of light in m/s.
 
constexpr double mElectron = 9.107E-31
 Electron mass in Kg.
 
constexpr double naturalElectron = 0.302822120214353
 Electron charge in natural units.
 
constexpr double PhMeterIneV = 5067731.236453719
 A meter in eV.
 
constexpr double qElectron = 1.602E-19
 Electron charge in C.
 
constexpr double secondIneV = 1519225802531030.2
 A second in eV (using natural units)
 
constexpr double solarRadius = 6.95700E8
 
constexpr double vacuumPermeability = 4E-7 * 3.141592653589793
 Vacuum permeability in H/m.
 
constexpr double vacuumPermitivity = 8.854E-12
 Vacuum permitivity in F/m.
 

Detailed Description

This namespace serves to define physics constants and other basic physical operations.

The methods and physics constants in this class can be accessed using the REST_Physics:: namespace.

We include basic geometrical operations that transform space coordinates or implement vector transportation.


RESTsoft - Software for Rare Event Searches with TPCs

History of developments:

2019-Mar: First concept and implementation of REST_Physics namespace.

Author
Javier Galan javie.nosp@m.r.ga.nosp@m.lan@u.nosp@m.niza.nosp@m.r.es

Function Documentation

◆ GetConeNormal()

TVector3 REST_Physics::GetConeNormal ( const TVector3 &  pos,
const Double_t  alpha,
const Double_t  R 
)

This method will return a vector that is normal to the cone surface. The position pos should be at the cone surface, and the angle alpha should be the angle that defines the cone construction.

It is assumed that the vertex is found at the right of pos.

Optionally, the radius of the cone at the given pos can be provided to facilitate the calculation

Definition at line 189 of file TRestPhysics.cxx.

◆ GetConeVectorIntersection() [1/2]

Double_t REST_Physics::GetConeVectorIntersection ( const TVector3 &  pos,
const TVector3 &  dir,
const TMatrixD &  M,
const TVector3 &  axis,
const TVector3 &  v 
)

This method will find the intersection of the trajectory defined by the vector starting at pos and moving in direction dir and the cone defined by its characteristic matrix M, which is built using the cone axis vector d as d^T x d, and the vertexv. The resulting TVector3 will be the position of the particle placed at the cone surface.

This method will return t, which is the value the particle position, pos, needs to be displaced by the vector, dir, to get the particle at the surface of the cone. If the particle does not cross the cone, then the value returned will be zero (no particle displacement).

This method is based on the document by "David Eberly, Geometric Tools, Redmond WA 98052, Intersection of a Line and a Cone".

Definition at line 267 of file TRestPhysics.cxx.

◆ GetConeVectorIntersection() [2/2]

Double_t REST_Physics::GetConeVectorIntersection ( const TVector3 &  pos,
const TVector3 &  dir,
const TVector3 &  d,
const TVector3 &  v,
const Double_t  cosTheta 
)

This method will find the intersection of the trajectory defined by the vector starting at pos and moving in direction dir and the cone defined by its axis vector d and the vertexv. The cosine of the angle defining the cone should be also given inside the cosTheta argument.

This method will return t, which is the value the particle position, pos, needs to be displaced by the vector, dir, to get the particle at the surface of the cone. If the particle does not cross the cone, then the value returned will be zero (no particle displacement). This method is based on the document by "David Eberly, Geometric Tools, Redmond WA 98052, Intersection of a Line and a Cone".

Definition at line 248 of file TRestPhysics.cxx.

◆ GetHyperbolicNormal()

TVector3 REST_Physics::GetHyperbolicNormal ( const TVector3 &  pos,
const Double_t  beta,
const Double_t  R3,
const Double_t  focal 
)

This method returns the normal vector on a hyperbolic surface pointing towards the inside of the hyperboloid. pos is the origin point of the normal vector on the hyperbolic plane and beta is the angle between the hyperboloid and the z-axis at the plane where the hyperboloid has the radius R3.

Just replaced here *TMath::Cot by /TMath::Tan to fix compilation issues

Just replaced here *TMath::Cot by /TMath::Tan to fix compilation issues

Definition at line 223 of file TRestPhysics.cxx.

◆ GetHyperbolicVectorIntersection()

TVector3 REST_Physics::GetHyperbolicVectorIntersection ( const TVector3 &  pos,
const TVector3 &  dir,
const Double_t  beta,
const Double_t  R3,
const Double_t  focal 
)

This method will find the intersection between a vector and a hyperbolic shape where beta = 3 * alpha is the angle between the z-axis and the hyperboloid at the plane where the hyperboloid has a radius of R3. The hyperboloid is rotationally symmetric around the z-axis. alpha in rad. The region in which the intersection can happen here is in positive direction on the z-axis.

In case no intersection is found this method returns the unmodified input position.

Just replaced here *TMath::Cot by /TMath::Tan to fix compilation issues

Just replaced here *TMath::Cot by /TMath::Tan to fix compilation issues

Definition at line 124 of file TRestPhysics.cxx.

◆ GetParabolicVectorIntersection()

TVector3 REST_Physics::GetParabolicVectorIntersection ( const TVector3 &  pos,
const TVector3 &  dir,
const Double_t  alpha,
const Double_t  R3 
)

This method will find the intersection between a vector and a parabolic shape where alpha is the angle between the z-axis and the paraboloid at the plane where the paraboloid has a radius of R3. The paraboloid is rotationally symmetric around the z-axis. alpha in rad. The region in which the intersection can happen here is in negative direction on the z-axis.

In case no intersection is found this method returns the unmodified input position.

Definition at line 94 of file TRestPhysics.cxx.

◆ MoveToPlane()

TVector3 REST_Physics::MoveToPlane ( const TVector3 &  pos,
const TVector3 &  dir,
const TVector3 &  n,
const TVector3 &  a 
)

This method will translate the vector with direction dir starting at position pos to the plane defined by the normal vector plane, n that contains the point a in the plane.

If the vector is parallel to the plane the position pos will not be translated.

Definition at line 58 of file TRestPhysics.cxx.