CMS 3D CMS Logo

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

#include <Block.h>

Public Member Functions

void amc (const amc::Header &h)
 
amc::Header amc () const
 
 Block (const BlockHeader &h, const uint32_t *payload_start, const uint32_t *payload_end)
 
 Block (unsigned int id, const std::vector< uint32_t > &payload, unsigned int capID=0, unsigned int flags=0, block_t type=MP7)
 
BxBlocks getBxBlocks (unsigned int payloadWordsPerBx, bool bxHeader) const
 
unsigned int getSize () const
 
BlockHeader header () const
 
bool operator< (const Block &o) const
 
const std::vector< uint32_t > & payload () const
 

Private Attributes

amc::Header amc_
 
BlockHeader header_
 
std::vector< uint32_t > payload_
 

Detailed Description

Definition at line 70 of file Block.h.

Constructor & Destructor Documentation

l1t::Block::Block ( const BlockHeader h,
const uint32_t *  payload_start,
const uint32_t *  payload_end 
)
inline

Definition at line 72 of file Block.h.

73  : header_(h), payload_(payload_start, payload_end){};
std::vector< uint32_t > payload_
Definition: Block.h:96
BlockHeader header_
Definition: Block.h:94
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4
l1t::Block::Block ( unsigned int  id,
const std::vector< uint32_t > &  payload,
unsigned int  capID = 0,
unsigned int  flags = 0,
block_t  type = MP7 
)
inline

Definition at line 74 of file Block.h.

79  : header_(id, payload.size(), capID, flags, type), payload_(payload){};
std::vector< uint32_t > payload_
Definition: Block.h:96
const std::vector< uint32_t > & payload() const
Definition: Block.h:86
BlockHeader header_
Definition: Block.h:94

Member Function Documentation

void l1t::Block::amc ( const amc::Header h)
inline
amc::Header l1t::Block::amc ( ) const
inline

Definition at line 89 of file Block.h.

References amc_.

89 { return amc_; };
amc::Header amc_
Definition: Block.h:95
BxBlocks l1t::Block::getBxBlocks ( unsigned int  payloadWordsPerBx,
bool  bxHeader 
) const

Definition at line 40 of file Block.cc.

References payload_.

Referenced by l1t::stage2::RegionalMuonGMTUnpacker::unpack(), l1t::stage2::MuonUnpacker::unpack(), l1t::stage2::IntermediateMuonUnpacker::unpack(), l1t::stage2::BMTFUnpackerOutput::unpack(), and l1t::stage2::unpacking_bmtf().

40  {
41  BxBlocks bxBlocks;
42 
43  // For MP7 format
44  unsigned int wordsPerBx = payloadWordsPerBx;
45  if (bxHeader) {
46  ++wordsPerBx;
47  }
48  // Calculate how many BxBlock objects can be made with the available payload
49  unsigned int nBxBlocks = payload_.size() / wordsPerBx;
50  for (size_t bxCtr = 0; bxCtr < nBxBlocks; ++bxCtr) {
51  size_t startIdx = bxCtr * wordsPerBx;
52  auto startBxBlock = payload_.cbegin() + startIdx;
53  // Pick the words from the block payload that correspond to the BX and add a BxBlock to the BxBlocks
54  if (bxHeader) {
55  bxBlocks.emplace_back(startBxBlock, startBxBlock + wordsPerBx);
56  } else {
57  bxBlocks.emplace_back(bxCtr, nBxBlocks, startBxBlock, startBxBlock + wordsPerBx);
58  }
59  }
60 
61  return bxBlocks;
62  }
std::vector< uint32_t > payload_
Definition: Block.h:96
std::vector< BxBlock > BxBlocks
Definition: BxBlock.h:79
unsigned int l1t::Block::getSize ( ) const
inline

Definition at line 83 of file Block.h.

References payload_.

83 { return payload_.size() + 1; };
std::vector< uint32_t > payload_
Definition: Block.h:96
BlockHeader l1t::Block::header ( void  ) const
inline
bool l1t::Block::operator< ( const Block o) const
inline

Definition at line 81 of file Block.h.

References header().

81 { return header() < o.header(); };
BlockHeader header() const
Definition: Block.h:85
const std::vector<uint32_t>& l1t::Block::payload ( ) const
inline

Definition at line 86 of file Block.h.

References payload_.

Referenced by l1t::stage2::emtf::GEMBlockUnpacker::checkFormat(), l1t::stage2::emtf::CountersBlockUnpacker::checkFormat(), l1t::stage2::emtf::HeadersBlockUnpacker::checkFormat(), l1t::stage2::emtf::MEBlockUnpacker::checkFormat(), l1t::stage2::emtf::RPCBlockUnpacker::checkFormat(), l1t::stage2::emtf::SPBlockUnpacker::checkFormat(), l1t::stage2::emtf::TrailersBlockUnpacker::checkFormat(), process(), l1t::stage2::MPUnpacker_0x10010033::unpack(), l1t::stage1::HFRingUnpacker::unpack(), l1t::stage2::GlobalExtBlkUnpacker::unpack(), l1t::stage1::MissEtUnpacker::unpack(), l1t::stage2::MPUnpacker::unpack(), l1t::stage1::EtSumUnpacker::unpack(), l1t::stage2::MPUnpacker_0x10010010::unpack(), l1t::stage1::MissHtUnpacker::unpack(), l1t::stage2::CaloTowerUnpacker::unpack(), l1t::stage1::CaloSpareHFUnpacker::unpack(), l1t::stage2::GlobalAlgBlkUnpacker::unpack(), l1t::stage1::legacy::HFRingUnpacker::unpack(), l1t::stage1::legacy::EtSumUnpacker::unpack(), l1t::stage2::MPUnpacker_0x1001000b::unpack(), l1t::stage2::RegionalMuonGMTUnpacker::unpack(), l1t::stage2::CaloLayer1Unpacker::unpack(), l1t::stage2::JetUnpacker::unpack(), l1t::stage2::EtSumUnpacker_0x10010057::unpack(), l1t::stage2::TauUnpacker::unpack(), l1t::stage2::EtSumUnpacker::unpack(), l1t::stage2::EGammaUnpacker::unpack(), l1t::stage2::IntermediateMuonUnpacker::unpack(), l1t::stage2::MuonUnpacker::unpack(), l1t::stage2::emtf::CountersBlockUnpacker::unpack(), l1t::stage2::emtf::SPBlockUnpacker::unpack(), l1t::stage2::emtf::GEMBlockUnpacker::unpack(), l1t::stage2::emtf::HeadersBlockUnpacker::unpack(), l1t::stage2::emtf::TrailersBlockUnpacker::unpack(), l1t::stage2::emtf::MEBlockUnpacker::unpack(), l1t::stage2::emtf::RPCBlockUnpacker::unpack(), l1t::stage1::unpack_em(), and l1t::stage1::unpack_region().

86 { return payload_; };
std::vector< uint32_t > payload_
Definition: Block.h:96

Member Data Documentation

amc::Header l1t::Block::amc_
private

Definition at line 95 of file Block.h.

Referenced by amc().

BlockHeader l1t::Block::header_
private

Definition at line 94 of file Block.h.

Referenced by header().

std::vector<uint32_t> l1t::Block::payload_
private

Definition at line 96 of file Block.h.

Referenced by getBxBlocks(), getSize(), and payload().