jhplot
Class HBook

java.lang.Object
  extended by jhplot.HBook

public class HBook
extends Object

This class is used to book histograms for writing and reading. It can read any input with histograms defined by an external XML file. In particular, it can read histogram files generated by FORTRAN or C++ external programs. Look at

See Also:
CFBook web page. Look at examples in examples/hbook.py and hbook2d.py.

Generally, however, use HFile or Serialized class to keep objects to read and write objects in a serialized form


Constructor Summary
HBook()
          Initialize HBook class.
HBook(String description)
          Initialize HBook.
 
Method Summary
 void add(int id, H1D h1d)
          add H1D histogram to HBook
 void add(int id, H2D h2d)
          add H2D histogram to HBook
 void add(int id, P1D p1d)
          add P1D histogram to HBook
 void clear()
          Remove all objects from the HBook
 void doc()
          Show online documentation.
 H1D[] getAllH1D()
          Get array with all H1D histograms.
 H2D[] getAllH2D()
          Get array with all H2D histograms.
 P1D[] getAllP1D()
          Get array with all P1D containers.
 H1D getH1D(int id)
          Get H1D histogram from the index (key)
 H2D getH2D(int id)
          Get H2D histogram from the index (key) ID
 int[] getKeysH1D()
          Get keys of all known H1D histograms.
 int[] getKeysH2D()
          Get keys of all known H2D histograms.
 int[] getKeysP1D()
          Get keys of all known P1D containers.
 P1D getP1D(int id)
          Get P1D object from the index (key)
 String listAll()
          List all objects inside HBook
 String listH1D()
          List all known H1D histograms.
 String listH2D()
          List all known H1D histograms.
 String listP1D()
          List all known P1D objects.
 void read(String file)
          Read external XML file with all objects (H1D, H2D, P1D)
 void write(String file)
          write an external XML file with all HBook objects (H1D, H2D, P1D)
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HBook

public HBook(String description)
Initialize HBook. The description will be written in XML file during the output.

Parameters:
description - description.

HBook

public HBook()
Initialize HBook class.

Method Detail

write

public void write(String file)
write an external XML file with all HBook objects (H1D, H2D, P1D)

Parameters:
file - output file name

read

public void read(String file)
Read external XML file with all objects (H1D, H2D, P1D)

Parameters:
file - input file name

getH1D

public H1D getH1D(int id)
Get H1D histogram from the index (key)

Parameters:
id - index or key of histogram
Returns:
H1D histogram

getP1D

public P1D getP1D(int id)
Get P1D object from the index (key)

Parameters:
id - index or key of P1D
Returns:
P1D histogram

listH1D

public String listH1D()
List all known H1D histograms. It prints indexes (keys) together with titles.

Returns:
String representing all known keys.

listP1D

public String listP1D()
List all known P1D objects. It prints indexes (keys) together with titles.

Returns:
String representing all known keys.

getKeysH1D

public int[] getKeysH1D()
Get keys of all known H1D histograms.

Returns:
array with all key numbers (integers)

getKeysP1D

public int[] getKeysP1D()
Get keys of all known P1D containers.

Returns:
array with all key numbers (integers)

getAllH1D

public H1D[] getAllH1D()
Get array with all H1D histograms.

Returns:
array with H1D histograms

getAllP1D

public P1D[] getAllP1D()
Get array with all P1D containers.

Returns:
array with P1D containers

getAllH2D

public H2D[] getAllH2D()
Get array with all H2D histograms.

Returns:
array with H2D histograms

getKeysH2D

public int[] getKeysH2D()
Get keys of all known H2D histograms.

Returns:
array with all key numbers (integers)

listH2D

public String listH2D()
List all known H1D histograms.

Returns:
String representing all keys and titles of histograms

listAll

public String listAll()
List all objects inside HBook

Returns:
string with description of all objects inside HBook.

getH2D

public H2D getH2D(int id)
Get H2D histogram from the index (key) ID

Parameters:
id - index
Returns:
H2D histogram

add

public void add(int id,
                H1D h1d)
add H1D histogram to HBook

Parameters:
id - key to be assigned
h1d - H1D histogram to be added

add

public void add(int id,
                H2D h2d)
add H2D histogram to HBook

Parameters:
id - key to be assigned
h2d - H2D histogram to be added

add

public void add(int id,
                P1D p1d)
add P1D histogram to HBook

Parameters:
id - key to be assigned
p1d - P1D histogram to be added

clear

public void clear()
Remove all objects from the HBook


doc

public void doc()
Show online documentation.



jHepWork 3.0 ©