CMS 3D CMS Logo

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

#include <AMC13Spec.h>

Public Member Functions

bool check () const
 
unsigned int getFormatVersion () const
 
unsigned int getNumberOfAMCs () const
 
unsigned int getOrbitNumber () const
 
 Header ()
 
 Header (const uint64_t *data)
 
 Header (unsigned int namc, unsigned int orbit)
 
uint64_t raw () const
 

Private Attributes

uint64_t data_
 

Static Private Attributes

static const unsigned int fov = 1
 
static const unsigned int max_amc = 12
 
static const unsigned int nAMC_mask = 0xf
 
static const unsigned int nAMC_shift = 52
 
static const unsigned int OrN_mask = 0xffffffff
 
static const unsigned int OrN_shift = 4
 
static const unsigned int uFOV_mask = 0xf
 
static const unsigned int uFOV_shift = 60
 

Detailed Description

Definition at line 15 of file AMC13Spec.h.

Constructor & Destructor Documentation

◆ Header() [1/3]

amc13::Header::Header ( )
inline

Definition at line 17 of file AMC13Spec.h.

17 : data_(0){};
uint64_t data_
Definition: AMC13Spec.h:39

◆ Header() [2/3]

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

Definition at line 18 of file AMC13Spec.h.

18 : data_(data[0]){};
uint64_t data_
Definition: AMC13Spec.h:39
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79

◆ Header() [3/3]

Header::Header ( unsigned int  namc,
unsigned int  orbit 
)

Definition at line 13 of file AMC13Spec.cc.

References data_, fov, nAMC_mask, nAMC_shift, OrN_mask, OrN_shift, uFOV_mask, and uFOV_shift.

13  {
14  data_ = (static_cast<uint64_t>(namc & nAMC_mask) << nAMC_shift) |
15  (static_cast<uint64_t>(orbit & OrN_mask) << OrN_shift) |
16  (static_cast<uint64_t>(fov & uFOV_mask) << uFOV_shift);
17  }
static const unsigned int OrN_shift
Definition: AMC13Spec.h:33
static const unsigned int fov
Definition: AMC13Spec.h:36
static const unsigned int nAMC_mask
Definition: AMC13Spec.h:32
uint64_t data_
Definition: AMC13Spec.h:39
static const unsigned int uFOV_shift
Definition: AMC13Spec.h:29
static const unsigned int uFOV_mask
Definition: AMC13Spec.h:30
unsigned long long uint64_t
Definition: Time.h:13
static const unsigned int nAMC_shift
Definition: AMC13Spec.h:31
static const unsigned int OrN_mask
Definition: AMC13Spec.h:34

Member Function Documentation

◆ check()

bool Header::check ( void  ) const

Definition at line 19 of file AMC13Spec.cc.

References fov, getFormatVersion(), getNumberOfAMCs(), and max_amc.

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

19 { return (getNumberOfAMCs() <= max_amc) && (getFormatVersion() == fov); }
static const unsigned int fov
Definition: AMC13Spec.h:36
static const unsigned int max_amc
Definition: AMC13Spec.h:37
unsigned int getFormatVersion() const
Definition: AMC13Spec.h:24
unsigned int getNumberOfAMCs() const
Definition: AMC13Spec.h:25

◆ getFormatVersion()

unsigned int amc13::Header::getFormatVersion ( ) const
inline

Definition at line 24 of file AMC13Spec.h.

References data_, uFOV_mask, and uFOV_shift.

Referenced by check(), amc13::Packet::parse(), and omtf::OmtfUnpacker::produce().

24 { return (data_ >> uFOV_shift) & uFOV_mask; };
uint64_t data_
Definition: AMC13Spec.h:39
static const unsigned int uFOV_shift
Definition: AMC13Spec.h:29
static const unsigned int uFOV_mask
Definition: AMC13Spec.h:30

◆ getNumberOfAMCs()

unsigned int amc13::Header::getNumberOfAMCs ( ) const
inline

Definition at line 25 of file AMC13Spec.h.

References data_, nAMC_mask, and nAMC_shift.

Referenced by check(), amc13::Packet::parse(), and omtf::OmtfUnpacker::produce().

25 { return (data_ >> nAMC_shift) & nAMC_mask; };
static const unsigned int nAMC_mask
Definition: AMC13Spec.h:32
uint64_t data_
Definition: AMC13Spec.h:39
static const unsigned int nAMC_shift
Definition: AMC13Spec.h:31

◆ getOrbitNumber()

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

Definition at line 26 of file AMC13Spec.h.

References data_, OrN_mask, and OrN_shift.

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

26 { return (data_ >> OrN_shift) & OrN_mask; };
static const unsigned int OrN_shift
Definition: AMC13Spec.h:33
uint64_t data_
Definition: AMC13Spec.h:39
static const unsigned int OrN_mask
Definition: AMC13Spec.h:34

◆ raw()

uint64_t amc13::Header::raw ( ) const
inline

Definition at line 21 of file AMC13Spec.h.

References data_.

21 { return data_; };
uint64_t data_
Definition: AMC13Spec.h:39

Member Data Documentation

◆ data_

uint64_t amc13::Header::data_
private

Definition at line 39 of file AMC13Spec.h.

Referenced by getFormatVersion(), getNumberOfAMCs(), getOrbitNumber(), Header(), and raw().

◆ fov

const unsigned int amc13::Header::fov = 1
staticprivate

Definition at line 36 of file AMC13Spec.h.

Referenced by check(), and Header().

◆ max_amc

const unsigned int amc13::Header::max_amc = 12
staticprivate

Definition at line 37 of file AMC13Spec.h.

Referenced by check().

◆ nAMC_mask

const unsigned int amc13::Header::nAMC_mask = 0xf
staticprivate

Definition at line 32 of file AMC13Spec.h.

Referenced by getNumberOfAMCs(), and Header().

◆ nAMC_shift

const unsigned int amc13::Header::nAMC_shift = 52
staticprivate

Definition at line 31 of file AMC13Spec.h.

Referenced by getNumberOfAMCs(), and Header().

◆ OrN_mask

const unsigned int amc13::Header::OrN_mask = 0xffffffff
staticprivate

Definition at line 34 of file AMC13Spec.h.

Referenced by getOrbitNumber(), and Header().

◆ OrN_shift

const unsigned int amc13::Header::OrN_shift = 4
staticprivate

Definition at line 33 of file AMC13Spec.h.

Referenced by getOrbitNumber(), and Header().

◆ uFOV_mask

const unsigned int amc13::Header::uFOV_mask = 0xf
staticprivate

Definition at line 30 of file AMC13Spec.h.

Referenced by getFormatVersion(), and Header().

◆ uFOV_shift

const unsigned int amc13::Header::uFOV_shift = 60
staticprivate

Definition at line 29 of file AMC13Spec.h.

Referenced by getFormatVersion(), and Header().