hephysics.vec
Class Hep3Vector
- java.lang.Object
-
- hephysics.vec.Hep3Vector
-
- All Implemented Interfaces:
- java.io.Serializable
public class Hep3Vector extends java.lang.Object implements java.io.Serializable
Basic implementation of a Hep3Vector- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description Hep3Vector()
New 3-vectorHep3Vector(double[] d)
Create a BasicHep3Vector from a double arrayHep3Vector(double dx, double dy, double dz)
Define a 3-vectorHep3Vector(float[] f)
Define a new vector
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description double
abs()
Magnitudevoid
add(Hep3Vector v)
Add a vectorHep3Vector
add(Hep3Vector v, Hep3Vector w)
Add 2 vectors and return a new objectdouble
angle(Hep3Vector momentum)
Angle between 2 vectorsHepLorentzVector
boost(HepLorentzVector fourVector, Hep3Vector boostVector)
Boost fourVector with boostVector.HepLorentzVector
boost(HepLorentzVector fourVector, HepLorentzVector refFourVector)
Boost fourVector into system of refFourVector.Hep3Vector
centerOfMass(java.util.List<Hep3Vector> vecSet)
Return a center of mass of a list of vectorsHep3Vector
copy(Hep3Vector p)
New copydouble
cosTheta()
cosThetadouble
cosTheta(Hep3Vector vector)
Cosine ThetaHep3Vector
cross(Hep3Vector v, Hep3Vector w)
Cross product of 2 vectorsdouble
dot(Hep3Vector p)
Dot operationdouble
dot(Hep3Vector v, Hep3Vector w)
Dot product of 2 vectorsboolean
equals(java.lang.Object obj)
double
getEta()
int
hashCode()
double
mag()
double
mag2()
double
magnitudeSquared()
void
mult(double scalar)
Multiply by a scalerHep3Vector
mult(double scalar, Hep3Vector v)
Multiply by a scalerHep3Vector
mult(Hep3Matrix m, Hep3Vector v)
Hep3Vector
neg(Hep3Vector v)
Invertdouble
perp()
Transversedouble
perp2()
Transversedouble
phi()
Phidouble
pseudoRapidity()
Pseudorapidity.double
rapidity()
Rapidity.void
setPhi(double ph)
Set phivoid
setV(double dx, double dy, double dz)
Set vectorvoid
setX(double x)
Set X componentvoid
setY(double y)
Y componentvoid
setZ(double z)
Set Z componentvoid
sub(Hep3Vector v)
SubtractHep3Vector
sub(Hep3Vector v, Hep3Vector w)
Subtractdouble
theta()
angle theta (=atan2(perp(),z)java.lang.String
toString()
Hep3Vector
unit(Hep3Vector v)
returns (0,0,0) vector if input vector has length 0double[]
v()
double
x()
double
y()
double
z()
-
-
-
Constructor Detail
-
Hep3Vector
public Hep3Vector()
New 3-vector
-
Hep3Vector
public Hep3Vector(double dx, double dy, double dz)
Define a 3-vector- Parameters:
dx
-dy
-dz
-
-
Hep3Vector
public Hep3Vector(double[] d)
Create a BasicHep3Vector from a double array- Parameters:
d
- An array {x,y,z}
-
Hep3Vector
public Hep3Vector(float[] f)
Define a new vector- Parameters:
f
-
-
-
Method Detail
-
abs
public double abs()
Magnitude- Returns:
-
copy
public Hep3Vector copy(Hep3Vector p)
New copy- Parameters:
p
-- Returns:
-
cosTheta
public double cosTheta()
cosTheta- Returns:
-
phi
public double phi()
Phi- Returns:
-
unit
public Hep3Vector unit(Hep3Vector v)
returns (0,0,0) vector if input vector has length 0
-
neg
public Hep3Vector neg(Hep3Vector v)
Invert- Parameters:
v
-- Returns:
-
add
public Hep3Vector add(Hep3Vector v, Hep3Vector w)
Add 2 vectors and return a new object- Parameters:
v
-w
-- Returns:
- new object
-
add
public void add(Hep3Vector v)
Add a vector- Parameters:
v
-
-
sub
public void sub(Hep3Vector v)
Subtract- Parameters:
v
-
-
sub
public Hep3Vector sub(Hep3Vector v, Hep3Vector w)
Subtract- Parameters:
v
-w
-- Returns:
-
mult
public Hep3Vector mult(double scalar, Hep3Vector v)
Multiply by a scaler- Parameters:
scalar
-v
-- Returns:
-
mult
public void mult(double scalar)
Multiply by a scaler- Parameters:
scalar
-
-
centerOfMass
public Hep3Vector centerOfMass(java.util.List<Hep3Vector> vecSet)
Return a center of mass of a list of vectors- Parameters:
vecSet
-- Returns:
-
cross
public Hep3Vector cross(Hep3Vector v, Hep3Vector w)
Cross product of 2 vectors- Parameters:
v
- vector 1w
- vector 2- Returns:
- cross product
-
dot
public double dot(Hep3Vector v, Hep3Vector w)
Dot product of 2 vectors- Parameters:
v
- vector 1w
- vector 2- Returns:
- product
-
perp
public double perp()
Transverse- Returns:
-
dot
public double dot(Hep3Vector p)
Dot operation- Parameters:
p
-- Returns:
-
perp2
public double perp2()
Transverse- Returns:
-
angle
public double angle(Hep3Vector momentum)
Angle between 2 vectors- Parameters:
momentum
-- Returns:
-
setV
public void setV(double dx, double dy, double dz)
Set vector- Parameters:
dx
-dy
-dz
-
-
x
public double x()
-
y
public double y()
-
z
public double z()
-
setX
public void setX(double x)
Set X component- Parameters:
x
-
-
boost
public HepLorentzVector boost(HepLorentzVector fourVector, Hep3Vector boostVector)
Boost fourVector with boostVector. Note, that beta=abs(boostVector) needs to be 0 < beta < 1.
-
boost
public HepLorentzVector boost(HepLorentzVector fourVector, HepLorentzVector refFourVector)
Boost fourVector into system of refFourVector.
-
mult
public Hep3Vector mult(Hep3Matrix m, Hep3Vector v)
-
setY
public void setY(double y)
Y component- Parameters:
y
-
-
setZ
public void setZ(double z)
Set Z component- Parameters:
z
-
-
mag2
public double mag2()
-
theta
public double theta()
angle theta (=atan2(perp(),z)- Returns:
-
cosTheta
public double cosTheta(Hep3Vector vector)
Cosine Theta- Parameters:
vector
-- Returns:
-
setPhi
public void setPhi(double ph)
Set phi- Parameters:
ph
- phi in radians
-
pseudoRapidity
public double pseudoRapidity()
Pseudorapidity. eta=-ln (tan (theta/2)) )- Returns:
-
rapidity
public double rapidity()
Rapidity. 0.5*log( (m+z)/(m-z) );- Returns:
-
getEta
public double getEta()
-
mag
public double mag()
-
magnitudeSquared
public double magnitudeSquared()
-
v
public double[] v()
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
-
DMelt 3.0 © DataMelt by jWork.ORG