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::ParticlecolumnpidbecomesREC::Particle_pidREC::EventcolumnstartTimebecomesREC::Event_startTime
Building with ROOT¶
ROOT support is auto-detected during build. Ensure ROOT is in your PATH:
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:
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¶
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.