CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
gem::AMC13Event Class Reference

#include <AMC13Event.h>

Public Member Functions

void addAMCheader (uint32_t AMC_size, uint8_t Blk_No, uint8_t AMC_No, uint16_t BoardID)
 
void addAMCheader (uint64_t word)
 
void addAMCpayload (const AMCdata &a)
 
 AMC13Event ()
 
int bxId () const
 
void clearAMCpayloads ()
 
uint16_t crc () const
 
uint8_t evtStatus () const
 
uint32_t fragmentLength () const
 
uint64_t getAMC13Header () const
 
uint64_t getAMC13Trailer () const
 
const std::vector< uint64_t > * getAMCheaders () const
 
const std::vector< AMCdata > * getAMCpayloads () const
 
uint32_t getAMCsize (int i) const
 
uint64_t getCDFHeader () const
 
uint64_t getCDFTrailer () const
 
uint32_t lv1Id () const
 
uint8_t nAMC () const
 
int orbitNumber () const
 
void setAMC13Header (uint64_t word)
 
void setAMC13Header (uint8_t CalTyp, uint8_t nAMC, uint32_t OrN)
 
void setAMC13Trailer (uint64_t word)
 
void setAMC13Trailer (uint8_t Blk_NoT, uint8_t LV1_idT, uint16_t BX_idT)
 
void setCDFHeader (uint64_t word)
 
void setCDFHeader (uint8_t Evt_ty, uint32_t LV1_id, uint16_t BX_id, uint16_t Source_id)
 
void setCDFTrailer (uint32_t EvtLength)
 
void setCDFTrailer (uint64_t word)
 
uint16_t sourceId () const
 
uint8_t ttsBits () const
 
 ~AMC13Event ()
 

Private Attributes

uint64_t amc13h_
 
uint64_t amc13t_
 
std::vector< uint64_t > amcHeaders_
 
std::vector< AMCdataamcs_
 
uint64_t cdfh_
 
uint64_t cdft_
 

Detailed Description

Definition at line 68 of file AMC13Event.h.

Constructor & Destructor Documentation

◆ AMC13Event()

gem::AMC13Event::AMC13Event ( )
inline

Definition at line 70 of file AMC13Event.h.

70 : cdfh_(0), amc13h_(0), amc13t_(0), cdft_(0) {}

◆ ~AMC13Event()

gem::AMC13Event::~AMC13Event ( )
inline

Definition at line 71 of file AMC13Event.h.

71  {
72  amcHeaders_.clear();
73  amcs_.clear();
74  }

References amcHeaders_, and amcs_.

Member Function Documentation

◆ addAMCheader() [1/2]

void AMC13Event::addAMCheader ( uint32_t  AMC_size,
uint8_t  Blk_No,
uint8_t  AMC_No,
uint16_t  BoardID 
)

Definition at line 43 of file AMC13Event.cc.

43  {
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 }

References amcHeaders_.

◆ addAMCheader() [2/2]

void AMC13Event::addAMCheader ( uint64_t  word)

Definition at line 41 of file AMC13Event.cc.

41 { amcHeaders_.push_back(word); }

References amcHeaders_.

◆ addAMCpayload()

void gem::AMC13Event::addAMCpayload ( const AMCdata a)
inline

Definition at line 109 of file AMC13Event.h.

109 { amcs_.push_back(a); }

References a, and amcs_.

◆ bxId()

int gem::AMC13Event::bxId ( ) const
inline

Definition at line 96 of file AMC13Event.h.

96 { return (int8_t)CDFHeader{cdfh_}.bxId; }

References cdfh_.

◆ clearAMCpayloads()

void gem::AMC13Event::clearAMCpayloads ( )
inline

Definition at line 110 of file AMC13Event.h.

110 { amcs_.clear(); }

References amcs_.

◆ crc()

uint16_t gem::AMC13Event::crc ( ) const
inline

Definition at line 92 of file AMC13Event.h.

92 { return CDFTrailer{cdft_}.crcCDF; }

References cdft_.

◆ evtStatus()

uint8_t gem::AMC13Event::evtStatus ( ) const
inline

Definition at line 93 of file AMC13Event.h.

93 { return CDFTrailer{cdft_}.evtStat; }

References cdft_.

◆ fragmentLength()

uint32_t gem::AMC13Event::fragmentLength ( ) const
inline

