Skip to content

Integration

ROOT RDataFrame

The HipoDataFrame extension provides a ROOT RDataSource for HIPO files, enabling analysis with RDataFrame:

#include "RHipoDS.hxx"

auto df = MakeHipoDataFrame("data.hipo");
auto h = df.Histo1D("REC::Particle_px");
h->Draw();

Note

The RDataFrame extension requires ROOT >= 6.28 and is only built when ROOT is detected.

Column Naming

RDataFrame flattens HIPO bank columns using underscores:

  • REC::Particle column pid becomes REC::Particle_pid
  • REC::Event column startTime becomes REC::Event_startTime

Building with ROOT

ROOT support is auto-detected during build. Ensure ROOT is in your PATH:

source /path/to/root/bin/thisroot.sh
meson setup build

Python

A thin ctypes wrapper around the C++ shared library lives under extensions/python/. hipolib.hreader opens a file, declares which banks to read, then iterates events:

from hipolib import hreader

reader = hreader('/path/to/hipo/install/lib')   # directory containing libhipo4.so
reader.open('data.hipo')
reader.define('RUN::config')

while reader.next():
    size = reader.getSize('RUN::config')
    if size > 0:
        event     = reader.getEntry('RUN::config', 'event')
        trigger   = reader.getEntry('RUN::config', 'trigger')
        timestamp = reader.getEntry('RUN::config', 'timestamp')

See readclas12.py for a runnable example.

For a higher-level, NumPy/awkward-style interface, see the third-party hipopy package.

Julia

using Hipo

reader = HipoReader("data.hipo")
for event in reader
    particles = event["REC::Particle"]
    # process...
end

Fortran

A Fortran wrapper provides basic read functionality:

program read_hipo
    use hipo_module
    implicit none

    type(hipo_reader) :: reader
    call reader%open("data.hipo")
    ! ...
end program

See the extensions/ directory for wrapper implementations.

pkg-config

After installation, use pkg-config to link against HIPO in other build systems:

# Get compiler flags
pkg-config --cflags hipo4

# Get linker flags
pkg-config --libs hipo4

CMake

find_package(PkgConfig REQUIRED)
pkg_check_modules(HIPO4 REQUIRED hipo4)

target_include_directories(myapp PRIVATE ${HIPO4_INCLUDE_DIRS})
target_link_libraries(myapp ${HIPO4_LIBRARIES})

Meson

hipo4_dep = dependency('hipo4')

executable('myapp', 'main.cpp', dependencies: hipo4_dep)

If the installed hipo4.pc is outside the default pkg-config search path, point PKG_CONFIG_PATH at <prefix>/lib/pkgconfig (or lib64/pkgconfig) before running meson setup.

Makefile

CXXFLAGS += $(shell pkg-config --cflags hipo4)
LDFLAGS  += $(shell pkg-config --libs hipo4)