CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes | Static Private Attributes
l1t::BlockHeader Class Reference

#include <Block.h>

Public Member Functions

 BlockHeader (unsigned int id, unsigned int size, unsigned int capID=0, unsigned int flags=0, block_t type=MP7)
 
 BlockHeader (const uint32_t *data)
 
unsigned int getCapID () const
 
unsigned int getFlags () const
 
unsigned int getID () const
 
unsigned int getSize () const
 
block_t getType () const
 
bool operator< (const BlockHeader &o) const
 
uint32_t raw () const
 

Private Attributes

unsigned int capID_
 
unsigned int flags_
 
unsigned int id_
 
unsigned int size_
 
block_t type_
 

Static Private Attributes

static constexpr unsigned capID_mask = 0xff
 
static constexpr unsigned capID_shift = 8
 
static constexpr unsigned CTP7_mask = 0xffff
 
static constexpr unsigned CTP7_shift = 0
 
static constexpr unsigned flags_mask = 0xff
 
static constexpr unsigned flags_shift = 0
 
static constexpr unsigned ID_mask = 0xff
 
static constexpr unsigned ID_shift = 24
 
static constexpr unsigned size_mask = 0xff
 
static constexpr unsigned size_shift = 16
 

Detailed Description

Definition at line 13 of file Block.h.

Constructor & Destructor Documentation

l1t::BlockHeader::BlockHeader ( unsigned int  id,
unsigned int  size,
unsigned int  capID = 0,
unsigned int  flags = 0,
block_t  type = MP7 
)
inline

Definition at line 15 of file Block.h.

Referenced by l1t::MTF7Payload::getHeader().

16  : id_(id), size_(size), capID_(capID), flags_(flags), type_(type){};
size
Write out results.
type
Definition: HCALResponse.h:21
block_t type_
Definition: Block.h:51
unsigned int flags_
Definition: Block.h:50
unsigned int size_
Definition: Block.h:48
unsigned int capID_
Definition: Block.h:49
unsigned int id_
Definition: Block.h:47
l1t::BlockHeader::BlockHeader ( const uint32_t *  data)
inline

Definition at line 18 of file Block.h.

19  : id_((data[0] >> ID_shift) & ID_mask),
20  size_((data[0] >> size_shift) & size_mask),
21  capID_((data[0] >> capID_shift) & capID_mask),
22  flags_((data[0] >> flags_shift) & flags_mask),
23  type_(MP7){};
static constexpr unsigned capID_shift
Definition: Block.h:42
Definition: Block.h:11
static constexpr unsigned capID_mask
Definition: Block.h:43
static constexpr unsigned flags_mask
Definition: Block.h:45
static constexpr unsigned size_shift
Definition: Block.h:40
static constexpr unsigned flags_shift
Definition: Block.h:44
block_t type_
Definition: Block.h:51
unsigned int flags_
Definition: Block.h:50
static constexpr unsigned ID_mask
Definition: Block.h:39
unsigned int size_
Definition: Block.h:48
unsigned int capID_
Definition: Block.h:49
static constexpr unsigned size_mask
Definition: Block.h:41
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
unsigned int id_
Definition: Block.h:47
static constexpr unsigned ID_shift
Definition: Block.h:38

Member Function Documentation

unsigned int l1t::BlockHeader::getCapID ( ) const
inline

Definition at line 29 of file Block.h.

References capID_.

Referenced by l1t::stage1::RCTEmRegionUnpacker::unpack().

29 { return capID_; };
unsigned int capID_
Definition: Block.h:49
unsigned int l1t::BlockHeader::getFlags ( ) const
inline
unsigned int l1t::BlockHeader::getID ( ) const
inline
unsigned int l1t::BlockHeader::getSize ( ) const
inline
block_t l1t::BlockHeader::getType ( void  ) const
inline
bool l1t::BlockHeader::operator< ( const BlockHeader o) const
inline

Definition at line 25 of file Block.h.

References getID().