Definition at line 91 of file AMC13Event.h.

91 { return CDFTrailer{cdft_}.evtLength; }

References cdft_.

◆ getAMC13Header()

uint64_t gem::AMC13Event::getAMC13Header ( ) const
inline

Definition at line 82 of file AMC13Event.h.

82 { return amc13h_; }

References amc13h_.

◆ getAMC13Trailer()

uint64_t gem::AMC13Event::getAMC13Trailer ( ) const
inline

Definition at line 86 of file AMC13Event.h.

86 { return amc13t_; }

References amc13t_.

◆ getAMCheaders()

const std::vector<uint64_t>* gem::AMC13Event::getAMCheaders ( ) const
inline

Definition at line 103 of file AMC13Event.h.

103 { return &amcHeaders_; }

References amcHeaders_.

◆ getAMCpayloads()

const std::vector<AMCdata>* gem::AMC13Event::getAMCpayloads ( ) const
inline

Definition at line 108 of file AMC13Event.h.

108 { return &amcs_; }

References amcs_.

◆ getAMCsize()

uint32_t gem::AMC13Event::getAMCsize ( int  i) const
inline

Definition at line 104 of file AMC13Event.h.

104 { return AMCHeader{amcHeaders_.at(i)}.amcSize; }

References amcHeaders_, and mps_fire::i.

◆ getCDFHeader()

uint64_t gem::AMC13Event::getCDFHeader ( ) const
inline

Definition at line 78 of file AMC13Event.h.

78 { return cdfh_; }

References cdfh_.

◆ getCDFTrailer()

uint64_t gem::AMC13Event::getCDFTrailer ( ) const
inline

Definition at line 90 of file AMC13Event.h.

90 { return cdft_; }

References cdft_.

◆ lv1Id()

uint32_t gem::AMC13Event::lv1Id ( ) const
inline

Definition at line 97 of file AMC13Event.h.

97 { return CDFHeader{cdfh_}.lv1Id; }

References cdfh_.

◆ nAMC()

uint8_t gem::AMC13Event::nAMC ( ) const
inline

Definition at line 101 of file AMC13Event.h.

101 { return AMC13Header{amc13h_}.nAMC; }

References amc13h_.

Referenced by setAMC13Header().

◆ orbitNumber()

int gem::AMC13Event::orbitNumber ( ) const
inline

Definition at line 100 of file AMC13Event.h.

100 { return AMC13Header{amc13h_}.orbitN; }

References amc13h_.

◆ setAMC13Header() [1/2]

void gem::AMC13Event::setAMC13Header ( uint64_t  word)
inline

Definition at line 80 of file AMC13Event.h.

80 { amc13h_ = word; }

References amc13h_.

◆ setAMC13Header() [2/2]

void AMC13Event::setAMC13Header ( uint8_t  CalTyp,
uint8_t  nAMC,
uint32_t  OrN 
)

Definition at line 16 of file AMC13Event.cc.

16  {
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 }

References amc13h_, gem::AMC13Header::cb0, and nAMC().

◆ setAMC13Trailer() [1/2]

void gem::AMC13Event::setAMC13Trailer ( uint64_t  word)
inline

Definition at line 84 of file AMC13Event.h.

84 { amc13t_ = word; }

References amc13t_.

◆ setAMC13Trailer() [2/2]

void AMC13Event::setAMC13Trailer ( uint8_t  Blk_NoT,
uint8_t  LV1_idT,
uint16_t  BX_idT 
)

Definition at line 25 of file AMC13Event.cc.

25  {
26  AMC13Trailer u{0};
27  u.blkN = Blk_NoT;
28  u.lv1IdT = LV1_idT;
29  u.bxIdT = BX_idT;
30  amc13t_ = u.word;
31 }

References amc13t_, and gem::AMC13Trailer::blkN.

◆ setCDFHeader() [1/2]

void gem::AMC13Event::setCDFHeader ( uint64_t  word)
inline

Definition at line 76 of file AMC13Event.h.

76 { cdfh_ = word; }

References cdfh_.

◆ setCDFHeader() [2/2]

void AMC13Event::setCDFHeader ( uint8_t  Evt_ty,
uint32_t  LV1_id,
uint16_t  BX_id,
uint16_t  Source_id 
)

Definition at line 6 of file AMC13Event.cc.

6  {
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 }

References gem::CDFHeader::cb5, and cdfh_.

