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 (uint64_t word)
 
void addAMCheader (uint32_t AMC_size, uint8_t Blk_No, uint8_t AMC_No, uint16_t BoardID)
 
void addAMCpayload (const AMCdata &a)
 
 AMC13Event ()
 
int bx_id () const
 
uint64_t getAMC13header () const
 
uint64_t getAMC13trailer () const
 
const std::vector< uint64_t > * getAMCheaders () const
 
const std::vector< AMCdata > * getAMCpayloads () const
 
uint64_t getCDFHeader () const
 
uint64_t getCDFTrailer () const
 
int lv1_id () const
 
int nAMC () const
 
void setAMC13header (uint8_t CalTyp, uint8_t nAMC, uint32_t OrN, uint8_t cb0)
 
void setAMC13header (uint64_t word)
 
void setAMC13trailer (uint32_t CRC_amc13, uint8_t Blk_NoT, uint8_t LV1_idT, uint16_t BX_idT)
 
void setAMC13trailer (uint64_t word)
 
void setCDFHeader (uint8_t cb5, uint8_t Evt_ty, uint32_t LV1_id, uint16_t BX_id, uint16_t Source_id)
 
void setCDFHeader (uint64_t word)
 
void setCDFTrailer (uint8_t cbA, uint32_t EvtLength, uint16_t CRC_cdf)
 
void setCDFTrailer (uint64_t word)
 
int source_id () const
 
 ~AMC13Event ()
 

Private Attributes

std::vector< uint64_t > m_amcHeaders
 
std::vector< AMCdatam_amcs
 
uint8_t m_Blk_NoT
 
uint16_t m_BX_id
 
uint16_t m_BX_idT
 
uint8_t m_CalTyp
 
uint8_t m_cb0
 
uint8_t m_cb5
 
uint8_t m_cbA
 
uint32_t m_CRC_amc13
 
uint16_t m_CRC_cdf
 
uint8_t m_Evt_ty
 
uint32_t m_EvtLength
 
uint32_t m_LV1_id
 
uint8_t m_LV1_idT
 
uint8_t m_nAMC
 
uint32_t m_OrN
 
uint16_t m_Source_id
 

Detailed Description

Definition at line 7 of file AMC13Event.h.

Constructor & Destructor Documentation

gem::AMC13Event::AMC13Event ( )
inline

Definition at line 10 of file AMC13Event.h.

10 {}
gem::AMC13Event::~AMC13Event ( )
inline

Definition at line 11 of file AMC13Event.h.

References m_amcHeaders, and m_amcs.

11 {m_amcHeaders.clear(); m_amcs.clear();}
std::vector< AMCdata > m_amcs
Definition: AMC13Event.h:61
std::vector< uint64_t > m_amcHeaders
Definition: AMC13Event.h:55

Member Function Documentation

void AMC13Event::addAMCheader ( uint64_t  word)

Definition at line 63 of file AMC13Event.cc.

References m_amcHeaders.

Referenced by getAMCheaders().

64 {
65  // m_AMC_size.push_back(0x00ffffff&(word>>32));
66  // m_Blk_No.push_back(0xff&(word>>20));
67  // m_AMC_No.push_back(0x0f&(word>>16));
68  // m_BoardID.push_back(0xffff&word);
69  m_amcHeaders.push_back(word);
70 }
std::vector< uint64_t > m_amcHeaders
Definition: AMC13Event.h:55
void AMC13Event::addAMCheader ( uint32_t  AMC_size,
uint8_t  Blk_No,
uint8_t  AMC_No,
uint16_t  BoardID 
)

Definition at line 72 of file AMC13Event.cc.

References m_amcHeaders.

73 {
74  // AMC Header word
75  // 55 - 32 | 27 - 20 | 19 - 16 | 15 - 0 |
76  // AMC_size | Blk_No | AMC_No | BoardID |
77  uint64_t word =
78  (static_cast<uint64_t>(AMC_size & 0x00ffffff) << 32) |
79  (static_cast<uint64_t>(Blk_No & 0xff) << 20) |
80  (static_cast<uint64_t>(AMC_No & 0x0f) << 16) |
81  (static_cast<uint64_t>(BoardID & 0xffff));
82  m_amcHeaders.push_back(word);
83 }
unsigned long long uint64_t
Definition: Time.h:15
std::vector< uint64_t > m_amcHeaders
Definition: AMC13Event.h:55
void gem::AMC13Event::addAMCpayload ( const AMCdata a)
inline

