Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Some of these arguments are similar to the job manager, but the steering file is supplied in a different way.  Evio2Lcio uses a command switch to specifiy the steering whereas the job manager expects this as an extra argument without a command switch.

Run Scripts

Run scripts that wrap a number of HPS Java command line utilities are generated when building the distribution.

After the build completes, they should be found in this HPS Java directory.

No Format
distribution/target/appassembler/bin/

For instance, the EvioToLcio utility can be run using this script.

Code Block
languagebash
distribution/target/appassembler/bin/evio2lcio.sh [...]

These scripts have several advantages over running the java commands yourself.

  • A full classpath is created in the script so it is not necessary to use the distribution jar (meaning a recompilation of distribution is not necessary to pickup changes).
  • Reasonable JVM options are included such as setting the min heap size.
  • Logging is configured automatically by loading in a default logging properties file.
  • Less typing of Java boilerplate commands ("java -jar" etc.)
  • You do not need to know the corresponding class's full name to run its command line utility.

Using symlinks to these scripts works fine e.g.

Code Block
languagebash
ln -s distribution/target/appassembler/bin/evio2lcio.sh
./evio2lcio.sh

When using these scripts, you cannot directly supply Java system properties, so the JAVA_OPTS variable should be used instead.

Code Block
languagebash
export JAVA_OPTS="-DdisableSvtAlignmentConstants=true"

The full list of Java system properties to be used should be included in this variable.

You should not set -Xmx or -Djava.util.logging.config.class as they are already set by the run scripts.

Logging and Debugging

Logging Config

...

Code Block
languagebash
cd hps-java-trunk; java -Djava.util.logging.config.file=logging/src/main/resources/org/hps/logging/config/logging.properties

Each logger is configured for an entire package rather than individual classes.

No Format
# evio
org.hps.evio.level = CONFIG

...

/logging/config/logging.properties [...]

You can also activate a Java class which will load this configuration.

Code Block
languagebash
java -Djava.util.logging.config.class=org.hps.logging.config.DefaultLoggingConfig [...]

Log Levels

These are the available log levels, in descending order.

...

This is defined in the config file as follows.

No Format
# default global level
 global level
.level = WARNING

So if a package is not explicitly configured, it will inherit the WARNING log level from the global logger.

Defining Loggers

In the config file, loggers are defined and configured by package rather than class.

No Format
# evio
org.hps.evio.level = WARNING

So if a package is not explicitly configured, it will inherit the WARNING log level from the global logger.

Defining Loggers

CONFIG

In the above config, any logger in the org.hps.evio package will have a log level of CONFIG.

A class's logger is typically be defined using the following templateA logger should typically be defined as follows in an HPS Java class.

Code Block
languagejava
package org.example;
 
import java.util.logging.Logger;
 
class MyClass {
 
    static private final Logger LOGGER = Logger.getLogger(MyClass.class.getPackage().getName());
 
    void someMethod() {
        LOGGER.info("some method was called");
    }
}

...