◆ setCDFTrailer() [1/2]

void AMC13Event::setCDFTrailer ( uint32_t  EvtLength)

Definition at line 33 of file AMC13Event.cc.

33  {
34  CDFTrailer u{0};
35  u.cbA = 0xA;
36  u.eventType = CDFHeader{cdfh_}.eventType;
37  u.evtLength = EvtLength;
38  cdft_ = u.word;
39 }

References gem::CDFTrailer::cbA, cdfh_, and cdft_.

◆ setCDFTrailer() [2/2]

void gem::AMC13Event::setCDFTrailer ( uint64_t  word)
inline

Definition at line 88 of file AMC13Event.h.

88 { cdft_ = word; }

References cdft_.

◆ sourceId()

uint16_t gem::AMC13Event::sourceId ( ) const
inline

Definition at line 98 of file AMC13Event.h.

98 { return CDFHeader{cdfh_}.sourceId; }

References cdfh_.

◆ ttsBits()

uint8_t gem::AMC13Event::ttsBits ( ) const
inline

Definition at line 94 of file AMC13Event.h.

94 { return CDFTrailer{cdft_}.tts; }

References cdft_.

Member Data Documentation

◆ amc13h_

uint64_t gem::AMC13Event::amc13h_
private

Definition at line 114 of file AMC13Event.h.

Referenced by getAMC13Header(), nAMC(), orbitNumber(), and setAMC13Header().

◆ amc13t_

uint64_t gem::AMC13Event::amc13t_
private

Definition at line 115 of file AMC13Event.h.

Referenced by getAMC13Trailer(), and setAMC13Trailer().

◆ amcHeaders_

std::vector<uint64_t> gem::AMC13Event::amcHeaders_
private

Definition at line 119 of file AMC13Event.h.

Referenced by addAMCheader(), getAMCheaders(), getAMCsize(), and ~AMC13Event().

◆ amcs_

std::vector<AMCdata> gem::AMC13Event::amcs_
private

Definition at line 121 of file AMC13Event.h.

Referenced by addAMCpayload(), clearAMCpayloads(), getAMCpayloads(), and ~AMC13Event().

◆ cdfh_

uint64_t gem::AMC13Event::cdfh_
private

Definition at line 113 of file AMC13Event.h.

Referenced by bxId(), getCDFHeader(), lv1Id(), setCDFHeader(), setCDFTrailer(), and sourceId().

◆ cdft_

uint64_t gem::AMC13Event::cdft_
private

Definition at line 116 of file AMC13Event.h.

Referenced by crc(), evtStatus(), fragmentLength(), getCDFTrailer(), setCDFTrailer(), and ttsBits().

mps_fire.i
i
Definition: mps_fire.py:428
gem::AMC13Header::cb0
uint64_t cb0
Definition: AMC13Event.h:22
gem::AMC13Event::cdft_
uint64_t cdft_
Definition: AMC13Event.h:116
gem::AMC13Event::amcHeaders_
std::vector< uint64_t > amcHeaders_
Definition: AMC13Event.h:119
gem::AMC13Event::cdfh_
uint64_t cdfh_
Definition: AMC13Event.h:113
word
uint64_t word
Definition: CTPPSTotemDataFormatter.cc:29
gem::AMC13Trailer::blkN
uint64_t blkN
Definition: AMC13Event.h:35
gem::AMC13Event::amcs_
std::vector< AMCdata > amcs_
Definition: AMC13Event.h:121
gem::CDFHeader::cb5
uint64_t cb5
Definition: AMC13Event.h:16
gem::CDFTrailer
Definition: AMC13Event.h:39
a
double a
Definition: hdecay.h:119
gem::CDFHeader
Definition: AMC13Event.h:8
gem::AMC13Trailer
Definition: AMC13Event.h:30
gem::CDFTrailer::cbA
uint64_t cbA
Definition: AMC13Event.h:53
gem::AMC13Event::amc13t_
uint64_t amc13t_
Definition: AMC13Event.h:115
cond::uint64_t
unsigned long long uint64_t
Definition: Time.h:13
gem::AMC13Event::amc13h_
uint64_t amc13h_
Definition: AMC13Event.h:114
gem::AMC13Event::nAMC
uint8_t nAMC() const
Definition: AMC13Event.h:101
gem::AMC13Header
Definition: AMC13Event.h:19