Project
Loading...
Searching...
No Matches
CathodeSegmentationCInterface.h File Reference

Go to the source code of this file.

Typedefs

typedef struct MchCathodeSegmentationMchCathodeSegmentationHandle
 
typedef void(* MchDetectionElementHandler) (void *clientData, int detElemId)
 
typedef void(* MchDualSampaHandler) (void *clientData, int dualSampaId)
 
typedef void(* MchPadHandler) (void *clientData, int catPadIndex)
 

Functions

Creation and destruction of the segmentation handle.

Most of the functions of this library require a segmentation handle to work with.

MchCathodeSegmentationHandle mchCathodeSegmentationConstruct (int detElemId, bool isBendingPlane) __attribute__((weak))
 Create a handle to a segmentation for a given plane of a detection element.
 
void mchCathodeSegmentationDestruct (MchCathodeSegmentationHandle segHandle) __attribute__((weak))
 Delete a segmentation handle.
 
Pad Unique Identifier

Pads are identified by a unique integer, catPadIndex.

Warning
This catPadIndex is only valid within the functions of this library (to use the query methods padPosition, padSize, etc...). So do not rely on any given value it might take (as it might change between e.g. library versions)
int mchCathodeSegmentationIsPadValid (MchCathodeSegmentationHandle segHandle, int catPadIndex) __attribute__((weak))
 Return > 0 if catPadIndex is a valid one or <= 1 if not.
 
Pad finding.

Functions to find a pad. In each case the returned integer represents either a catPadIndex if a pad is found or an integer representing an invalid catPadIndex otherwise. Validity of the returned value can be tested using mchCathodeSegmentationIsPadValid()

int mchCathodeSegmentationFindPadByPosition (MchCathodeSegmentationHandle segHandle, double x, double y) __attribute__((weak))
 Find the pad at position (x,y) (in cm).
 
int mchCathodeSegmentationFindPadByFEE (MchCathodeSegmentationHandle segHandle, int dualSampaId, int dualSampaChannel) __attribute__((weak))
 Find the pad connected to the given channel of the given dual sampa.
 
Pad information retrieval.

Given a valid catPadIndex those methods return information (position, size, front-end electronics) about that pad.

Positions and sizes are in centimetres.

If catPadIndex is invalid, you are on your own.

double mchCathodeSegmentationPadPositionX (MchCathodeSegmentationHandle segHandle, int catPadIndex) __attribute__((weak))
 
double mchCathodeSegmentationPadPositionY (MchCathodeSegmentationHandle segHandle, int catPadIndex) __attribute__((weak))
 
double mchCathodeSegmentationPadSizeX (MchCathodeSegmentationHandle segHandle, int catPadIndex) __attribute__((weak))
 
double mchCathodeSegmentationPadSizeY (MchCathodeSegmentationHandle segHandle, int catPadIndex) __attribute__((weak))
 
int mchCathodeSegmentationPadDualSampaId (MchCathodeSegmentationHandle segHandle, int catPadIndex) __attribute__((weak))
 
int mchCathodeSegmentationPadDualSampaChannel (MchCathodeSegmentationHandle segHandle, int catPadIndex) __attribute__((weak))
 
ForEach methods.

Functions to loop over some items : detection elements, dual sampas, and pads.

void mchCathodeSegmentationForEachDetectionElement (MchDetectionElementHandler handler, void *clientData) __attribute__((weak))
 
void mchCathodeSegmentationForOneDetectionElementOfEachSegmentationType (MchDetectionElementHandler handler, void *clientData) __attribute__((weak))
 
void mchCathodeSegmentationForEachDualSampa (MchCathodeSegmentationHandle segHandle, MchDualSampaHandler handler, void *clientData) __attribute__((weak))
 
void mchCathodeSegmentationForEachPadInDualSampa (MchCathodeSegmentationHandle segHandle, int dualSampaId, MchPadHandler handler, void *clientData) __attribute__((weak))
 
void mchCathodeSegmentationForEachPadInArea (MchCathodeSegmentationHandle segHandle, double xmin, double ymin, double xmax, double ymax, MchPadHandler handler, void *clientData) __attribute__((weak))
 
void mchCathodeSegmentationForEachPad (MchCathodeSegmentationHandle segHandle, MchPadHandler handler, void *clientData) __attribute__((weak))
 
void mchCathodeSegmentationForEachNeighbouringPad (MchCathodeSegmentationHandle segHandle, int catPadIndex, MchPadHandler handler, void *userData) __attribute__((weak))
 

Detailed Description

C Interface to the Muon MCH mapping.

This interface is actually the main entrypoint to the mapping, at least if dealing with cathodes and not full detection elements. (in which case Segmentation.h is probably more convenient)

Even the C++ interface is using it (CathodeSegmentation.h).

Based on the idea of hourglass interfaces https://github.com/CppCon/CppCon2014/tree/master/Presentations/Hourglass%20Interfaces%20for%20C%2B%2B%20APIs

Author
Laurent Aphecetche

Definition in file CathodeSegmentationCInterface.h.

Typedef Documentation

◆ MchCathodeSegmentationHandle

◆ MchDetectionElementHandler

typedef void(* MchDetectionElementHandler) (void *clientData, int detElemId)

Definition at line 36 of file CathodeSegmentationCInterface.h.

◆ MchDualSampaHandler

typedef void(* MchDualSampaHandler) (void *clientData, int dualSampaId)

Definition at line 38 of file CathodeSegmentationCInterface.h.

