hephysics.vec
Class HepLorentzVector
- java.lang.Object
-
- hephysics.vec.HepLorentzVector
-
- All Implemented Interfaces:
- java.io.Serializable
- Direct Known Subclasses:
- LParticle
public class HepLorentzVector extends java.lang.Object implements java.io.Serializable
a HepLorentzVector (4-vector). It can hold either space-coordinate and time (x,y,z,t) or 4-momentum (px,py,pz,energy).- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description HepLorentzVector()
Default Lorentz vector constructorHepLorentzVector(double[] x, double t)
Define a Lorentz vectorHepLorentzVector(double x, double y, double z, double t)
Define a Lorentz vector This can either be (x,y,z,time) or (px,py,pz,energy)HepLorentzVector(float[] x, double t)
Define a Lorentz vectorHepLorentzVector(Hep3Vector v, double t)
Define Lorentz vector
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description void
add(HepLorentzVector parent)
Add 2 Lorentz vectorsHepLorentzVector
add(HepLorentzVector v, HepLorentzVector w)
Add 2 vectorsdouble
angle(HepLorentzVector momentum)
Angle between 2 vectorsvoid
boost(double bx, double by, double bz)
Lorentz Boost using 3-vectorHepLorentzVector
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<HepLorentzVector> vecSet)
Return a center mass vectorHepLorentzVector
copy()
Make exact copydouble
cosTheta()
cosThetadouble
dot(HepLorentzVector v, HepLorentzVector w)
Dot productdouble
e()
Get energyboolean
equals(java.lang.Object obj)
Compre 2 vectorsdouble
et()
Transverse energy.double
et2()
Transverse energy squared.double
getE()
Get energy (as e())double
getEta()
Get a pseudorapidity: eta=-ln (tan (theta/2)) )double
getT()
Get time (as t())Hep3Vector
getV3()
Get 3-vectorint
hashCode()
Hash codedouble
invariantMass()
Same as m().double
invariantMass2()
Same as m2().boolean
isLightlike(double epsilon)
is spacelike?boolean
isSpacelike()
Is particle spacelike (i.e restMass2() smaller than 0)double
m()
Invariant mass.double
m2()
Invariant mass squareddouble
mag()
Magnitude sqrt(x**2+y**2+z**2)double
mag2()
Magnitude squared: t()*t() - v.mag2() or e()*e() - v.mag2().double
mt()
Transverse mass.double
mt2()
Transverse mass: e()*e() - pz()*pz()HepLorentzVector
mult(double scalar, HepLorentzVector v)
Multiply by a scalerHep3Vector
neg(Hep3Vector v)
HepLorentzVector
neg(HepLorentzVector v)
Inversedouble
perp()
Transverse momentum.double
perp2()
Transverse momentum squareddouble
phi()
Phidouble
pseudoRapidity()
Pseudorapidity.double
px()
Get X position or (Px,Py,Pz)double
py()
Get Y position or Pydouble
pz()
Get Z position ot Pzdouble
rapidity()
Rapidity.double
restMass2()
Rest mass squared -- same as m2()void
setE(double e)
Set energyvoid
setPx(double px)
Set Pxvoid
setPy(double py)
Set Pyvoid
setPz(double pz)
Set Pzvoid
setT(double t)
Set timevoid
setV3(double x, double y, double z)
Set 3-vector position or Px,Py,Pzvoid
setV3(Hep3Vector v)
Set 3-vectorvoid
setX(double x)
Set X position.void
setY(double y)
Set Y position.void
setZ(double z)
Set Z position.double
skp(HepLorentzVector momentum)
Useful: for x1*x2+y1*y2+z1*z2HepLorentzVector
sub(HepLorentzVector v, HepLorentzVector w)
Subtract 2 vectorsdouble
t()
Get timedouble
theta()
Get theta anglejava.lang.String
toString()
Convert to stringHep3Vector
v3()
Get 3-vectordouble
x()
Get X position or Pxdouble
y()
Get Ydouble
z()
Get Z position or Pz
-
-
-
Constructor Detail
-
HepLorentzVector
public HepLorentzVector()
Default Lorentz vector constructor
-
HepLorentzVector
public HepLorentzVector(double x, double y, double z, double t)
Define a Lorentz vector This can either be (x,y,z,time) or (px,py,pz,energy)- Parameters:
x
- X position (or Px)y
- Y position (or Py)z
- Z position (or Pz)t
- time or energy
-
HepLorentzVector
public HepLorentzVector(double[] x, double t)
Define a Lorentz vector- Parameters:
x
- 3-vector position or momentumt
- time or energy
-
HepLorentzVector
public HepLorentzVector(float[] x, double t)
Define a Lorentz vector- Parameters:
x
- 3-vector with position or 3-momentumt
- time or energy
-
HepLorentzVector
public HepLorentzVector(Hep3Vector v, double t)
Define Lorentz vector- Parameters:
x
- 3-vector with position or 3-momentumt
- time or energy
-
-
Method Detail
-
setV3
public void setV3(Hep3Vector v)
Set 3-vector- Parameters:
v
- position 9x,y,z)
-
setV3
public void setV3(double x, double y, double z)
Set 3-vector position or Px,Py,Pz- Parameters:
x
- Xy
- Yz
- Z
-
px
public double px()
Get X position or (Px,Py,Pz)- Returns:
- X
-
py
public double py()
Get Y position or Py- Returns:
- Y
-
pz
public double pz()
Get Z position ot Pz- Returns:
- Z
-
x
public double x()
Get X position or Px- Returns:
- X
-
y
public double y()
Get Y- Returns:
- Y
-
z
public double z()
Get Z position or Pz- Returns:
- Z
-
e
public double e()
Get energy- Returns:
-
getE
public double getE()
Get energy (as e())- Returns:
-
setPx
public void setPx(double px)
Set Px- Parameters:
px
-
-
setPy
public void setPy(double py)
Set Py- Parameters:
py
-
-
setPz
public void setPz(double pz)
Set Pz- Parameters:
pz
-
-
setX
public void setX(double x)
Set X position.- Parameters:
x
- position.
-
setY
public void setY(double y)
Set Y position.- Parameters:
y
- Y position.
-
setZ
public void setZ(double z)
Set Z position.- Parameters:
z
- X position.
-
add
public void add(HepLorentzVector parent)
Add 2 Lorentz vectors- Parameters:
parent
-
-
mt2
public double mt2()
Transverse mass: e()*e() - pz()*pz()- Returns:
-
mag2
public double mag2()
Magnitude squared: t()*t() - v.mag2() or e()*e() - v.mag2(). This corresponds to the invariant mass squared- Returns:
-
boost
public void boost(double bx, double by, double bz)
Lorentz Boost using 3-vector- Parameters:
bx
- Xby
- Ybz
- Z
-
setE
public void setE(double e)
Set energy- Parameters:
e
- energy
-
setT
public void setT(double t)
Set time- Parameters:
t
- time
-
t
public double t()
Get time- Returns:
- time
-
getT
public double getT()
Get time (as t())- Returns:
-
v3
public Hep3Vector v3()
Get 3-vector- Returns:
- 3-vector
-
et2
public double et2()
Transverse energy squared.
-
et
public double et()
Transverse energy.- Returns:
-
restMass2
public double restMass2()
Rest mass squared -- same as m2()- Returns:
-
mt
public double mt()
Transverse mass.- Returns:
-
invariantMass2
public double invariantMass2()
Same as m2().- Returns:
-
m2
public double m2()
Invariant mass squared- Returns:
- t**2 - x**2-y**2-z**2
-
invariantMass
public double invariantMass()
Same as m(). If m2() is negative then -sqrt(-m2()) is returned.- Returns:
-
m
public double m()
Invariant mass. If m2() is negative then -sqrt(-m2()) is returned.- Returns:
- invariant mass
-
isSpacelike
public boolean isSpacelike()
Is particle spacelike (i.e restMass2() smaller than 0)- Returns:
- true if spacelike
-
isLightlike
public boolean isLightlike(double epsilon)
is spacelike?- Parameters:
epsilon
- precision- Returns:
-
dot
public double dot(HepLorentzVector v, HepLorentzVector w)
Dot product- Parameters:
v
-w
-- Returns:
-
add
public HepLorentzVector add(HepLorentzVector v, HepLorentzVector w)
Add 2 vectors- Parameters:
v
-w
-- Returns:
-
sub
public HepLorentzVector sub(HepLorentzVector v, HepLorentzVector w)
Subtract 2 vectors- Parameters:
v
-w
-- Returns:
-
mult
public HepLorentzVector mult(double scalar, HepLorentzVector v)
Multiply by a scaler- Parameters:
scalar
-v
-- Returns:
-
neg
public HepLorentzVector neg(HepLorentzVector v)
Inverse- Parameters:
v
-- Returns:
-
neg
public Hep3Vector neg(Hep3Vector v)
-
centerOfMass
public Hep3Vector centerOfMass(java.util.List<HepLorentzVector> vecSet)
Return a center mass vector- Parameters:
vecSet
-- Returns:
-
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.
-
cosTheta
public double cosTheta()
cosTheta- Returns:
-
phi
public double phi()
Phi- Returns:
-
perp
public double perp()
Transverse momentum.- Returns:
- pt
-
perp2
public double perp2()
Transverse momentum squared- Returns:
- pt*pt
-
angle
public double angle(HepLorentzVector momentum)
Angle between 2 vectors- Parameters:
momentum
-- Returns:
-
theta
public double theta()
Get theta angle- Returns:
-
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()
Get a pseudorapidity: eta=-ln (tan (theta/2)) )- Returns:
- pseudorapidity
-
getV3
public Hep3Vector getV3()
Get 3-vector- Returns:
- 3-vector
-
mag
public double mag()
Magnitude sqrt(x**2+y**2+z**2)- Returns:
-
skp
public double skp(HepLorentzVector momentum)
Useful: for x1*x2+y1*y2+z1*z2- Parameters:
momentum
-- Returns:
-
equals
public boolean equals(java.lang.Object obj)
Compre 2 vectors- Overrides:
equals
in classjava.lang.Object
-
copy
public HepLorentzVector copy()
Make exact copy- Returns:
- new copy
-
hashCode
public int hashCode()
Hash code- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
Convert to string- Overrides:
toString
in classjava.lang.Object
-
-
DMelt 3.0 © DataMelt by jWork.ORG