hephysics.jet
Class ParticleD
- java.lang.Object
-
- hephysics.jet.ParticleD
-
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Comparable<ParticleD>
public class ParticleD extends java.lang.Object implements java.lang.Comparable<ParticleD>, java.io.Serializable
A class representing a jet or particle with pre-computed px,py,pz,e (double precision). It uses double types to keep information on 4-meomenta. The merging is done in the 4-momentum space. The class has a minimum dynamic computation to minimize CPU usage.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description ParticleD()
Initialize pseudoparticle.ParticleD(double px, double py, double pz, double energy)
Initialize from 4-momenta.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description void
add(ParticleD a)
Add to this particle another particle.void
add(ParticleD a, int index)
Add to this particle another particle.void
addConstituent(int i)
void
cachePhiRapidity()
The method precomputers Phi, Rapidity and Pt2 and store them.int
compareTo(ParticleD o)
Comparator.ParticleD
copy(ParticleD o)
Copy a particle.double
e()
Get energy.double
et()
Compute transverse energy.double
et2()
Compute transverse energy squared.double
eta()
Compute pseudorapidity.int[]
getConstituents()
Get indexes of constituents, iff filled with the "add" methodjava.util.List<java.lang.Integer>
getConstituentsList()
Get indexes of constituents, iff filled with the "add" methoddouble
getPhi()
Get cached phidouble
getPt()
Get cached Pt.double
getPt2()
Get cached perp**2.double
getRapidity()
Get cached rapidityint
hashCode()
Get a hash codedouble
m()
Compute mass.double
mag()
Compute magnitude sqrt(px**2+py**2+pz**2)double
mass()
Compute mass.double
perp()
Compute transverse momentum (pT).double
perp2()
Compute pT**2.double
phi()
Compute Phidouble
px()
Get px.double
py()
Get py.double
pz()
Get pz.double
rapidity()
Compute rapidity.void
setConstituents(java.util.ArrayList<java.lang.Integer> consts)
void
setEnergy(double energy)
Set energy.void
setPhi(double phi)
void
setPt2(double pt2)
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
setPx(double px)
void
setPxPyPzE(double px, double py, double pz, double energy)
Initialize from 4-momenta.void
setPy(double py)
void
setPz(double pz)
void
setRapidity(double rapidity)
java.lang.String
toString()
Convert a particle to a string.
-
-
-
Constructor Detail
-
ParticleD
public ParticleD()
Initialize pseudoparticle.
-
ParticleD
public ParticleD(double px, double py, double pz, double energy)
Initialize from 4-momenta.- Parameters:
px
-py
-pz
-energy
-
-
-
Method Detail
-
setPxPyPzE
public void setPxPyPzE(double px, double py, double pz, double energy)
Initialize from 4-momenta.- Parameters:
px
-py
-pz
-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
-
eta
public double eta()
Compute pseudorapidity.- Returns:
- pseudorapidity.
-
et2
public double et2()
Compute transverse energy squared.- Returns:
- transverse energy squared.
-
et
public double et()
Compute transverse energy.- Returns:
- transverse energy.
-
mass
public double mass()
Compute mass.- Returns:
- mass
-
m
public double m()
Compute mass.- Returns:
- mass
-
rapidity
public double rapidity()
Compute rapidity. 0.5*log( (m+z)/(m-z) );- Returns:
- rapidity
-
mag
public double mag()
Compute magnitude sqrt(px**2+py**2+pz**2)- Returns:
- mag
-
perp2
public double perp2()
Compute pT**2.- Returns:
- pt**2
-
perp
public double perp()
Compute transverse momentum (pT).- Returns:
- Transverse momentum (pt)
-
setEnergy
public void setEnergy(double energy)
Set energy.
-
compareTo
public int compareTo(ParticleD o)
Comparator. Use pT2 for comparison (in increasing order)- Specified by:
compareTo
in interfacejava.lang.Comparable<ParticleD>
- Parameters:
o
- particle- Returns:
-
copy
public ParticleD copy(ParticleD o)
Copy a particle.- Parameters:
o
-- Returns:
- a copy of particle
-
toString
public java.lang.String toString()
Convert a particle to a string.- Overrides:
toString
in classjava.lang.Object
- Returns:
- a string with the particle
-
px
public double px()
Get px.- Returns:
- px component
-
py
public double py()
Get py.- Returns:
- py component
-
pz
public double pz()
Get pz.- Returns:
- pz component
-
getRapidity
public double getRapidity()
Get cached rapidity- Returns:
- rapidity
-
getPt2
public double getPt2()
Get cached perp**2.- Returns:
- perp2.
-
getPt
public double getPt()
Get cached Pt.- Returns:
- et transverse energy
-
getPhi
public double getPhi()
Get cached phi- Returns:
- cached phi
-
getConstituentsList
public java.util.List<java.lang.Integer> getConstituentsList()
Get indexes of constituents, iff filled with the "add" method- Returns:
- list of constituents.
-
setConstituents
public void setConstituents(java.util.ArrayList<java.lang.Integer> consts)
-
addConstituent
public void addConstituent(int i)
-
getConstituents
public int[] getConstituents()
Get indexes of constituents, iff filled with the "add" method- Returns:
- array of constituents.
-
phi
public double phi()
Compute Phi- Returns:
-
e
public double e()
Get energy.- Returns:
- energy component
-
setPx
public void setPx(double px)
-
setPy
public void setPy(double py)
-
setPz
public void setPz(double pz)
-
setRapidity
public void setRapidity(double rapidity)
-
setPhi
public void setPhi(double phi)
-
setPt2
public void setPt2(double pt2)
-
cachePhiRapidity
public void cachePhiRapidity()
The method precomputers Phi, Rapidity and Pt2 and store them. Such caching makes faster computations. Use getRapidity(), getPhi(), getPt2() methods to return such values.
-
add
public void add(ParticleD a)
Add to this particle another particle. The method also precomputes rapidity, phi and pt2 for fast retrival using getPhi, getRapidity methods.- Parameters:
a
-
-
add
public void add(ParticleD a, int index)
Add to this particle another particle. Also add index of the added particle, which will be stored as an array. The method also precomputes rapidity, phi and et2 for fast retrival using getPhi, getRapidity methods.- Parameters:
a
-index
- index of the particle to be stored
-
hashCode
public int hashCode()
Get a hash code- Overrides:
hashCode
in classjava.lang.Object
-
-
DMelt 3.0 © DataMelt by jWork.ORG