1.9 Data structures supported by jHepWork

The main data types and structures can be divided into several categories:

  1. Data types and structures of the Python programming language [1] such as string, list, tuple, sets, maps, dictionaries, etc.;

  2. Data types of the standard Java API. For example, to import the Java random number generator, one should use:

    >>> from java.util import Random
    

  3. Data types and structures from the Numeric package and jhplot.math.* One should import them as:

    >>> from Numeric import [class]
    
    or

    >>> from jhplot.math import [class]
    
    where [class] is the corresponding imported class. These packages should be used if one wants to have a short and highly-optimised code, which is a factor 10 faster than the usual Jython code with big loops over primitive data types.

  4. All FreeHEP data structures for histograming, fit etc. Usually, to import JAIDA classes, the user should include:

    >>> from hep.aida import [class]
    

  5. The data structures of jHepWork itself which, in several cases, are build on top of the JAIDA histogram classes. Those include histogram classes (H1D, H2D) and data containers P1D, P2D and P3D for scientific plots with 2-level errors (statistical and systematical errors) and functions F1D and F2D. All such classes are included to the jHPlot package [11]. You can import such classes as:

    >>> from jhplot import [class1],[class2],[class3]
    
    where [class] is the corresponding class for import.

  6. Finally, data structures for Jython scripting based on Jython classes which inherent jHPlot Java classes:

    >>> from shplot import *
    

    As it will be explained below, the advantage of this package is that many common arithmetic operators are overloaded (something which cannot be done when one calls directly Java classes)

The most important classes of jHPlot package, which is the core of jHepWork, will be discussed below. Also, below we will discuss only Jython scripting. Analogously, one can write programs in BeanShell or Java.