CMS 3D CMS Logo

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

#include <BxBlock.h>

Public Member Functions

 BxBlockHeader ()
 
 BxBlockHeader (unsigned int id, unsigned int totalBx, unsigned int flags=0)
 
 BxBlockHeader (const uint32_t raw)
 
int getBx () const
 
unsigned int getFlags () const
 
unsigned int getId () const
 
unsigned int getTotalBx () const
 
bool operator< (const BxBlockHeader &o) const
 
uint32_t raw () const
 

Private Attributes

unsigned int flags_
 
unsigned int id_
 
unsigned int totalBx_
 

Static Private Attributes

static constexpr unsigned flags_mask = 0xffff
 
static constexpr unsigned flags_shift = 0
 
static constexpr unsigned id_mask = 0xff
 
static constexpr unsigned id_shift = 24
 
static constexpr unsigned n_words = 6
 
static constexpr unsigned totalBx_mask = 0xff
 
static constexpr unsigned totalBx_shift = 16
 

Detailed Description

Definition at line 10 of file BxBlock.h.

Constructor & Destructor Documentation

l1t::BxBlockHeader::BxBlockHeader ( )
inline

Definition at line 12 of file BxBlock.h.

12 : id_(0), totalBx_(0), flags_(0) {};
unsigned int flags_
Definition: BxBlock.h:41
unsigned int totalBx_
Definition: BxBlock.h:40
unsigned int id_
Definition: BxBlock.h:39
l1t::BxBlockHeader::BxBlockHeader ( unsigned int  id,
unsigned int  totalBx,
unsigned int  flags = 0 
)
inline

Definition at line 13 of file BxBlock.h.

13 : id_(id), totalBx_(totalBx), flags_(flags) {};
unsigned int flags_
Definition: BxBlock.h:41
std::vector< Variable::Flags > flags
Definition: MVATrainer.cc:135
unsigned int totalBx_
Definition: BxBlock.h:40
unsigned int id_
Definition: BxBlock.h:39
l1t::BxBlockHeader::BxBlockHeader ( const uint32_t  raw)
inline

Definition at line 15 of file BxBlock.h.

15  : id_(((raw >> id_shift) & id_mask) / n_words)
17  , flags_((raw >> flags_shift) & flags_mask) {};
static constexpr unsigned flags_mask
Definition: BxBlock.h:37
unsigned int flags_
Definition: BxBlock.h:41
static constexpr unsigned n_words
Definition: BxBlock.h:31
static constexpr unsigned id_mask
Definition: BxBlock.h:33
unsigned int totalBx_
Definition: BxBlock.h:40
static constexpr unsigned id_shift
Definition: BxBlock.h:32
static constexpr unsigned flags_shift
Definition: BxBlock.h:36
static constexpr unsigned totalBx_mask
Definition: BxBlock.h:35
static constexpr unsigned totalBx_shift
Definition: BxBlock.h:34
unsigned int id_
Definition: BxBlock.h:39
uint32_t raw() const
Definition: BxBlock.h:26

Member Function Documentation

int l1t::BxBlockHeader::getBx ( ) const
inline

Definition at line 21 of file BxBlock.h.

References id_, min(), and totalBx_.

Referenced by operator<().

21 { return (int)id_ + std::min(0, 1 - (int)totalBx_%2 - (int)std::floor(totalBx_/2.)); }; // In case of an even totalBx_ the BX range should be like, e.g. -3 to +4
unsigned int totalBx_
Definition: BxBlock.h:40
T min(T a, T b)
Definition: MathUtil.h:58
unsigned int id_
Definition: BxBlock.h:39
unsigned int l1t::BxBlockHeader::getFlags ( ) const
inline

Definition at line 24 of file BxBlock.h.

References flags_.

24 { return flags_; };
unsigned int flags_
Definition: BxBlock.h:41
unsigned int l1t::BxBlockHeader::getId ( ) const
inline

Definition at line 22 of file BxBlock.h.

References id_.

22 { return id_; };
unsigned int id_
Definition: BxBlock.h:39
unsigned int l1t::BxBlockHeader::getTotalBx ( ) const
inline
bool l1t::BxBlockHeader::operator< ( const BxBlockHeader o) const
inline

Definition at line 19 of file BxBlock.h.

References getBx().

19 { return getBx() < o.getBx(); };
int getBx() const
Definition: BxBlock.h:21
uint32_t l1t::BxBlockHeader::raw ( ) const
inline

Definition at line 26 of file BxBlock.h.

References flags_, flags_mask, flags_shift, id_, id_mask, id_shift, n_words, totalBx_, totalBx_mask, and totalBx_shift.

26  { return (((id_ & id_mask) << id_shift) * n_words)
28  | ((flags_ & flags_mask) << flags_shift); };
static constexpr unsigned flags_mask
Definition: BxBlock.h:37
unsigned int flags_
Definition: BxBlock.h:41
static constexpr unsigned n_words
Definition: BxBlock.h:31
static constexpr unsigned id_mask
Definition: BxBlock.h:33
unsigned int totalBx_
Definition: BxBlock.h:40
static constexpr unsigned id_shift
Definition: BxBlock.h:32
static constexpr unsigned flags_shift
Definition: BxBlock.h:36
static constexpr unsigned totalBx_mask
Definition: BxBlock.h:35
static constexpr unsigned totalBx_shift
Definition: BxBlock.h:34
unsigned int id_
Definition: BxBlock.h:39

Member Data Documentation

unsigned int l1t::BxBlockHeader::flags_
private

Definition at line 41 of file BxBlock.h.

Referenced by getFlags(), and raw().

constexpr unsigned l1t::BxBlockHeader::flags_mask = 0xffff
staticprivate

Definition at line 37 of file BxBlock.h.

Referenced by raw().

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

Definition at line 36 of file BxBlock.h.

Referenced by raw().

unsigned int l1t::BxBlockHeader::id_
private

Definition at line 39 of file BxBlock.h.

Referenced by getBx(), getId(), and raw().

constexpr unsigned l1t::BxBlockHeader::id_mask = 0xff
staticprivate

Definition at line 33 of file BxBlock.h.

Referenced by raw().

constexpr unsigned l1t::BxBlockHeader::id_shift = 24
staticprivate

Definition at line 32 of file BxBlock.h.

Referenced by raw().

constexpr unsigned l1t::BxBlockHeader::n_words = 6
staticprivate

Definition at line 31 of file BxBlock.h.

Referenced by raw().

unsigned int l1t::BxBlockHeader::totalBx_
private

Definition at line 40 of file BxBlock.h.

Referenced by getBx(), getTotalBx(), and raw().

constexpr unsigned l1t::BxBlockHeader::totalBx_mask = 0xff
staticprivate

Definition at line 35 of file BxBlock.h.

Referenced by raw().

constexpr unsigned l1t::BxBlockHeader::totalBx_shift = 16
staticprivate

Definition at line 34 of file BxBlock.h.

Referenced by raw().