CMS 3D CMS Logo

AMC13Event.cc
Go to the documentation of this file.
1 #include <cstdint>
3 
4 using namespace gem;
5 
6 void AMC13Event::setCDFHeader(uint8_t Evt_ty, uint32_t LV1_id, uint16_t BX_id, uint16_t Source_id)
7 {
8  CDFHeader u;
9  u.cb5 = 0x5;
10  u.eventType = Evt_ty;
11  u.lv1Id = LV1_id;
12  u.bxId = BX_id;
13  u.sourceId = Source_id;
14  cdfh_ = u.word;
15 }
16 
17 void AMC13Event::setAMC13Header(uint8_t CalTyp, uint8_t nAMC, uint32_t OrN)
18 {
19  AMC13Header u;
20  u.cb0 = 0x0;
21  u.calType = CalTyp;
22  u.nAMC = nAMC;
23  u.orbitN = OrN;
24  amc13h_ = u.word;
25 }
26 
27 void AMC13Event::setAMC13Trailer(uint8_t Blk_NoT, uint8_t LV1_idT, uint16_t BX_idT)
28 {
29  AMC13Trailer u;
30  u.blkN = Blk_NoT;
31  u.lv1IdT = LV1_idT;
32  u.bxIdT = BX_idT;
33  amc13t_ = u.word;
34 }
35 
36 void AMC13Event::setCDFTrailer(uint32_t EvtLength)
37 {
38  CDFTrailer u;
39  u.cbA = 0xA;
40  u.evtLength = EvtLength;
41  cdft_ = u.word;
42 }
43 
45 {
46  amcHeaders_.push_back(word);
47 }
48 
49 void AMC13Event::addAMCheader(uint32_t AMC_size, uint8_t Blk_No, uint8_t AMC_No, uint16_t BoardID)
50 {
51  // AMC Header word
52  // 55 - 32 | 27 - 20 | 19 - 16 | 15 - 0 |
53  // AMC_size | Blk_No | AMC_No | BoardID |
54  uint64_t word =
55  (static_cast<uint64_t>(AMC_size & 0x00ffffff) << 32) |
56  (static_cast<uint64_t>(Blk_No & 0xff) << 20) |
57  (static_cast<uint64_t>(AMC_No & 0x0f) << 16) |
58  (static_cast<uint64_t>(BoardID & 0xffff));
59  amcHeaders_.push_back(word);
60 }
uint64_t amc13h_
Definition: AMC13Event.h:88
void addAMCheader(uint64_t word)
Definition: AMC13Event.cc:44
uint64_t bxIdT
Definition: AMC13Event.h:33
uint64_t word
Definition: AMC13Event.h:9
uint64_t cdft_
Definition: AMC13Event.h:90
uint64_t bxId
Definition: AMC13Event.h:13
void setAMC13Trailer(uint64_t word)
Definition: AMC13Event.h:65
void setCDFTrailer(uint64_t word)
Definition: AMC13Event.h:69
std::vector< uint64_t > amcHeaders_
Definition: AMC13Event.h:93
uint64_t eventType
Definition: AMC13Event.h:15
uint64_t cdfh_
Definition: AMC13Event.h:87
uint64_t orbitN
Definition: AMC13Event.h:23
Definition: AMC13Event.h:6
uint64_t lv1IdT
Definition: AMC13Event.h:34
void setCDFHeader(uint64_t word)
Definition: AMC13Event.h:57
uint64_t calType
Definition: AMC13Event.h:26
uint64_t sourceId
Definition: AMC13Event.h:12
uint64_t cb0
Definition: AMC13Event.h:22
uint64_t word
Definition: AMC13Event.h:20
uint64_t nAMC
Definition: AMC13Event.h:25
unsigned long long uint64_t
Definition: Time.h:15
void setAMC13Header(uint64_t word)
Definition: AMC13Event.h:61
uint64_t cb5
Definition: AMC13Event.h:16
uint64_t amc13t_
Definition: AMC13Event.h:89
uint64_t lv1Id
Definition: AMC13Event.h:14
uint64_t cbA
Definition: AMC13Event.h:46
uint64_t evtLength
Definition: AMC13Event.h:45
uint64_t word
Definition: AMC13Event.h:40
uint8_t nAMC() const
Definition: AMC13Event.h:77