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. More...
 
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". More...
 
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. More...
 
Double_t GetDistance2 (const TVector3 &v1, const TVector3 &v2)
 This method returns the squared cartesian distance between vector v2 and v1. More...
 
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. More...
 
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. More...
 
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! More...
 
Double_t GetVectorsAngle (const TVector3 &v1, const TVector3 &v2)
 This method will return the angle in radians between 2 vectors. More...
 
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. More...
 
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! More...
 
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. More...
 
constexpr double hPlanck = 1.054E-34
 Planck constant in J*s. More...
 
constexpr double kBoltzman = 1.380E-23
 Boltzman constant in J/K. More...
 
constexpr double kelvinToeV = 86.172809e-6
 A kelvin in eV. More...
 
constexpr double lightSpeed = 2.99792458E8
 Speed of light in m/s. More...
 
constexpr double mElectron = 9.107E-31
 Electron mass in Kg. More...
 
constexpr double naturalElectron = 0.302822120214353
 Electron charge in natural units. More...
 
constexpr double PhMeterIneV = 5067731.236453719
 A meter in eV. More...
 
constexpr double qElectron = 1.602E-19
 Electron charge in C. More...
 
constexpr double secondIneV = 1519225802531030.2
 A second in eV (using natural units) More...
 
constexpr double solarRadius = 6.95700E8
 
constexpr double vacuumPermeability = 4E-7 * 3.141592653589793
 Vacuum permeability in H/m. More...
 
constexpr double vacuumPermitivity = 8.854E-12
 Vacuum permitivity in F/m. More...
 

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

◆ DistanceToAxis()

Double_t REST_Physics::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.

Definition at line 71 of file TRestPhysics.cxx.

◆ GetConeMatrix()

TMatrixD REST_Physics::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".

Definition at line 150 of file TRestPhysics.cxx.

◆ 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.

◆ GetDistance()

Double_t REST_Physics::GetDistance ( const TVector3 &  v1,
const TVector3 &  v2 
)

This method returns the cartesian distance between vector v2 and v1.

Definition at line 321 of file TRestPhysics.cxx.

◆ GetDistance2()

Double_t REST_Physics::GetDistance2 ( const TVector3 &  v1,
const TVector3 &  v2 
)

This method returns the squared cartesian distance between vector v2 and v1.

Definition at line 326 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.

◆ GetParabolicNormal()

TVector3 REST_Physics::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.

Definition at line 208 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.

◆ GetPlaneVectorIntersection()

TVector3 REST_Physics::GetPlaneVectorIntersection ( const TVector3 &  pos,
const TVector3 &  dir,
TVector3 const &  n,
TVector3 const &  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.

Definition at line 81 of file TRestPhysics.cxx.

◆ GetVectorReflection()

TVector3 REST_Physics::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!

Definition at line 172 of file TRestPhysics.cxx.

◆ GetVectorsAngle()

Double_t REST_Physics::GetVectorsAngle ( const TVector3 &  v1,
const TVector3 &  v2 
)

This method will return the angle in radians between 2 vectors.

Definition at line 177 of file TRestPhysics.cxx.

◆ MoveByDistance()

TVector3 REST_Physics::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.

Definition at line 310 of file TRestPhysics.cxx.

◆ MoveByDistanceFast()

TVector3 REST_Physics::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!

Definition at line 316 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.

Variable Documentation

◆ AU

constexpr double REST_Physics::AU = 1.49597870691E11
constexpr

Average Sun-Earth distance in m.

Definition at line 61 of file TRestPhysics.h.

◆ hPlanck

constexpr double REST_Physics::hPlanck = 1.054E-34
constexpr

Planck constant in J*s.

Definition at line 49 of file TRestPhysics.h.

◆ kBoltzman

constexpr double REST_Physics::kBoltzman = 1.380E-23
constexpr

Boltzman constant in J/K.

Definition at line 47 of file TRestPhysics.h.

◆ kelvinToeV

constexpr double REST_Physics::kelvinToeV = 86.172809e-6
constexpr

A kelvin in eV.

Definition at line 58 of file TRestPhysics.h.

◆ lightSpeed

constexpr double REST_Physics::lightSpeed = 2.99792458E8
constexpr

Speed of light in m/s.

Definition at line 41 of file TRestPhysics.h.

◆ mElectron

constexpr double REST_Physics::mElectron = 9.107E-31
constexpr

Electron mass in Kg.

Definition at line 45 of file TRestPhysics.h.

◆ naturalElectron

constexpr double REST_Physics::naturalElectron = 0.302822120214353
constexpr

Electron charge in natural units.

Definition at line 56 of file TRestPhysics.h.

◆ PhMeterIneV

constexpr double REST_Physics::PhMeterIneV = 5067731.236453719
constexpr

A meter in eV.

Definition at line 52 of file TRestPhysics.h.

◆ qElectron

constexpr double REST_Physics::qElectron = 1.602E-19
constexpr

Electron charge in C.

Definition at line 43 of file TRestPhysics.h.

◆ secondIneV

constexpr double REST_Physics::secondIneV = 1519225802531030.2
constexpr

A second in eV (using natural units)

Definition at line 54 of file TRestPhysics.h.

◆ solarRadius

constexpr double REST_Physics::solarRadius = 6.95700E8
constexpr

Definition at line 64 of file TRestPhysics.h.

◆ vacuumPermeability

constexpr double REST_Physics::vacuumPermeability = 4E-7 * 3.141592653589793
constexpr

Vacuum permeability in H/m.

Definition at line 39 of file TRestPhysics.h.

◆ vacuumPermitivity

constexpr double REST_Physics::vacuumPermitivity = 8.854E-12
constexpr

Vacuum permitivity in F/m.

Definition at line 37 of file TRestPhysics.h.