File indexing completed on 2024-04-06 12:11:05
0001 #ifndef EVF_UTILITIES_GLOBALEVENTNUMBER_H
0002 #define EVF_UTILITIES_GLOBALEVENTNUMBER_H
0003
0004 #include <cstddef>
0005
0006 #include "DataFormats/FEDRawData/interface/FEDHeader.h"
0007
0008 namespace evf {
0009 namespace evtn {
0010
0011 const unsigned int SLINK_WORD_SIZE = 8;
0012 const unsigned int SLINK_HALFWORD_SIZE = 4;
0013 const unsigned int FED_HEADER_SIZE = SLINK_WORD_SIZE;
0014 const unsigned int FED_TRAILER_SIZE = SLINK_WORD_SIZE;
0015
0016 const unsigned int DAQ_TOTTRG_OFFSET = 2;
0017 const unsigned int DAQ_BOARDID_OFFSET = 1;
0018 const unsigned int DAQ_BOARDID_MASK = 0xffff0000;
0019 const unsigned int DAQ_BOARDID_SHIFT = 24;
0020 const unsigned int DAQ_BOARDID_VALUE = 0x11;
0021
0022 enum EvmRecordScheme {
0023 BST32_3BX = 34 * SLINK_WORD_SIZE,
0024 BST32_5BX = 48 * SLINK_WORD_SIZE,
0025 BST52_3BX = 37 * SLINK_WORD_SIZE,
0026 BST52_5BX = 51 * SLINK_WORD_SIZE
0027 };
0028
0029 const unsigned int EVM_BOARDID_OFFSET = 1;
0030 const unsigned int EVM_BOARDID_MASK = 0xffff0000;
0031 const unsigned int EVM_BOARDID_SHIFT = 24;
0032 const unsigned int EVM_BOARDID_VALUE = 0x11;
0033
0034 const unsigned int EVM_GTFE_BLOCK_V0000 = 6;
0035 const unsigned int EVM_GTFE_BLOCK_V0011 = 9;
0036 const unsigned int EVM_GTFE_BSTGPS_OFFSET = 4;
0037
0038 const unsigned int EVM_TCS_BOARDID_VALUE = 0xcc07;
0039 const unsigned int EVM_TCS_BLOCK = 5;
0040 const unsigned int EVM_TCS_TRIGNR_OFFSET = 5;
0041 const unsigned int EVM_TCS_LSBLNR_OFFSET = 0;
0042 const unsigned int EVM_TCS_BOARDID_OFFSET = 1;
0043 const unsigned int EVM_TCS_ORBTNR_OFFSET = 6;
0044 const unsigned int EVM_TCS_LSBLNR_MASK = 0x0000ffff;
0045 const unsigned int EVM_TCS_BOARDID_MASK = 0xffff0000;
0046 const unsigned int EVM_TCS_BOARDID_SHIFT = 16;
0047 const unsigned int EVM_TCS_EVNTYP_MASK = 0x00f00000;
0048 const unsigned int EVM_TCS_EVNTYP_SHIFT = 20;
0049 const unsigned int EVM_TCS_BCNRIN_MASK = 0x00000fff;
0050
0051 const unsigned int EVM_FDL_BLOCK = 7;
0052 const unsigned int EVM_FDL_BCNRIN_OFFSET = 1;
0053 const unsigned int EVM_FDL_TECTRG_OFFSET = 2;
0054 const unsigned int EVM_FDL_ALGOB1_OFFSET = 4;
0055 const unsigned int EVM_FDL_ALGOB2_OFFSET = 6;
0056 const unsigned int EVM_FDL_PSCVSN_OFFSET = 11;
0057
0058 const unsigned int GTPE_BOARDID_OFFSET = 16;
0059 const unsigned int GTPE_BOARDID_MASK = 0x000000ff;
0060 const unsigned int GTPE_BOARDID_SHIFT = 0;
0061 const unsigned int GTPE_BOARDID_VALUE = 0x1;
0062 const unsigned int GTPE_TRIGNR_OFFSET = 14;
0063 const unsigned int GTPE_ORBTNR_OFFSET = 18;
0064 const unsigned int GTPE_BCNRIN_OFFSET = 3;
0065 const unsigned int GTPE_BCNRIN_MASK = 0x00000fff;
0066
0067 unsigned int offset(bool);
0068 bool daq_board_sense(const unsigned char *p);
0069 bool gtpe_board_sense(const unsigned char *p);
0070 bool evm_board_sense(const unsigned char *p, size_t size);
0071 bool evm_tcs_board_sense(const unsigned char *p);
0072 void evm_board_setformat(size_t size);
0073
0074 unsigned int get(const unsigned char *, bool);
0075 unsigned int gtpe_get(const unsigned char *);
0076 unsigned int getlbn(const unsigned char *);
0077 unsigned int gtpe_getlbn(const unsigned char *);
0078 unsigned int getgpslow(const unsigned char *);
0079 unsigned int getgpshigh(const unsigned char *);
0080 unsigned int getorbit(const unsigned char *);
0081 unsigned int getevtyp(const unsigned char *);
0082 unsigned int gtpe_getorbit(const unsigned char *);
0083 unsigned int getfdlbx(const unsigned char *);
0084 unsigned int gtpe_getbx(const unsigned char *);
0085 unsigned int getfdlpsc(const unsigned char *);
0086 unsigned long long getfdlttr(const unsigned char *);
0087 unsigned long long getfdlta1(const unsigned char *);
0088 unsigned long long getfdlta2(const unsigned char *);
0089 }
0090 }
0091 #endif