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

amc13::Header::Header ( )
inline

Definition at line 17 of file AMC13Spec.h.

Referenced by amc13::Packet::parse().

17 : data_(0) {};
uint64_t data_
Definition: AMC13Spec.h:39
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:82
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.

14  {
15  data_ =
16  (static_cast<uint64_t>(namc & nAMC_mask) << nAMC_shift) |
17  (static_cast<uint64_t>(orbit & OrN_mask) << OrN_shift) |
18  (static_cast<uint64_t>(fov & uFOV_mask) << uFOV_shift);
19  }
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:15
static const unsigned int nAMC_shift
Definition: AMC13Spec.h:31
static const unsigned int OrN_mask
Definition: AMC13Spec.h:34

Member Function Documentation

bool Header::check ( void  ) const

Definition at line 22 of file AMC13Spec.cc.

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

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

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

Definition at line 24 of file AMC13Spec.h.

Referenced by check(), 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
unsigned int amc13::Header::getNumberOfAMCs ( ) const
inline

Definition at line 25 of file AMC13Spec.h.

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
unsigned int amc13::Header::getOrbitNumber ( ) const
inline

Definition at line 26 of file AMC13Spec.h.

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
uint64_t amc13::Header::raw ( ) const
inline

Definition at line 21 of file AMC13Spec.h.

References edm::check().

Referenced by amc13::Packet::write().

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

Member Data Documentation

uint64_t amc13::Header::data_
private

Definition at line 39 of file AMC13Spec.h.

Referenced by Header(), and amc13::Trailer::Trailer().

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

Definition at line 36 of file AMC13Spec.h.

Referenced by check(), and Header().

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

Definition at line 37 of file AMC13Spec.h.

Referenced by check().

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

Definition at line 32 of file AMC13Spec.h.

Referenced by Header().

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

Definition at line 31 of file AMC13Spec.h.

Referenced by Header().

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

Definition at line 34 of file AMC13Spec.h.

Referenced by Header().

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

Definition at line 33 of file AMC13Spec.h.

Referenced by Header().

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

Definition at line 30 of file AMC13Spec.h.

Referenced by Header().

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

Definition at line 29 of file AMC13Spec.h.

Referenced by Header().