CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes | Static Private Attributes
amc::Header Class Reference

#include <AMCSpec.h>

Public Member Functions

unsigned int getAMCNumber () const
 
unsigned int getBoardID () const
 
unsigned int getBX () const
 
unsigned int getLV1ID () const
 
unsigned int getOrbitNumber () const
 
unsigned int getSize () const
 
unsigned int getUserData () const
 
 Header ()
 
 Header (const uint64_t *data)
 
 Header (unsigned int amc_no, unsigned int lv1_id, unsigned int bx_id, unsigned int size, unsigned int or_n, unsigned int board_id, unsigned int user)
 
std::vector< uint64_t > raw () const
 

Private Attributes

uint64_t data0_
 
uint64_t data1_
 

Static Private Attributes

static const unsigned int AmcNo_mask = 0xf
 
static const unsigned int AmcNo_shift = 56
 
static const unsigned int BoardID_mask = 0xffff
 
static const unsigned int BoardID_shift = 0
 
static const unsigned int BX_mask = 0xfff
 
static const unsigned int BX_shift = 20
 
static const unsigned int LV1ID_mask = 0xffffff
 
static const unsigned int LV1ID_shift = 32
 
static const unsigned int OrN_mask = 0xffff
 
static const unsigned int OrN_shift = 16
 
static const unsigned int Size_mask = 0xfffff
 
static const unsigned int Size_shift = 0
 
static const unsigned int User_mask = 0xffffffff
 
static const unsigned int User_shift = 32
 

Detailed Description

Definition at line 59 of file AMCSpec.h.

Constructor & Destructor Documentation

◆ Header() [1/3]

amc::Header::Header ( )
inline

Definition at line 61 of file AMCSpec.h.

61 : data0_(0), data1_(0){};
uint64_t data1_
Definition: AMCSpec.h:99
uint64_t data0_
Definition: AMCSpec.h:98

◆ Header() [2/3]

amc::Header::Header ( const uint64_t *  data)
inline

Definition at line 62 of file AMCSpec.h.

62 : data0_(data[0]), data1_(data[1]){};
uint64_t data1_
Definition: AMCSpec.h:99
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:80
uint64_t data0_
Definition: AMCSpec.h:98

◆ Header() [3/3]

Header::Header ( unsigned int  amc_no,
unsigned int  lv1_id,
unsigned int  bx_id,
unsigned int  size,
unsigned int  or_n,
unsigned int  board_id,
unsigned int  user 
)

Definition at line 66 of file AMCSpec.cc.

73  : data0_((uint64_t(amc_no & AmcNo_mask) << AmcNo_shift) | (uint64_t(lv1_id & LV1ID_mask) << LV1ID_shift) |
74  (uint64_t(bx_id & BX_mask) << BX_shift) | (uint64_t(size & Size_mask) << Size_shift)),
75  data1_((uint64_t(or_n & OrN_mask) << OrN_shift) | (uint64_t(board_id & BoardID_mask) << BoardID_shift) |
76  (uint64_t(user & User_mask) << User_shift)) {}
size
Write out results.
static const unsigned int AmcNo_mask
Definition: AMCSpec.h:89
static const unsigned int BX_mask
Definition: AMCSpec.h:85
static const unsigned int BoardID_shift
Definition: AMCSpec.h:91
static const unsigned int Size_shift
Definition: AMCSpec.h:82
static const unsigned int Size_mask
Definition: AMCSpec.h:83
static const unsigned int LV1ID_mask
Definition: AMCSpec.h:87
static const unsigned int OrN_mask
Definition: AMCSpec.h:94
static const unsigned int LV1ID_shift
Definition: AMCSpec.h:86
static const unsigned int AmcNo_shift
Definition: AMCSpec.h:88
static const unsigned int BX_shift
Definition: AMCSpec.h:84
static const unsigned int User_shift
Definition: AMCSpec.h:95
uint64_t data1_
Definition: AMCSpec.h:99
static const unsigned int BoardID_mask
Definition: AMCSpec.h:92
unsigned long long uint64_t
Definition: Time.h:13
static const unsigned int User_mask
Definition: AMCSpec.h:96
static const unsigned int OrN_shift
Definition: AMCSpec.h:93
uint64_t data0_
Definition: AMCSpec.h:98

Member Function Documentation

◆ getAMCNumber()

unsigned int amc::Header::getAMCNumber ( ) const
inline

Definition at line 71 of file AMCSpec.h.

References AmcNo_mask, AmcNo_shift, and data0_.

Referenced by omtf::OmtfUnpacker::produce().

71 { return (data0_ >> AmcNo_shift) & AmcNo_mask; };
static const unsigned int AmcNo_mask
Definition: AMCSpec.h:89
static const unsigned int AmcNo_shift
Definition: AMCSpec.h:88
uint64_t data0_
Definition: AMCSpec.h:98

◆ getBoardID()

unsigned int amc::Header::getBoardID ( ) const
inline

Definition at line 72 of file AMCSpec.h.

References BoardID_mask, BoardID_shift, and data1_.

72 { return (data1_ >> BoardID_shift) & BoardID_mask; };
static const unsigned int BoardID_shift
Definition: AMCSpec.h:91
uint64_t data1_
Definition: AMCSpec.h:99
static const unsigned int BoardID_mask
Definition: AMCSpec.h:92

◆ getBX()

unsigned int amc::Header::getBX ( ) const
inline

Definition at line 74 of file AMCSpec.h.

References BX_mask, BX_shift, and data0_.