◆ MchPadHandler

typedef void(* MchPadHandler) (void *clientData, int catPadIndex)

Definition at line 40 of file CathodeSegmentationCInterface.h.

Function Documentation

◆ mchCathodeSegmentationConstruct()

MchCathodeSegmentationHandle mchCathodeSegmentationConstruct ( int  detElemId,
bool  isBendingPlane 
)

Create a handle to a segmentation for a given plane of a detection element.

Definition at line 28 of file CathodeSegmentationCImpl3.cxx.

◆ mchCathodeSegmentationDestruct()

void mchCathodeSegmentationDestruct ( MchCathodeSegmentationHandle  segHandle)

Delete a segmentation handle.

Definition at line 35 of file CathodeSegmentationCImpl3.cxx.

◆ mchCathodeSegmentationFindPadByFEE()

int mchCathodeSegmentationFindPadByFEE ( MchCathodeSegmentationHandle  segHandle,
int  dualSampaId,
int  dualSampaChannel 
)

Find the pad connected to the given channel of the given dual sampa.

Definition at line 51 of file CathodeSegmentationCImpl3.cxx.

◆ mchCathodeSegmentationFindPadByPosition()

int mchCathodeSegmentationFindPadByPosition ( MchCathodeSegmentationHandle  segHandle,
double  x,
double  y 
)

Find the pad at position (x,y) (in cm).

Definition at line 45 of file CathodeSegmentationCImpl3.cxx.

◆ mchCathodeSegmentationForEachDetectionElement()

void mchCathodeSegmentationForEachDetectionElement ( MchDetectionElementHandler  handler,
void clientData 
)

Definition at line 57 of file CathodeSegmentationCImpl3.cxx.

◆ mchCathodeSegmentationForEachDualSampa()

void mchCathodeSegmentationForEachDualSampa ( MchCathodeSegmentationHandle  segHandle,
MchDualSampaHandler  handler,
void clientData 
)

Definition at line 74 of file CathodeSegmentationCImpl3.cxx.

◆ mchCathodeSegmentationForEachNeighbouringPad()

void mchCathodeSegmentationForEachNeighbouringPad ( MchCathodeSegmentationHandle  segHandle,
int  catPadIndex,
MchPadHandler  handler,
void userData 
)

Definition at line 151 of file CathodeSegmentationCImpl3.cxx.

◆ mchCathodeSegmentationForEachPad()

void mchCathodeSegmentationForEachPad ( MchCathodeSegmentationHandle  segHandle,
MchPadHandler  handler,
void clientData 
)

◆ mchCathodeSegmentationForEachPadInArea()

void mchCathodeSegmentationForEachPadInArea ( MchCathodeSegmentationHandle  segHandle,
double  xmin,
double  ymin,
double  xmax,
double  ymax,
MchPadHandler  handler,
void clientData 
)

Definition at line 142 of file CathodeSegmentationCImpl3.cxx.

◆ mchCathodeSegmentationForEachPadInDualSampa()

void mchCathodeSegmentationForEachPadInDualSampa ( MchCathodeSegmentationHandle  segHandle,
int  dualSampaId,
MchPadHandler  handler,
void clientData 
)

Definition at line 97 of file CathodeSegmentationCImpl3.cxx.

◆ mchCathodeSegmentationForOneDetectionElementOfEachSegmentationType()

void mchCathodeSegmentationForOneDetectionElementOfEachSegmentationType ( MchDetectionElementHandler  handler,
void clientData 
)

Definition at line 82 of file CathodeSegmentationCImpl3.cxx.

◆ mchCathodeSegmentationIsPadValid()

int mchCathodeSegmentationIsPadValid ( MchCathodeSegmentationHandle  segHandle,
int  catPadIndex 
)

Return > 0 if catPadIndex is a valid one or <= 1 if not.

Definition at line 91 of file CathodeSegmentationCImpl3.cxx.

◆ mchCathodeSegmentationPadDualSampaChannel()

int mchCathodeSegmentationPadDualSampaChannel ( MchCathodeSegmentationHandle  segHandle,
int  catPadIndex 
)

Definition at line 136 of file CathodeSegmentationCImpl3.cxx.

◆ mchCathodeSegmentationPadDualSampaId()

int mchCathodeSegmentationPadDualSampaId ( MchCathodeSegmentationHandle  segHandle,
int  catPadIndex 
)

Definition at line 130 of file CathodeSegmentationCImpl3.cxx.

◆ mchCathodeSegmentationPadPositionX()

double mchCathodeSegmentationPadPositionX ( MchCathodeSegmentationHandle  segHandle,
int  catPadIndex 
)

Definition at line 106 of file CathodeSegmentationCImpl3.cxx.

◆ mchCathodeSegmentationPadPositionY()

double mchCathodeSegmentationPadPositionY ( MchCathodeSegmentationHandle  segHandle,
int  catPadIndex 
)

Definition at line 112 of file CathodeSegmentationCImpl3.cxx.

◆ mchCathodeSegmentationPadSizeX()

double mchCathodeSegmentationPadSizeX ( MchCathodeSegmentationHandle  segHandle,
int  catPadIndex 
)

Definition at line 118 of file CathodeSegmentationCImpl3.cxx.

◆ mchCathodeSegmentationPadSizeY()

double mchCathodeSegmentationPadSizeY ( MchCathodeSegmentationHandle  segHandle,
int  catPadIndex 
)

Definition at line 124 of file CathodeSegmentationCImpl3.cxx.