CMS 3D CMS Logo

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

#include <Block.h>

Inheritance diagram for l1t::CTP7Payload:
l1t::Payload

Public Member Functions

 CTP7Payload (const uint32_t *data, const uint32_t *end, amc::Header amcHeader)
 
std::unique_ptr< BlockgetBlock () override
 
BlockHeader getHeader () override
 
unsigned getHeaderSize () const override
 
- Public Member Functions inherited from l1t::Payload
virtual unsigned getAlgorithmFWVersion () const
 
virtual unsigned getInfrastructureFWVersion () const
 
 Payload (const uint32_t *data, const uint32_t *end)
 
virtual ~Payload ()
 

Private Attributes

amc::Header amcHeader_
 
unsigned bx_per_l1a_
 
unsigned calo_bxid_
 
unsigned capId_
 
unsigned size_
 

Static Private Attributes

static constexpr unsigned size_mask = 0xff
 
static constexpr unsigned size_shift = 16
 

Additional Inherited Members

- Protected Attributes inherited from l1t::Payload
unsigned algo_
 
const uint32_t * data_
 
const uint32_t * end_
 
unsigned infra_
 

Detailed Description

Definition at line 123 of file Block.h.

Constructor & Destructor Documentation

l1t::CTP7Payload::CTP7Payload ( const uint32_t *  data,
const uint32_t *  end,
amc::Header  amcHeader 
)

Definition at line 225 of file Block.cc.

References l1t::Payload::algo_, amcHeader_, bx_per_l1a_, calo_bxid_, capId_, l1t::Payload::data_, amc::Header::getUserData(), and l1t::Payload::infra_.

225  : Payload(data, end), amcHeader_(amcHeader)
226  {
227  if (not (*data_ == 0xA110CA7E) ) {
228  edm::LogError("L1T") << "CTP7 block with invalid header:" << std::hex << *data_;
229  }
230  ++data_;
231  bx_per_l1a_ = (*data_ >> 16) & 0xff;
232  calo_bxid_ = *data_ & 0xfff;
233  capId_ = 0;
234  if (bx_per_l1a_ > 1) {
235  edm::LogInfo("L1T") << "CTP7 block with multiple bunch crossings:" << bx_per_l1a_;
236  }
238  infra_ = 0;
239  ++data_;
240  }
unsigned capId_
Definition: Block.h:135
#define end
Definition: vmac.h:39
unsigned infra_
Definition: Block.h:91
const uint32_t * data_
Definition: Block.h:87
unsigned calo_bxid_
Definition: Block.h:137
unsigned int getUserData() const
Definition: AMCSpec.h:72
unsigned bx_per_l1a_
Definition: Block.h:136
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
amc::Header amcHeader_
Definition: Block.h:138
unsigned algo_
Definition: Block.h:90
Payload(const uint32_t *data, const uint32_t *end)
Definition: Block.h:76

Member Function Documentation

std::unique_ptr< Block > l1t::CTP7Payload::getBlock ( )
overridevirtual

Reimplemented from l1t::Payload.

Definition at line 256 of file Block.cc.

References bx_per_l1a_, capId_, l1t::Payload::data_, l1t::Payload::end_, getHeader(), getHeaderSize(), RecoTauValidation_cfi::header, LogDebug, LogTrace, and eostools::move().

257  {
258  if (end_ - data_ < getHeaderSize()) {
259  LogDebug("L1T") << "Reached end of payload";
260  return std::move(std::unique_ptr<Block>());
261  }
262  if ( capId_ > bx_per_l1a_ ) {
263  edm::LogWarning("L1T") << "CTP7 with more bunch crossings than expected";
264  }
265 
266  auto header = getHeader();
267 
268  if (end_ - data_ < header.getSize()) {
269  edm::LogError("L1T")
270  << "Expecting a block size of " << header.getSize()
271  << " but only " << (end_ - data_) << " words remaining";
272  return std::move(std::unique_ptr<Block>());
273  }
274 
275  LogTrace("L1T") << "Creating block with size " << header.getSize();
276 
277  auto res = std::unique_ptr<Block>(new Block(header, data_, data_ + header.getSize()));
278  data_ += header.getSize();
279  capId_++;
280  return std::move(res);
281  }
#define LogDebug(id)
BlockHeader getHeader() override
Definition: Block.cc:243
unsigned getHeaderSize() const override
Definition: Block.h:126
const uint32_t * end_
Definition: Block.h:88
Definition: Electron.h:6
unsigned capId_
Definition: Block.h:135
#define LogTrace(id)
const uint32_t * data_
Definition: Block.h:87
unsigned bx_per_l1a_
Definition: Block.h:136
def move(src, dest)
Definition: eostools.py:511
BlockHeader l1t::CTP7Payload::getHeader ( )
overridevirtual

Implements l1t::Payload.

Definition at line 243 of file Block.cc.

References bx_per_l1a_, calo_bxid_, capId_, and l1t::CTP7.

Referenced by getBlock().

244  {
245  // only one block type, use dummy id
246  unsigned blockId = 0;
247  // CTP7 header contains number of BX in payload and the bunch crossing ID
248  // Not sure how to map to generic BlockHeader variables, so just packing
249  // it all in flags variable
250  unsigned blockFlags = ((bx_per_l1a_&0xf)<<16) | (calo_bxid_&0xfff);
251  unsigned blockSize = 192;
252  return BlockHeader(blockId, blockSize, capId_, blockFlags, CTP7);
253  }
unsigned capId_
Definition: Block.h:135
unsigned calo_bxid_
Definition: Block.h:137
unsigned bx_per_l1a_
Definition: Block.h:136
unsigned l1t::CTP7Payload::getHeaderSize ( ) const
inlineoverridevirtual

Implements l1t::Payload.

Definition at line 126 of file Block.h.

Referenced by getBlock().

126 { return 2; };

Member Data Documentation

amc::Header l1t::CTP7Payload::amcHeader_
private

Definition at line 138 of file Block.h.

Referenced by CTP7Payload().

unsigned l1t::CTP7Payload::bx_per_l1a_
private

Definition at line 136 of file Block.h.

Referenced by CTP7Payload(), getBlock(), and getHeader().

unsigned l1t::CTP7Payload::calo_bxid_
private

Definition at line 137 of file Block.h.

Referenced by CTP7Payload(), and getHeader().

unsigned l1t::CTP7Payload::capId_
private

Definition at line 135 of file Block.h.

Referenced by CTP7Payload(), getBlock(), and getHeader().

unsigned l1t::CTP7Payload::size_
private

Definition at line 134 of file Block.h.

constexpr unsigned l1t::CTP7Payload::size_mask = 0xff
staticprivate

Definition at line 131 of file Block.h.

constexpr unsigned l1t::CTP7Payload::size_shift = 16
staticprivate

Definition at line 132 of file Block.h.