Package cnuphys.lund
Class LundId
java.lang.Object
cnuphys.lund.LundId
- All Implemented Interfaces:
Comparable<LundId>
Used to store a Lund ID
- Author:
- heddle
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
Compare based on Id.int
drawLineForLegend
(Graphics g, int x, int yc) Draw a line for use on a toolbar user component, most likelyint
Get the charge of the particle in e's.double
Get the charge in Coulombsint
Return three times the charge, in units of e.int
getId()
Get the Lund Id of the particle.Get a component to place on a legend.double
getMass()
Get the mass in GeV/c^2double
Get the mass in kilogramsgetName()
Get the name of the particle.double
getSpin()
Get the spin of the particle.getStyle()
Get the LundStyle for this idgetType()
Get the type, one of {"Lepton","InterBoson", "Nucleus","Baryon", "Meson"}double
pFromT
(double t) Get the momentum from the kinetic energyObtain a small string representation.toString()
Obtain a string representation.
-
Field Details
-
unknownLabel
-
-
Constructor Details
-
LundId
Create a Lund ID- Parameters:
type
- "Lepton", "InterBoson", "Nucleus", "Baryon", or "Meson"name
- e.g., "pi+"id
- the Lund Idmass
- the mass in GeV/c^2chargeX3
- three times the chargespinX2
- twice the spin
-
-
Method Details
-
getType
Get the type, one of {"Lepton","InterBoson", "Nucleus","Baryon", "Meson"}- Returns:
- the type
-
getName
Get the name of the particle.- Returns:
- the name of the particle.
-
getId
public int getId()Get the Lund Id of the particle.- Returns:
- the Lund id
-
getSpin
public double getSpin()Get the spin of the particle.- Returns:
- the spin.
-
getCharge
public int getCharge()Get the charge of the particle in e's.- Returns:
- the charge of the particle in units of e.
-
getMass
public double getMass()Get the mass in GeV/c^2- Returns:
- the mass in GeV/c^2
-
getChargeX3
public int getChargeX3()Return three times the charge, in units of e.- Returns:
- three times the charge, in units of e.
-
toString
Obtain a string representation. -
compareTo
Compare based on Id.- Specified by:
compareTo
in interfaceComparable<LundId>
- Returns:
- -1, 0, or 1 for less than, equal, or greater than.
-
smallString
Obtain a small string representation.- Returns:
- a small string representation.
-
pFromT
public double pFromT(double t) Get the momentum from the kinetic energy- Parameters:
t
- the kinetic energy in GeV- Returns:
- the momentum in Gev/c
-
getChargeCoulombs
public double getChargeCoulombs()Get the charge in Coulombs- Returns:
- the charge in Coulombs
-
getMassKg
public double getMassKg()Get the mass in kilograms- Returns:
- the mass in kilograms
-
getLabelForLegend
Get a component to place on a legend.- Returns:
- a component for the legend.
-
drawLineForLegend
Draw a line for use on a toolbar user component, most likely- Parameters:
g
- the graphics contextx
- the horizontal staring pointyc
- the central vertical position- Returns:
- the offset
-
getStyle
Get the LundStyle for this id- Returns:
- the LundStyle for this id
-