CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
GEMAMC13.cc
Go to the documentation of this file.
1 #include <cstdint>
3 
4 void GEMAMC13::setCDFHeader(uint8_t Evt_ty, uint32_t LV1_id, uint16_t BX_id, uint16_t Source_id) {
5  CDFHeader u{0};
6  u.cb5 = 0x5;
7  u.eventType = Evt_ty;
8  u.lv1Id = LV1_id;
9  u.bxId = BX_id;
10  u.sourceId = Source_id;
11  cdfh_ = u.word;
12 }
13 
14 void GEMAMC13::setAMC13Header(uint8_t CalTyp, uint8_t nAMC, uint32_t OrN) {
15  AMC13Header u{0};
16  u.cb0 = 0x0;
17  u.calType = CalTyp;
18  u.nAMC = nAMC;
19  u.orbitN = OrN;
20  amc13h_ = u.word;
21 }
22 
23 void GEMAMC13::setAMC13Trailer(uint8_t Blk_NoT, uint8_t LV1_idT, uint16_t BX_idT) {
24  AMC13Trailer u{0};
25  u.blkN = Blk_NoT;
26  u.lv1IdT = LV1_idT;
27  u.bxIdT = BX_idT;
28  amc13t_ = u.word;
29 }
30 
31 void GEMAMC13::setCDFTrailer(uint32_t EvtLength) {
32  CDFTrailer u{0};
33  u.cbA = 0xA;
34  u.eventType = CDFHeader{cdfh_}.eventType;
35  u.evtLength = EvtLength;
36  cdft_ = u.word;
37 }
38 
39 void GEMAMC13::addAMCheader(uint64_t word) { amcHeaders_.push_back(word); }
40 
41 void GEMAMC13::addAMCheader(uint32_t AMC_size, uint8_t Blk_No, uint8_t AMC_No, uint16_t BoardID) {
42  // AMC Header word
43  // 55 - 32 | 27 - 20 | 19 - 16 | 15 - 0 |
44  // AMC_size | Blk_No | AMC_No | BoardID |
45  uint64_t word = (static_cast<uint64_t>(AMC_size & 0x00ffffff) << 32) | (static_cast<uint64_t>(Blk_No & 0xff) << 20) |
46  (static_cast<uint64_t>(AMC_No & 0x0f) << 16) | (static_cast<uint64_t>(BoardID & 0xffff));
47  amcHeaders_.push_back(word);
48 }
uint8_t nAMC() const
Definition: GEMAMC13.h:99
void setAMC13Trailer(uint64_t word)
Definition: GEMAMC13.h:83
uint64_t cdft_
Definition: GEMAMC13.h:118
void setAMC13Header(uint64_t word)
Definition: GEMAMC13.h:79
uint64_t word
void setCDFHeader(uint64_t word)
Definition: GEMAMC13.h:75
uint64_t amc13t_
Definition: GEMAMC13.h:117
uint64_t cdfh_
Definition: GEMAMC13.h:115
void addAMCheader(uint64_t word)
Definition: GEMAMC13.cc:39
uint64_t amc13h_
Definition: GEMAMC13.h:116
unsigned long long uint64_t
Definition: Time.h:13
std::vector< uint64_t > amcHeaders_
Definition: GEMAMC13.h:121
void setCDFTrailer(uint64_t word)
Definition: GEMAMC13.h:87