cnuphys.lund
Class LundId

java.lang.Object
  extended by cnuphys.lund.LundId
All Implemented Interfaces:
java.lang.Comparable<LundId>

public class LundId
extends java.lang.Object
implements java.lang.Comparable<LundId>

Used to store a Lund ID

Author:
heddle

Constructor Summary
LundId(java.lang.String type, java.lang.String name, int id, double mass, int chargeX3, int spinX2)
          Create a Lund ID
 
Method Summary
 int compareTo(LundId o)
          Compare based on Id.
 int getCharge()
          Get the charge of the particle in e's.
 int getChargeX3()
          Return three times the charge, in units of e.
 int getId()
          Get the Lund Id of the particle.
 double getMass()
          Get the mass in MeV
 java.lang.String getName()
          Get the name of the particle.
 double getSpin()
          Get the spin of the particle.
 java.lang.String getType()
          Get the type, one of {"Lepton","InterBoson", "Nucleus","Baryon", "Meson"}
 java.lang.String smallString()
          Obtain a small string representation.
 java.lang.String toString()
          Obtain a string representation.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LundId

public LundId(java.lang.String type,
              java.lang.String name,
              int id,
              double mass,
              int chargeX3,
              int spinX2)
Create a Lund ID

Parameters:
type - "Lepton", "InterBoson", "Nucleus", "Baryon", or "Meson"
name - e.g., "pi+"
id - the Lund Id
mass - the mass in GeV
chargeX3 - three times the charge
spinX2 - twice the spin
Method Detail

getType

public java.lang.String getType()
Get the type, one of {"Lepton","InterBoson", "Nucleus","Baryon", "Meson"}

Returns:
the type

getName

public java.lang.String 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.

getMass

public double getMass()
Get the mass in MeV

Returns:
the mass in MeV

getChargeX3

public int getChargeX3()
Return three times the charge, in units of e.

Returns:
three times the charge, in units of e.

toString

public java.lang.String toString()
Obtain a string representation.

Overrides:
toString in class java.lang.Object

compareTo

public int compareTo(LundId o)
Compare based on Id.

Specified by:
compareTo in interface java.lang.Comparable<LundId>
Returns:
-1, 0, or 1 for less than, equal, or greater than.

smallString

public java.lang.String smallString()
Obtain a small string representation.

Returns:
a small string representation.