CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Attributes
l1t::Payload Class Referenceabstract

#include <Block.h>

Inheritance diagram for l1t::Payload:
l1t::CTP7Payload l1t::MP7Payload l1t::MTF7Payload

Public Member Functions

virtual unsigned getAlgorithmFWVersion () const
 
virtual std::unique_ptr< BlockgetBlock ()
 
virtual BlockHeader getHeader ()=0
 
virtual unsigned getHeaderSize () const =0
 
virtual unsigned getInfrastructureFWVersion () const
 
 Payload (const uint32_t *data, const uint32_t *end)
 
virtual ~Payload ()
 

Protected Attributes

unsigned algo_
 
const uint32_t * data_
 
const uint32_t * end_
 
unsigned infra_
 

Detailed Description

Definition at line 101 of file Block.h.

Constructor & Destructor Documentation

◆ Payload()

l1t::Payload::Payload ( const uint32_t *  data,
const uint32_t *  end 
)
inline

Definition at line 103 of file Block.h.

103 : data_(data), end_(end), algo_(0), infra_(0){};

◆ ~Payload()

virtual l1t::Payload::~Payload ( )
inlinevirtual

Definition at line 104 of file Block.h.

104 {};

Member Function Documentation

◆ getAlgorithmFWVersion()

virtual unsigned l1t::Payload::getAlgorithmFWVersion ( ) const
inlinevirtual

Definition at line 105 of file Block.h.

105 { return algo_; };

References algo_.

◆ getBlock()

std::unique_ptr< Block > l1t::Payload::getBlock ( )
virtual

Reimplemented in l1t::CTP7Payload, and l1t::MTF7Payload.

Definition at line 64 of file Block.cc.

64  {
65  if (end_ - data_ < getHeaderSize()) {
66  LogDebug("L1T") << "Reached end of payload";
67  return std::unique_ptr<Block>();
68  }
69 
70  if (data_[0] == 0xffffffff) {
71  LogDebug("L1T") << "Skipping padding word";
72  ++data_;
73  return getBlock();
74  }
75 
76  auto header = getHeader();
77 
78  if (end_ - data_ < header.getSize()) {
79  edm::LogError("L1T") << "Expecting a block size of " << header.getSize() << " but only " << (end_ - data_)
80  << " words remaining";
81  return std::unique_ptr<Block>();
82  }
83 
84  LogTrace("L1T") << "Creating block with size " << header.getSize();
85 
86  auto res = std::make_unique<Block>(header, data_, data_ + header.getSize());
87  data_ += header.getSize();
88  return res;
89  }

References data_, end_, getHeader(), getHeaderSize(), RecoTauValidation_cfi::header, LogDebug, and LogTrace.

◆ getHeader()

virtual BlockHeader l1t::Payload::getHeader ( )
pure virtual

Implemented in l1t::CTP7Payload, l1t::MTF7Payload, and l1t::MP7Payload.

Referenced by getBlock().

◆ getHeaderSize()

virtual unsigned l1t::Payload::getHeaderSize ( ) const
pure virtual

Implemented in l1t::CTP7Payload, l1t::MTF7Payload, and l1t::MP7Payload.

Referenced by getBlock().

◆ getInfrastructureFWVersion()

virtual unsigned l1t::Payload::getInfrastructureFWVersion ( ) const
inlinevirtual

Definition at line 106 of file Block.h.

106 { return infra_; };

References infra_.

Member Data Documentation

◆ algo_

unsigned l1t::Payload::algo_
protected

◆ data_

const uint32_t* l1t::Payload::data_
protected

◆ end_

const uint32_t* l1t::Payload::end_
protected

◆ infra_

unsigned l1t::Payload::infra_
protected
l1t::Payload::end_
const uint32_t * end_
Definition: Block.h:116
l1t::Payload::getBlock
virtual std::unique_ptr< Block > getBlock()
Definition: Block.cc:64
l1t::Payload::infra_
unsigned infra_
Definition: Block.h:119
l1t::Payload::getHeader
virtual BlockHeader getHeader()=0
l1t::Payload::getHeaderSize
virtual unsigned getHeaderSize() const =0
mps_fire.end
end
Definition: mps_fire.py:242
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:233
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
res
Definition: Electron.h:6
data
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
l1t::Payload::data_
const uint32_t * data_
Definition: Block.h:115
RecoTauValidation_cfi.header
header
Definition: RecoTauValidation_cfi.py:291
LogTrace
#define LogTrace(id)
Definition: MessageLogger.h:234
l1t::Payload::algo_
unsigned algo_
Definition: Block.h:118