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

Constructor & Destructor Documentation

◆ Payload()

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

Definition at line 87 of file Block.h.

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

◆ ~Payload()

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

Definition at line 88 of file Block.h.

88 {};

Member Function Documentation

◆ getAlgorithmFWVersion()

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

Definition at line 89 of file Block.h.

89 { return algo_; };

References algo_.

◆ getBlock()

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

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

Definition at line 66 of file Block.cc.

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

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

90 { 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:100
l1t::Payload::getBlock
virtual std::unique_ptr< Block > getBlock()
Definition: Block.cc:66
end
#define end
Definition: vmac.h:39
l1t::Payload::infra_
unsigned infra_
Definition: Block.h:103
l1t::Payload::getHeader
virtual BlockHeader getHeader()=0
l1t::Payload::getHeaderSize
virtual unsigned getHeaderSize() const =0
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:670
edm::LogError
Definition: MessageLogger.h:183
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:99
RecoTauValidation_cfi.header
header
Definition: RecoTauValidation_cfi.py:292
LogTrace
#define LogTrace(id)
Definition: MessageLogger.h:671
l1t::Payload::algo_
unsigned algo_
Definition: Block.h:102