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

Constructor & Destructor Documentation

◆ Block() [1/2]

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

◆ Block() [2/2]

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
BlockHeader header_
Definition: Block.h:94
const std::vector< uint32_t > & payload() const
Definition: Block.h:86

Member Function Documentation

◆ amc() [1/2]

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

Definition at line 88 of file Block.h.

References amc_, and h.

88 { amc_ = h; };
amc::Header amc_
Definition: Block.h:95
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4

◆ amc() [2/2]

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

◆ getBxBlocks()

BxBlocks l1t::Block::getBxBlocks ( unsigned int  payloadWordsPerBx,
bool  bxHeader 
) const

Definition at line 40 of file Block.cc.

References payload_.

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

◆ getSize()

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

◆ header()

BlockHeader l1t::Block::header ( void  ) const
inline

Definition at line 85 of file Block.h.

References header_.

Referenced by operator<().

85 { return header_; };
BlockHeader header_
Definition: Block.h:94

◆ operator<()

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

Definition at line 81 of file Block.h.

References header(), and EcalTangentSkim_cfg::o.

81 { return header() < o.header(); };
BlockHeader header() const
Definition: Block.h:85

◆ payload()

const std::vector<uint32_t>& l1t::Block::payload ( ) const
inline

Definition at line 86 of file Block.h.

References payload_.

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

Member Data Documentation

◆ amc_

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

Definition at line 95 of file Block.h.

Referenced by amc().

◆ header_

BlockHeader l1t::Block::header_
private

Definition at line 94 of file Block.h.

Referenced by header().

◆ payload_

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

Definition at line 96 of file Block.h.

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