GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> TCC_DB / V0-0-3 > tcc_db_test / rhel4-32
#include <TCC_DB/TCC_DB_schema.h>
#include <PBI/Endianness.h>
Classes | |
struct | _TCC_DB_split |
Bit field definition of a split point specification. More... | |
struct | _TCC_DB_strip_range |
Bit field definition of track strip range. This data structure is used to define both dead data strips and dead trigger strips. More... | |
Defines | |
#define | MAY_ALIAS |
#define | TCC_DB_SPLITS(_twr, _lyr, _lo_cnt, _hi_cnt) {_twr, _lyr, _hi_cnt, _lo_cnt} |
Composes a tracker split point specification. | |
#define | TCC_DB_SPLITS_DEFAULT(_lo_cnt, _hi_cnt) TCC_DB_SPLITS (Twr_All, Lyr_All, _lo_cnt, _hi_cnt) |
Convenience macro to define a default split point. | |
#define | TCC_DB_STRIPS(_twr, _lyr, _strip, _cnt) {_twr, _lyr, _strip, _cnt} |
Composes a tracker strip range. | |
#define | TCC_DB_STRIPS_GTFE(_twr, _lyr, _gtfe, _cnt) TCC_DB_STRIPS(_twr, _lyr, (_gtfe)*64, (_cnt) * 64) |
Composes the range of all the strips in 1 GTFE. | |
#define | TCC_DB_STRIPS_LAYER(_twr, _lyr) TCC_DB_STRIPS (_twr, _lyr, 0, 1536) |
Composes the range of all the strips in 1 layer. | |
#define | TCC_DB_STRIP(_twr, _lyr, _strip) TCC_DB_STRIPS(_twr, _lyr, _strip, 1) |
Composes the address of a single tracker strip. | |
Typedefs | |
typedef struct _TCC_DB_split | TCC_DB_split |
Typedef for struct _TCC_DB_split. | |
typedef struct _TCC_DB_strip_range | TCC_DB_strip_range |
Typedef for struct _TCC_DB_range. | |
Enumerations | |
enum | _TCC_DB_TWR_K { Twr_0 = 0, Twr_1 = 1, Twr_2 = 2, Twr_3 = 3, Twr_4 = 4, Twr_5 = 5, Twr_6 = 6, Twr_7 = 7, Twr_8 = 8, Twr_9 = 9, Twr_A = 0xA, Twr_B = 0xB, Twr_C = 0xC, Twr_D = 0xD, Twr_E = 0xE, Twr_F = 0xF, Twr_All = 0xff } |
Convenience symbols naming the towers. The only non-trivial definition is defining a symbol to represent all towers. | |
enum | _TCC_DB_LYR_K { X0 = 0, X1 = 1, X2 = 2, X3 = 3, X4 = 4, X5 = 5, X6 = 6, X7 = 7, X8 = 8, X9 = 9, X10 = 10, X11 = 11, X12 = 12, X13 = 13, X14 = 14, X15 = 15, X16 = 16, X17 = 17, Y0 = 18, Y1 = 19, Y2 = 20, Y3 = 21, Y4 = 22, Y5 = 23, Y6 = 24, Y7 = 25, Y8 = 26, Y9 = 27, Y10 = 28, Y11 = 29, Y12 = 30, Y13 = 31, Y14 = 32, Y15 = 33, Y16 = 34, Y17 = 35, Lyr_All = 0xff } |
Define a set of symbols representing the layers. More... |
CVS $Id: TCC_DB_schema_build.h,v 1.4 2011/09/17 21:27:23 russell Exp $
The use of this include is a bit unusual. In order to avoid multiple include files cluttering the directory this include file is actually two include files in one.
When building a Tracker Configuration database, this file should be included twice
The first time it is dropped, various macros and data structure definitions used to layout the data that will populate the database are defined using a set of standard names. The second time it is dropped, the names that have been defined are examined and the physical database is constructed.
Each section has macros to shield the user from the internal storage representation. In all cases, there is one underlying macro and some convenience macros for specifying common cases in a more obvious form. The example belows gives an illustration of every macro. Also note that the example below is taken from the unit test database. To see the data that this produces type
$ tccprint $CMX_B_TCC_DB/sun-gcc/tcc_db_data/libtcc_db_data.so or $ tccprint $CMX_B_TCC_DB/linux-gcc/tcc_db_data/libtcc_db_data.so
#include <TCC_DB/TCC_DB_schema_build.h> / * Define the CDM instance and name of the configuration data * / #define CDM_TCP_DB_TCP_DB_DATA_SCHEMA TCC_DB_K_SCHEMA #define CDM_TCP_DB_TCP_DB_DATA_VERSION TCC_DB_K_VERSION #define CDM_TCP_DB_TCP_DB_DATA_INSTANCE 0 #define CDM_TCP_DB_TCP_DB_DATA_HANDLE TCP_DB_data / * Define the Tracker Split Points * / #define TCC_DB_SPLITS_DATA \\ TCC_DB_SPLITS_DEFAULT ( 12, 12), \\ TCC_DB_SPLITS (Twr_A, Y0, 0, 24) / * Define the Tracker Dead Data Strips * / #define TCC_DB_DEAD_DATA_DATA \\ TCC_DB_STRIPS (Twr_A, Y1, 100, 46), \\ TCC_DB_STRIP (Twr_B, Y2, 200), \\ TCC_DB_STRIPS_GTFE (Twr_C, Y3, 2, 1), \\ TCC_DB_STRIPS_LAYER (Twr_D, Y4) / * Define the Tracker Dead Trigger Strips * / #define TCC_DB_DEAD_TRIGGER_DATA \\ TCC_DB_STRIPS (Twr_A, X1, 100, 46), \\ TCC_DB_STRIP (Twr_B, X2, 200), \\ TCC_DB_STRIPS_GTFE (Twr_C, X3, 2, 2), \\ TCC_DB_STRIPS_LAYER (Twr_D, X4) #include <TCC_DB/TCC_DB_schema_build.h> TCC_DB_DATA (CDM_TCP_DB_TCP_DB_DATA_HANDLE, TCC_DB_TARGET_K_PRELAUNCH);
#define TCC_DB_SPLITS | ( | _twr, | |||
_lyr, | |||||
_lo_cnt, | |||||
_hi_cnt | ) | {_twr, _lyr, _hi_cnt, _lo_cnt} |
Composes a tracker split point specification.
_twr | The tower number 0x0-0xf | |
_lyr | The layer number X = 0-17, Y = 18-35, suggest using the symbols X0, X1, etc Y0, Y1 | |
_lo_cnt | The number of GTFEs serviced on the low side | |
_hi_cnt | The number of GTFEs serviced on the hi side. Either or both of this may be 0, but the sum cannot be greater than 24. |
#define TCC_DB_SPLITS_DEFAULT | ( | _lo_cnt, | |||
_hi_cnt | ) | TCC_DB_SPLITS (Twr_All, Lyr_All, _lo_cnt, _hi_cnt) |
Convenience macro to define a default split point.
_lo_cnt | The number of GTFEs serviced on the low side | |
_hi_cnt | The number of GTFEs serviced on the hi side. Either or both of this may be 0, but the sum cannot be greater than 24. |
#define TCC_DB_STRIP | ( | _twr, | |||
_lyr, | |||||
_strip | ) | TCC_DB_STRIPS(_twr, _lyr, _strip, 1) |
Composes the address of a single tracker strip.
_twr | The tower number 0-15 | |
_lyr | The layer number X = 0-17, Y = 18-35, suggest using the symbols X0, X1, etc Y0, Y1 | |
_strip | The beginning of the strip range (0-1535) |
#define TCC_DB_STRIPS | ( | _twr, | |||
_lyr, | |||||
_strip, | |||||
_cnt | ) | {_twr, _lyr, _strip, _cnt} |
Composes a tracker strip range.
_twr | The tower number 0-15 | |
_lyr | The layer number X = 0-17, Y = 18-35, suggest using the symbols X0, X1, etc Y0, Y1 | |
_strip | The beginning of the strip range (0-1535) | |
_cnt | The number of consecutive dead strips (1-1536) The sum of _strip and _cnt cannot be greater than 1536. |
#define TCC_DB_STRIPS_GTFE | ( | _twr, | |||
_lyr, | |||||
_gtfe, | |||||
_cnt | ) | TCC_DB_STRIPS(_twr, _lyr, (_gtfe)*64, (_cnt) * 64) |
Composes the range of all the strips in 1 GTFE.
_twr | The tower number 0-15 | |
_lyr | The layer number X = 0-17, Y = 18-35, suggest using the symbols X0, X1, etc Y0, Y1 | |
_gtfe | The GTFE (0-23) | |
_cnt | The count of GTFEs |
#define TCC_DB_STRIPS_LAYER | ( | _twr, | |||
_lyr | ) | TCC_DB_STRIPS (_twr, _lyr, 0, 1536) |
Composes the range of all the strips in 1 layer.
_twr | The tower number 0-15 | |
_lyr | The layer number X = 0-17, Y = 18-35, suggest using the symbols X0, X1, etc Y0, Y1 |
enum _TCC_DB_LYR_K |
Define a set of symbols representing the layers.
This is only slightly less than trivial. In the number scheme employed by TCC_DB, layer numbers run from 0-35, with
To relieve the user of remembering to about 18 to get to the Y layers symbols are defined, such as Y1 (=19). Hopefully this makes the specification more readable.