Go HEP release 0.8


Release v0.8 is fresh from the oven.

No API changes in go-hep itself, just a few modifications to cater with changes in gonum/v1/gonum and gonum/v1/plot:

  • gonum/v1/gonum/stat/distuv distributions replaced the name of their rand.Rand source field from Source to Src (to align with the standard library)
  • gonum/v1/gonum/stat/... packages now use golang.org/x/exp/rand.Rand instead of math/rand.Rand

The biggest news (and where the work mostly happened between v0.7 and v0.8) is that there’s now a Jupyter instance with a Go kernel installed with Go-HEP and Gonum libraries pre-installed. This has been packaged up at go-hep/binder. You can try it there: Binder

Here are some examples:


fmom gained a new top-level function fmom.InvMass(p1, p2 P4) float64 :

// InvMass computes the invariant mass of two incoming 4-vectors p1 and p2.
func InvMass(p1, p2 P4) float64 {
       p := Add(p1, p2)
       return p.M()


hplot gained a new top-level function Show:

// Show displays the plot according to format, returning the raw bytes and
// an error, if any.
// If format is the empty string, then "png" is selected.
// The list of accepted format strings is the same one than from
// the gonum.org/v1/plot/vg/draw.NewFormattedCanvas function.
func Show(p *Plot, w, h vg.Length, format string) ([]byte, error) { ... }

Show is especially useful for the new support for Go in Jupyter notebooks (via the Neugram interpreter)

See https://github.com/go-hep/binder for more details and examples on using Go and Go-HEP in Jupyter.

David Blyth provided a new hplot.HInfoStdDev HInfoStyle value and made them bitset-like. Thanks David!


  • cmd/root-dump can now recursively handle rootio.Directory and thus walk an entire ROOT file.
  • cmd/root-ls got the same handling of rootio.Directory.