Documentation
¶
Index ¶
- Variables
- func ComputeBBox(cseg CathodeSegmentation) geo.BBox
- func ComputeCathodePadBBox(cseg CathodeSegmentation, padcid PadCID, xmin, ymin, xmax, ymax *float64)
- func ComputePadBBox(padps PadSizerPositioner, paduid PadUID, xmin, ymin, xmax, ymax *float64)
- func ComputeSegmentationBBox(seg Segmentation) geo.BBox
- func ForEachDetectionElement(detElemIDHandler func(deid DEID))
- func ForOneDetectionElementOfEachSegmentationType(detElemIDHandler func(deid DEID))
- func PlaneAbbreviation(isBendingPlane bool) string
- func RegisterCathodeSegmentationBuilder(segType int, builder cathodeSegmentationBuilder)
- type CathodeSegmentation
- type DEID
- type DualSampaChannelID
- type DualSampaID
- type PadByFEEFinder
- type PadByFEEFinderFunc
- type PadCID
- type PadFEELocator
- type PadFEELocatorFunc
- type PadSizerPositioner
- type PadUID
- type SegCache
- type Segmentation
Constants ¶
This section is empty.
Variables ¶
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 ¶
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 DualSampaChannelID ¶
type DualSampaChannelID int
DualSampaChannel is a DualSampa channel 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 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 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).