120 likes | 240 Vues
A Histogramming Package in Java. CHEP 2000 February 10, 2000 Teatro Antonianum, Padova Naomi Takashimizu/Shimane University Takashi Sasaki/KEK. A Simple Histogramming Package. We have developed a prototype of software package for histogramming. creating, filling, and several operations
E N D
A Histogramming Package in Java CHEP 2000 February 10, 2000 Teatro Antonianum, Padova Naomi Takashimizu/Shimane University Takashi Sasaki/KEK
A Simple Histogramming Package • We have developed a prototype of software package for histogramming. • creating, filling, and several operations • Histogram objects stored in the OODB can be shared by C++ and Java applications. • The package also includes a histogram visualizer • browsing and modifying histograms interactively. C++ Java OODB
Software Development in Java • Java is suited for developing physics analysis program or tools. • A simple language designed to be object oriented. • Pointer and garbage collection are excluded. • Architecture-neutral bytecode can be transported to any platform. • Provides a variety of GUI components. • etc • However software development in C++ is still dominant in HEP. • If it is possible to share object between C++ and Java one can choose language suited for one’s purpose.
Interoperability of persistent objects • C++ and Java objects which have different internal expression can be shared by using Objectivity/DB. • To share objects you must make C++ and Java class compatible with the schema. • Schema definition is done by defining a class derived from a persistent-capable class of Objectivity/DB. • DDL(Data Definition Language) files in C++ • normal source files in Java
Schema definition C++ Java //Histo1D.ddl //Histo1D.java #include bin.h public class Histo1D typedef ooRef(Bin) BinR extends Histogram declare(ooVArray,BinR) { static int SIZE=100; class Histo1D:public private int _numberOfBins; :public Histogram private Bin[] _bin { = new Bin[SIZE]; private: ... int32 _numberOfBins; ooVArray(BinR) _bin; ...
Limitations in defining compatible schema • variable-length arrays in C++ are mapped to fixed-length arrays in Java • Multiple inheritance is not supported in Java. • Schema files cannot be shared.
Design Visualizer Database control class Persistent class
Design • A Histogram object contains an collection of Bin objects as a member. • In the current version of Objectivity/DB, the collection of Bin is implemented by • variable-length array in C++ • fixed-length array in Java • Histograms object is a container of Histogram objects. • A new Histogram is created by a method in a container and clustered into the container.
Design • ooSession is the class for all purpose to establish a connection of an application with the database and control transactions. • MySession is the extended class of ooSession for accessing persistent histograms. • Jaws(Java Analysis WorkShop) is the core of the visualizer.
Summary • We have implemented a prototype of software package for histogramming in a short period using Java. • Objects were able to be shared by C++ and Java application without much difficulty.