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){};
const uint32_t * end_
Definition: Block.h:116
unsigned infra_
Definition: Block.h:119
const uint32_t * data_
Definition: Block.h:115
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:80
unsigned algo_
Definition: Block.h:118

◆ ~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.

References algo_.

105 { return algo_; };
unsigned algo_
Definition: Block.h:118

◆ getBlock()

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

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

Definition at line 64 of file Block.cc.

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

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  }
Log< level::Error, false > LogError
const uint32_t * end_
Definition: Block.h:116
virtual std::unique_ptr< Block > getBlock()
Definition: Block.cc:64
Definition: Electron.h:6
#define LogTrace(id)
virtual BlockHeader getHeader()=0
virtual unsigned getHeaderSize() const =0
const uint32_t * data_
Definition: Block.h:115
#define LogDebug(id)

◆ 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.

References infra_.

106 { return infra_; };
unsigned infra_
Definition: Block.h:119

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