To use the YaPPI Java API means to write a Java program that uses class definitions from the YaPPI class package. The program will make use of methods to read (or write) particle data from (or to) XML files that you specify. The basic steps in using the YaPPI Java API are:
We expand on each of these steps below.
For the details on what you can do with each YaPPI API class, such as constructor to use, which methods to call, and so on, you will need to browse the javadoc (automatically generated documentation) for the Java classes of the YaPPI API. The YaPPI javadoc is contained in the FreeHEP Java Library javadoc.
Please the the YaPPI Class Diagram for
an overview of the available classes.
Please visit the YaPPI XML Schema for a visual representation of how Particle Property data is structured in XML by YaPPI.
Data that is read in from XML files is made accessible to your program via a set of get methods, for each supported data element. Please see the methods available to XMLYappi for a complete list. The sample below shows a get of a family and a get of a particle.
package hep.physics.yappi.test; import hep.physics.yappi.*; public class TestYappi { public static void main(String[] args) throws Exception { XMLYappi yappi = new XMLYappi(); yappi.read("hep/physics/yappi/xml/2000/PDG-Family.xml"); yappi.read("hep/physics/yappi/xml/2000/PDG-Properties.xml"); Family family = yappi.getFamily("ccbar MESONS"); System.out.println("Family: " + family); ParticleType particleType = yappi.getParticle("eta(c)(1S)"); System.out.println("Particle: " + particleType); } }