groot

package
v0.0.0-...-9ae748d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 4, 2012 License: BSD-2-Clause Imports: 9 Imported by: 0

Documentation

Overview

groot is a native implementation of the core of ROOT in Go.

Index

Constants

This section is empty.

Variables

View Source
var Factory factory = factory{
	// contains filtered or unexported fields
}

the registry of all factory functions, by class name

Functions

This section is empty.

Types

type Basket

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

func (*Basket) Class

func (basket *Basket) Class() Class

func (*Basket) Name

func (basket *Basket) Name() string

func (*Basket) ROOTDecode

func (basket *Basket) ROOTDecode(b *Buffer) (err error)

func (*Basket) ROOTEncode

func (basket *Basket) ROOTEncode(b *Buffer) (err error)

func (*Basket) Title

func (basket *Basket) Title() string

type Branch

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

func (*Branch) Class

func (branch *Branch) Class() string

func (*Branch) Name

func (branch *Branch) Name() string

func (*Branch) ROOTDecode

func (branch *Branch) ROOTDecode(b *Buffer) (err error)

func (*Branch) ROOTEncode

func (branch *Branch) ROOTEncode(b *Buffer) (err error)

func (*Branch) Title

func (branch *Branch) Title() string

type BranchElement

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

func (*BranchElement) Class

func (be *BranchElement) Class() string

func (*BranchElement) Name

func (be *BranchElement) Name() string

func (*BranchElement) ROOTDecode

func (be *BranchElement) ROOTDecode(b *Buffer) (err error)

func (*BranchElement) ROOTEncode

func (be *BranchElement) ROOTEncode(b *Buffer) (err error)

func (*BranchElement) Title

func (be *BranchElement) Title() string

type Buffer

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

func NewBuffer

func NewBuffer(data []byte, order binary.ByteOrder, klen uint32) (b *Buffer, err error)

func NewBufferFromKey

func NewBufferFromKey(k *Key) (b *Buffer, err error)

func (*Buffer) Bytes

func (b *Buffer) Bytes() []byte

func (*Buffer) Len

func (b *Buffer) Len() int

func (*Buffer) Pos

func (b *Buffer) Pos() int

type Class

type Class interface {

	// Members returns the list of members for this ROOT class
	Members() []Member

	// Version returns the version number for this ROOT class
	Version() int

	// Name returns the ROOT class name for this ROOT class
	Name() string
}

Class represents a ROOT class. Class instances are created by a ClassFactory.

type ClassFactory

type ClassFactory interface {
	Create(name string) Class
}

ClassFactory creates ROOT classes

type Directory

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

Directory is a directory inside a ROOT file

func NewDirectory

func NewDirectory(f *File, buf []byte) (d *Directory, err error)

func (*Directory) Keys

func (d *Directory) Keys() []Key

func (*Directory) ROOTDecode

func (d *Directory) ROOTDecode(b *Buffer) (err error)

func (*Directory) ROOTEncode

func (d *Directory) ROOTEncode(buffer *Buffer) error

func (*Directory) SetFile

func (d *Directory) SetFile(f *File) error

type FactoryFct

type FactoryFct func() reflect.Value

type File

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

func NewFileReader

func NewFileReader(name string) (f *File, err error)

func (*File) ByteOrder

func (f *File) ByteOrder() binary.ByteOrder

func (*File) Dir

func (f *File) Dir() *Directory

func (*File) Name

func (f *File) Name() string

func (*File) Version

func (f *File) Version() uint32

type FileSetter

type FileSetter interface {
	SetFile(f *File) error
}

FileSetter is the interface allowing to reset the ownership of a ROOT object w.r.t a given file

type Key

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

Key is a key (a label) in a ROOT file

The Key class includes functions to book space on a file,
 to create I/O buffers, to fill these buffers
 to compress/uncompress data buffers.

