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 
27  public:
28 
31  struct {
32  uint32_t sourceid;
33  uint32_t eventid;
34  } header;
35  };
36  TCDSFEDHeader(const unsigned char *p) :
37  fh((tcdsfedheader*)(p))
38  {
39 
40  }
41  const tcdsfedheader &getData(){return *fh;}
42  private:
44  };
45 
46  class TCDSHeader{
47  public:
48 
49  union tcdsheader{
51  struct {
53  uint32_t sw;
54  uint32_t fw;
55  uint32_t reserved0;
56  uint32_t format;
57  uint32_t runNumber;
58  uint32_t reserved1;
60  uint32_t reserved2;
63  uint32_t nibble;
64  uint32_t lumiSection;
66  uint16_t triggerTypeFlags;
67  uint16_t reserved5;
68  uint16_t inputs;
69  uint16_t bcid;
70  uint16_t orbitLow;
71  uint32_t orbitHigh;
74  } header;
75  };
76 
77  TCDSHeader(const unsigned char *p) :
78  s((sizes*)p),
79  h((tcdsheader*)(p+sizeof(uint64_t)))
80  {
81 
82  }
83  const sizes &getSizes(){return *s;}
84  const tcdsheader &getData(){return *h;}
85  private:
86  sizes *s;
88  };
90  public:
91  struct l1a{
92  uint16_t bxid;
93  uint16_t dummy0;
94  uint16_t dummy1;
95  unsigned char dummy2;
96  unsigned char ind0;
97  uint32_t orbitlow;
98  uint16_t orbithigh;
99  unsigned char eventtype;
100  unsigned char ind1;
101  };
102  union l1h{
104  l1a hist[32];
105  };
106  TCDSL1AHistory(const unsigned char *p) : hist((l1h*)p){
107  }
108  const l1h &history(){return *hist;}
109  private:
111  };
112 
113  class TCDSBST{
114  public:
115  struct bst{
116  uint32_t gpstimelow;
117  uint32_t gpstimehigh;
118  uint32_t low0;
119  uint32_t high0;
120  uint32_t low1;
121  uint32_t high1;
122  uint32_t low2;
123  uint32_t high2;
124  uint32_t low3;
125  uint32_t high3;
126  uint32_t low4;
127  uint32_t high4;
128  uint32_t low5;
129  uint32_t status;
130  };
131  TCDSBST(const unsigned char *p) : b((bst*)p){
132  }
133  const bst &getBST(){return *b;}
134  private:
135  bst *b;
136  };
137 
138  class TCDSRecord{
139  public:
140  TCDSRecord(const unsigned char *p) :
141  fh(p),
142  h(p+sizeof(fedh_t)),
143  l1h(p+sizeof(fedh_t)+(h.getSizes().size.headerSize+1)*8),
144  b(p+sizeof(fedh_t)+(h.getSizes().size.headerSize+1)*8+
145  (h.getSizes().size.L1AhistSize)*8)
146  {
147 
148  }
150  TCDSHeader &getHeader(){return h;}
152  TCDSBST &getBST(){return b;}
153  private:
158  };
159 
160 
161  }
162 }
163 #endif
const unsigned char reserved2
Definition: FED1024.h:21
const sizes & getSizes()
Definition: FED1024.h:83
TCDSFEDHeader fh
Definition: FED1024.h:154
const unsigned char reserved1
Definition: FED1024.h:20
TCDSBST & getBST()
Definition: FED1024.h:152
const unsigned char L1AhistSize
Definition: FED1024.h:17
struct evf::evtn::TCDSFEDHeader::tcdsfedheader::@317 header
TCDSHeader & getHeader()
Definition: FED1024.h:150
TCDSL1AHistory(const unsigned char *p)
Definition: FED1024.h:106
tcdsfedheader * fh
Definition: FED1024.h:43
const unsigned char BSTSize
Definition: FED1024.h:18
TCDSHeader(const unsigned char *p)
Definition: FED1024.h:77
const unsigned char BGOSize
Definition: FED1024.h:22
TCDSL1AHistory l1h
Definition: FED1024.h:156
struct evf::evtn::sizes::@316 size
TCDSFEDHeader & getFEDHeader()
Definition: FED1024.h:149
const tcdsheader & getData()
Definition: FED1024.h:84
TCDSFEDHeader(const unsigned char *p)
Definition: FED1024.h:36
TCDSRecord(const unsigned char *p)
Definition: FED1024.h:140
const l1h & history()
Definition: FED1024.h:108
unsigned long long uint64_t
Definition: Time.h:15
const tcdsfedheader & getData()
Definition: FED1024.h:41
const bst & getBST()
Definition: FED1024.h:133
TCDSL1AHistory & getHistory()
Definition: FED1024.h:151
const unsigned char headerSize
Definition: FED1024.h:15
const unsigned char summarySize
Definition: FED1024.h:16
uint64_t sizeword
Definition: FED1024.h:13
struct evf::evtn::TCDSHeader::tcdsheader::@318 header
const unsigned char reserved0
Definition: FED1024.h:19
TCDSBST(const unsigned char *p)
Definition: FED1024.h:131
tuple size
Write out results.
tcdsheader * h
Definition: FED1024.h:87