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  CDFHeader u{0};
8  u.cb5 = 0x5;
9  u.eventType = Evt_ty;
10  u.lv1Id = LV1_id;
11  u.bxId = BX_id;
12  u.sourceId = Source_id;
13  cdfh_ = u.word;
14 }
15 
16 void AMC13Event::setAMC13Header(uint8_t CalTyp, uint8_t nAMC, uint32_t OrN) {
17  AMC13Header u{0};
18  u.cb0 = 0x0;
19  u.calType = CalTyp;
20  u.nAMC = nAMC;
21  u.orbitN = OrN;
22  amc13h_ = u.word;
23 }
24 
25 void AMC13Event::setAMC13Trailer(uint8_t Blk_NoT, uint8_t LV1_idT, uint16_t BX_idT) {
26  AMC13Trailer u{0};
27  u.blkN = Blk_NoT;
28  u.lv1IdT = LV1_idT;
29  u.bxIdT = BX_idT;
30  amc13t_ = u.word;
31 }
32 
33 void AMC13Event::setCDFTrailer(uint32_t EvtLength) {
34  CDFTrailer u{0};
35  u.cbA = 0xA;
36  u.eventType = CDFHeader{cdfh_}.eventType;
37  u.evtLength = EvtLength;
38  cdft_ = u.word;
39 }
40 
42 
43 void AMC13Event::addAMCheader(uint32_t AMC_size, uint8_t Blk_No, uint8_t AMC_No, uint16_t BoardID) {
44  // AMC Header word
45  // 55 - 32 | 27 - 20 | 19 - 16 | 15 - 0 |
46  // AMC_size | Blk_No | AMC_No | BoardID |
47  uint64_t word = (static_cast<uint64_t>(AMC_size & 0x00ffffff) << 32) | (static_cast<uint64_t>(Blk_No & 0xff) << 20) |
48  (static_cast<uint64_t>(AMC_No & 0x0f) << 16) | (static_cast<uint64_t>(BoardID & 0xffff));
49  amcHeaders_.push_back(word);
50 }
gem::AMC13Header::cb0
uint64_t cb0
Definition: AMC13Event.h:22
gem::AMC13Event::cdft_
uint64_t cdft_
Definition: AMC13Event.h:92
gem::AMC13Event::amcHeaders_
std::vector< uint64_t > amcHeaders_
Definition: AMC13Event.h:95
gem::AMC13Event::addAMCheader
void addAMCheader(uint64_t word)
Definition: AMC13Event.cc:41
gem::AMC13Event::setCDFTrailer
void setCDFTrailer(uint64_t word)
Definition: AMC13Event.h:71
gem::AMC13Event::cdfh_
uint64_t cdfh_
Definition: AMC13Event.h:89
word
uint64_t word
Definition: CTPPSTotemDataFormatter.cc:29
gem::AMC13Event::setCDFHeader
void setCDFHeader(uint64_t word)
Definition: AMC13Event.h:59
gem::AMC13Trailer::blkN
uint64_t blkN
Definition: AMC13Event.h:35
gem::CDFHeader::cb5
uint64_t cb5
Definition: AMC13Event.h:16
gem::CDFTrailer
Definition: AMC13Event.h:39
gem::CDFHeader
Definition: AMC13Event.h:8
gem::AMC13Trailer
Definition: AMC13Event.h:30
gem
Definition: AMC13Event.h:6
gem::CDFTrailer::cbA
uint64_t cbA
Definition: AMC13Event.h:47
gem::AMC13Event::setAMC13Header
void setAMC13Header(uint64_t word)
Definition: AMC13Event.h:63
gem::AMC13Event::amc13t_
uint64_t amc13t_
Definition: AMC13Event.h:91
AMC13Event.h
cond::uint64_t
unsigned long long uint64_t
Definition: Time.h:13
gem::AMC13Event::amc13h_
uint64_t amc13h_
Definition: AMC13Event.h:90
gem::AMC13Event::setAMC13Trailer
void setAMC13Trailer(uint64_t word)
Definition: AMC13Event.h:67
gem::AMC13Event::nAMC
uint8_t nAMC() const
Definition: AMC13Event.h:79
gem::AMC13Header
Definition: AMC13Event.h:19