Before saving (making persistent) an object on a file, a key must
be created. The key structure contains all the information to
uniquely identify a persistent object on a file.
   fNbytes    = number of bytes for the compressed object+key
   version of the Key class
   fObjlen    = Length of uncompressed object
   fDatime    = Date/Time when the object was written
   fKeylen    = number of bytes for the key structure
   fCycle     = cycle number of the object
   fSeekKey   = Address of the object on file (points to fNbytes)
                This is a redundant information used to cross-check
                the data base integrity.
   fSeekPdir  = Pointer to the directory supporting this object
   fClassName = Object class name
   fName      = name of the object
   fTitle     = title of the object

The Key class is used by ROOT to:
  - to write an object in the Current Directory
  - to write a new ntuple buffer

func NewKey

func NewKey(f *File, pos int64, nbytes uint32) (k *Key, err error)

func (*Key) Buffer

func (k *Key) Buffer() (buf []byte, err error)

Buffer returns the buffer of bytes corresponding to the Key's value

func (*Key) Class

func (k *Key) Class() string

func (*Key) Name

func (k *Key) Name() string

func (*Key) Size

func (k *Key) Size() uint32

func (*Key) Title

func (k *Key) Title() string

func (*Key) Value

func (k *Key) Value() (v interface{})

type LeafB

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

func (*LeafB) Class

func (leaf *LeafB) Class() string

func (*LeafB) Name

func (leaf *LeafB) Name() string

func (*LeafB) ROOTDecode

func (leaf *LeafB) ROOTDecode(b *Buffer) (err error)

func (*LeafB) ROOTEncode

func (leaf *LeafB) ROOTEncode(b *Buffer) (err error)

func (*LeafB) Title

func (leaf *LeafB) Title() string

type LeafC

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

func (*LeafC) Class

func (leaf *LeafC) Class() string

func (*LeafC) Name

func (leaf *LeafC) Name() string

func (*LeafC) ROOTDecode

func (leaf *LeafC) ROOTDecode(b *Buffer) (err error)

func (*LeafC) ROOTEncode

func (leaf *LeafC) ROOTEncode(b *Buffer) (err error)

func (*LeafC) Title

func (leaf *LeafC) Title() string

type LeafD

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

func (*LeafD) Class

func (leaf *LeafD) Class() string

func (*LeafD) Name

func (leaf *LeafD) Name() string

func (*LeafD) ROOTDecode

func (leaf *LeafD) ROOTDecode(b *Buffer) (err error)

func (*LeafD) ROOTEncode

func (leaf *LeafD) ROOTEncode(b *Buffer) (err error)

func (*LeafD) Title

func (leaf *LeafD) Title() string

type LeafElement

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

func (*LeafElement) Class

func (le *LeafElement) Class() string

func (*LeafElement) Name

func (le *LeafElement) Name() string

func (*LeafElement) ROOTDecode

func (le *LeafElement) ROOTDecode(b *Buffer) (err error)

func (*LeafElement) ROOTEncode

func (le *LeafElement) ROOTEncode(b *Buffer) (err error)

func (*LeafElement) Title

func (le *LeafElement) Title() string

type LeafF

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

func (*LeafF) Class

func (leaf *LeafF) Class() string

func (*LeafF) Name

func (leaf *LeafF) Name() string

func (*LeafF) ROOTDecode

func (leaf *LeafF) ROOTDecode(b *Buffer) (err error)

func (*LeafF) ROOTEncode

func (leaf *LeafF) ROOTEncode(b *Buffer) (err error)

func (*LeafF) Title

func (leaf *LeafF) Title() string

type LeafI

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

func (*LeafI) Class

func (leaf *LeafI) Class() string

func (*LeafI) Name

func (leaf *LeafI) Name() string

func (*LeafI) ROOTDecode

func (leaf *LeafI) ROOTDecode(b *Buffer) (err error)

func (*LeafI) ROOTEncode

func (leaf *LeafI) ROOTEncode(b *Buffer) (err error)

func (*LeafI) Title

