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 voidadd(ParticleD a)Add to this particle another particle.voidadd(ParticleD a, int index)Add to this particle another particle.voidaddConstituent(int i)voidcachePhiRapidity()The method precomputers Phi, Rapidity and Pt2 and store them.intcompareTo(ParticleD o)Comparator.ParticleDcopy(ParticleD o)Copy a particle.doublee()Get energy.doubleet()Compute transverse energy.doubleet2()Compute transverse energy squared.doubleeta()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" methoddoublegetPhi()Get cached phidoublegetPt()Get cached Pt.doublegetPt2()Get cached perp**2.doublegetRapidity()Get cached rapidityinthashCode()Get a hash codedoublem()Compute mass.doublemag()Compute magnitude sqrt(px**2+py**2+pz**2)doublemass()Compute mass.doubleperp()Compute transverse momentum (pT).doubleperp2()Compute pT**2.doublephi()Compute Phidoublepx()Get px.doublepy()Get py.doublepz()Get pz.doublerapidity()Compute rapidity.voidsetConstituents(java.util.ArrayList<java.lang.Integer> consts)voidsetEnergy(double energy)Set energy.voidsetPhi(double phi)voidsetPt2(double pt2)voidsetPtEtaPhiM(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).voidsetPx(double px)voidsetPxPyPzE(double px, double py, double pz, double energy)Initialize from 4-momenta.voidsetPy(double py)voidsetPz(double pz)voidsetRapidity(double rapidity)java.lang.StringtoString()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:
compareToin 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:
toStringin 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:
hashCodein classjava.lang.Object
-
-
DMelt 3.0 © DataMelt by jWork.ORG