daq

package
v0.0.0-...-3215db2 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2022 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Overview

Package daq contains types and functions to build a simple DAQ system.

Index

Constants

View Source
const (
	EvtBeg = 0xdeadcafe
	EvtEnd = 0xdeadfeed
	DetEnd = 0xdecafeed
)

Variables

View Source
var (
	MagicHdr = [4]byte{0, 'd', 'a', 'q'}
)

Functions

func NewDetScanner

func NewDetScanner(r io.Reader) *bufio.Scanner

func NewEvtScanner

func NewEvtScanner(r io.Reader) *bufio.Scanner

Types

type Calorimeter

type Calorimeter struct {
	CellID uint64
	Ene    float64
}

type Decoder

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

func NewDecoder

func NewDecoder(r io.Reader) *Decoder

func (*Decoder) Err

func (dec *Decoder) Err() error

func (*Decoder) Read

func (dec *Decoder) Read(p []byte) (int, error)

func (*Decoder) ReadCalorimeter

func (dec *Decoder) ReadCalorimeter() Calorimeter

func (*Decoder) ReadEnvSys

func (dec *Decoder) ReadEnvSys() Env

func (*Decoder) ReadF64

func (dec *Decoder) ReadF64() float64

func (*Decoder) ReadHeader

func (dec *Decoder) ReadHeader() Header

func (*Decoder) ReadI64

func (dec *Decoder) ReadI64() int64

func (*Decoder) ReadStr

func (dec *Decoder) ReadStr() string

func (*Decoder) ReadStreamHeader

func (dec *Decoder) ReadStreamHeader() [4]byte

func (*Decoder) ReadU32

func (dec *Decoder) ReadU32() uint32

func (*Decoder) ReadU64

func (dec *Decoder) ReadU64() uint64

func (*Decoder) ReadU8

func (dec *Decoder) ReadU8() uint8

type DetKind

type DetKind byte
const (
	CaloDet   DetKind = 0
	EnvSysDet DetKind = 1
)

type Encoder

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

func NewEncoder

func NewEncoder(w io.Writer) *Encoder

func (*Encoder) Err

func (enc *Encoder) Err() error

func (*Encoder) Write

func (enc *Encoder) Write(p []byte) (int, error)

func (*Encoder) WriteF64

func (enc *Encoder) WriteF64(v float64)

func (*Encoder) WriteStr

func (enc *Encoder) WriteStr(v string)

func (*Encoder) WriteU32

func (enc *Encoder) WriteU32(v uint32)

func (*Encoder) WriteU64

func (enc *Encoder) WriteU64(v uint64)

func (*Encoder) WriteU8

func (enc *Encoder) WriteU8(v uint8)

type Env

type Env struct {
	Name string
	H    float64
	P    float64
	T    float64
}
type Header struct {
	Len    int64
	Sum    uint32
	RunNbr int64
	EvtNbr int64
}

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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