GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> EDS / V2-11-5 > eds / rhel5-64
#include <PBI/Endianness.h>
Classes | |
struct | _EBF_tkr |
Lays out the format of the TKR data block from the event builder. More... | |
Defines | |
#define | EBF_TKR_K_ACCEPTS_CNT 3 |
The number of words in the TKR layer accept list block. | |
#define | EBF_TKR_ACCEPTS_LEFT_XLO(_a0) ((unsigned int)_a0 & 0xffffc000) |
Unpacks the accept hit mask for X lo mask. The mask is left justified in the resulting 32 bit word. | |
#define | EBF_TKR_ACCEPTS_LEFT_XHI(_a0, _a1) |
Unpacks the accept hit mask for X hi mask. The mask is left justified in the resulting 32 bit word. | |
#define | EBF_TKR_ACCEPTS_LEFT_YLO(_a1) (((unsigned int)_a1 & 0x0ffffc00) << 4) |
Unpacks the accept hit mask for Y lo mask. The mask is left justified in the resulting 32 bit word. | |
#define | EBF_TKR_ACCEPTS_LEFT_YHI(_a1, _a2) |
Unpacks the accept hit mask for Y hi mask. The mask is left justified in the resulting 32 bit word. | |
#define | EBF_TKR_ACCEPTS_LEFT_UNPACK(_accepts, _xlo, xhi, _ylo, yhi) |
Unpacks the accepts hit map into bits masks for the X and Y masks. The right and left halves of the X and Y masks are returned as 4 separate values. The bit masks are left justified in the 32 bit word. | |
#define | EBF_TKR_ACCEPTS_LEFT_ORED_UNPACK(_accepts, _x, _y) |
Unpacks the accepts hit map into bits masks for the X and Y masks. The right and left halves of the masks are OR'd together. The masks are returned left justified in the 32 bit fields. | |
#define | EBF_TKR_LEFT_LAYER_REMAP(_laccept, _layer) ((((_laccept)>>EBF_TKR_LEFT_BIT_K_L ## _layer)&1)<<(EBF_TKR_K_L ## _layer+14)) |
Moves the bit corresponding to the specified layer in a left justified accept mask to the bit position _layer. | |
#define | EBF_TKR_LEFT_ACCEPT_REMAP(_accept) |
Remaps a tracker accept pattern word in the even/odd order to the canonical order (layer 0->17 in LSB to MSB. | |
#define | EBF_TKR_ACCEPTS_RIGHT_XLO(_a0) (((unsigned int)_a0 & 0xffffc000) >> 14) |
Unpacks the accept hit mask for X lo mask. The mask is right justified in the resulting 32 bit word. | |
#define | EBF_TKR_ACCEPTS_RIGHT_XHI(_a0, _a1) |
Unpacks the accept hit mask for X hi mask. The mask is right justified in the resulting 32 bit word. | |
#define | EBF_TKR_ACCEPTS_RIGHT_YLO(_a1) (((unsigned int)_a1 & 0x0ffffc00) >> 10) |
Unpacks the accept hit mask for Y lo mask. The mask is right justified in the resulting 32 bit word. | |
#define | EBF_TKR_ACCEPTS_RIGHT_YHI(_a1, _a2) |
Unpacks the accept hit mask for Y hi mask. The mask is right justified in the resulting 32 bit word. | |
#define | EBF_TKR_ACCEPTS_RIGHT_UNPACK(_accepts, _xlo, xhi, _ylo, yhi) |
Unpacks the accepts hit map into bits masks for the X and Y masks. The right and left halves of the X and Y masks are returned as 4 separate values. The bit masks are right justified in the 32 bit word. | |
#define | EBF_TKR_ACCEPTS_RIGHT_ORED_UNPACK(_accepts, _x, _y) |
Unpacks the accepts hit map into bits masks for the X and Y masks. The right and left halves of the masks are OR'd together. The masks are returned right justified in the 32 bit word. | |
#define | EBF_TKR_RIGHT_LAYER_REMAP(_raccept, _layer) ((( (_raccept)>>EBF_TKR_RIGHT_BIT_K_L ## _layer)&1) << EBF_TKR_K_L ## _layer) |
Moves the bit corresponding to the specified layer in a right justified accept mask to the bit position _layer. | |
#define | EBF_TKR_RIGHT_ACCEPT_REMAP(_accept) |
Remaps a tracker accept pattern word in the even/odd order to the canonical order (layer 0->17 in LSB to MSB. | |
Typedefs | |
typedef enum _EBF_TKR_RIGHT_BIT_K_LX | EBF_TKR_RIGHT_BIT_K_LX |
Typedef for enum _EBF_TKR_RIGHT_BIT_K_LX. | |
typedef enum _EBF_TKR_LEFT_BIT_K_LX | EBF_TKR_LEFT_BIT_K_LX |
Typedef for enum _EBF_TKR_LEFT_BIT_K_LX. | |
typedef enum _EBF_TKR_K_LX | EBF_TKR_K_LX |
Typedef for enum _EBF_TKR_K_LX. | |
typedef struct _EBF_tkr | EBF_tkr |
Enumerations | |
enum | _EBF_TKR_RIGHT_BIT_K_LX { EBF_TKR_RIGHT_BIT_K_L1 = 17, EBF_TKR_RIGHT_BIT_K_L3 = 16, EBF_TKR_RIGHT_BIT_K_L5 = 15, EBF_TKR_RIGHT_BIT_K_L7 = 14, EBF_TKR_RIGHT_BIT_K_L9 = 13, EBF_TKR_RIGHT_BIT_K_LB = 12, EBF_TKR_RIGHT_BIT_K_LD = 11, EBF_TKR_RIGHT_BIT_K_LF = 10, EBF_TKR_RIGHT_BIT_K_LH = 9, EBF_TKR_RIGHT_BIT_K_L0 = 8, EBF_TKR_RIGHT_BIT_K_L2 = 7, EBF_TKR_RIGHT_BIT_K_L4 = 6, EBF_TKR_RIGHT_BIT_K_L6 = 5, EBF_TKR_RIGHT_BIT_K_L8 = 4, EBF_TKR_RIGHT_BIT_K_LA = 3, EBF_TKR_RIGHT_BIT_K_LC = 2, EBF_TKR_RIGHT_BIT_K_LE = 1, EBF_TKR_RIGHT_BIT_K_LG = 0 } |
Enumeration of the bit number for a particular layer in the 18 bit accept word, when the accept word is right justified. More... | |
enum | _EBF_TKR_LEFT_BIT_K_LX { EBF_TKR_LEFT_BIT_K_L1 = 31, EBF_TKR_LEFT_BIT_K_L3 = 30, EBF_TKR_LEFT_BIT_K_L5 = 29, EBF_TKR_LEFT_BIT_K_L7 = 28, EBF_TKR_LEFT_BIT_K_L9 = 27, EBF_TKR_LEFT_BIT_K_LB = 26, EBF_TKR_LEFT_BIT_K_LD = 25, EBF_TKR_LEFT_BIT_K_LF = 24, EBF_TKR_LEFT_BIT_K_LH = 23, EBF_TKR_LEFT_BIT_K_L0 = 22, EBF_TKR_LEFT_BIT_K_L2 = 21, EBF_TKR_LEFT_BIT_K_L4 = 20, EBF_TKR_LEFT_BIT_K_L6 = 19, EBF_TKR_LEFT_BIT_K_L8 = 18, EBF_TKR_LEFT_BIT_K_LA = 17, EBF_TKR_LEFT_BIT_K_LC = 16, EBF_TKR_LEFT_BIT_K_LE = 15, EBF_TKR_LEFT_BIT_K_LG = 14 } |
Enumeration of the bit number for a particular layer in the 18 bit accept word, when the accept word is left justified. More... | |
enum | _EBF_TKR_K_LX { EBF_TKR_K_L0 = 0x00, EBF_TKR_K_L1 = 0x01, EBF_TKR_K_L2 = 0x02, EBF_TKR_K_L3 = 0x03, EBF_TKR_K_L4 = 0x04, EBF_TKR_K_L5 = 0x05, EBF_TKR_K_L6 = 0x06, EBF_TKR_K_L7 = 0x07, EBF_TKR_K_L8 = 0x08, EBF_TKR_K_L9 = 0x09, EBF_TKR_K_LA = 0x0A, EBF_TKR_K_LB = 0x0B, EBF_TKR_K_LC = 0x0C, EBF_TKR_K_LD = 0x0D, EBF_TKR_K_LE = 0x0E, EBF_TKR_K_LF = 0x0F, EBF_TKR_K_LG = 0x10, EBF_TKR_K_LH = 0x11 } |
Enumeration mapping a layer designation, ie 0,1,...A,B,C,D,E,F,G,H to a number. More... | |
Functions | |
int | EBF_tkrLayerEndCount (const EBF_tkr *tkr) |
Counts the number of layer ends with hit strips. | |
int | EBF_tkrStripCount (const EBF_tkr *tkr, int layerEndCnt, int maxwrds) |
Counts the hit strips. | |
int | EBF_tkrLenCalc (const EBF_tkr *tkr, int maxwrds) |
Calculates the number of bytes, not including any padding, in the EBF_tkr record. | |
static int __inline | EBF__tkrNbytes (int nLayerEnds, int nStrips) |
Calculates the size, in bytes, of the EBF_tkr block. |
CVS $Id: EBF_tkr.h,v 1.4 2011/03/25 22:16:54 russell Exp $
#define EBF_TKR_ACCEPTS_LEFT_ORED_UNPACK | ( | _accepts, | |||
_x, | |||||
_y | ) |
Value:
{ \ unsigned int a0 = _accepts[0]; \ unsigned int a1 = _accepts[1]; \ unsigned int a2 = _accepts[2]; \ \ _x = EBF_TKR_ACCEPTS_LEFT_XLO(a0) | EBF_TKR_ACCEPTS_LEFT_XHI(a0, a1); \ _y = EBF_TKR_ACCEPTS_LEFT_YLO(a1) | EBF_TKR_ACCEPTS_LEFT_YHI(a1, a2); \ \ }
#define EBF_TKR_ACCEPTS_LEFT_UNPACK | ( | _accepts, | |||
_xlo, | |||||
xhi, | |||||
_ylo, | |||||
yhi | ) |
Value:
{ \ unsigned int a0 = _accepts[0]; \ unsigned int a1 = _accepts[1]; \ unsigned int a2 = _accepts[2]; \ \ _xlo = EBF_TKR_ACCEPTS_LEFT_XLO(a0); \ _xhi = EBF_TKR_ACCEPTS_LEFT_XHI(a0, a1); \ _ylo = EBF_TKR_ACCEPTS_LEFT_YLO(a1); \ _yhi = EBF_TKR_ACCEPTS_LEFT_YHI(a1, a2); \ \ }
#define EBF_TKR_ACCEPTS_LEFT_XHI | ( | _a0, | |||
_a1 | ) |
Value:
((((unsigned int)_a0 & 0x00003fff) << (32-14)) | \ (((unsigned int)_a1 & 0xf0000000) >> 14))
#define EBF_TKR_ACCEPTS_LEFT_YHI | ( | _a1, | |||
_a2 | ) |
Value:
((((unsigned int)_a1 & 0x000003ff) << (32-10)) | \ (((unsigned int)_a2 & 0xff000000) >> 10))
#define EBF_TKR_ACCEPTS_RIGHT_ORED_UNPACK | ( | _accepts, | |||
_x, | |||||
_y | ) |
Value:
{ \ unsigned int a0 = _accepts[0]; \ unsigned int a1 = _accepts[1]; \ unsigned int a2 = _accepts[2]; \ \ _x = EBF_TKR_ACCEPTS_RIGHT_XLO(a0) | EBF_TKR_ACCEPTS_RIGHT_XHI(a0, a1); \ _y = EBF_TKR_ACCEPTS_RIGHT_YLO(a1) | EBF_TKR_ACCEPTS_RIGHT_YHI(a1, a2); \ \ }
#define EBF_TKR_ACCEPTS_RIGHT_UNPACK | ( | _accepts, | |||
_xlo, | |||||
xhi, | |||||
_ylo, | |||||
yhi | ) |
Value:
{ \ unsigned int a0 = _accepts[0]; \ unsigned int a1 = _accepts[1]; \ unsigned int a2 = _accepts[2]; \ \ _xlo = EBF_TKR_ACCEPTS_RIGHT_XLO(a0); \ _xhi = EBF_TKR_ACCEPTS_RIGHT_XHI(a0, a1); \ _ylo = EBF_TKR_ACCEPTS_RIGHT_YLO(a1); \ _yhi = EBF_TKR_ACCEPTS_RIGHT_YHI(a1, a2); \ \ }
#define EBF_TKR_ACCEPTS_RIGHT_XHI | ( | _a0, | |||
_a1 | ) |
Value:
((((unsigned int)_a0 & 0x00003fff) << 4) | \ (((unsigned int)_a1 & 0xf0000000) >> 28))
#define EBF_TKR_ACCEPTS_RIGHT_YHI | ( | _a1, | |||
_a2 | ) |
Value:
((((unsigned int)_a1 & 0x000003ff) << 8) | \ (((unsigned int)_a2 & 0xff000000) >> 24))
#define EBF_TKR_K_ACCEPTS_CNT 3 |
The number of words in the TKR layer accept list block.
Accept Hit Map 8 9 bit vectors, one for each of the readout controllers Strip Addresses The list of strip addresses, 12 bits/per address TOT values The TOT values, one 8 bit value for each accept hit.
3 2 In Reads Out Out +--------------+ 0: Yeven Left (lo) 6: Xodd Lo 4 | | 1 1: Yeven Right (hi) 3: Xeven Lo | | 2: Xeven Left (hi) 7: Xodd Hi | | 3: Xeven Right (lo) 2: Xeven Hi | | 4: Yodd Left (hi) 5: Yodd Lo | | 5: Yodd Right (lo) 0: Yeven Lo 5 | | 0 6: Xodd Left (lo) 4: Yodd Hi +--------------+ 7: Xodd Right (hi) 1: Yeven Hi 6 7
X odd lo | X even lo X odd hi | X even hi Y odd lo | Y even lo Y odd hi | Y even hi
11111111 11111111 fedcba98 76543210 fedcba98 76543210 +--------+--------+--------+--------+ 0 |66666666 63333333 33777777 77722222| 1 |22225555 55555222 22222244 44444441| 2 |11111111 | +--------+--------+--------+--------+
6 = X odd lo (0) 5 = Y odd lo (4) 3 = X even lo (1) 0 = Y even lo (5) 7 = X odd hi (2) 4 = Y odd hi (6) 2 = X even hi (3) 1 = Y even hi (7)
#define EBF_TKR_LEFT_ACCEPT_REMAP | ( | _accept | ) |
Value:
(EBF_TKR_LEFT_LAYER_REMAP(_accept, 0) \ | EBF_TKR_LEFT_LAYER_REMAP(_accept, 1) \ | EBF_TKR_LEFT_LAYER_REMAP(_accept, 2) \ | EBF_TKR_LEFT_LAYER_REMAP(_accept, 3) \ | EBF_TKR_LEFT_LAYER_REMAP(_accept, 4) \ | EBF_TKR_LEFT_LAYER_REMAP(_accept, 5) \ | EBF_TKR_LEFT_LAYER_REMAP(_accept, 6) \ | EBF_TKR_LEFT_LAYER_REMAP(_accept, 7) \ | EBF_TKR_LEFT_LAYER_REMAP(_accept, 8) \ | EBF_TKR_LEFT_LAYER_REMAP(_accept, 9) \ | EBF_TKR_LEFT_LAYER_REMAP(_accept, A) \ | EBF_TKR_LEFT_LAYER_REMAP(_accept, B) \ | EBF_TKR_LEFT_LAYER_REMAP(_accept, C) \ | EBF_TKR_LEFT_LAYER_REMAP(_accept, D) \ | EBF_TKR_LEFT_LAYER_REMAP(_accept, E) \ | EBF_TKR_LEFT_LAYER_REMAP(_accept, F) \ | EBF_TKR_LEFT_LAYER_REMAP(_accept, G) \ | EBF_TKR_LEFT_LAYER_REMAP(_accept, H))
#define EBF_TKR_LEFT_LAYER_REMAP | ( | _laccept, | |||
_layer | ) | ((((_laccept)>>EBF_TKR_LEFT_BIT_K_L ## _layer)&1)<<(EBF_TKR_K_L ## _layer+14)) |
Moves the bit corresponding to the specified layer in a left justified accept mask to the bit position _layer.
#define EBF_TKR_RIGHT_ACCEPT_REMAP | ( | _accept | ) |
Value:
(EBF_TKR_RIGHT_LAYER_REMAP(_accept, 0) \ | EBF_TKR_RIGHT_LAYER_REMAP(_accept, 1) \ | EBF_TKR_RIGHT_LAYER_REMAP(_accept, 2) \ | EBF_TKR_RIGHT_LAYER_REMAP(_accept, 3) \ | EBF_TKR_RIGHT_LAYER_REMAP(_accept, 4) \ | EBF_TKR_RIGHT_LAYER_REMAP(_accept, 5) \ | EBF_TKR_RIGHT_LAYER_REMAP(_accept, 6) \ | EBF_TKR_RIGHT_LAYER_REMAP(_accept, 7) \ | EBF_TKR_RIGHT_LAYER_REMAP(_accept, 8) \ | EBF_TKR_RIGHT_LAYER_REMAP(_accept, 9) \ | EBF_TKR_RIGHT_LAYER_REMAP(_accept, A) \ | EBF_TKR_RIGHT_LAYER_REMAP(_accept, B) \ | EBF_TKR_RIGHT_LAYER_REMAP(_accept, C) \ | EBF_TKR_RIGHT_LAYER_REMAP(_accept, D) \ | EBF_TKR_RIGHT_LAYER_REMAP(_accept, E) \ | EBF_TKR_RIGHT_LAYER_REMAP(_accept, F) \ | EBF_TKR_RIGHT_LAYER_REMAP(_accept, G) \ | EBF_TKR_RIGHT_LAYER_REMAP(_accept, H))
#define EBF_TKR_RIGHT_LAYER_REMAP | ( | _raccept, | |||
_layer | ) | ((( (_raccept)>>EBF_TKR_RIGHT_BIT_K_L ## _layer)&1) << EBF_TKR_K_L ## _layer) |
Moves the bit corresponding to the specified layer in a right justified accept mask to the bit position _layer.
enum _EBF_TKR_K_LX |
Enumeration mapping a layer designation, ie 0,1,...A,B,C,D,E,F,G,H to a number.
Enumeration of the bit number for a particular layer in the 18 bit accept word, when the accept word is left justified.
Enumeration of the bit number for a particular layer in the 18 bit accept word, when the accept word is right justified.
static int __inline EBF__tkrNbytes | ( | int | nLayerEnds, | |
int | nStrips | |||
) | [static] |
Calculates the size, in bytes, of the EBF_tkr block.
nLayerEnds | The number of layer ends with active strips. | |
nStrips | The number of active strips |
int EBF_tkrLayerEndCount | ( | const EBF_tkr * | tkr | ) |
Counts the number of layer ends with hit strips.
tkr | Pointer to the tracker data |
References _EBF_tkr::accepts, and countLayerEnds().
int EBF_tkrLenCalc | ( | const EBF_tkr * | tkr, | |
int | maxwrds | |||
) |
Calculates the number of bytes, not including any padding, in the EBF_tkr record.
tkr | Pointer to the tracker data | |
maxwrds | The maximum number of words that can possibly be in the EBF_tkr record. This serves as a sanity check in case the serial decode of the record goes haywire. |
References _EBF_tkr::accepts, countLayerEnds(), and EBF_tkrStripCount().
Referenced by EBF_dirAuxFill().
int EBF_tkrStripCount | ( | const EBF_tkr * | tkr, | |
int | layerEndCnt, | |||
int | maxwrds | |||
) |
Counts the hit strips.
tkr | Pointer to the tracker data | |
layerEndCnt | Count of the number hit layer end ends. This is most easily acquired from EBF_tkrLayerEndCount. | |
maxwrds | The maximum number of words in the TKR record. This value is currently not used, but may be used in the future as an integrity check. |
References _EBF_tkr::accepts.
Referenced by EBF_tkrLenCalc().