func (leaf *LeafI) Title() string

type LeafL

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

func (*LeafL) Class

func (leaf *LeafL) Class() string

func (*LeafL) Name

func (leaf *LeafL) Name() string

func (*LeafL) ROOTDecode

func (leaf *LeafL) ROOTDecode(b *Buffer) (err error)

func (*LeafL) ROOTEncode

func (leaf *LeafL) ROOTEncode(b *Buffer) (err error)

func (*LeafL) Title

func (leaf *LeafL) Title() string

type LeafO

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

func (*LeafO) Class

func (leaf *LeafO) Class() string

func (*LeafO) Name

func (leaf *LeafO) Name() string

func (*LeafO) ROOTDecode

func (leaf *LeafO) ROOTDecode(b *Buffer) (err error)

func (*LeafO) ROOTEncode

func (leaf *LeafO) ROOTEncode(b *Buffer) (err error)

func (*LeafO) Title

func (leaf *LeafO) Title() string

type LeafS

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

func (*LeafS) Class

func (leaf *LeafS) Class() string

func (*LeafS) Name

func (leaf *LeafS) Name() string

func (*LeafS) ROOTDecode

func (leaf *LeafS) ROOTDecode(b *Buffer) (err error)

func (*LeafS) ROOTEncode

func (leaf *LeafS) ROOTEncode(b *Buffer) (err error)

func (*LeafS) Title

func (leaf *LeafS) Title() string

type List

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

func (*List) Class

func (lst *List) Class() string

func (*List) Name

func (lst *List) Name() string

func (*List) ROOTDecode

func (lst *List) ROOTDecode(b *Buffer) (err error)

func (*List) ROOTEncode

func (lst *List) ROOTEncode(b *Buffer) (err error)

func (*List) Title

func (lst *List) Title() string

type Member

type Member interface {
	// GetArrayDim returns the dimension of the array (if any)
	ArrayDim() int

	// GetComment returns the comment associated with this member
	Comment() string

	// Name returns the name of this member
	Name() string

	// Type returns the class of this member
	Type() Class
}

Member represents a single member of a ROOT class

type Object

type Object interface {
	// Class returns the ROOT class of this object
	Class() string

	// Name returns the name of this ROOT object
	Name() string

	// Title returns the title of this ROOT object
	Title() string
}

Object represents a ROOT object

type ROOTStreamer

type ROOTStreamer interface {
	// de-serialize into the current value using 'buf' as input
	ROOTDecode(buf *Buffer) error
	// serialize the current value using 'buf' as output
	ROOTEncode(buf *Buffer) error
}

ROOTStreamer is the interface describing data that provides its own routine for encoding and decoding transmitted values sent to a ROOT file.

type StreamerBase

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

StreamerBase is a streamer element for a base class

func (*StreamerBase) ArrDim

func (se *StreamerBase) ArrDim() int

func (*StreamerBase) ArrLen

func (se *StreamerBase) ArrLen() int

func (*StreamerBase) Class

func (se *StreamerBase) Class() string

func (*StreamerBase) MaxIdx

func (se *StreamerBase) MaxIdx() []int32

func (*StreamerBase) Name

func (se *StreamerBase) Name() string

func (*StreamerBase) Offset

func (se *StreamerBase) Offset() int

func (*StreamerBase) ROOTDecode

func (se *StreamerBase) ROOTDecode(b *Buffer) (err error)

func (*StreamerBase) ROOTEncode

func (se *StreamerBase) ROOTEncode(b *Buffer) (err error)

func (*StreamerBase) Size

func (se *StreamerBase) Size() int

func (*StreamerBase) Title

func (se *StreamerBase) Title() string

func (*StreamerBase) Type

func (se *StreamerBase) Type() int

func (*StreamerBase) TypeName

func (se *StreamerBase) TypeName() string

type StreamerBasicPointer

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

StreamerBasicPointer is a streamer element for a pointer to a builtin type

