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

Constructor & Destructor Documentation

◆ CTP7Payload()

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

Definition at line 205 of file Block.cc.

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

206  : Payload(data, end), amcHeader_(amcHeader) {
207  if (not(*data_ == 0xA110CA7E)) {
208  edm::LogError("L1T") << "CTP7 block with invalid header:" << std::hex << *data_;
209  }
210  ++data_;
211  bx_per_l1a_ = (*data_ >> 16) & 0xff;
212  calo_bxid_ = *data_ & 0xfff;
213  capId_ = 0;
214  six_hcal_feature_bits_ = (*data_ >> 15) & 0x1;
215  if (bx_per_l1a_ > 1) {
216  edm::LogInfo("L1T") << "CTP7 block with multiple bunch crossings:" << bx_per_l1a_;
217  }
219  infra_ = 0;
220  ++data_;
221  }
Log< level::Error, false > LogError
unsigned six_hcal_feature_bits_
Definition: Block.h:188
unsigned capId_
Definition: Block.h:185
unsigned int getUserData() const
Definition: AMCSpec.h:77
unsigned infra_
Definition: Block.h:119
Log< level::Info, false > LogInfo
const uint32_t * data_
Definition: Block.h:115
unsigned calo_bxid_
Definition: Block.h:187
unsigned bx_per_l1a_
Definition: Block.h:186
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
amc::Header amcHeader_
Definition: Block.h:189
unsigned algo_
Definition: Block.h:118
Payload(const uint32_t *data, const uint32_t *end)
Definition: Block.h:103

Member Function Documentation

◆ getBlock()

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

Reimplemented from l1t::Payload.

Definition at line 234 of file Block.cc.

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

234  {
235  if (end_ - data_ < getHeaderSize()) {
236  LogDebug("L1T") << "Reached end of payload";
237  return std::unique_ptr<Block>();
238  }
239  if (capId_ > bx_per_l1a_) {
240  edm::LogWarning("L1T") << "CTP7 with more bunch crossings than expected";
241  }
242 
243  auto header = getHeader();
244 
245  if (end_ - data_ < header.getSize()) {
246  edm::LogError("L1T") << "Expecting a block size of " << header.getSize() << " but only " << (end_ - data_)
247  << " words remaining";
248  return std::unique_ptr<Block>();
249  }
250 
251  LogTrace("L1T") << "Creating block with size " << header.getSize();
252 
253  auto res = std::make_unique<Block>(header, data_, data_ + header.getSize());
254  data_ += header.getSize();
255  capId_++;
256  return res;
257  }
unsigned getHeaderSize() const override
Definition: Block.h:175
BlockHeader getHeader() override
Definition: Block.cc:223
Log< level::Error, false > LogError
const uint32_t * end_
Definition: Block.h:116
Definition: Electron.h:6
#define LogTrace(id)
unsigned capId_
Definition: Block.h:185
const uint32_t * data_
Definition: Block.h:115
unsigned bx_per_l1a_
Definition: Block.h:186
Log< level::Warning, false > LogWarning
#define LogDebug(id)

◆ getHeader()

BlockHeader l1t::CTP7Payload::getHeader ( )
overridevirtual

Implements l1t::Payload.

Definition at line 223 of file Block.cc.

References bx_per_l1a_, calo_bxid_, capId_, l1t::CTP7, createfilelist::int, and six_hcal_feature_bits_.

Referenced by getBlock().

223  {
224  // only one block type, use dummy id
225  unsigned blockId = 0;
226  // CTP7 header contains number of BX in payload and the bunch crossing ID
227  // Not sure how to map to generic BlockHeader variables, so just packing
228  // it all in flags variable
229  unsigned blockFlags = ((bx_per_l1a_ & 0xf) << 16) | (calo_bxid_ & 0xfff) | ((six_hcal_feature_bits_ & 0x1) << 15);
230  unsigned blockSize = (192 + (int)six_hcal_feature_bits_ * 28) * (int)bx_per_l1a_;
231  return BlockHeader(blockId, blockSize, capId_, blockFlags, CTP7);
232  }
unsigned six_hcal_feature_bits_
Definition: Block.h:188
unsigned capId_
Definition: Block.h:185
unsigned calo_bxid_
Definition: Block.h:187
unsigned bx_per_l1a_
Definition: Block.h:186

◆ getHeaderSize()

unsigned l1t::CTP7Payload::getHeaderSize ( ) const
inlineoverridevirtual

Implements l1t::Payload.

Definition at line 175 of file Block.h.

Referenced by getBlock().

175 { return 2; };

Member Data Documentation

◆ amcHeader_

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

Definition at line 189 of file Block.h.

Referenced by CTP7Payload().

◆ bx_per_l1a_

unsigned l1t::CTP7Payload::bx_per_l1a_
private

Definition at line 186 of file Block.h.

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

◆ calo_bxid_

unsigned l1t::CTP7Payload::calo_bxid_
private

Definition at line 187 of file Block.h.

Referenced by CTP7Payload(), and getHeader().

◆ capId_

unsigned l1t::CTP7Payload::capId_
private

Definition at line 185 of file Block.h.

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

◆ six_hcal_feature_bits_

unsigned l1t::CTP7Payload::six_hcal_feature_bits_
private

Definition at line 188 of file Block.h.

Referenced by CTP7Payload(), and getHeader().

◆ size_

unsigned l1t::CTP7Payload::size_
private

Definition at line 184 of file Block.h.

◆ size_mask

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

Definition at line 181 of file Block.h.

◆ size_shift

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

Definition at line 182 of file Block.h.