CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes | Static Private Attributes
amc13::Header Class Reference

#include <AMCSpec.h>

Public Member Functions

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
 
bool valid ()
 

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 77 of file AMCSpec.h.

Constructor & Destructor Documentation

amc13::Header::Header ( )
inline

Definition at line 79 of file AMCSpec.h.

79 : data_(0) {};
uint64_t data_
Definition: AMCSpec.h:102
amc13::Header::Header ( const uint64_t *  data)
inline

Definition at line 80 of file AMCSpec.h.

80 : data_(data[0]) {};
uint64_t data_
Definition: AMCSpec.h:102
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
Header::Header ( unsigned int  namc,
unsigned int  orbit 
)

Definition at line 109 of file AMCSpec.cc.

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

110  {
111  data_ =
112  (static_cast<uint64_t>(namc & nAMC_mask) << nAMC_shift) |
113  (static_cast<uint64_t>(orbit & OrN_mask) << OrN_shift) |
114  (static_cast<uint64_t>(fov & uFOV_mask) << uFOV_shift);
115  }
static const unsigned int OrN_shift
Definition: AMCSpec.h:96
static const unsigned int fov
Definition: AMCSpec.h:99
static const unsigned int nAMC_mask
Definition: AMCSpec.h:95
uint64_t data_
Definition: AMCSpec.h:102
static const unsigned int uFOV_shift
Definition: AMCSpec.h:92
static const unsigned int uFOV_mask
Definition: AMCSpec.h:93
unsigned long long uint64_t
Definition: Time.h:15
static const unsigned int nAMC_shift
Definition: AMCSpec.h:94
static const unsigned int OrN_mask
Definition: AMCSpec.h:97

Member Function Documentation

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

Definition at line 87 of file AMCSpec.h.

References data_, uFOV_mask, and uFOV_shift.

Referenced by amc13::Packet::parse(), and valid().

87 { return (data_ >> uFOV_shift) & uFOV_mask; };
uint64_t data_
Definition: AMCSpec.h:102
static const unsigned int uFOV_shift
Definition: AMCSpec.h:92
static const unsigned int uFOV_mask
Definition: AMCSpec.h:93
unsigned int amc13::Header::getNumberOfAMCs ( ) const
inline

Definition at line 88 of file AMCSpec.h.

References data_, nAMC_mask, and nAMC_shift.

Referenced by amc13::Packet::parse(), and valid().

88 { return (data_ >> nAMC_shift) & nAMC_mask; };
static const unsigned int nAMC_mask
Definition: AMCSpec.h:95
uint64_t data_
Definition: AMCSpec.h:102
static const unsigned int nAMC_shift
Definition: AMCSpec.h:94
unsigned int amc13::Header::getOrbitNumber ( ) const
inline

Definition at line 89 of file AMCSpec.h.

References data_, OrN_mask, and OrN_shift.

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

89 { return (data_ >> OrN_shift) & OrN_mask; };
static const unsigned int OrN_shift
Definition: AMCSpec.h:96
uint64_t data_
Definition: AMCSpec.h:102
static const unsigned int OrN_mask
Definition: AMCSpec.h:97
uint64_t amc13::Header::raw ( ) const
inline

Definition at line 85 of file AMCSpec.h.

References data_.

85 { return data_; };
uint64_t data_
Definition: AMCSpec.h:102
bool Header::valid ( )

Definition at line 118 of file AMCSpec.cc.

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

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

119  {
120  return (getNumberOfAMCs() <= max_amc) && (getFormatVersion() == fov);
121  }
static const unsigned int fov
Definition: AMCSpec.h:99
static const unsigned int max_amc
Definition: AMCSpec.h:100
unsigned int getNumberOfAMCs() const
Definition: AMCSpec.h:88
unsigned int getFormatVersion() const
Definition: AMCSpec.h:87

Member Data Documentation

uint64_t amc13::Header::data_
private

Definition at line 102 of file AMCSpec.h.

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

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

Definition at line 99 of file AMCSpec.h.

Referenced by Header(), and valid().

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

Definition at line 100 of file AMCSpec.h.

Referenced by valid().

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

Definition at line 95 of file AMCSpec.h.

Referenced by getNumberOfAMCs(), and Header().

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

Definition at line 94 of file AMCSpec.h.

Referenced by getNumberOfAMCs(), and Header().

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

Definition at line 97 of file AMCSpec.h.

Referenced by getOrbitNumber(), and Header().

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

Definition at line 96 of file AMCSpec.h.

Referenced by getOrbitNumber(), and Header().

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

Definition at line 93 of file AMCSpec.h.

Referenced by getFormatVersion(), and Header().

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

Definition at line 92 of file AMCSpec.h.

Referenced by getFormatVersion(), and Header().