Definition at line 32 of file AMC13Event.h.

References getAMC13trailer(), getCDFTrailer(), m_amcs, setAMC13trailer(), and setCDFTrailer().

32 {m_amcs.push_back(a);}
std::vector< AMCdata > m_amcs
Definition: AMC13Event.h:61
double a
Definition: hdecay.h:121
int gem::AMC13Event::bx_id ( ) const
inline

Definition at line 14 of file AMC13Event.h.

References m_BX_id.

14 {return unsigned(m_BX_id);}
uint16_t m_BX_id
Definition: AMC13Event.h:47
uint64_t AMC13Event::getAMC13header ( ) const

Definition at line 36 of file AMC13Event.cc.

References m_CalTyp, m_cb0, m_nAMC, and m_OrN.

Referenced by source_id().

37 {
38  // AMC13 Header word
39  // 63 - 60 | 59 - 56 | 55 - 52 | 51 - 36 | 35 - 4 | 4 - 0 |
40  // uFOV | CalTyp | nAMC | Reserved| OrN | cb0 |
41  return (static_cast<uint64_t>(m_CalTyp & 0x0f) << 56) |
42  (static_cast<uint64_t>(m_nAMC & 0x0f) << 52) |
43  (static_cast<uint64_t>(m_OrN) << 4) |
44  (static_cast<uint64_t>(m_cb0 & 0x0f));
45 }
uint8_t m_cb0
Definition: AMC13Event.h:53
uint8_t m_CalTyp
Definition: AMC13Event.h:50
uint8_t m_nAMC
Definition: AMC13Event.h:51
uint32_t m_OrN
Definition: AMC13Event.h:52
unsigned long long uint64_t
Definition: Time.h:15
uint64_t AMC13Event::getAMC13trailer ( ) const

Definition at line 85 of file AMC13Event.cc.

References m_Blk_NoT, m_BX_idT, m_CRC_amc13, and m_LV1_idT.

Referenced by addAMCpayload().

86 {
87  // AMC13 trailer word
88  // 63 - 32 | 27 - 20 | 19 - 12 | 11 - 0 |
89  // CRC_amc13 | Blk_No | LV1_idT | BX_idT |
90  return (static_cast<uint64_t>(m_CRC_amc13) << 32) |
91  (static_cast<uint64_t>(m_Blk_NoT & 0xff) << 20) |
92  (static_cast<uint64_t>(m_LV1_idT & 0xff) << 12) |
93  (static_cast<uint64_t>(m_BX_idT & 0x0fff));
94 }
uint8_t m_LV1_idT
Definition: AMC13Event.h:65
unsigned long long uint64_t
Definition: Time.h:15
uint16_t m_BX_idT
Definition: AMC13Event.h:66
uint8_t m_Blk_NoT
Definition: AMC13Event.h:64
uint32_t m_CRC_amc13
Definition: AMC13Event.h:63
const std::vector<uint64_t>* gem::AMC13Event::getAMCheaders ( ) const
inline

Definition at line 27 of file AMC13Event.h.

References addAMCheader(), and m_amcHeaders.

27 {return &m_amcHeaders;}
std::vector< uint64_t > m_amcHeaders
Definition: AMC13Event.h:55
const std::vector<AMCdata>* gem::AMC13Event::getAMCpayloads ( ) const
inline

Definition at line 31 of file AMC13Event.h.

References m_amcs.

31 {return &m_amcs;}
std::vector< AMCdata > m_amcs
Definition: AMC13Event.h:61
uint64_t AMC13Event::getCDFHeader ( ) const

Definition at line 6 of file AMC13Event.cc.

References m_BX_id, m_cb5, m_Evt_ty, m_LV1_id, and m_Source_id.

