Skip to content
This repository was archived by the owner on Oct 30, 2025. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 27 additions & 3 deletions cmd/hepmc2root/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,21 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

// hepmc2root converts HepMC files into ROOT files.
// Command hepmc2root converts a HepMC2 ASCII file into a ROOT file and (flat) tree.
//
// Usage: hepmc2root [OPTIONS] hepmc.ascii
//
// Example:
//
// $> hepmc2root -o hepmc.root hepmc.ascii
// $> hepmc2root -o hepmc.root -t mytree hepmc.ascii
// $> hepmc2root ./hepmc.ascii
// $> hepmc2root -o out.root -t mytree ./hepmc.ascii
//
// Options:
//
// -o string
// path to output ROOT file name (default "out.root")
// -t string
// name of the output tree (default "tree")
package main // import "go-hep.org/x/hep/cmd/hepmc2root"

import (
Expand All @@ -31,6 +40,21 @@ func main() {
oname := flag.String("o", "out.root", "path to output ROOT file name")
tname := flag.String("t", "tree", "name of the output tree")

flag.Usage = func() {
fmt.Fprintf(os.Stderr, `hepmc2root converts a HepMC2 ASCII file into a ROOT file and (flat) tree.

Usage: hepmc2root [OPTIONS] hepmc.ascii

Example:

$> hepmc2root ./hepmc.ascii
$> hepmc2root -o out.root -t mytree ./hepmc.ascii

Options:
`)
flag.PrintDefaults()
}

flag.Parse()

if flag.NArg() != 1 {
Expand Down