func (*StreamerBasicPointer) ArrDim

func (se *StreamerBasicPointer) ArrDim() int

func (*StreamerBasicPointer) ArrLen

func (se *StreamerBasicPointer) ArrLen() int

func (*StreamerBasicPointer) Class

func (se *StreamerBasicPointer) Class() string

func (*StreamerBasicPointer) MaxIdx

func (se *StreamerBasicPointer) MaxIdx() []int32

func (*StreamerBasicPointer) Name

func (se *StreamerBasicPointer) Name() string

func (*StreamerBasicPointer) Offset

func (se *StreamerBasicPointer) Offset() int

func (*StreamerBasicPointer) ROOTDecode

func (se *StreamerBasicPointer) ROOTDecode(b *Buffer) (err error)

func (*StreamerBasicPointer) ROOTEncode

func (se *StreamerBasicPointer) ROOTEncode(b *Buffer) (err error)

func (*StreamerBasicPointer) Size

func (se *StreamerBasicPointer) Size() int

func (*StreamerBasicPointer) Title

func (se *StreamerBasicPointer) Title() string

func (*StreamerBasicPointer) Type

func (se *StreamerBasicPointer) Type() int

func (*StreamerBasicPointer) TypeName

func (se *StreamerBasicPointer) TypeName() string

type StreamerBasicType

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

StreamerBasicType is a streamer element for a builtin type

func (*StreamerBasicType) ArrDim

func (se *StreamerBasicType) ArrDim() int

func (*StreamerBasicType) ArrLen

func (se *StreamerBasicType) ArrLen() int

func (*StreamerBasicType) Class

func (se *StreamerBasicType) Class() string

func (*StreamerBasicType) MaxIdx

func (se *StreamerBasicType) MaxIdx() []int32

func (*StreamerBasicType) Name

func (se *StreamerBasicType) Name() string

func (*StreamerBasicType) Offset

func (se *StreamerBasicType) Offset() int

func (*StreamerBasicType) ROOTDecode

func (se *StreamerBasicType) ROOTDecode(b *Buffer) (err error)

func (*StreamerBasicType) ROOTEncode

func (se *StreamerBasicType) ROOTEncode(b *Buffer) (err error)

func (*StreamerBasicType) Size

func (se *StreamerBasicType) Size() int

func (*StreamerBasicType) Title

func (se *StreamerBasicType) Title() string

func (*StreamerBasicType) Type

func (se *StreamerBasicType) Type() int

func (*StreamerBasicType) TypeName

func (se *StreamerBasicType) TypeName() string

type StreamerElement

type StreamerElement interface {
	Name() string
	Title() string
	Type() int       // element type
	Size() int       // sizeof element
	ArrLen() int     // cumulative size of all array dims
	ArrDim() int     // number of array dimensions
	MaxIdx() []int32 // maximum array index for array dimension "dim"
	Offset() int     // element offset in class
	//IsNewType() int // new element type when reading
	TypeName() string // data type name of data member
}

type StreamerInfo

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

func (*StreamerInfo) Class

func (si *StreamerInfo) Class() string

func (*StreamerInfo) Name

func (si *StreamerInfo) Name() string

func (*StreamerInfo) ROOTDecode

func (si *StreamerInfo) ROOTDecode(b *Buffer) (err error)

func (*StreamerInfo) ROOTEncode

func (si *StreamerInfo) ROOTEncode(b *Buffer) (err error)

func (*StreamerInfo) Title

func (si *StreamerInfo) Title() string

type StreamerObject

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

StreamerObject is a streamer element for an object

func NewStreamerObject

func NewStreamerObject(name, title string, offset int, typename string) *StreamerObject

func (*StreamerObject) ArrDim

func (se *StreamerObject) ArrDim() int

func (*StreamerObject) ArrLen

func (se *StreamerObject) ArrLen() int

func (*StreamerObject) Class

func (se *StreamerObject) Class() string

