CMS 3D CMS Logo

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 48 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 50 of file Block.h.

50  :
51  header_(h), payload_(payload_start, payload_end) {};
std::vector< uint32_t > payload_
Definition: Block.h:69
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
BlockHeader header_
Definition: Block.h:67
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 52 of file Block.h.

52  :
53  header_(id, payload.size(), capID, flags, type), payload_(payload) {};
type
Definition: HCALResponse.h:21
std::vector< uint32_t > payload_
Definition: Block.h:69
const std::vector< uint32_t > & payload() const
Definition: Block.h:60
std::vector< Variable::Flags > flags
Definition: MVATrainer.cc:135
BlockHeader header_
Definition: Block.h:67

Member Function Documentation

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

Definition at line 63 of file Block.h.

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

Definition at line 47 of file Block.cc.

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

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

Definition at line 57 of file Block.h.

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

Definition at line 55 of file Block.h.

References header(), and RecoTauValidation_cfi::header.

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

Definition at line 60 of file Block.h.

Referenced by 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::MPUnpacker::unpack(), l1t::stage2::GlobalExtBlkUnpacker::unpack(), l1t::stage1::MissEtUnpacker::unpack(), l1t::stage1::EtSumUnpacker::unpack(), l1t::stage1::MissHtUnpacker::unpack(), l1t::stage2::MPUnpacker_0x10010010::unpack(), l1t::stage2::CaloTowerUnpacker::unpack(), l1t::stage1::CaloSpareHFUnpacker::unpack(), l1t::stage2::GlobalAlgBlkUnpacker::unpack(), l1t::stage2::MPUnpacker_0x1001000b::unpack(), l1t::stage1::legacy::EtSumUnpacker::unpack(), l1t::stage1::legacy::HFRingUnpacker::unpack(), l1t::stage2::RegionalMuonGMTUnpacker::unpack(), l1t::stage2::CaloLayer1Unpacker::unpack(), l1t::stage2::EtSumUnpacker_0x10010057::unpack(), l1t::stage2::JetUnpacker::unpack(), l1t::stage2::EGammaUnpacker::unpack(), l1t::stage2::TauUnpacker::unpack(), l1t::stage2::EtSumUnpacker::unpack(), l1t::stage2::MuonUnpacker::unpack(), l1t::stage2::IntermediateMuonUnpacker::unpack(), l1t::stage2::emtf::MEBlockUnpacker::unpack(), l1t::stage2::emtf::TrailersBlockUnpacker::unpack(), l1t::stage2::emtf::SPBlockUnpacker::unpack(), l1t::stage2::emtf::HeadersBlockUnpacker::unpack(), l1t::stage2::emtf::CountersBlockUnpacker::unpack(), l1t::stage2::emtf::RPCBlockUnpacker::unpack(), l1t::stage1::unpack_em(), and l1t::stage1::unpack_region().

60 { return payload_; };
std::vector< uint32_t > payload_
Definition: Block.h:69

Member Data Documentation

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

Definition at line 68 of file Block.h.

BlockHeader l1t::Block::header_
private

Definition at line 67 of file Block.h.

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

Definition at line 69 of file Block.h.