pumas

package
v0.0.0-...-d3cb9a1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrConfig            = errors.New("pumas: configuration error")
	ErrIndex             = errors.New("pumas: index error")
	ErrIO                = errors.New("pumas: I/O error")
	ErrValue             = errors.New("pumas: value error")
	ErrIncompleteMessage = errors.New("pumas: incomplete message")
)

Functions

This section is empty.

Types

type Context

type Context struct {
	Rand     *rand.Rand
	Recorder *Recorder
	Kinetic  struct {
		Min float64 // in GeV
		Max float64 // in GeV
	}
	Step struct {
		Min float64 // in meters
		Max float64 // in meters
	}
	TransportRatio  float64
	EnergyLossRatio float64
	MagneticRatio   float64

	Data interface{}
	// contains filtered or unexported fields
}

func New

func New() *Context

func (*Context) Finalize

func (ctx *Context) Finalize() error

func (*Context) Initialize

func (ctx *Context) Initialize() error

func (*Context) Propagate

func (ctx *Context) Propagate(charge float64, state State, scattering, fwd int) (State, error)

Propagate propagates through a pre-configured set of media using either:

  • propagation through a uniform medium
  • propagation through a set of media described by a locator function.

func (*Context) SetLocator

func (ctx *Context) SetLocator(locator Locator, media []Medium)

func (*Context) SetMedium

func (ctx *Context) SetMedium(media []Medium)

type CutKind

type CutKind int
const (
	MinKinetic CutKind = iota
	MaxKinetic
	MinStep
	MaxStep
	TransportRatio
	EnergyLossRatio
	MagneticRatio
)

type Locator

type Locator func(ctx *Context, pos fmom.Vec3) int

type MaterialKind

type MaterialKind int

MaterialKind describes the kind of medium through which a particle propagates.

const (
	StandardRock MaterialKind = iota
	DryAir
	Concrete
	Iron
	Lead
)

type Medium

type Medium struct {
	Material   MaterialKind
	Magnetized bool
	Density    float64
	Magnet     fmom.Vec3
}

Medium is a medium descriptor.

type PropertyKind

type PropertyKind int
const (
	Kinetic PropertyKind = iota
	Grammage
	WeightedTime
	EnergyLoss
	LarmorIntegral0
	LarmorIntegral1
	LarmorIntegral2
	LarmorIntegral3
	LarmorIntegral4
	LarmorIntegral5
	LarmorIntegral6
	LarmorIntegral7
	LarmorPhase
)

type Recorder

type Recorder struct {
	First   *State
	Last    *State
	Len     int
	Scaling int
	Record  int
}

type State

type State struct {
	Medium    int
	Kinetic   float64
	Distance  float64
	Time      float64
	Position  fmom.Vec3
	Direction fmom.Vec3
}

State describes the current state of a particle propagation

Jump to

Keyboard shortcuts

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