CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
l1t::Block Class Reference

#include <Block.h>

Public Member Functions

amc::Header amc () const
 
void amc (const amc::Header &h)
 
 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 54 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 56 of file Block.h.

57  : header_(h), payload_(payload_start, payload_end){};

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

63  : header_(id, payload.size(), capID, flags, type), payload_(payload){};

Member Function Documentation

◆ amc() [1/2]

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

Definition at line 73 of file Block.h.

73 { return amc_; };

References amc_.

◆ amc() [2/2]

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

Definition at line 72 of file Block.h.

72 { amc_ = h; };

References amc_, and h.

◆ getBxBlocks()

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

Definition at line 42 of file Block.cc.

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

References payload_.

◆ getSize()

unsigned int l1t::Block::getSize ( ) const
inline

Definition at line 67 of file Block.h.

67 { return payload_.size() + 1; };

References payload_.

◆ header()

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

Definition at line 69 of file Block.h.

69 { return header_; };

References header_.

Referenced by operator<().

◆ operator<()

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

Definition at line 65 of file Block.h.

65 { return header() < o.header(); };

References header(), and EcalTangentSkim_cfg::o.

◆ payload()

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

Definition at line 70 of file Block.h.

70 { return payload_; };

References payload_.

Member Data Documentation

◆ amc_

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

Definition at line 79 of file Block.h.

Referenced by amc().

◆ header_

BlockHeader l1t::Block::header_
private

Definition at line 78 of file Block.h.

Referenced by header().

◆ payload_

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

Definition at line 80 of file Block.h.

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

h
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
Definition: L1TUtmAlgorithmRcd.h:4
EcalTangentSkim_cfg.o
o
Definition: EcalTangentSkim_cfg.py:36
l1t::Block::header_
BlockHeader header_
Definition: Block.h:78
h
l1t::Block::payload
const std::vector< uint32_t > & payload() const
Definition: Block.h:70
type
type
Definition: HCALResponse.h:21
l1t::Block::amc_
amc::Header amc_
Definition: Block.h:79
l1t::Block::payload_
std::vector< uint32_t > payload_
Definition: Block.h:80
HLT_2018_cff.flags
flags
Definition: HLT_2018_cff.py:11758
l1t::Block::header
BlockHeader header() const
Definition: Block.h:69
l1t::BxBlocks
std::vector< BxBlock > BxBlocks
Definition: BxBlock.h:79