hephysics.particle
Class LParticle
- java.lang.Object
-
- hephysics.vec.HepLorentzVector
-
- hephysics.particle.LParticle
-
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Comparable<LParticle>
- Direct Known Subclasses:
- HEParticle
public class LParticle extends HepLorentzVector implements java.lang.Comparable<LParticle>, java.io.Serializable
A class representing a Lorentz particle. It is based on four-Lorentz vector and extends HepLorentzVector. A particle can be represented by either (px,py,pz,E) or (x,y,z,time). In addition, you can define name, mass,charge and a parent particle as an object.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description LParticle()
Define a dummy particle.LParticle(double px, double py, double pz)
Define a 3-momentum or X,Y,Z position.LParticle(double px, double py, double pz, double energy)
Define a particle in momentum or 4-space time.LParticle(double px, double py, double pz, double energy, double mass)
Define a particle in momentum or coordinate space.LParticle(java.lang.String name)
Define a particle with a name.LParticle(java.lang.String name, double mass)
Define a particle with a name and mass.LParticle(java.lang.String name, double px, double py, double pz, double energy, double mass)
Define a Lorentz particle in momentum or coordinate space.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description double
abs()
Magnitudevoid
add(LParticle another)
Add 2 particledouble
angle(LParticle momentum)
Angle between 2 vectors in radvoid
boost(LParticle parent)
Lorentz Boostdouble
calcMass()
Get calculated mass as sqrt(e*e-px**2-py**2-pz**2)int
compareTo(LParticle o)
Comparator.LParticle
copy()
Make an exact copy of this particlevoid
dividePxPyPzE(double scale)
Divide all components (Px,Py,Px,E) by a factor C.void
doc()
Show online documentation.double
getCharge()
Get chargedouble
getMass()
Get a massjava.lang.String
getName()
Get a nameLParticle
getParent()
Get a parent particleHep3Vector
getV3()
Get a 3-vector woth (Px,Py,Pz) or (X,Y,Z)int
hashCode()
Get a hash codedouble
mass()
Get a massvoid
print()
Print particlevoid
scalePxPyPzE(double scale)
Scale all components (Px,Py,Px,E) by a factor C.void
scaleXYZT(double scale)
Scale all components (X,Y,Z,T) by a factor This means all components are multiplied by this factor.void
setCharge(double charge)
Set chargevoid
setMass(double mass)
Set a massvoid
setParent(LParticle parent)
Set a parent particlevoid
setPtEtaPhiE(double pt, double eta, double phi, double e)
Set 4-momentum of a particle using transverse momentum (pt), pseudorapidity (Eta) and azimuthal angle (phi) and energy.void
setPtEtaPhiM(double pt, double eta, double phi, double m)
Set 4-momentum of a particle using transverse momentum (pt), pseudorapidity (eta) and azimuthal angle (phi) and mass (m).void
setPxPyPz(double px, double py, double pz)
Set Px,Py,Pz (or x,y,z)void
setPxPyPzE(double px, double py, double pz, double e)
Set Px,Py,Pz and energy of a particlevoid
setThetaPhiP(double theta, double phi, double P)
Set HepLorentzVector using theta angle, phi and total momentum P.void
setXYZT(double x, double y, double z, double t)
Set x,y,z and time for a particle (vertex position)java.lang.String
toString()
Convert to stringvoid
twoBodyDecay(LParticle prod1, LParticle prod2, boolean randomRotate)
Evaluates 4-vector of decay product in the rest frame of parent.-
Methods inherited from class hephysics.vec.HepLorentzVector
add, add, angle, boost, boost, boost, centerOfMass, cosTheta, dot, e, equals, et, et2, getE, getEta, getT, invariantMass, invariantMass2, isLightlike, isSpacelike, m, m2, mag, mag2, mt, mt2, mult, neg, neg, perp, perp2, phi, pseudoRapidity, px, py, pz, rapidity, restMass2, setE, setPx, setPy, setPz, setT, setV3, setV3, setX, setY, setZ, skp, sub, t, theta, v3, x, y, z
-
-
-
-
Constructor Detail
-
LParticle
public LParticle()
Define a dummy particle. Set Px,Py,Pz,mass to zero.
-
LParticle
public LParticle(java.lang.String name)
Define a particle with a name. Set Px,Py,Pz,mass to zero.- Parameters:
name
- particle name
-
LParticle
public LParticle(java.lang.String name, double mass)
Define a particle with a name and mass. Set Px,Py,Pz to zero.- Parameters:
name
- particle namemass
- mass
-
LParticle
public LParticle(double px, double py, double pz)
Define a 3-momentum or X,Y,Z position. Energy and mass are set to 0.- Parameters:
px
- Px (or X_)py
- Py (or Y)pz
- Pz (or Z)
-
LParticle
public LParticle(double px, double py, double pz, double energy, double mass)
Define a particle in momentum or coordinate space.- Parameters:
px
- Px (or X position)py
- Py (or Y position)pz
- Pz (or Z position)energy
- energy (or time)mass
- mass
-
LParticle
public LParticle(double px, double py, double pz, double energy)
Define a particle in momentum or 4-space time. Mass is set to 0- Parameters:
px
- Px or X positionpy
- Py or Y positionpz
- Pz or Z positionenergy
- energy or time
-
LParticle
public LParticle(java.lang.String name, double px, double py, double pz, double energy, double mass)
Define a Lorentz particle in momentum or coordinate space.- Parameters:
name
- Name of particlepx
- px (or X)py
- py (or Y)pz
- pz (or Z)energy
- energy or timemass
- mass
-
-
Method Detail
-
setPxPyPz
public void setPxPyPz(double px, double py, double pz)
Set Px,Py,Pz (or x,y,z)- Parameters:
px
-py
-pz
-
-
setPxPyPzE
public void setPxPyPzE(double px, double py, double pz, double e)
Set Px,Py,Pz and energy of a particle- Parameters:
px
- Px momentumpy
- Py momentumpz
- Pz momentume
- energy
-
setXYZT
public void setXYZT(double x, double y, double z, double t)
Set x,y,z and time for a particle (vertex position)- Parameters:
x
- X positiony
- Y positionz
- Z positiont
- time
-
setParent
public void setParent(LParticle parent)
Set a parent particle- Parameters:
parent
- parent particle
-
scalePxPyPzE
public void scalePxPyPzE(double scale)
Scale all components (Px,Py,Px,E) by a factor C. Keep mass unchanged. This means all components are multiplied by this factor.- Parameters:
scale
- factor used to multiply Px,Py,Pz,E components.
-
scaleXYZT
public void scaleXYZT(double scale)
Scale all components (X,Y,Z,T) by a factor This means all components are multiplied by this factor.- Parameters:
scale
- factor used to multiply X,Y,Z,T components.
-
dividePxPyPzE
public void dividePxPyPzE(double scale)
Divide all components (Px,Py,Px,E) by a factor C. Useful for varints (integer) representation.- Parameters:
scale
- factor used to divide Px,Py,Pz,E
-
getParent
public LParticle getParent()
Get a parent particle- Returns:
- parent
-
add
public void add(LParticle another)
Add 2 particle- Parameters:
another
- particle to be edded
-
getMass
public double getMass()
Get a mass- Returns:
- mass
-
mass
public double mass()
Get a mass- Returns:
- mass
-
getName
public java.lang.String getName()
Get a name- Returns:
- name
-
getV3
public Hep3Vector getV3()
Get a 3-vector woth (Px,Py,Pz) or (X,Y,Z)- Overrides:
getV3
in classHepLorentzVector
- Returns:
- 3-vector
-
setMass
public void setMass(double mass)
Set a mass- Parameters:
mass
- Mass
-
hashCode
public int hashCode()
Get a hash code- Overrides:
hashCode
in classHepLorentzVector
-
setThetaPhiP
public void setThetaPhiP(double theta, double phi, double P)
Set HepLorentzVector using theta angle, phi and total momentum P. e = sqrt(P*P + mass*mass);
pX = P*sin(theta)*cos(phi);
pY = P*sin(theta)*sin(phi);
pZ = P*cos(theta);- Parameters:
theta
- thetaphi
- phiP
- momentum
-
setPtEtaPhiE
public void setPtEtaPhiE(double pt, double eta, double phi, double e)
Set 4-momentum of a particle using transverse momentum (pt), pseudorapidity (Eta) and azimuthal angle (phi) and energy.- Parameters:
pt
- transverse momentum of a particle.eta
- eta (pseudorapidity) .phi
- azimuthal anglee
- energy
-
setPtEtaPhiM
public void setPtEtaPhiM(double pt, double eta, double phi, double m)
Set 4-momentum of a particle using transverse momentum (pt), pseudorapidity (eta) and azimuthal angle (phi) and mass (m). In this case, the energy is Math.sqrt(px*px+py*py+pz*pz-m*m).- Parameters:
pt
- transverse momentum of a particle.eta
- eta (pseudorapidity) .phi
- azimuthal anglem
- mass
-
abs
public double abs()
Magnitude- Returns:
-
setCharge
public void setCharge(double charge)
Set charge- Parameters:
charge
- charge
-
getCharge
public double getCharge()
Get charge- Returns:
-
angle
public double angle(LParticle momentum)
Angle between 2 vectors in rad- Parameters:
momentum
- parent particle- Returns:
- angle in rad
-
calcMass
public double calcMass()
Get calculated mass as sqrt(e*e-px**2-py**2-pz**2)- Returns:
-
twoBodyDecay
public void twoBodyDecay(LParticle prod1, LParticle prod2, boolean randomRotate)
Evaluates 4-vector of decay product in the rest frame of parent.- Parameters:
prod1
- first decay productprod2
- second decay productrandomRotate
- is Phi randomly rotated?
-
boost
public void boost(LParticle parent)
Lorentz Boost- Parameters:
parent
- parent particle
-
toString
public java.lang.String toString()
Convert to string- Overrides:
toString
in classHepLorentzVector
-
copy
public LParticle copy()
Make an exact copy of this particle- Overrides:
copy
in classHepLorentzVector
- Returns:
- new copy
-
print
public void print()
Print particle
-
doc
public void doc()
Show online documentation.
-
-
DMelt 3.0 © DataMelt by jWork.ORG