hi there,
quite happy to announce the release of Go-HEP@v0.28.0
.
The main new feature of that release (among fixes and code gardening) is the ability to write “structured trees”, ie: write trees with Go user types (that are translated into their C++ equivalent).
e.g.:
type Event struct {
I32 int32 `groot:"i32"` // -> translated into Int_t
Sli []float32 `groot:"sli"` // -> std::vector<float>
Ps []Particle `groot:"ps"` // -> std::vector<Particle>
}
type Particle struct {
Chg float32 `groot:"charge"`
Alg string `groot:"alg_name"` // -> std::string
Mom []float64 `groot:"mom"` // -> std::vector<double>
}
here are complete examples:
- https://pkg.go.dev/go-hep.org/x/hep@v0.28.0/groot/rtree#example-package-CreateEventNtupleFullSplit
- https://pkg.go.dev/go-hep.org/x/hep@v0.28.0/groot/rtree#example-package-CreateEventNtupleNoSplit
enjoy!
-s