func (*StreamerObject) MaxIdx

func (se *StreamerObject) MaxIdx() []int32

func (*StreamerObject) Name

func (se *StreamerObject) Name() string

func (*StreamerObject) Offset

func (se *StreamerObject) Offset() int

func (*StreamerObject) ROOTDecode

func (se *StreamerObject) ROOTDecode(b *Buffer) (err error)

func (*StreamerObject) ROOTEncode

func (se *StreamerObject) ROOTEncode(b *Buffer) (err error)

func (*StreamerObject) Size

func (se *StreamerObject) Size() int

func (*StreamerObject) Title

func (se *StreamerObject) Title() string

func (*StreamerObject) Type

func (se *StreamerObject) Type() int

func (*StreamerObject) TypeName

func (se *StreamerObject) TypeName() string

type StreamerObjectAny

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

StreamerObjectAny is a streamer element for any object

func (*StreamerObjectAny) ArrDim

func (se *StreamerObjectAny) ArrDim() int

func (*StreamerObjectAny) ArrLen

func (se *StreamerObjectAny) ArrLen() int

func (*StreamerObjectAny) Class

func (se *StreamerObjectAny) Class() string

func (*StreamerObjectAny) MaxIdx

func (se *StreamerObjectAny) MaxIdx() []int32

func (*StreamerObjectAny) Name

func (se *StreamerObjectAny) Name() string

func (*StreamerObjectAny) Offset

func (se *StreamerObjectAny) Offset() int

func (*StreamerObjectAny) ROOTDecode

func (se *StreamerObjectAny) ROOTDecode(b *Buffer) (err error)

func (*StreamerObjectAny) ROOTEncode

func (se *StreamerObjectAny) ROOTEncode(b *Buffer) (err error)

func (*StreamerObjectAny) Size

func (se *StreamerObjectAny) Size() int

func (*StreamerObjectAny) Title

func (se *StreamerObjectAny) Title() string

func (*StreamerObjectAny) Type

func (se *StreamerObjectAny) Type() int

func (*StreamerObjectAny) TypeName

func (se *StreamerObjectAny) TypeName() string

type StreamerObjectPointer

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

StreamerObjectPointer is a streamer element for a pointer to an object

func (*StreamerObjectPointer) ArrDim

func (se *StreamerObjectPointer) ArrDim() int

func (*StreamerObjectPointer) ArrLen

func (se *StreamerObjectPointer) ArrLen() int

func (*StreamerObjectPointer) Class

func (se *StreamerObjectPointer) Class() string

func (*StreamerObjectPointer) MaxIdx

func (se *StreamerObjectPointer) MaxIdx() []int32

func (*StreamerObjectPointer) Name

func (se *StreamerObjectPointer) Name() string

func (*StreamerObjectPointer) Offset

func (se *StreamerObjectPointer) Offset() int

func (*StreamerObjectPointer) ROOTDecode

func (se *StreamerObjectPointer) ROOTDecode(b *Buffer) (err error)

func (*StreamerObjectPointer) ROOTEncode

func (se *StreamerObjectPointer) ROOTEncode(b *Buffer) (err error)

func (*StreamerObjectPointer) Size

func (se *StreamerObjectPointer) Size() int

func (*StreamerObjectPointer) Title

func (se *StreamerObjectPointer) Title() string

func (*StreamerObjectPointer) Type

func (se *StreamerObjectPointer) Type() int

func (*StreamerObjectPointer) TypeName

func (se *StreamerObjectPointer) TypeName() string

type StreamerSTL

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

StreamerSTL is a streamer element for STL containers

func (*StreamerSTL) ArrDim

func (se *StreamerSTL) ArrDim() int

func (*StreamerSTL) ArrLen

func (se *StreamerSTL) ArrLen() int

func (*StreamerSTL) Class

func (se *StreamerSTL) Class() string

func (*StreamerSTL) MaxIdx

func (se *StreamerSTL) MaxIdx() []int32