Referenced by source_id().

7 {
8  // CDF Header word
9  // 63 - 60 | 59 - 56 | 55 - 32 | 31 - 20 | 19 - 8 |
10  // cb5 | Evt_ty | LV1_id | BX_id | Source_id |
11  return (static_cast<uint64_t>(m_cb5 & 0x0f) << 60) |
12  (static_cast<uint64_t>(m_Evt_ty & 0x0f) << 56) |
13  (static_cast<uint64_t>(m_LV1_id & 0x00ffffff) << 32) |
14  (static_cast<uint64_t>(m_BX_id & 0x0fff) << 20) |
15  (static_cast<uint64_t>(m_Source_id & 0x0fff) << 8);
16 }
uint8_t m_Evt_ty
Definition: AMC13Event.h:45
uint16_t m_Source_id
Definition: AMC13Event.h:48
uint32_t m_LV1_id
Definition: AMC13Event.h:46
unsigned long long uint64_t
Definition: Time.h:15
uint16_t m_BX_id
Definition: AMC13Event.h:47
uint8_t m_cb5
Definition: AMC13Event.h:44
uint64_t AMC13Event::getCDFTrailer ( ) const

Definition at line 112 of file AMC13Event.cc.

References m_cbA, m_CRC_cdf, and m_EvtLength.

Referenced by addAMCpayload().

113 {
114  // CDF trailer word
115  // 63 - 60 | 55 - 32 | 31 - 16 |
116  // cbA | EvtLength | CRC_cdf |
117  return (static_cast<uint64_t>(m_cbA & 0x0f) << 60) |
118  (static_cast<uint64_t>(m_EvtLength & 0x00ffffff) << 32) |
119  (static_cast<uint64_t>(m_CRC_cdf & 0xffff) << 16);
120 }
uint16_t m_CRC_cdf
Definition: AMC13Event.h:70
uint8_t m_cbA
Definition: AMC13Event.h:68
uint32_t m_EvtLength
Definition: AMC13Event.h:69
unsigned long long uint64_t
Definition: Time.h:15
int gem::AMC13Event::lv1_id ( ) const
inline

Definition at line 15 of file AMC13Event.h.

References m_LV1_id.

15 {return unsigned(m_LV1_id);}
uint32_t m_LV1_id
Definition: AMC13Event.h:46
int gem::AMC13Event::nAMC ( ) const
inline

Definition at line 13 of file AMC13Event.h.

References m_nAMC.

Referenced by setAMC13header(), and source_id().

13 {return unsigned(m_nAMC);}
uint8_t m_nAMC
Definition: AMC13Event.h:51
void AMC13Event::setAMC13header ( uint8_t  CalTyp,
uint8_t  nAMC,
uint32_t  OrN,
uint8_t  cb0 
)

Definition at line 55 of file AMC13Event.cc.

References m_CalTyp, m_cb0, m_nAMC, m_OrN, and nAMC().

Referenced by source_id().

56 {
57  m_CalTyp = CalTyp;
58  m_nAMC = nAMC;
59  m_OrN = OrN;
60  m_cb0 = cb0;
61 }
uint8_t m_cb0
Definition: AMC13Event.h:53
uint8_t m_CalTyp
Definition: AMC13Event.h:50
uint8_t m_nAMC
Definition: AMC13Event.h:51
uint32_t m_OrN
Definition: AMC13Event.h:52
int nAMC() const
Definition: AMC13Event.h:13
void AMC13Event::setAMC13header ( uint64_t  word)

Definition at line 47 of file AMC13Event.cc.

References m_CalTyp, m_cb0, m_nAMC, and m_OrN.

48 {
49  m_CalTyp = 0x0f & (word >> 56);
50  m_nAMC = 0x0f & (word >> 52);
51  m_OrN = word >> 4;
52  m_cb0 = 0x0f & word;
53 }
uint8_t m_cb0
Definition: AMC13Event.h:53
uint8_t m_CalTyp
Definition: AMC13Event.h:50
uint8_t m_nAMC
Definition: AMC13Event.h:51
uint32_t m_OrN
Definition: AMC13Event.h:52
void AMC13Event::setAMC13trailer ( uint32_t  CRC_amc13,
uint8_t  Blk_NoT,
uint8_t  LV1_idT,
uint16_t  BX_idT 
)

