GitHub release reference Build Status Build status CI codecov Go Report Card GoDoc License DOI JOSS Paper Binder Twitter Follow TODOs

hep is a set of libraries and tools to perform High Energy Physics analyses with ease and Go

See for more informations.


hep is released under the BSD-3 license.


Documentation for hep is served by GoDoc.


Guidelines for contributing to go-hep are available here:


This project exists thanks to all the people who contribute.


Writing analyses in HEP involves many steps and one needs a few tools to successfully carry out such an endeavour. But - at minima - one needs to be able to read (and possibly write) ROOT files to be able to interoperate with the rest of the HEP community or to insert one's work into an already existing analysis pipeline.

Go-HEP provides this necessary interoperability layer, in the Go programming language. This allows physicists to leverage the great concurrency primitives of Go, together with the surrounding tooling and software engineering ecosystem of Go, to implement physics analyses.


Go-HEP currently sports the following packages:


Go-HEP packages are installable via the go get command:

$ go get

Just select the package you are interested in and go get will take care of fetching, building and installing it, as well as its dependencies, recursively.

Expand ▾ Collapse ▴



Package hep is a simple placeholder to root all go-hep documentation

Example (Version)


package main

import (

func main() {
	version, sum := hep.Version()
	fmt.Printf("Go-HEP version:  %q\n", version)
	fmt.Printf("       checksum: %q\n", sum)




This section is empty.


This section is empty.


func Version

func Version() (version, sum string)

Version returns the version of Go-HEP and its checksum. The returned values are only valid in binaries built with module support.


This section is empty.

Source Files


Path Synopsis
brio Package brio is a set of tools to handle binary (de)serialized data.
brio/cmd/brio-gen Command brio-gen generates (un)marshaler code for types.
cmd/arrow2root arrow2root converts the content of an ARROW file to a ROOT TTree.
cmd/fits2root fits2root converts the content of a FITS table to a ROOT file and tree.
cmd/lhef2hepmc lhef2hepmc converts a LHEF input file into a HepMC file.
cmd/npy2root Command npy2root converts the content of a NumPy data file to a ROOT file and tree.
cmd/podio-gen Command podio-gen generates a complete EDM from a PODIO YAML file definition.
cmd/rio2yoda rio2yoda converts rio files containing hbook values (H1D, H2D, P1D, ...) into YODA files.
cmd/root2arrow root2arrow converts the content of a ROOT TTree to an ARROW file.
cmd/root2csv root2csv converts the content of a ROOT TTree to a CSV file.
cmd/root2fits root2fits converts the content of a ROOT tree to a FITS (binary) table.
cmd/root2npy root2npy converts the content of a ROOT TTree to a NumPy data file.
cmd/root2yoda root2yoda converts ROOT files containing hbook-like values (H1D, H2D, ...) into YODA files.
cmd/yoda2rio yoda2rio converts YODA files containing hbook-like values (H1D, H2D, P1D, ...) into rio files.
cmd/yoda2root yoda2root converts YODA files containing hbook-like values (H1D, H2D, P1D, ...) into ROOT files.
csvutil Package csvutil exposes functions and types to easily handle CSV files.
csvutil/csvdriver package csvdriver registers a database/sql/driver.Driver implementation for CSV files.
fads Package fads exposes building blocks for a fast simulation of a HEP detector.
fads/cmd/fads-app fads-app is a command that runs a simple ATLAS-like detector simulation, modelled after the C++ Delphes ATLAS data-card.
fads/cmd/fads-rivet-mc-generic fads-rivet-mc-generic is a command mirroring the MC_GENERIC analysis example from Rivet.
fastjet Package fastjet is a Go-based implementation of the C++ FastJet library.
fastjet/internal/delaunay package delaunay contains functions to compute a Delaunay Triangulation
fastjet/internal/heap package heap implements a min-heap for pairs of jets.
fastjet/internal/plot package plot contains functions to plot the Delaunay Triangulation and the Voronoi Diagram.
fastjet/internal/predicates package predicates handles the geometric predicates for a delaunay triangulation
fit Package fit provides functions to fit data.
fmom Package fmom provides types and functions to operate with Lorentz 4-vectors.
fwk Package fwk provides a set of tools to process High Energy Physics events data.
fwk/utils/builder package builder builds a fwk-app binary from a list of go files.
fwk/utils/parallel The parallel package provides a way of running functions concurrently while limiting the maximum number running at once.
fwk/utils/tarjan package tarjan implements a graph loop detection algorithm called Tarjan's algorithm.
geo/gdml Package gdml parses and interprets GDML files.
groot Package groot provides a pure-go read/write-access to ROOT files.
groot/cmd/root-cp root-cp selects and copies keys from a ROOT file to another ROOT file.
groot/cmd/root-diff root-diff compares the content of 2 ROOT files, including the content of their Trees (for all entries), if any.
groot/cmd/root-dump root-dump dumps the content of a ROOT file, including the content of the Trees (for all entries), if any.
groot/cmd/root-gen-datareader Command root-gen-datareader generates a Go struct to easily read the event data type stored inside a Tree.
groot/cmd/root-gen-rfunc Command root-gen-rfunc generates a rfunc.Formula based on a function signature or an already existing function.
groot/cmd/root-gen-streamer Command root-gen-streamer generates a StreamerInfo for ROOT and user types.
groot/cmd/root-gen-type Command root-gen-type generates a Go type from the StreamerInfo contained in a ROOT file.
groot/cmd/root-ls root-ls lists the content of a ROOT file.
groot/cmd/root-merge root-merge merges ROOT files' content into a merged ROOT file.
groot/cmd/root-print root-print prints ROOT files contents to PDF, PNG, ...
groot/cmd/root-split root-split splits an input file+tree into multiple output ROOT files, each containing N entries.
groot/cmd/root-srv root-srv runs a web server that can inspect and browse ROOT files.
groot/exp/rntup Package rntup contains types to handle RNTuple-related data.
groot/internal/rcompress rcompress provides types and functions to compress and decompress ROOT data payloads.
groot/rarrow Package rarrow handles conversion between ROOT and ARROW data models.
groot/rbase Package rbase contains the definitions of ROOT base classes.
groot/rbytes Package rbytes contains the definitions of types useful for serializing and deserializing ROOT data buffers.
groot/rcmd Package rcmd provides helper functions containing the logic of various root-xyz commands.
groot/rcont Package rcont contains the definitions of ROOT container types, such as TList, THashList and TObjArray.
groot/rdict Package rdict contains the definition of ROOT streamers and facilities to generate new streamers meta data from user types.
groot/rhist Package rhist contains the interfaces and definitions of ROOT types related to histograms and graphs.
groot/riofs Package riofs contains the types and low-level functions to deal with opening and creating ROOT files, and decoding the internal structure of ROOT files.
groot/riofs/plugin/http Package http is a plugin for riofs.Open to support opening ROOT files over http(s).
groot/riofs/plugin/xrootd Package xrootd is a plugin for riofs.Open to support opening ROOT files over xrootd.
groot/rmeta Package rmeta provides tools to interoperate with ROOT Meta.
groot/root Package root defines ROOT core interfaces.
groot/rphys Package rphys contains definitions for physics-related ROOT classes.
groot/rsql Package rsql provides a convenient access to ROOT files/trees as a database.
groot/rsql/rsqldrv Package rsqldrv registers a database/sql/driver.Driver implementation for ROOT files.
groot/rsrv Package rsrv exposes HTTP end-points to manipulate ROOT files.
groot/rtree Package rtree contains the interfaces and types to decode, read, concatenate and iterate over ROOT Trees.
groot/rtree/rfunc Package rfunc provides types and funcs to implement user-provided formulae evaluated on data exposed by ROOT trees.
groot/rtypes Package rtypes contains the means to register types (ROOT ones and user defined ones) with the ROOT type factory.
groot/rvers Package rvers contains the ROOT version and the classes' versions groot is supporting and currently reading.
groot/ztypes Package ztypes holds all the types registered with the rtypes factory.
hbook Package hbook is a set of data analysis tools for HEP (histograms (1D, 2D, 3D), profiles and ntuples).
hbook/ntup Package ntup provides a way to create, open and iterate over n-tuple data.
hbook/ntup/ntcsv Package ntcsv provides a convenient access to CSV files as n-tuple data.
hbook/ntup/ntroot Package ntroot provides convenience functions to access ROOT trees as n-tuple data.
hbook/rootcnv Package rootcnv provides tools to convert ROOT histograms and graphs to go-hep/hbook ones.
hbook/yodacnv Package yodacnv provides tools to read/write YODA archive files.
hepevt Package hepevt provides access to the HEPEVT event format record from FORTRAN-77.
hepmc Package hepmc is a pure Go implementation of the C++ HepMC-2 library.
hepmc/go-hepmc-dump go-hepmc-dump is a simple command to dump in an almost human-friendly format the content of a hepmc file.
heppdt Package heppdt provides access to the HEP Particle Data Table.
hplot Package hplot is a package to plot histograms, n-tuples and functions
hplot/cmd/hplot hplot is a simple gnuplot-like command to create plots
lcio Package lcio provides read/write access to the LCIO data model.
lcio/cmd/lcio-ls lcio-ls displays the content of a LCIO file.
lcio/example/lcio-ex-read-event lcio-ex-read-event is the hep/x/lcio example equivalent to: example: $> lcio-ex-read-event ./DST01-06_ppr004_bbcsdu.slcio lcio-ex-read-event: read 50 events from file "./DST01-06_ppr004_bbcsdu.slcio" $> open out.png
lhef Package lhef implements the "Les Houches Event File" data format.
pawgo pawgo is a simple interactive shell to quickly plot hbook histograms from rio files.
rio Package rio is a record-oriented persistency mechanism.
rio/cmd/rio-ls-records rio-ls-records displays the list of records stored in a given rio file.
sio Package sio implements a record-oriented persistency mechanism.
slha Package slha implements encoding and decoding of SUSY Les Houches Accords (SLHA) data format.
sliceop/f64s Package f64s provides common operations on float64 slices.
xrootd Package xrootd implements the XRootD protocol from Package xrootd provides a Client and a Server.
xrootd/cmd/xrd-client Command xrd-client provides access to data hosted on XRootD clusters.
xrootd/cmd/xrd-cp Command xrd-cp copies files and directories from a remote xrootd server to local storage.
xrootd/cmd/xrd-ls Command xrd-ls lists directory contents on a remote xrootd server.
xrootd/cmd/xrd-srv Command xrd-srv serves data from a local filesystem over the XRootD protocol.
xrootd/internal/mux Package mux implements the multiplexer that manages access to and writes data to the channels by corresponding StreamID from xrootd protocol specification.
xrootd/xrdfs Package xrdfs contains structures representing the XRootD-based filesystem.
xrootd/xrdio Package xrdio provides a File type that implements various interfaces from the io package.
xrootd/xrdproto Package protocol contains the XRootD protocol specific types and methods to handle them, such as marshalling and unmarshalling requests.
xrootd/xrdproto/admin Package admin contains the types related to the admin request.
xrootd/xrdproto/auth Package auth contains the structures describing auth request.
xrootd/xrdproto/auth/host Package host contains the implementation for the "host" security provider.
xrootd/xrdproto/auth/krb5 Package krb5 contains the implementation of krb5 (Kerberos) security provider.
xrootd/xrdproto/auth/unix Package unix contains the implementation of unix security provider.
xrootd/xrdproto/bind Package bind contains the structures describing bind request and response.
xrootd/xrdproto/chmod Package chmod contains the structures describing chmod request.
xrootd/xrdproto/decrypt Package decrypt contains the types related to the decrypt request.
xrootd/xrdproto/dirlist Package dirlist contains the structures describing request and response for dirlist request used to obtain the contents of a directory.
xrootd/xrdproto/endsess Package endsess contains the types related to the endsess request.
xrootd/xrdproto/handshake Package handshake contains the structures describing request and response for handshake request (see XRootD specification).
xrootd/xrdproto/locate Package locate contains the types related to the locate request.
xrootd/xrdproto/login Package login contains the structures describing request and response for login request.
xrootd/xrdproto/mkdir Package mkdir contains the structures describing mkdir request.
xrootd/xrdproto/mv Package mv contains the structures describing mv request.
xrootd/xrdproto/open Package open contains the structures describing request and response for open request.
xrootd/xrdproto/ping Package ping contains the structures describing ping request.
xrootd/xrdproto/prepare Package prepare contains the types related to the prepare request.
xrootd/xrdproto/protocol Package protocol contains the structures describing request and response for protocol request (see XRootD specification).
xrootd/xrdproto/query Package query contains the types related to the query request.
xrootd/xrdproto/read Package read contains the structures describing request and response for read request.
xrootd/xrdproto/rm Package rm contains the structures describing rm request.
xrootd/xrdproto/rmdir Package rmdir contains the structures describing rmdir request.
xrootd/xrdproto/signing Package signing contains implementation of a way to check if request should be signed according to XRootD protocol specification v.
xrootd/xrdproto/sigver Package sigver contains the structures describing sigver request.
xrootd/xrdproto/stat Package stat contains the structures describing request and response for stat request.
xrootd/xrdproto/statx Package statx contains the structures describing request and response for statx request.
xrootd/xrdproto/sync Package sync contains the structures describing sync request.
xrootd/xrdproto/truncate Package truncate contains the structures describing truncate request.
xrootd/xrdproto/verifyw Package verifyw contains the structures describing verifyw request.
xrootd/xrdproto/write Package write contains the structures describing write request.
xrootd/xrdproto/xrdclose Package xrdclose contains the structures describing request and response for close request.