74 { return (data0_ >> BX_shift) & BX_mask; };
static const unsigned int BX_mask
Definition: AMCSpec.h:85
static const unsigned int BX_shift
Definition: AMCSpec.h:84
uint64_t data0_
Definition: AMCSpec.h:98

◆ getLV1ID()

unsigned int amc::Header::getLV1ID ( ) const
inline

Definition at line 73 of file AMCSpec.h.

References data0_, LV1ID_mask, and LV1ID_shift.

73 { return (data0_ >> LV1ID_shift) & LV1ID_mask; };
static const unsigned int LV1ID_mask
Definition: AMCSpec.h:87
static const unsigned int LV1ID_shift
Definition: AMCSpec.h:86
uint64_t data0_
Definition: AMCSpec.h:98

◆ getOrbitNumber()

unsigned int amc::Header::getOrbitNumber ( ) const
inline

Definition at line 75 of file AMCSpec.h.

References data1_, OrN_mask, and OrN_shift.

75 { return (data1_ >> OrN_shift) & OrN_mask; };
static const unsigned int OrN_mask
Definition: AMCSpec.h:94
uint64_t data1_
Definition: AMCSpec.h:99
static const unsigned int OrN_shift
Definition: AMCSpec.h:93

◆ getSize()

unsigned int amc::Header::getSize ( ) const
inline

Definition at line 76 of file AMCSpec.h.

References data0_, Size_mask, and Size_shift.

Referenced by amc::Packet::finalize().

76 { return (data0_ >> Size_shift) & Size_mask; };
static const unsigned int Size_shift
Definition: AMCSpec.h:82
static const unsigned int Size_mask
Definition: AMCSpec.h:83
uint64_t data0_
Definition: AMCSpec.h:98

◆ getUserData()

unsigned int amc::Header::getUserData ( ) const
inline

Definition at line 77 of file AMCSpec.h.

References data1_, User_mask, and User_shift.

Referenced by l1t::CTP7Payload::CTP7Payload().

77 { return (data1_ >> User_shift) & User_mask; };
static const unsigned int User_shift
Definition: AMCSpec.h:95
uint64_t data1_
Definition: AMCSpec.h:99
static const unsigned int User_mask
Definition: AMCSpec.h:96

◆ raw()

std::vector<uint64_t> amc::Header::raw ( ) const
inline

Definition at line 79 of file AMCSpec.h.

References data0_, and data1_.

Referenced by amc::Packet::Packet(), and omtf::OmtfUnpacker::produce().

79 { return {data0_, data1_}; };
uint64_t data1_
Definition: AMCSpec.h:99
uint64_t data0_
Definition: AMCSpec.h:98

Member Data Documentation

◆ AmcNo_mask

const unsigned int amc::Header::AmcNo_mask = 0xf
staticprivate

Definition at line 89 of file AMCSpec.h.

Referenced by getAMCNumber().

◆ AmcNo_shift

const unsigned int amc::Header::AmcNo_shift = 56
staticprivate

Definition at line 88 of file AMCSpec.h.

Referenced by getAMCNumber().

◆ BoardID_mask

const unsigned int amc::Header::BoardID_mask = 0xffff
staticprivate

Definition at line 92 of file AMCSpec.h.

Referenced by getBoardID().

◆ BoardID_shift

const unsigned int amc::Header::BoardID_shift = 0
staticprivate

Definition at line 91 of file AMCSpec.h.

Referenced by getBoardID().

◆ BX_mask

const unsigned int amc::Header::BX_mask = 0xfff
staticprivate

Definition at line 85 of file AMCSpec.h.

Referenced by getBX().

◆ BX_shift

const unsigned int amc::Header::BX_shift = 20
staticprivate

Definition at line 84 of file AMCSpec.h.

Referenced by getBX().

◆ data0_

uint64_t amc::Header::data0_
private

Definition at line 98 of file AMCSpec.h.

Referenced by getAMCNumber(), getBX(), getLV1ID(), getSize(), and raw().

◆ data1_

uint64_t amc::Header::data1_
private

Definition at line 99 of file AMCSpec.h.

Referenced by getBoardID(), getOrbitNumber(), getUserData(), and raw().

◆ LV1ID_mask

const unsigned int amc::Header::LV1ID_mask = 0xffffff
staticprivate

Definition at line 87 of file AMCSpec.h.

Referenced by getLV1ID().

◆ LV1ID_shift

const unsigned int amc::Header::LV1ID_shift = 32
staticprivate

Definition at line 86 of file AMCSpec.h.

Referenced by getLV1ID().

◆ OrN_mask

const unsigned int amc::Header::OrN_mask = 0xffff
staticprivate

Definition at line 94 of file AMCSpec.h.

Referenced by getOrbitNumber().

◆ OrN_shift

const unsigned int amc::Header::OrN_shift = 16
staticprivate

Definition at line 93 of file AMCSpec.h.

Referenced by getOrbitNumber().

◆ Size_mask

const unsigned int amc::Header::Size_mask = 0xfffff
staticprivate

Definition at line 83 of file AMCSpec.h.

Referenced by getSize().

◆ Size_shift

const unsigned int amc::Header::Size_shift = 0
staticprivate

Definition at line 82 of file AMCSpec.h.

Referenced by getSize().

◆ User_mask

const unsigned int amc::Header::User_mask = 0xffffffff
staticprivate

Definition at line 96 of file AMCSpec.h.

Referenced by getUserData().

◆ User_shift

const unsigned int amc::Header::User_shift = 32
staticprivate

Definition at line 95 of file AMCSpec.h.

Referenced by getUserData().