Particle Class Reference

A particle in a Reaction's final state or initial state collection. More...

Inheritance diagram for Particle:

Inheritance graph
[legend]

Collaboration diagram for Particle:

Collaboration graph
[legend]

List of all members.


Public Member Functions

 Particle ()
 No-arg contructor.
 Particle (Integer pdgCode)
 Particle (String name)
 Particle (String name, Integer multiplicity)
 Particle (String name, Integer multiplicity, Relation relation)
Integer getPDGCode ()
 Get PDG code.
Particle setPDGCode (Integer pdgCode)
 Set PDG code.
String getName ()
 Get particle name.
Particle setName (String name)
 Set particle name.
Integer getMultiplicity ()
 Get multiplicity.
Particle setMultiplicity (Integer multiplicity)
 Set multiplicity.
Relation getMultRelation ()
 Get the multiplicity relation.
Particle setMultRelation (Relation multRelation)
 Set the multiplicity relation.
String getHtmlName () throws HDException
 Get HTML version of the particle name, using YaPPI.
String getTexName () throws HDException
 Get TeX version of the particle name, using YaPPI.
boolean equals (Object other)
 Compare particles for equality.
int hashCode ()
 Specific hashCode.
String toString ()
 Default String representation: declares that method is not properly defined by default.

Static Public Member Functions

static Boolean sameType (Particle a, Particle b)

Package Functions

Logger log ()
 Neat method to allow every class to get hold of a custom-named Logger.

Detailed Description

A particle in a Reaction's final state or initial state collection.

A particle in this sense also encodes the multiplicity of the particle in the reaction, possibly with an inequality on the multiplicity relation.

Todo:
Base this around YaPPI and just store the PDG code
Author:
Andy Buckley
Version:
Date
2007-10-19 12:36:19 +0100 (Fri, 19 Oct 2007)
Revision
1104

Definition at line 17 of file Particle.java.


Constructor & Destructor Documentation

Particle (  ) 

No-arg contructor.

Definition at line 40 of file Particle.java.

00040 {}

Particle ( Integer  pdgCode  ) 

Definition at line 42 of file Particle.java.

References Particle.setPDGCode().

00042                                      {
00043         setPDGCode(pdgCode);
00044     }

Particle ( String  name  ) 

Definition at line 46 of file Particle.java.

References Particle.setName().

00046                                  {
00047         setName(name);
00048     }

Particle ( String  name,
Integer  multiplicity 
)

Definition at line 50 of file Particle.java.

References Particle.setMultiplicity().

00050                                                        {
00051         this(name);
00052         setMultiplicity(multiplicity);
00053     }

Particle ( String  name,
Integer  multiplicity,
Relation  relation 
)

Definition at line 55 of file Particle.java.

References Particle.setMultRelation().

00055                                                                           {
00056         this(name, multiplicity);
00057         setMultRelation(relation);
00058     }


Member Function Documentation

static Boolean sameType ( Particle  a,
Particle  b 
) [static]

Definition at line 65 of file Particle.java.

References Particle.getName(), and Particle.getPDGCode().

00065                                                            {
00066         return a.getPDGCode() != null && b.getPDGCode() != null && a.getPDGCode() == b.getPDGCode()
00067             || a.getName() == b.getName();
00068     }

Integer getPDGCode (  ) 

Get PDG code.

Definition at line 75 of file Particle.java.

Referenced by Particle.hashCode(), and Particle.sameType().

00075                                 {
00076         return pdgCode;
00077     }

Particle setPDGCode ( Integer  pdgCode  ) 

Set PDG code.

Definition at line 79 of file Particle.java.

References Particle.pdgCode.

Referenced by Particle.Particle().

00079                                                 {
00080         this.pdgCode = pdgCode;
00081         return this;
00082     }

String getName (  ) 

Get particle name.

Todo:
Use YaPPI

Definition at line 88 of file Particle.java.

Referenced by Particle.hashCode(), Particle.sameType(), and Particle.toString().

