The UCD
Nuclear Physics Group
Compiling FTPC PadMonitor Source Code


Physics Department, University of California, One Shields Avenue, Davis, CA 95616

Compiling the GUI

Before attempting to compile the Java code, you must have a release of the Java Development Kit (JDK) installed on your system. The PadMonitor was written using the
Blackdown Java for Linux release 117_v1a of the JDK. This version does not have the Java Swing classes (essential to GUI Building) built in, but at the time the PadMonitor was first developed, it was the most stable current release available for Linux. If you select this version, you will also need to download the Java Foundation Classes (JFC) Swing 1.1 release and the Java Runtime Environment (JRE) 117_v1a release.

The JDK 1.2.2, Revision RC4 is now available from Blackdown. The PadMonitor has been compiled and tested with this version.

If you are using Solaris or Windows, the JDK can be obtained from Sun directly.


In order to configure your system to run this program, please include the appropriate paths and environments in your shell configuration file.

For JDK 1.1.x, one must declare the following environment variables:
(e.g. in .tcshrc)

############################################
#Java Stuff JDK1.1.7

setenv JAVA /home/pcstar6/jklay/Java/jdk117_v1a
setenv SWING_HOME /home/pcstar6/jklay/Java/swing-1.1
setenv THREADS_FLAG native
setenv CLASSPATH .:$JAVA/lib/classes.zip:$SWING_HOME/swing.jar:$JAVA/../jre117_v1a
set path=($path $JAVA/bin )

#############################################

For the JDK 1.2, one need only set the following:

############################################
#Java Stuff JDK1.2.2

setenv JAVA /usr/local/jdk1.2.2
setenv THREADS_FLAG native
set path=($path $JAVA/bin )

#############################################

For both distributions, add the appropriate Java library directory and the current working directory to your LD_LIBRARY_PATH:

setenv LD_LIBRARY_PATH .:/usr/include:/usr/local/lib:$JAVA/lib

Once these paths are set, you are ready to compile.
For the implementation of the native methods contained in the file DataHandler.C the following commands suffice:

javac PadMonitor.java
(Generates the .class files)

javah -jni DataHandler
(Generates native method signature (.h) file from the class file)

make
(Generates shared library used by JNI to invoke native methods using this Makefile)


To run the program:

java PadMonitor



Note: I had to add some links to the include file in the Java include directory because the Blackdown release separated some of the machine dependent headers into another directory but did not update the paths in all the header files.

JDK 1.1.7:

In ~jklay/Java/jdk117_v1a/include I added:

ln -s genunix/jni_md.h jni_md.h
ln -s genunix/typedefs_md.h typedefs_md.h

JDK 1.2.2:

In /usr/local/jdk1.2.2/include I added:

ln -s linux/jni_md.h jni_md.h


Compiling the Format Reader

Running the Format Reader as a stand-alone executable:

Obtain the latest version from the
CVS Repository. Modify the program client.cxx to perform the functions you wish, following the example provided in client.cxx or according to the Format Reader Specification. Use the Makefile included in the release by issuing the command:

make

Run the program with a file by typing:

client filename


Compiling as a shared library to use with the GUI:

After you have generated the GUI .class files and generated the native method signature file, use this Makefile to create the shared library.

Run the program with:

java PadMonitor


Compiling the Mock Data Writer

It is as simple as using the Makefile included with the MDW release. This will create an executable "mdata". Here is the output from the usage function that is displayed if the program isn't called with the correct command syntax:

[jklay@pcstar8] 205) mdata
usage: mdata [-s|-u] inputFile [triggerFile]
example: mdata -s events.input
example: mdata -u events.input
-s means zero-suppressed data (including ADCD, SEQD, ADCX)
-u means un-suppressed data (including ADCR, PADK)
Here is a sample inputFile (# is a comment symbol):
# detector 1 = TPC, detector 2 = FTP
# event detector sector padrow pad centerbin
  1    1    1   13    3    44
  1    1    2   43   77    344
  1    2    1    1    4    28
  1    2    4    2   112   143
  2    1    1   13    3    44
  2    1    2   43   77    344
  2    2    1    1    4    28
  2    2    4    2   112   143
The triggerFile has the format below, the line order
is not important, but the order within the line is
The max value that can follow are L0(32) MZ(36) EC(120) the rest(64)
Here is a sample triggerFile:
LO: 1 2 3 4 5 6
L1: 1 2 3 4 5 6
L2: 1 2 3 4 5 6
MZ: 1 2 3 4 5 6
CT: 1 2 3 4 5 6
EC: 1 2 3 4 5 6
[jklay@pcstar8] 206)


A second executable "bdump" is also created. This program dumps the binary data from the requested file to the standard output. bdump has the following usage:

[jklay@pcstar8] 206) bdump
usage: bdump filename OFFSET NWORDS
skips OFFSET word in file before beginning reading.
does a total of NWORDS words



Last update: 13-Jul-2000.


[ FTPC Home Page | STAR Home ]