25 { return getID() < o.getID(); };
unsigned int getID() const
Definition: Block.h:27
uint32_t l1t::BlockHeader::raw ( ) const

Definition at line 25 of file Block.cc.

References capID_, capID_mask, capID_shift, l1t::CTP7, flags_, flags_mask, flags_shift, id_, ID_mask, ID_shift, LogTrace, l1t::MP7, size_, size_mask, size_shift, and type_.

Referenced by getType().

25  {
26  if (type_ == MP7) {
27  LogTrace("L1T") << "Writing MP7 link header";
28  return ((id_ & ID_mask) << ID_shift) | ((size_ & size_mask) << size_shift) |
30  } else if (type_ == CTP7) {
31  LogTrace("L1T") << "Writing CTP7 link header";
32  return flags_;
33  }
34  // if (type_ == MTF7) {
35  // LogTrace("L1T") << "Writing MTF7 link header";
36  // return ((id_ & ID_mask) << ID_shift) | ((size_ & size_mask) << size_shift) | ((capID_ & capID_mask) << capID_shift);
37  // }
38  LogTrace("L1T") << "Writing meaningless link header";
39  return 0;
40  }
static constexpr unsigned capID_shift
Definition: Block.h:42
Definition: Block.h:11
static constexpr unsigned capID_mask
Definition: Block.h:43
static constexpr unsigned flags_mask
Definition: Block.h:45
static constexpr unsigned size_shift
Definition: Block.h:40
static constexpr unsigned flags_shift
Definition: Block.h:44
block_t type_
Definition: Block.h:51
unsigned int flags_
Definition: Block.h:50
static constexpr unsigned ID_mask
Definition: Block.h:39
unsigned int size_
Definition: Block.h:48
#define LogTrace(id)
unsigned int capID_
Definition: Block.h:49
static constexpr unsigned size_mask
Definition: Block.h:41
unsigned int id_
Definition: Block.h:47
static constexpr unsigned ID_shift
Definition: Block.h:38

Member Data Documentation

unsigned int l1t::BlockHeader::capID_
private

Definition at line 49 of file Block.h.

Referenced by getCapID(), and raw().

constexpr unsigned l1t::BlockHeader::capID_mask = 0xff
staticprivate

Definition at line 43 of file Block.h.

Referenced by raw().

constexpr unsigned l1t::BlockHeader::capID_shift = 8
staticprivate

Definition at line 42 of file Block.h.

Referenced by raw().

constexpr unsigned l1t::BlockHeader::CTP7_mask = 0xffff
staticprivate

Definition at line 37 of file Block.h.

constexpr unsigned l1t::BlockHeader::CTP7_shift = 0
staticprivate

Definition at line 36 of file Block.h.

unsigned int l1t::BlockHeader::flags_
private

Definition at line 50 of file Block.h.

Referenced by getFlags(), and raw().

constexpr unsigned l1t::BlockHeader::flags_mask = 0xff
staticprivate

Definition at line 45 of file Block.h.

Referenced by raw().

constexpr unsigned l1t::BlockHeader::flags_shift = 0
staticprivate

Definition at line 44 of file Block.h.

Referenced by raw().

unsigned int l1t::BlockHeader::id_
private

Definition at line 47 of file Block.h.

Referenced by getID(), and raw().

constexpr unsigned l1t::BlockHeader::ID_mask = 0xff
staticprivate

Definition at line 39 of file Block.h.

Referenced by raw().

constexpr unsigned l1t::BlockHeader::ID_shift = 24
staticprivate

Definition at line 38 of file Block.h.

Referenced by raw().

unsigned int l1t::BlockHeader::size_
private

Definition at line 48 of file Block.h.

Referenced by getSize(), and raw().

constexpr unsigned l1t::BlockHeader::size_mask = 0xff
staticprivate

Definition at line 41 of file Block.h.

Referenced by raw().

constexpr unsigned l1t::BlockHeader::size_shift = 16
staticprivate

Definition at line 40 of file Block.h.

Referenced by raw().

block_t l1t::BlockHeader::type_
private