00088                             {
00089         return name;
00090     }

Particle setName ( String  name  ) 

Set particle name.

Todo:
Use YaPPI and ditch this method

Definition at line 94 of file Particle.java.

References Particle.name.

Referenced by Particle.Particle().

00094                                          {
00095         this.name = name;
00096         return this;
00097     }

Integer getMultiplicity (  ) 

Get multiplicity.

Definition at line 101 of file Particle.java.

Referenced by Reaction.addToFinalState(), Reaction.addToInitialState(), Particle.hashCode(), Reaction.removeFromFinalState(), Reaction.removeFromInitialState(), and Particle.toString().

00101                                      {
00102         return multiplicity;
00103     }

Particle setMultiplicity ( Integer  multiplicity  ) 

Set multiplicity.

Definition at line 105 of file Particle.java.

References Particle.multiplicity.

Referenced by Particle.Particle().

00105                                                           {
00106         this.multiplicity = multiplicity;
00107         return this;
00108     }

Relation getMultRelation (  ) 

Get the multiplicity relation.

Todo:
Provide string-based accessors for Castor

Definition at line 114 of file Particle.java.

Referenced by Particle.hashCode(), and Particle.toString().

00114                                       {
00115         return multRelation;
00116     }

Particle setMultRelation ( Relation  multRelation  ) 

Set the multiplicity relation.

Todo:
Provide string-based accessors for Castor

Definition at line 120 of file Particle.java.

References Particle.multRelation.

Referenced by Particle.Particle().

00120                                                            {
00121         this.multRelation = multRelation;
00122         return this;
00123     }

String getHtmlName (  )  throws HDException

Get HTML version of the particle name, using YaPPI.

Todo:
Make this work!

Definition at line 134 of file Particle.java.

00134                                                    {
00135         throw new HDException("YaPPI functionality currently unimplemented");
00136     }

String getTexName (  )  throws HDException

Get TeX version of the particle name, using YaPPI.

Todo:
Make this work!

Definition at line 142 of file Particle.java.

00142                                                   {
00143         throw new HDException("YaPPI functionality currently unimplemented");
00144     }

boolean equals ( Object  other  ) 

Compare particles for equality.

Definition at line 153 of file Particle.java.

References Particle.hashCode().

00153                                         {
00154         if (this == other) return true;
00155         if (! (other instanceof Particle)) return false;
00156         return hashCode() == other.hashCode();
00157     }

int hashCode (  ) 

Specific hashCode.

Definition at line 161 of file Particle.java.

References Particle.getMultiplicity(), Particle.getMultRelation(), Particle.getName(), and Particle.getPDGCode().

Referenced by Particle.equals().

00161                           {
00162         int code = 37;
00163         if (getName() != null)         code ^= getName().hashCode();
00164         if (getPDGCode() != null)      code ^= getPDGCode().hashCode();
00165         if (getMultiplicity() != null) code ^= getMultiplicity().hashCode();
00166         if (getMultRelation() != null) code ^= getMultRelation().hashCode();
00167         return code;
00168     }

String toString (  ) 

Default String representation: declares that method is not properly defined by default.

Reimplemented from Storeable.

Definition at line 175 of file Particle.java.

References Particle.getMultiplicity(), Particle.getMultRelation(), and Particle.getName().

00175                              {
00176         StringBuffer s = new StringBuffer();
00177         if (getMultiplicity() != null) {
00178             if (getMultRelation() != null && getMultRelation() != Relation.EQUALS) {
00179                 s.append(getMultRelation());
00180                 s.append(getMultiplicity());
00181             } else if (getMultiplicity() != 1) {
00182                 s.append(getMultiplicity());
00183             }
00184         }
00185         s.append(getName());
00186         return s.toString();
00187     }

Logger log (  )  [package, inherited]


The documentation for this class was generated from the following file:


Generated on Tue Apr 21 15:54:47 2009 for HepData object model by  doxygen 1.5.5