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 210 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_.

210  : Payload(data, end), amcHeader_(amcHeader)
211  {
212  if (not (*data_ == 0xA110CA7E) ) {
213  edm::LogError("L1T") << "CTP7 block with invalid header:" << std::hex << *data_;
214  }
215  ++data_;
216  bx_per_l1a_ = (*data_ >> 16) & 0xff;
217  calo_bxid_ = *data_ & 0xfff;
218  capId_ = 0;
219  if (bx_per_l1a_ > 1) {
220  edm::LogInfo("L1T") << "CTP7 block with multiple bunch crossings:" << bx_per_l1a_;
221  }
223  infra_ = 0;
224  ++data_;
225  }
unsigned capId_
Definition: Block.h:135
#define end
Definition: vmac.h:37
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 241 of file Block.cc.

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

242  {
243  if (end_ - data_ < getHeaderSize()) {
244  LogDebug("L1T") << "Reached end of payload";
245  return std::auto_ptr<Block>();
246  }
247  if ( capId_ > bx_per_l1a_ ) {
248  edm::LogWarning("L1T") << "CTP7 with more bunch crossings than expected";
249  }
250 
251  auto header = getHeader();
252 
253  if (end_ - data_ < header.getSize()) {
254  edm::LogError("L1T")
255  << "Expecting a block size of " << header.getSize()
256  << " but only " << (end_ - data_) << " words remaining";
257  return std::auto_ptr<Block>();
258  }
259 
260  LogTrace("L1T") << "Creating block with size " << header.getSize();
261 
262  auto res = std::unique_ptr<Block>(new Block(header, data_, data_ + header.getSize()));
263  data_ += header.getSize();
264  capId_++;
265  return res;
266  }
#define LogDebug(id)
BlockHeader getHeader() override
Definition: Block.cc:228
unsigned getHeaderSize() const override
Definition: Block.h:126
const uint32_t * end_
Definition: Block.h:88
Definition: Electron.h:4
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
BlockHeader l1t::CTP7Payload::getHeader ( )
overridevirtual

Implements l1t::Payload.

Definition at line 228 of file Block.cc.

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

Referenced by getBlock().

229  {
230  // only one block type, use dummy id
231  unsigned blockId = 0;
232  // CTP7 header contains number of BX in payload and the bunch crossing ID
233  // Not sure how to map to generic BlockHeader variables, so just packing
234  // it all in flags variable
235  unsigned blockFlags = ((bx_per_l1a_&0xf)<<16) | (calo_bxid_&0xfff);
236  unsigned blockSize = 192;
237  return BlockHeader(blockId, blockSize, capId_, blockFlags, CTP7);
238  }
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.