func (*StreamerSTL) Name

func (se *StreamerSTL) Name() string

func (*StreamerSTL) Offset

func (se *StreamerSTL) Offset() int

func (*StreamerSTL) ROOTDecode

func (se *StreamerSTL) ROOTDecode(b *Buffer) (err error)

func (*StreamerSTL) ROOTEncode

func (se *StreamerSTL) ROOTEncode(b *Buffer) (err error)

func (*StreamerSTL) Size

func (se *StreamerSTL) Size() int

func (*StreamerSTL) Title

func (se *StreamerSTL) Title() string

func (*StreamerSTL) Type

func (se *StreamerSTL) Type() int

func (*StreamerSTL) TypeName

func (se *StreamerSTL) TypeName() string

type StreamerSTLstring

type StreamerSTLstring struct {
	StreamerSTL
}

StreamerSTLstring is a streamer element for std::string

func (*StreamerSTLstring) ArrDim

func (se *StreamerSTLstring) ArrDim() int

func (*StreamerSTLstring) ArrLen

func (se *StreamerSTLstring) ArrLen() int

func (*StreamerSTLstring) Class

func (se *StreamerSTLstring) Class() string

func (*StreamerSTLstring) MaxIdx

func (se *StreamerSTLstring) MaxIdx() []int32

func (*StreamerSTLstring) Name

func (se *StreamerSTLstring) Name() string

func (*StreamerSTLstring) Offset

func (se *StreamerSTLstring) Offset() int

func (*StreamerSTLstring) ROOTDecode

func (se *StreamerSTLstring) ROOTDecode(b *Buffer) (err error)

func (*StreamerSTLstring) ROOTEncode

func (se *StreamerSTLstring) ROOTEncode(b *Buffer) (err error)

func (*StreamerSTLstring) Size

func (se *StreamerSTLstring) Size() int

func (*StreamerSTLstring) Title

func (se *StreamerSTLstring) Title() string

func (*StreamerSTLstring) Type

func (se *StreamerSTLstring) Type() int

func (*StreamerSTLstring) TypeName

func (se *StreamerSTLstring) TypeName() string

type StreamerString

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

StreamerString is a streamer element for a string

func (*StreamerString) ArrDim

func (se *StreamerString) ArrDim() int

func (*StreamerString) ArrLen

func (se *StreamerString) ArrLen() int

func (*StreamerString) Class

func (se *StreamerString) Class() string

func (*StreamerString) MaxIdx

func (se *StreamerString) MaxIdx() []int32

func (*StreamerString) Name

func (se *StreamerString) Name() string

func (*StreamerString) Offset

func (se *StreamerString) Offset() int

func (*StreamerString) ROOTDecode

func (se *StreamerString) ROOTDecode(b *Buffer) (err error)

func (*StreamerString) ROOTEncode

func (se *StreamerString) ROOTEncode(b *Buffer) (err error)

func (*StreamerString) Size

func (se *StreamerString) Size() int

func (*StreamerString) Title

func (se *StreamerString) Title() string

func (*StreamerString) Type

func (se *StreamerString) Type() int

func (*StreamerString) TypeName

func (se *StreamerString) TypeName() string

type Tree

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

func NewTree

func NewTree(file *File, name, title string) (tree *Tree, err error)

func (*Tree) Branches

func (tree *Tree) Branches() []Branch

func (*Tree) Class

func (tree *Tree) Class() string

func (*Tree) Entries

func (tree *Tree) Entries() uint64

func (*Tree) Name

func (tree *Tree) Name() string

func (*Tree) ROOTDecode

func (tree *Tree) ROOTDecode(b *Buffer) (err error)

func (*Tree) ROOTEncode

func (tree *Tree) ROOTEncode(b *Buffer) (err error)

func (*Tree) SetFile

func (tree *Tree) SetFile(f *File) (err error)

func (*Tree) Title

func (tree *Tree) Title() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL