mapping

package
v0.0.0-...-7df57c3 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2020 License: BSD-3-Clause Imports: 5 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidPadCID = errors.New("invalid pad uid")

ErrInvalidPadCID signals that an invalid pad uid was used / returned

Functions

func ComputeBBox

func ComputeBBox(cseg CathodeSegmentation) geo.BBox

ComputeCathodeBBox return the bounding box of the cathode.

func ComputeCathodePadBBox

func ComputeCathodePadBBox(cseg CathodeSegmentation, padcid PadCID, xmin, ymin, xmax, ymax *float64)

ComputeCathodePadBBox fills the coordinates of the bounding box of one pad of the given cathode.

func ComputePadBBox

func ComputePadBBox(padps PadSizerPositioner, paduid PadUID, xmin, ymin, xmax, ymax *float64)

ComputePadBBox fills the coordinates (xmin,ymin,xmax,ymax) of the bounding box of one pad of the given segmentation.

func ComputeSegmentationBBox

func ComputeSegmentationBBox(seg Segmentation) geo.BBox

ComputeSegmentationBBox return the bounding box of the detection element represented by it segmentation.

func ForEachDetectionElement

func ForEachDetectionElement(detElemIDHandler func(deid DEID))

ForEachDetectionElement loops over all detection elements and call the detElemIdHandler function for each of them

func ForOneDetectionElementOfEachSegmentationType

func ForOneDetectionElementOfEachSegmentationType(detElemIDHandler func(deid DEID))

ForOneDetectionElementOfEachSegmentationType loops over one detection element per segmentation type and call the detElemIdHandler function for each of them

func PlaneAbbreviation

func PlaneAbbreviation(isBendingPlane bool) string

PlaneAbbreviation returns a short name for a bending/non-bending plane

func RegisterCathodeSegmentationBuilder

func RegisterCathodeSegmentationBuilder(segType int, builder cathodeSegmentationBuilder)

Types

type CathodeSegmentation

type CathodeSegmentation interface {
	DetElemID() DEID
	NofPads() int
	NofDualSampas() int
	DualSampaID(dualSampaIndex int) (DualSampaID, error)
	IsValid(padcid PadCID) bool
	FindPadByFEE(dualSampaID DualSampaID, dualSampaChannel DualSampaChannelID) (PadCID, error)
	FindPadByPosition(x, y float64) (PadCID, error)
	ForEachPad(padHandler func(padcid PadCID))
	ForEachPadInDualSampa(dualSampaID DualSampaID, padHandler func(padcid PadCID))
	PadDualSampaChannel(padcid PadCID) DualSampaChannelID
	PadDualSampaID(padcid PadCID) DualSampaID
	PadPositionX(padcid PadCID) float64
	PadPositionY(padcid PadCID) float64
	PadSizeX(padcid PadCID) float64
	PadSizeY(padcid PadCID) float64
	GetNeighbourIDs(padcid PadCID, neighbours []int) int
	IsBending() bool
	String(padcid PadCID) string
}

CathodeSegmentation represents the mapping of one cathode (either bending or non-bending cathode).

func NewCathodeSegmentation

func NewCathodeSegmentation(deid DEID, isBendingPlane bool) CathodeSegmentation

NewSegmentation creates a segmentation object for the given detection element plane (aka cathode).

type DEID

type DEID int

DEID is a detection element identifier.

type DualSampaChannelID

type DualSampaChannelID int

DualSampaChannel is a DualSampa channel identifier.

type DualSampaID

type DualSampaID int

DualSampaID is a DualSampa identifier.

type PadByFEEFinder

type PadByFEEFinder interface {
	FindPadByFEE(DualSampaID, DualSampaChannelID) (PadUID, error)
}

PadByFEEFinder finds a pad by its front-end electronics (FEE) identifiers.

type PadByFEEFinderFunc

type PadByFEEFinderFunc func(deid DEID) PadByFEEFinder

PadByFEEFinderFunc is any function that can create a PadByFEEFinder from a detection element id.

type PadCID

type PadCID int

PadCID is a pad identifier, valid for one cathode only.

type PadFEELocator

type PadFEELocator interface {
	PadDualSampaChannel(paduid PadUID) DualSampaChannelID
	PadDualSampaID(paduid PadUID) DualSampaID
}

PadFEELocator retrieves DualSampa ID and channel information from a PadUID (within a given detection element). Note that mapping.Segmentation interface satisfy PadFEELocator.

type PadFEELocatorFunc

type PadFEELocatorFunc func(deid DEID) PadFEELocator

PadFEELocatorFunc is any function that can create a PadFEELocator from a detection element id.

type PadSizerPositioner

type PadSizerPositioner interface {
	PadPositionX(paduid PadUID) float64
	PadPositionY(paduid PadUID) float64
	PadSizeX(paduid PadUID) float64
	PadSizeY(paduid PadUID) float64
}

PadSizerPositioner is able to return the x and y positions (in cm) of a pad, relative to detection element origin, as well as its x and y sizes (in cm). Note that mapping.Segmentation interface satisfy PadSizerPositioner.

type PadUID

type PadUID int
var InvalidPadUID PadUID = -1

type SegCache

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

SegCache is a simple cache for the detection element segmentations.

func (*SegCache) CathodeSegmentation

func (sc *SegCache) CathodeSegmentation(deid DEID, bending bool) CathodeSegmentation

Segmentation returns the segmentation for given detection element id and given plane (true for bending plane). The segmentation for both planes of that detection element is created and cached if not already cached

func (*SegCache) Segmentation

func (sc *SegCache) Segmentation(deid DEID) Segmentation

type Segmentation

type Segmentation interface {
	DetElemID() DEID
	NofPads() int
	NofDualSampas() int
	IsValid(paduid PadUID) bool
	IsBendingPad(paduid PadUID) bool
	FindPadByFEE(dualSampaID DualSampaID, dualSampaChannel DualSampaChannelID) (PadUID, error)
	FindPadPairByPosition(x, y float64) (PadUID, PadUID, error)
	ForEachPad(padHandler func(paduid PadUID))
	ForEachPadInDualSampa(dualSampaID DualSampaID, padHandler func(paduid PadUID))
	PadDualSampaChannel(paduid PadUID) DualSampaChannelID
	PadDualSampaID(paduid PadUID) DualSampaID
	PadPositionX(paduid PadUID) float64
	PadPositionY(paduid PadUID) float64
	PadSizeX(paduid PadUID) float64
	PadSizeY(paduid PadUID) float64
	GetNeighbourIDs(paduid PadUID, neighbours []int) int
	Bending() CathodeSegmentation
	NonBending() CathodeSegmentation
	String(paduid PadUID) string
}

Segmentation is the main entry point to the MCH mapping. It encompasses both cathodes of a detection element.

func NewSegmentation

func NewSegmentation(deid DEID) Segmentation

NewSegmentation creates a Segmentation object for the given detection element. The returned segmentation spans both cathodes (bending and non-bending).

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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