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

◆ BxBlockHeader() [1/3]

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:46
unsigned int totalBx_
Definition: BxBlock.h:45
unsigned int id_
Definition: BxBlock.h:44

◆ BxBlockHeader() [2/3]

l1t::BxBlockHeader::BxBlockHeader ( unsigned int  id,
unsigned int  totalBx,
unsigned int  flags = 0 
)
inline

Definition at line 13 of file BxBlock.h.

14  : id_(id), totalBx_(totalBx), flags_(flags){};
unsigned int flags_
Definition: BxBlock.h:46
unsigned int totalBx_
Definition: BxBlock.h:45
unsigned int id_
Definition: BxBlock.h:44

◆ BxBlockHeader() [3/3]

l1t::BxBlockHeader::BxBlockHeader ( const uint32_t  raw)
inline

Definition at line 16 of file BxBlock.h.

17  : id_(((raw >> id_shift) & id_mask) / n_words),
19  flags_((raw >> flags_shift) & flags_mask){};
static constexpr unsigned flags_mask
Definition: BxBlock.h:42
unsigned int flags_
Definition: BxBlock.h:46
static constexpr unsigned n_words
Definition: BxBlock.h:36
static constexpr unsigned id_mask
Definition: BxBlock.h:38
unsigned int totalBx_
Definition: BxBlock.h:45
static constexpr unsigned id_shift
Definition: BxBlock.h:37
static constexpr unsigned flags_shift
Definition: BxBlock.h:41
static constexpr unsigned totalBx_mask
Definition: BxBlock.h:40
uint32_t raw() const
Definition: BxBlock.h:30
static constexpr unsigned totalBx_shift
Definition: BxBlock.h:39
unsigned int id_
Definition: BxBlock.h:44

Member Function Documentation

◆ getBx()

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

Definition at line 23 of file BxBlock.h.

References id_, SiStripPI::min, and totalBx_.

Referenced by operator<().

23  {
24  return (int)id_ + std::min(0, 1 - (int)totalBx_ % 2 - (int)std::floor(totalBx_ / 2.));
25  }; // In case of an even totalBx_ the BX range should be like, e.g. -3 to +4
unsigned int totalBx_
Definition: BxBlock.h:45
unsigned int id_
Definition: BxBlock.h:44

◆ getFlags()

unsigned int l1t::BxBlockHeader::getFlags ( ) const
inline

Definition at line 28 of file BxBlock.h.

References flags_.

28 { return flags_; };
unsigned int flags_
Definition: BxBlock.h:46

◆ getId()

unsigned int l1t::BxBlockHeader::getId ( ) const
inline

Definition at line 26 of file BxBlock.h.

References id_.

26 { return id_; };
unsigned int id_
Definition: BxBlock.h:44

◆ getTotalBx()

unsigned int l1t::BxBlockHeader::getTotalBx ( ) const
inline

◆ operator<()

bool l1t::BxBlockHeader::operator< ( const BxBlockHeader o) const
inline

Definition at line 21 of file BxBlock.h.

References getBx(), and EcalTangentSkim_cfg::o.

21 { return getBx() < o.getBx(); };
int getBx() const
Definition: BxBlock.h:23

◆ raw()

uint32_t l1t::BxBlockHeader::raw ( ) const
inline

Definition at line 30 of file BxBlock.h.

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

30  {
31  return (((id_ & id_mask) << id_shift) * n_words) | (((totalBx_ & totalBx_mask) << totalBx_shift) * n_words) |
32  ((flags_ & flags_mask) << flags_shift);
33  };
static constexpr unsigned flags_mask
Definition: BxBlock.h:42
unsigned int flags_
Definition: BxBlock.h:46
static constexpr unsigned n_words
Definition: BxBlock.h:36
static constexpr unsigned id_mask
Definition: BxBlock.h:38
unsigned int totalBx_
Definition: BxBlock.h:45
static constexpr unsigned id_shift
Definition: BxBlock.h:37
static constexpr unsigned flags_shift
Definition: BxBlock.h:41
static constexpr unsigned totalBx_mask
Definition: BxBlock.h:40
static constexpr unsigned totalBx_shift
Definition: BxBlock.h:39
unsigned int id_
Definition: BxBlock.h:44

Member Data Documentation

◆ flags_

unsigned int l1t::BxBlockHeader::flags_
private

Definition at line 46 of file BxBlock.h.

Referenced by getFlags(), and raw().

◆ flags_mask

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

Definition at line 42 of file BxBlock.h.

Referenced by raw().

◆ flags_shift

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

Definition at line 41 of file BxBlock.h.

Referenced by raw().

◆ id_

unsigned int l1t::BxBlockHeader::id_
private

Definition at line 44 of file BxBlock.h.

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

◆ id_mask

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

Definition at line 38 of file BxBlock.h.

Referenced by raw().

◆ id_shift

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

Definition at line 37 of file BxBlock.h.

Referenced by raw().

◆ n_words

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

Definition at line 36 of file BxBlock.h.

Referenced by raw().

◆ totalBx_

unsigned int l1t::BxBlockHeader::totalBx_
private

Definition at line 45 of file BxBlock.h.

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

◆ totalBx_mask

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

Definition at line 40 of file BxBlock.h.

Referenced by raw().

◆ totalBx_shift

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

Definition at line 39 of file BxBlock.h.

Referenced by raw().