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

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  if (bx_per_l1a_ > 1) {
215  edm::LogInfo("L1T") << "CTP7 block with multiple bunch crossings:" << bx_per_l1a_;
216  }
218  infra_ = 0;
219  ++data_;
220  }

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

Member Function Documentation

◆ getBlock()

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

Reimplemented from l1t::Payload.

Definition at line 233 of file Block.cc.

233  {
234  if (end_ - data_ < getHeaderSize()) {
235  LogDebug("L1T") << "Reached end of payload";
236  return std::unique_ptr<Block>();
237  }
238  if (capId_ > bx_per_l1a_) {
239  edm::LogWarning("L1T") << "CTP7 with more bunch crossings than expected";
240  }
241 
242  auto header = getHeader();
243 
244  if (end_ - data_ < header.getSize()) {
245  edm::LogError("L1T") << "Expecting a block size of " << header.getSize() << " but only " << (end_ - data_)
246  << " words remaining";
247  return std::unique_ptr<Block>();
248  }
249 
250  LogTrace("L1T") << "Creating block with size " << header.getSize();
251 
252  auto res = std::make_unique<Block>(header, data_, data_ + header.getSize());
253  data_ += header.getSize();
254  capId_++;
255  return res;
256  }

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

◆ getHeader()

BlockHeader l1t::CTP7Payload::getHeader ( )
overridevirtual

Implements l1t::Payload.

Definition at line 222 of file Block.cc.

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

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

Referenced by getBlock().

◆ getHeaderSize()

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

Implements l1t::Payload.

Definition at line 175 of file Block.h.

175 { return 2; };

Referenced by getBlock().

Member Data Documentation

◆ amcHeader_

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

Definition at line 188 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().

◆ size_

unsigned l1t::CTP7Payload::size_
private

Definition at line 184 of file Block.h.

◆ size_mask

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

Definition at line 181 of file Block.h.

◆ size_shift

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

Definition at line 182 of file Block.h.

l1t::CTP7
Definition: Block.h:11
l1t::CTP7Payload::getHeaderSize
unsigned getHeaderSize() const override
Definition: Block.h:175
l1t::Payload::end_
const uint32_t * end_
Definition: Block.h:116
l1t::Payload::Payload
Payload(const uint32_t *data, const uint32_t *end)
Definition: Block.h:103
l1t::CTP7Payload::getHeader
BlockHeader getHeader() override
Definition: Block.cc:222
l1t::CTP7Payload::bx_per_l1a_
unsigned bx_per_l1a_
Definition: Block.h:186
edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
l1t::CTP7Payload::calo_bxid_
unsigned calo_bxid_
Definition: Block.h:187
edm::LogWarning
Log< level::Warning, false > LogWarning
Definition: MessageLogger.h:122
amc::Header::getUserData
unsigned int getUserData() const
Definition: AMCSpec.h:77
l1t::Payload::infra_
unsigned infra_
Definition: Block.h:119
mps_fire.end
end
Definition: mps_fire.py:242
l1t::CTP7Payload::amcHeader_
amc::Header amcHeader_
Definition: Block.h:188
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:233
createfilelist.int
int
Definition: createfilelist.py:10
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
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:115
RecoTauValidation_cfi.header
header
Definition: RecoTauValidation_cfi.py:291
LogTrace
#define LogTrace(id)
Definition: MessageLogger.h:234
l1t::CTP7Payload::capId_
unsigned capId_
Definition: Block.h:185
l1t::Payload::algo_
unsigned algo_
Definition: Block.h:118