Versions Compared

Key

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

HPS uses a database conditions backend which is accessible through the DatabaseConditionsManager.

Basic Usage

Initialization

The conditions system is initialized using the ConditionsManager's setDetector method which takes the name of a detector and a run number.

Code Block
languagejava
themeMidnight
DatabaseConditionsManager.getInstance().setDetector("RealDetectorNameHere", 1234);

HPS adds several features to the lcsim conditions system.

You can add one or more tags for filtering the conditions records.  Only those records belonging to the tag will be accessible.

Code Block
DatabaseConditionsManager.getInstance().addTag("pass0");

The conditions system can be "frozen" after it is initialized, meaning that subsequent calls to set a new detector and run number will be completely ignored.

Code Block
DatabaseConditionsManager.getInstance().freeze();

This is useful to force the system to load a specific configuration by run number if the actual event data does not have the same run number (or for run 0 events from simulation).

Accessing Conditions from a Driver

Typically, conditions information is accessed in the beginning of the job through the Driver class's detectorChanged method.

...