GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> QSE / dev > qseprint / rhel6-64
#include <QSE/QSE_map.h>
#include <QSE/QSE_calLog.h>
#include <PBI/Endianness.h>
Classes | |
struct | _QSE_calTwr |
Structure containing the unpacked CAL data for this tower. More... | |
struct | _QSE_cal |
Structure containing the unpacked CAL data for all towers. More... | |
Defines | |
#define | QSE_CALTWRMAP_0 0x0001 |
The value of a QSE_calTwrMap with TWR 0 set. | |
#define | QSE_CALLYRMAP_0 0x01 |
The value of a QSE_calLyrMap with Layer 0 set. | |
#define | QSE_CALCOLMAP_0 0x0001 |
The value of a QSE_calColMap with Column 0 set. | |
Typedefs | |
typedef unsigned short int | QSE_calTwrMap |
Abstract typedef for a CAL tower map. | |
typedef unsigned short int | QSE_calColMap |
Abstract typedef for a CAL column map. | |
typedef unsigned char | QSE_calLyrMap |
Abstract typedef for a CAL layer map. | |
typedef enum _QSE_CALFLAGS_V | QSE_CALFLAGS_V |
Typedef for enum _QSE_CALFLAGS_V. | |
typedef enum _QSE_CALFLAGS_M | QSE_CALFLAGS_M |
Typedef for enum _QSE_CALFLAGS_M. | |
typedef struct _QSE_calTwr | QSE_calTwr |
Typedef for struct _QSE_calTwr. | |
typedef struct _QSE_cal | QSE_cal |
Typedef for struct _QSE_cal. | |
Enumerations | |
enum | _QSE_CALFLAGS_V { QSE_CALFLAGS_V_4RNG = 0, QSE_CALFLAGS_V_NOSUPPRESS = 1 } |
Enumeration/definition of the bit offsets to the 4 range and 0-suppress flags, right justified bit offsets. More... | |
enum | _QSE_CALFLAGS_M { QSE_CALFLAGS_M_4RNG = 1 << QSE_CALFLAGS_V_4RNG, QSE_CALFLAGS_M_NOSUPPRESS = 1 << QSE_CALFLAGS_V_NOSUPPRESS } |
Enumeration/definition of the bit offsets to the 4 range and 0-suppress flags, in place masks. More... | |
Functions | |
static __inline QSE_map | QSE_calTwrMapGet (const QSE_cal *cal) |
Returns a properly justified version of the tower map. | |
static __inline QSE_map | QSE_calLyrMapGet (const QSE_calTwr *twr) |
Returns a properly justified version of a tower's layer map. | |
static __inline QSE_map | QSE_calColMapGet (const QSE_calColMap *map) |
Returns a properly justified version of the tower map. | |
static __inline unsigned int | QSE_calTwrMask (int num) |
Converts the indicated tower number to a mask. | |
static __inline unsigned int | QSE_calLyrMask (int num) |
Converts the indicated layer number to a mask. | |
static __inline unsigned int | QSE_calColMask (int num) |
Converts the indicated layer number to a mask. | |
static __inline QSE_calTwrMap | QSE_calTwrMapInsert (QSE_calTwrMap map, int num) |
Returns the tower map with the new tower number inserted. | |
static __inline QSE_calLyrMap | QSE_calLyrMapInsert (QSE_calLyrMap map, int num) |
Returns the layer map with the new layer number inserted. | |
static __inline QSE_calColMap | QSE_calColMapInsert (QSE_calColMap map, int num) |
Returns the column map with the new column number inserted. | |
static __inline int | QSE_calFlagsIs4Rng (unsigned int flags) |
Returns a non-zero value if the flags indicate the readout mode is 4-range. | |
static __inline int | QSE_calFlagsIsNoSuppress (unsigned int flags) |
Returns a non-zero value if the flags indicate the readout mode is not zero suppression. |
CVS $Id: QSE_cal.h,v 1.5 2011/03/27 01:45:43 russell Exp $
#define QSE_CALCOLMAP_0 0x0001 |
The value of a QSE_calColMap with Column 0 set.
Referenced by QSE_calTwrPrint().
#define QSE_CALLYRMAP_0 0x01 |
The value of a QSE_calLyrMap with Layer 0 set.
#define QSE_CALTWRMAP_0 0x0001 |
The value of a QSE_calTwrMap with TWR 0 set.
Typedef for struct _QSE_cal.
void cal_print (const QSE_cal *cal) { QSE_map twrMap = QSE_calTwrMapGet (cal); const QSE_calTwr *twrs = cal->twrs; / * Loop as long as there are still towers in the tower map * / while (twrMap) { int twrNum; int lyrNum; const QSE_calTwr *twr; const QSE_calLog *logs; / * | Get the next struck layer, | Then eliminate it from the map | Finally locate the relevant CAL tower / twrNum = QSE_mapScanf (twrMap); twrMap = QSE_mapRemove (twrMap, twrNum); twr = twrs + twrNum; lyrCnts = QSE_calLyrCntsGet (twr); logs = twr->logs; for (lyrNum = 0; lyrCnts, lyrNum += 1) { int lyrCnt; lyrCnt = QSE_calLyrCntNext (lyrCnts); lyrCnts = QSE_calLyrCntsEliminate (lyrCnts); while (--lyrCnt >= 0) { printf (" Twr:%1x Lyr:%1x Col:%1x Adc-:%3x Adc+:%3x\n", twrNum, lyrNum, QSE_calLogColGet (log), QSE_calLogAdcNGet (log), QSE_calLogAdcPGet (log)); } } } return; }
Alternatively one could use the column maps
void cal_print (const QSE_cal *cal) { QSE_map twrMap = QSE_calTwrMapGet (cal); const QSE_calTwr *twrs = cal->twrs; / * Loop as long as there are still towers in the tower map * / while (twrMap) { int twrNum; const QSE_calTwr *twr; QSE_map lyrMap; const QSE_calLog *logs; const QSE_calColMap *colMaps; / * | Get the next struck layer, | Then eliminate it from the map | Finally locate the relevant CAL tower / twrNum = QSE_mapScanf (twrMap); twrMap = QSE_mapRemove (twrMap, twrNum); twr = twrs + twrNum; / * Get the map of struck layers and the array of hit columns * / lyrMap = QSE_calLyrMapGet (twr); colMaps = twr->colMaps; logs = twr->logs; / * While there are still layers * / while (lyrMap) { int lyrNum = QSE_mapScanf (lyrMap); int lyrCnt = QSE_mapRemove (lyrMap, lyrNum); QSE_map colMap = QSE_calColMapGet (colMaps + lyrNum]); / * While there are still columns * / while (colMaps) { unsigned int colNum = QSE_mapScanf (colMap); unsigned int colMap = QSE_mapEliminate (colMap, colNum); QSE_calLog log = *logs++; printf (" Twr:%1x Lyr:%1x Col:%1x Adc-:%3x Adc+:%3x\n", twrNum, lyrNum, colNum, QSE_calLogAdcNGet (log), QSE_calLogAdcPGet (log)); } } } return; }
Typedef for struct _QSE_calTwr.
enum _QSE_CALFLAGS_M |
enum _QSE_CALFLAGS_V |
static __inline QSE_map QSE_calColMapGet | ( | const QSE_calColMap * | map | ) | [static] |
Returns a properly justified version of the tower map.
map | The CAL columm map |
Referenced by printCalMapLayer(), QSE_ecalTwrPrintBrief(), and QSE_ecalTwrPrintFull().
static __inline QSE_calColMap QSE_calColMapInsert | ( | QSE_calColMap | map, | |
int | num | |||
) | [static] |
Returns the column map with the new column number inserted.
map | The CAL column map to add the new column to | |
num | The number of the column to add |
static __inline unsigned int QSE_calColMask | ( | int | num | ) | [static] |
Converts the indicated layer number to a mask.
num | The number of the column to convert to a mask |
Referenced by printCalMapLayer().
static __inline int QSE_calFlagsIs4Rng | ( | unsigned int | flags | ) | [static] |
Returns a non-zero value if the flags indicate the readout mode is 4-range.
==0,Readout | mode is single range | |
!=0,Readout | mode is 4-range |
flags | The CAL flags word to test |
References QSE_CALFLAGS_M_4RNG.
static __inline int QSE_calFlagsIsNoSuppress | ( | unsigned int | flags | ) | [static] |
Returns a non-zero value if the flags indicate the readout mode is not zero suppression.
==0,Readout | mode is zero suppression | |
!=0,Readout | mode is not zero suppression |
flags | The CAL flags word to test |
References QSE_CALFLAGS_M_NOSUPPRESS.
static __inline QSE_map QSE_calLyrMapGet | ( | const QSE_calTwr * | twr | ) | [static] |
Returns a properly justified version of a tower's layer map.
twr | The CAL tower data |
References _QSE_calTwr::lyrMap.
Referenced by QSE_ecalTwrPrintBrief(), and QSE_ecalTwrPrintFull().
static __inline QSE_calLyrMap QSE_calLyrMapInsert | ( | QSE_calLyrMap | map, | |
int | num | |||
) | [static] |
Returns the layer map with the new layer number inserted.
map | The CAL layer map to add the new layer to | |
num | The number of the layer to add |
static __inline unsigned int QSE_calLyrMask | ( | int | num | ) | [static] |
Converts the indicated layer number to a mask.
num | The number of the layer to convert to a mask |
Referenced by QSE_calMapPrint().
Returns a properly justified version of the tower map.
cal | The CAL data |
References _QSE_cal::twrMap.
Referenced by QSE_calMapPrint(), QSE_calPrint(), and QSE_ecalPrint().
static __inline QSE_calTwrMap QSE_calTwrMapInsert | ( | QSE_calTwrMap | map, | |
int | num | |||
) | [static] |
Returns the tower map with the new tower number inserted.
map | The CAL tower map to add the new tower to | |
num | The number of the tower to add |
static __inline unsigned int QSE_calTwrMask | ( | int | num | ) | [static] |
Converts the indicated tower number to a mask.
num | The number of the tower to convert to a mask |
Referenced by QSE_calMapPrint().