Subsections

1.2 Main differences with other data-analysis tools

Below we will compare jHepWork with two popular object-oriented packages currently used in high-energy physics: 1) JAS package [5], based on Java and FreeHEP libraries [4] and 2) C++ ROOT package [6,7].

1.2.1 Main differences with JAS

Compare to JAS, jHepWork:

1.2.2 Main differences with the ROOT package

Compare to ROOT, jHepWork:

1.2.3 How fast it is?

Jython scripts are about 4-10 times slower than equivalent Java programs and about a factor 5 slower than the equivalent ROOT/CINT codes for operations on primitive data types (remember, all Jython data types are objects). This means that CPU extensive tasks should be moved to Java jar libraries.

jHepWork was designed for the front-end data analysis in which program speed is not essential, as it is assumed the a JHepWork program is used for operations with data and objects (like histograms) which have been already created by C++, Fortran or Java code. For such front-end data analysis, the bottleneck is mainly user input speed, interaction with a graphical object using mouse or network latency.

In practice, final results obtained with Jython programs can be obtained much faster than those designed in C++/Java, because development is so much easier in jHepWork that you often wind up with a much better algorithm based on Jython syntax and jHepWork high-level objects than he/she would in C++ or Java.

In case of CPU extensive tasks, like large loops over primitive data types, reading files etc. one should use high-level structures of Jython and jHepWork. For example, one should use the method randomUniform() of the P0D class to create an array of random numbers, rather than writing a loop over random numbers and using add() method to fill an array in Jython. To write a file with many numbers, one should use a single line with the statement toFile() or methods of the P1D class, instead of writing a Jython loop over all numbers with the Jython write() method. In case if such methods are used, jHepWork programs are typically 5-10 times faster than those in which loops are directly implemented in Jython scripts, and about 2-3 times faster than those macros written in CINT/C++ language. We will consider examples of the jHepWork scripts optimized for speed in Section :autorefGetting started with jHepWork Java classes3.36.