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

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

Member Function Documentation

◆ amc() [1/2]

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

Definition at line 89 of file Block.h.

89 { return amc_; };

References amc_.

◆ amc() [2/2]

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

Definition at line 88 of file Block.h.

88 { amc_ = h; };

References amc_, and h.

◆ getBxBlocks()

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

Definition at line 40 of file Block.cc.

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  }

References payload_.

◆ getSize()

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

Definition at line 83 of file Block.h.

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

References payload_.

◆ header()

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

Definition at line 85 of file Block.h.

85 { return header_; };

References header_.

Referenced by operator<().

◆ operator<()

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

Definition at line 81 of file Block.h.

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

References header(), and EcalTangentSkim_cfg::o.

◆ payload()

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

Definition at line 86 of file Block.h.

86 { return payload_; };

References payload_.

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().

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:94
h
gainCalibHelper::gainCalibPI::type
type
Definition: SiPixelGainCalibHelper.h:39
l1t::Block::payload
const std::vector< uint32_t > & payload() const
Definition: Block.h:86
l1t::Block::amc_
amc::Header amc_
Definition: Block.h:95
l1t::Block::payload_
std::vector< uint32_t > payload_
Definition: Block.h:96
HLT_FULL_cff.flags
flags
Definition: HLT_FULL_cff.py:13150
l1t::Block::header
BlockHeader header() const
Definition: Block.h:85
l1t::BxBlocks
std::vector< BxBlock > BxBlocks
Definition: BxBlock.h:79