hep: go-hep.org/x/hep/slha Index | Files

package slha

import "go-hep.org/x/hep/slha"

Package slha implements encoding and decoding of SUSY Les Houches Accords (SLHA) data format.

Index

Package Files

decode.go encode.go slha.go

func Encode Uses

func Encode(w io.Writer, data *SLHA) error

Encode writes the SLHA informations to w.

type Block Uses

type Block struct {
    Name    string
    Comment string
    Q       float64
    Data    DataArray
}

Block represents a block in a SLHA file.

func (*Block) Get Uses

func (b *Block) Get(args ...int) (Value, error)

Get returns the Value at index args. Note that args are 1-based indices.

func (*Block) Set Uses

func (b *Block) Set(v interface{}, args ...int) error

Set sets the Value at index args with v. Set creates a new empty Value if none exists at args. Note that args are 1-based indices.

type Blocks Uses

type Blocks []Block

Blocks is a list of Blocks.

func (Blocks) Get Uses

func (b Blocks) Get(name string) *Block

Get returns the block named name or nil.

func (Blocks) Keys Uses

func (b Blocks) Keys() []string

Keys returns the names of the contained blocks.

type DataArray Uses

type DataArray []DataItem

DataArray is an ordered list of DataItems.

func (DataArray) Get Uses

func (d DataArray) Get(idx Index) (Value, bool)

Get returns the value at the n-dim index idx.

type DataItem Uses

type DataItem struct {
    Index Index
    Value Value
}

DataItem is a pair of (Index,Value). Index is a n-dim index (1-based indices)

type Decay Uses

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 Decays Uses

type Decays []Decay

Decays is a list of decays in a Decay block.

type Index Uses

type Index struct {
    // contains filtered or unexported fields
}

Index is an n-dimensional index. Note that the indices are 1-based.

func NewIndex Uses

func NewIndex(args ...int) Index

NewIndex creates a new n-dim index from args. Note that args are 1-based indices.

func (Index) Index Uses

func (idx Index) Index() []int

Index returns the n-dim indices. Note that the indices are 1-based.

type Particle Uses

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 Uses

type Particles []Particle

Particles is a block of particle's decays in an SLHA file.

func (Particles) Get Uses

func (p Particles) Get(pdgid int) *Particle

Get returns the Particle with matching pdgid or nil.

func (Particles) Len Uses

func (p Particles) Len() int

func (Particles) Less Uses

func (p Particles) Less(i, j int) bool

func (Particles) Swap Uses

func (p Particles) Swap(i, j int)

type SLHA Uses

type SLHA struct {
    Blocks    Blocks
    Particles Particles
}

SLHA holds informations about a SUSY Les Houches Accords file.

func Decode Uses

func Decode(r io.Reader) (*SLHA, error)

Decode reads SLHA informations from r and returns them as a *slha.SLHA.

type Value Uses

type Value struct {
    // contains filtered or unexported fields
}

Value represents a value (string,int,float64) + comment in a SLHA line.

func (*Value) Comment Uses

func (v *Value) Comment() string

Comment returns the comment string attached to this value

func (*Value) Float Uses

func (v *Value) Float() float64

Float returns the value as a float64. Float panics if the underlying value isn't a float64.

func (*Value) Int Uses

func (v *Value) Int() int64

Int returns the value as an int64. Int panics if the underlying value isn't an int64.

func (*Value) Interface Uses

func (v *Value) Interface() interface{}

Interface returns the value as an interface{}.

func (*Value) Kind Uses

func (v *Value) Kind() reflect.Kind

Kind returns the kind of the value (reflect.String, reflect.Float64, reflect.Int)

Package slha imports 10 packages (graph). Updated 2018-08-02. Refresh now. Tools for package owners.