Skip to main content
LARDON reads three environment variables at startup. If any variable is unset, LARDON falls back to os.getcwd() — the directory from which the lardon command was invoked.
VariablePurposeDefault if unset
LARDON_PATHPath to the src/lardon/ directory (settings, channel maps, calibration files)os.getcwd()
LARDON_RECODirectory where reconstructed HDF5 output files are writtenos.getcwd()
LARDON_PLOTDirectory where control plots are savedos.getcwd()

Setting environment variables with set_lardon.sh

The repository ships with set_lardon.sh in its root directory. Source it once per shell session before running LARDON:
source set_lardon.sh
The script sets all three variables relative to $PWD, so run it from the repository root:
#!/bin/bash

export QT_XCB_GL_INTEGRATION=none
#eval "$(pixi shell-hook)"

#uncomment next two lines to open files outside of CERN/FERMILAB
#xrootd=$(find .pixi -name "libXrdPosixPreload.so")
#export LD_PRELOAD=$PWD/$xrootd

export LARDON_PATH=$PWD/src/lardon
export LARDON_RECO=$PWD/reco
export LARDON_PLOT=$PWD/plots
After sourcing, confirm the variables are set:
echo $LARDON_PATH   # .../lardon/src/lardon
echo $LARDON_RECO   # .../lardon/reco
echo $LARDON_PLOT   # .../lardon/plots
set_lardon.sh sets LARDON_RECO to $PWD/reco and LARDON_PLOT to $PWD/plots. These directories are not created automatically — create them if they do not exist:
mkdir -p reco plots

Setting variables manually

You can also export the variables directly for non-standard layouts:
export LARDON_PATH=/path/to/lardon/src/lardon
export LARDON_RECO=/scratch/my_project/reco
export LARDON_PLOT=/scratch/my_project/plots

How LARDON uses the variables

The variables are read in src/lardon/config.py:
lardon_path = os.environ.get("LARDON_PATH", os.getcwd())
store_path  = os.environ.get("LARDON_RECO",  os.getcwd())
plot_path   = os.environ.get("LARDON_PLOT",  os.getcwd())
LARDON_PATH is the most critical: LARDON constructs all internal paths from it, including the path to detector settings ($LARDON_PATH/settings/), channel maps, and calibration files. If it is wrong, LARDON will fail to load detector geometry and abort.

Qt headless display

set_lardon.sh also exports:
export QT_XCB_GL_INTEGRATION=none
This disables Qt’s XCB OpenGL integration, which allows LARDON to generate plots on headless servers (batch nodes, SSH sessions without X11 forwarding) without a connected display.

XRootD for remote file access

If you need to open raw data files stored outside CERN or Fermilab — for example, using the -file root://... command-line option — uncomment the two XRootD lines in set_lardon.sh:
xrootd=$(find .pixi -name "libXrdPosixPreload.so")
export LD_PRELOAD=$PWD/$xrootd
This preloads the XRootD POSIX library, enabling transparent remote file access. Leave these lines commented out when running at CERN lxplus or Fermilab where XRootD is handled by the site environment.
LD_PRELOAD affects all child processes started in the same shell session. If you encounter unexpected crashes in unrelated tools after sourcing the script, comment the XRootD lines out again.

Build docs developers (and LLMs) love