CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
FED1024.h
Go to the documentation of this file.
1 #ifndef EVF_FEDINTERFACE_FED1024_H
2 #define EVF_FEDINTERFACE_FED1024_H
3 
4 
5 #include <stddef.h>
8 
9 namespace evf{
10  namespace evtn{
11 
12  union sizes{
14  struct{
15  const unsigned char headerSize;
16  const unsigned char summarySize;
17  const unsigned char L1AhistSize;
18  const unsigned char BSTSize;
19  const unsigned char reserved0;
20  const unsigned char reserved1;
21  const unsigned char reserved2;
22  const unsigned char BGOSize;
23  } size;
24  };
25 
26  class TCDSHeader{
27  public:
28 
29  union tcdsheader{
31  struct {
33  uint32_t sw;
34  uint32_t fw;
35  uint32_t reserved0;
36  uint32_t format;
37  uint32_t runNumber;
38  uint32_t reserved1;
40  uint32_t reserved2;
43  uint32_t nibble;
44  uint32_t lumiSection;
45  uint16_t reserved3;
46  uint16_t reserved4;
47  uint16_t reserved5;
48  uint16_t inputs;
49  uint16_t bcid;
50  uint16_t orbitLow;
51  uint32_t orbitHigh;
54  } header;
55  };
56 
57  TCDSHeader(const unsigned char *p) :
58  s((sizes*)p),
59  h((tcdsheader*)(p+sizeof(uint64_t)))
60  {
61 
62  }
63  const sizes &getSizes(){return *s;}
64  const tcdsheader &getData(){return *h;}
65  private:
66  sizes *s;
68  };
70  public:
71  struct l1a{
72  uint16_t bxid;
73  uint16_t dummy0;
74  uint16_t dummy1;
75  unsigned char ind0;
76  uint32_t orbitlow;
77  uint16_t orbithigh;
78  unsigned char eventtype;
79  unsigned char ind1;
80  };
81  union l1h{
83  l1a hist[32];
84  };
85  TCDSL1AHistory(const unsigned char *p) : hist((l1h*)p){
86  }
87  const l1h &history(){return *hist;}
88  private:
90  };
91 
92  class TCDSBST{
93  public:
94  struct bst{
95  uint32_t gpstimelow;
96  uint32_t gpstimehigh;
97  uint32_t low0;
98  uint32_t high0;
99  uint32_t low1;
100  uint32_t high1;
101  uint32_t low2;
102  uint32_t high2;
103  uint32_t low3;
104  uint32_t high3;
105  uint32_t low4;
106  uint32_t high4;
107  uint32_t low5;
108  uint32_t status;
109  };
110  TCDSBST(const unsigned char *p) : b((bst*)p){
111  }
112  const bst &getBST(){return *b;}
113  private:
114  bst *b;
115  };
116 
117  class TCDSRecord{
118  public:
119  TCDSRecord(const unsigned char *p) :
120  h(p+sizeof(fedh_t)),
121  l1h(p+sizeof(fedh_t)+(h.getSizes().size.headerSize+1)*8),
122  b(p+sizeof(fedh_t)+(h.getSizes().size.headerSize+1)*8+
123  (h.getSizes().size.L1AhistSize)*8)
124  {
125 
126  }
127  TCDSHeader &getHeader(){return h;}
129  TCDSBST &getBST(){return b;}
130  private:
134  };
135 
136 
137  }
138 }
139 #endif
const unsigned char reserved2
Definition: FED1024.h:21
const sizes & getSizes()
Definition: FED1024.h:63
const unsigned char reserved1
Definition: FED1024.h:20
TCDSBST & getBST()
Definition: FED1024.h:129
const unsigned char L1AhistSize
Definition: FED1024.h:17
TCDSHeader & getHeader()
Definition: FED1024.h:127
TCDSL1AHistory(const unsigned char *p)
Definition: FED1024.h:85
const unsigned char BSTSize
Definition: FED1024.h:18
TCDSHeader(const unsigned char *p)
Definition: FED1024.h:57
const unsigned char BGOSize
Definition: FED1024.h:22
TCDSL1AHistory l1h
Definition: FED1024.h:132
struct evf::evtn::sizes::@295 size
uint32_t gpstimehigh
Definition: FED1024.h:96
const tcdsheader & getData()
Definition: FED1024.h:64
TCDSRecord(const unsigned char *p)
Definition: FED1024.h:119
const l1h & history()
Definition: FED1024.h:87
struct evf::evtn::TCDSHeader::tcdsheader::@296 header
unsigned long long uint64_t
Definition: Time.h:15
const bst & getBST()
Definition: FED1024.h:112
TCDSL1AHistory & getHistory()
Definition: FED1024.h:128
const unsigned char headerSize
Definition: FED1024.h:15
const unsigned char summarySize
Definition: FED1024.h:16
uint64_t sizeword
Definition: FED1024.h:13
const unsigned char reserved0
Definition: FED1024.h:19
TCDSBST(const unsigned char *p)
Definition: FED1024.h:110
tuple size
Write out results.
tcdsheader * h
Definition: FED1024.h:67