Definition at line 104 of file AMC13Event.cc.

References m_Blk_NoT, m_BX_idT, m_CRC_amc13, and m_LV1_idT.

Referenced by addAMCpayload().

105 {
106  m_CRC_amc13 = CRC_amc13;
107  m_Blk_NoT = Blk_NoT;
108  m_LV1_idT = LV1_idT;
109  m_BX_idT = BX_idT;
110 }
uint8_t m_LV1_idT
Definition: AMC13Event.h:65
uint16_t m_BX_idT
Definition: AMC13Event.h:66
uint8_t m_Blk_NoT
Definition: AMC13Event.h:64
uint32_t m_CRC_amc13
Definition: AMC13Event.h:63
void AMC13Event::setAMC13trailer ( uint64_t  word)

Definition at line 96 of file AMC13Event.cc.

References m_Blk_NoT, m_BX_idT, m_CRC_amc13, and m_LV1_idT.

97 {
98  m_CRC_amc13 = word >> 32;
99  m_Blk_NoT = 0xff & (word >> 20);
100  m_LV1_idT = 0xff & (word >> 12);
101  m_BX_idT = 0x0fff & word;
102 }
uint8_t m_LV1_idT
Definition: AMC13Event.h:65
uint16_t m_BX_idT
Definition: AMC13Event.h:66
uint8_t m_Blk_NoT
Definition: AMC13Event.h:64
uint32_t m_CRC_amc13
Definition: AMC13Event.h:63
void AMC13Event::setCDFHeader ( uint8_t  cb5,
uint8_t  Evt_ty,
uint32_t  LV1_id,
uint16_t  BX_id,
uint16_t  Source_id 
)

Definition at line 27 of file AMC13Event.cc.

References m_BX_id, m_cb5, m_Evt_ty, m_LV1_id, and m_Source_id.

Referenced by source_id().

28 {
29  m_cb5 = cb5;
30  m_Evt_ty = Evt_ty;
31  m_LV1_id = LV1_id;
32  m_BX_id = BX_id;
33  m_Source_id = Source_id;
34 }
uint8_t m_Evt_ty
Definition: AMC13Event.h:45
uint16_t m_Source_id
Definition: AMC13Event.h:48
uint32_t m_LV1_id
Definition: AMC13Event.h:46
uint16_t m_BX_id
Definition: AMC13Event.h:47
uint8_t m_cb5
Definition: AMC13Event.h:44
void AMC13Event::setCDFHeader ( uint64_t  word)

Definition at line 18 of file AMC13Event.cc.

References m_BX_id, m_cb5, m_Evt_ty, m_LV1_id, and m_Source_id.

19 {
20  m_cb5 = 0x0f & (word >> 60);
21  m_Evt_ty = 0x0f & (word >> 56);
22  m_LV1_id = 0x00ffffff & (word >> 32);
23  m_BX_id = 0x0fff & (word >> 20);
24  m_Source_id = 0x0fff & (word >> 8);
25 }
uint8_t m_Evt_ty
Definition: AMC13Event.h:45
uint16_t m_Source_id
Definition: AMC13Event.h:48
uint32_t m_LV1_id
Definition: AMC13Event.h:46
uint16_t m_BX_id
Definition: AMC13Event.h:47
uint8_t m_cb5
Definition: AMC13Event.h:44
void AMC13Event::setCDFTrailer ( uint8_t  cbA,
uint32_t  EvtLength,
uint16_t  CRC_cdf 
)

Definition at line 129 of file AMC13Event.cc.

References m_cbA, m_CRC_cdf, and m_EvtLength.

Referenced by addAMCpayload().

130 {
131  m_cbA = cbA;
132  m_EvtLength = EvtLength;
133  m_CRC_cdf = CRC_cdf;
134 }
uint16_t m_CRC_cdf
Definition: AMC13Event.h:70
uint8_t m_cbA
Definition: AMC13Event.h:68
uint32_t m_EvtLength
Definition: AMC13Event.h:69
void AMC13Event::setCDFTrailer ( uint64_t  word)

