CMS 3D CMS Logo

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{
50  uint64_t words[11];
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{
103  uint64_t words[32];
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  union tcdsbst {
116  uint64_t words[8];
117  struct {
118  uint32_t gpstimelow;
119  uint32_t gpstimehigh;
120  uint32_t bireserved8_11;
121  uint32_t bireserved12_15;
123  uint16_t turnCountLow;
124  uint16_t turnCountHigh;
125  uint16_t lhcFillLow;
126  uint16_t lhcFillHigh;
127  uint16_t beamMode;
128  uint16_t particleTypes;
129  uint16_t beamMomentum;
130  uint32_t intensityBeam1;
131  uint32_t intensityBeam2;
132  uint32_t bireserved40_43;
133  uint32_t bireserved44_47;
134  uint32_t bireserved48_51;
135  uint32_t bireserved52_55;
136  uint32_t bireserved56_59;
137  uint32_t bireserved60_63;
138  } bst;
139  };
140  TCDSBST(const unsigned char *p) : b((tcdsbst*)p){
141  }
142  const tcdsbst &getBST(){return *b;}
143  private:
145  };
146 
147  class TCDSRecord{
148  public:
149  TCDSRecord(const unsigned char *p) :
150  fh(p),
151  h(p+sizeof(fedh_t)),
152  l1h(p+sizeof(fedh_t)+(h.getSizes().size.headerSize+1)*8),
153  b(p+sizeof(fedh_t)+(h.getSizes().size.headerSize+1)*8+
154  (h.getSizes().size.L1AhistSize)*8)
155  {
156 
157  }
158  TCDSFEDHeader &getFEDHeader(){return fh;}
159  TCDSHeader &getHeader(){return h;}
160  TCDSL1AHistory &getHistory(){return l1h;}
161  TCDSBST &getBST(){return b;}
162  private:
167  };
168 
169 
170  }
171 }
172 #endif
uint16_t bstMaster_bireserved16
Definition: FED1024.h:122
const unsigned char reserved2
Definition: FED1024.h:21
const sizes & getSizes()
Definition: FED1024.h:83
TCDSFEDHeader fh
Definition: FED1024.h:163
const unsigned char reserved1
Definition: FED1024.h:20
TCDSBST & getBST()
Definition: FED1024.h:161
const unsigned char L1AhistSize
Definition: FED1024.h:17
TCDSHeader & getHeader()
Definition: FED1024.h:159
TCDSL1AHistory(const unsigned char *p)
Definition: FED1024.h:106
tcdsfedheader * fh
Definition: FED1024.h:43
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
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:165
tcdsbst * b
Definition: FED1024.h:144
TCDSFEDHeader & getFEDHeader()
Definition: FED1024.h:158
const tcdsheader & getData()
Definition: FED1024.h:84
TCDSFEDHeader(const unsigned char *p)
Definition: FED1024.h:36
TCDSRecord(const unsigned char *p)
Definition: FED1024.h:149
const l1h & history()
Definition: FED1024.h:108
unsigned long long uint64_t
Definition: Time.h:15
double b
Definition: hdecay.h:120
const tcdsfedheader & getData()
Definition: FED1024.h:41
TCDSL1AHistory & getHistory()
Definition: FED1024.h:160
const unsigned char headerSize
Definition: FED1024.h:15
const unsigned char summarySize
Definition: FED1024.h:16
struct evf::evtn::sizes::@334 size
uint64_t sizeword
Definition: FED1024.h:13
const unsigned char reserved0
Definition: FED1024.h:19
TCDSBST(const unsigned char *p)
Definition: FED1024.h:140
const tcdsbst & getBST()
Definition: FED1024.h:142
tcdsheader * h
Definition: FED1024.h:87