README
slha
Package slha
implements encoding and decoding of SUSY Les Houches
Accords (SLHA) data format.
Installation
$ go get go-hep.org/x/hep/slha
Example
package main
import (
"fmt"
"os"
"go-hep.org/x/hep/slha"
)
func handle(err error) {
if err != nil {
panic(err)
}
}
func main() {
fname := "testdata/sps1a.spc"
if len(os.Args) > 1 {
fname = os.Args[1]
}
f, err := os.Open(fname)
handle(err)
defer f.Close()
data, err := slha.Decode(f)
handle(err)
spinfo := data.Blocks.Get("SPINFO")
value, err := spinfo.Get(1)
handle(err)
fmt.Printf("spinfo: %s -- %q\n", value.Interface(), value.Comment())
modsel := data.Blocks.Get("MODSEL")
value, err = modsel.Get(1)
handle(err)
fmt.Printf("modsel: %d -- %q\n", value.Interface(), value.Comment())
mass := data.Blocks.Get("MASS")
value, err = mass.Get(5)
handle(err)
fmt.Printf("mass[pdgid=5]: %v -- %q\n", value.Interface(), value.Comment())
nmix := data.Blocks.Get("NMIX")
value, err = nmix.Get(1, 2)
handle(err)
fmt.Printf("nmix[1,2] = %v -- %q\n", value.Interface(), value.Comment())
}
// Output:
// spinfo: SOFTSUSY -- "spectrum calculator"
// modsel: 1 -- "sugra"
// mass[pdgid=5]: 4.88991651 -- "b-quark pole mass calculated from mb(mb)_Msbar"
// nmix[1,2] = -0.0531103553 -- "N_12"
Documentation
Documentation is available on godoc:
Documentation
Overview ¶
Package slha implements encoding and decoding of SUSY Les Houches Accords (SLHA) data format.
Index ¶
Constants ¶
Variables ¶
Functions ¶
Types ¶
type Block ¶
Block represents a block in a SLHA file.
type Blocks ¶
type Blocks []Block
Blocks is a list of Blocks.
type Decay ¶
type Decay struct { Br float64 // Branching Ratio IDs []int // list of PDG IDs to which the decay occur Comment string // comment attached to this decay line - if any }
Decay is a decay line in an SLHA file.
type Index ¶
type Index struct {
// contains filtered or unexported fields
}
Index is an n-dimensional index. Note that the indices are 1-based.
type Particle ¶
type Particle struct { PdgID int // PDG-ID code Width float64 // total width of that particle Mass float64 // mass of that particle Comment string Decays Decays }
Particle is the representation of a single, specific particle, decay block from a SLHA file.
type Particles ¶
type Particles []Particle
Particles is a block of particle's decays in an SLHA file.
type Value ¶
type Value struct {
// contains filtered or unexported fields
}
Value represents a value (string,int,float64) + comment in a SLHA line.
func (*Value) Float ¶
Float returns the value as a float64. Float panics if the underlying value isn't a float64.
func (*Value) Int ¶
Int returns the value as an int64. Int panics if the underlying value isn't an int64.
Directories
Path | Synopsis |
---|---|
example
|
|