Definition at line 122 of file AMC13Event.cc.

References m_cbA, m_CRC_cdf, and m_EvtLength.

123 {
124  m_cbA = 0x0f & (word >> 60);
125  m_EvtLength = 0x00ffffff & (word >> 32);
126  m_CRC_cdf = 0xffff & (word >> 16);
127 }
uint16_t m_CRC_cdf
Definition: AMC13Event.h:70
uint8_t m_cbA
Definition: AMC13Event.h:68
uint32_t m_EvtLength
Definition: AMC13Event.h:69
int gem::AMC13Event::source_id ( ) const
inline

Definition at line 16 of file AMC13Event.h.

References getAMC13header(), getCDFHeader(), m_Source_id, nAMC(), setAMC13header(), and setCDFHeader().

16 {return unsigned(m_Source_id);}
uint16_t m_Source_id
Definition: AMC13Event.h:48

Member Data Documentation

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

Definition at line 55 of file AMC13Event.h.

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

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

Definition at line 61 of file AMC13Event.h.

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

uint8_t gem::AMC13Event::m_Blk_NoT
private

Definition at line 64 of file AMC13Event.h.

Referenced by getAMC13trailer(), and setAMC13trailer().

uint16_t gem::AMC13Event::m_BX_id
private

Definition at line 47 of file AMC13Event.h.

Referenced by bx_id(), getCDFHeader(), and setCDFHeader().

uint16_t gem::AMC13Event::m_BX_idT
private

Definition at line 66 of file AMC13Event.h.

Referenced by getAMC13trailer(), and setAMC13trailer().

uint8_t gem::AMC13Event::m_CalTyp
private

Definition at line 50 of file AMC13Event.h.

Referenced by getAMC13header(), and setAMC13header().

uint8_t gem::AMC13Event::m_cb0
private

Definition at line 53 of file AMC13Event.h.

Referenced by getAMC13header(), and setAMC13header().

uint8_t gem::AMC13Event::m_cb5
private

Definition at line 44 of file AMC13Event.h.

Referenced by getCDFHeader(), and setCDFHeader().

uint8_t gem::AMC13Event::m_cbA
private

Definition at line 68 of file AMC13Event.h.

Referenced by getCDFTrailer(), and setCDFTrailer().

uint32_t gem::AMC13Event::m_CRC_amc13
private

Definition at line 63 of file AMC13Event.h.

Referenced by getAMC13trailer(), and setAMC13trailer().

uint16_t gem::AMC13Event::m_CRC_cdf
private

Definition at line 70 of file AMC13Event.h.

Referenced by getCDFTrailer(), and setCDFTrailer().

uint8_t gem::AMC13Event::m_Evt_ty
private

Definition at line 45 of file AMC13Event.h.

Referenced by getCDFHeader(), and setCDFHeader().

uint32_t gem::AMC13Event::m_EvtLength
private

Definition at line 69 of file AMC13Event.h.

Referenced by getCDFTrailer(), and setCDFTrailer().

uint32_t gem::AMC13Event::m_LV1_id
private

Definition at line 46 of file AMC13Event.h.

Referenced by getCDFHeader(), lv1_id(), and setCDFHeader().

uint8_t gem::AMC13Event::m_LV1_idT
private

Definition at line 65 of file AMC13Event.h.

Referenced by getAMC13trailer(), and setAMC13trailer().

uint8_t gem::AMC13Event::m_nAMC
private

Definition at line 51 of file AMC13Event.h.

Referenced by getAMC13header(), nAMC(), and setAMC13header().

uint32_t gem::AMC13Event::m_OrN
private

Definition at line 52 of file AMC13Event.h.

Referenced by getAMC13header(), and setAMC13header().

uint16_t gem::AMC13Event::m_Source_id
private

Definition at line 48 of file AMC13Event.h.

Referenced by getCDFHeader(), setCDFHeader(), and source_id().