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 (const uint32_t raw)
 
 BxBlockHeader (unsigned int id, unsigned int totalBx, unsigned int flags=0)
 
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){};

◆ 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){};

◆ 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){};

Member Function Documentation

◆ getBx()

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

Definition at line 23 of file BxBlock.h.

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

References id_, min(), and totalBx_.

Referenced by operator<().

◆ getFlags()

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

Definition at line 28 of file BxBlock.h.

28 { return flags_; };

References flags_.

◆ getId()

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

Definition at line 26 of file BxBlock.h.

26 { return id_; };

References id_.

◆ 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.

21 { return getBx() < o.getBx(); };

References getBx(), and EcalTangentSkim_cfg::o.

◆ raw()

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

Definition at line 30 of file BxBlock.h.

30  {
31  return (((id_ & id_mask) << id_shift) * n_words) | (((totalBx_ & totalBx_mask) << totalBx_shift) * n_words) |
32  ((flags_ & flags_mask) << flags_shift);
33  };

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

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
staticconstexprprivate

Definition at line 42 of file BxBlock.h.

Referenced by raw().

◆ flags_shift

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

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
staticconstexprprivate

Definition at line 38 of file BxBlock.h.

Referenced by raw().

◆ id_shift

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

Definition at line 37 of file BxBlock.h.

Referenced by raw().

◆ n_words

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

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
staticconstexprprivate

Definition at line 40 of file BxBlock.h.

Referenced by raw().

◆ totalBx_shift

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

Definition at line 39 of file BxBlock.h.

Referenced by raw().

l1t::BxBlockHeader::flags_
unsigned int flags_
Definition: BxBlock.h:46
min
T min(T a, T b)
Definition: MathUtil.h:58
l1t::BxBlockHeader::totalBx_shift
static constexpr unsigned totalBx_shift
Definition: BxBlock.h:39
l1t::BxBlockHeader::raw
uint32_t raw() const
Definition: BxBlock.h:30
EcalTangentSkim_cfg.o
o
Definition: EcalTangentSkim_cfg.py:36
l1t::BxBlockHeader::flags_mask
static constexpr unsigned flags_mask
Definition: BxBlock.h:42
l1t::BxBlockHeader::id_shift
static constexpr unsigned id_shift
Definition: BxBlock.h:37
l1t::BxBlockHeader::flags_shift
static constexpr unsigned flags_shift
Definition: BxBlock.h:41
l1t::BxBlockHeader::getBx
int getBx() const
Definition: BxBlock.h:23
l1t::BxBlockHeader::totalBx_mask
static constexpr unsigned totalBx_mask
Definition: BxBlock.h:40
l1t::BxBlockHeader::n_words
static constexpr unsigned n_words
Definition: BxBlock.h:36
l1t::BxBlockHeader::totalBx_
unsigned int totalBx_
Definition: BxBlock.h:45
l1t::BxBlockHeader::id_
unsigned int id_
Definition: BxBlock.h:44
l1t::BxBlockHeader::id_mask
static constexpr unsigned id_mask
Definition: BxBlock.h:38
HLT_2018_cff.flags
flags
Definition: HLT_2018_cff.py:11758