CMS 3D CMS Logo

Enumerations | Functions
hgcal::backend Namespace Reference

Enumerations

enum  ECONDPacketStatus {
  Normal = 0x0, PayloadCRCError = 0x1, EventIDMismatch = 0x2, EBTimeout = 0x4,
  BCIDOrbitIDMismatch = 0x5, MainBufferOverflow = 0x6, InactiveECOND = 0x7
}
 
enum  SlinkEmulationFlag { Subsystem = 0, SlinkRocketSenderCore = 1, DTH = 2 }
 

Functions

std::vector< uint32_t > buildCaptureBlockHeader (uint32_t bunch_crossing, uint32_t event_counter, uint32_t orbit_counter, const std::vector< ECONDPacketStatus > &econd_statuses)
 
uint32_t buildSlinkContentId (SlinkEmulationFlag, uint8_t l1a_subtype, uint16_t l1a_fragment_cnt)
 
std::vector< uint32_t > buildSlinkHeader (uint8_t boe, uint8_t v, uint64_t global_event_id, uint32_t content_id, uint32_t fed_id)
 
uint16_t buildSlinkRocketStatus (bool fed_crc_err, bool slinkrocket_crc_err, bool source_id_err, bool sync_lost, bool fragment_trunc)
 
std::vector< uint32_t > buildSlinkTrailer (uint8_t eoe, uint16_t daqcrc, uint32_t event_length, uint16_t bxid, uint32_t orbit_id, uint16_t crc, uint16_t status)
 

Enumeration Type Documentation

◆ ECONDPacketStatus

◆ SlinkEmulationFlag

Function Documentation

◆ buildCaptureBlockHeader()

std::vector< uint32_t > hgcal::backend::buildCaptureBlockHeader ( uint32_t  bunch_crossing,
uint32_t  event_counter,
uint32_t  orbit_counter,
const std::vector< ECONDPacketStatus > &  econd_statuses 
)

builds the capture block header (see page 16 of "HGCAL BE DAQ firmware description")

Returns
a vector of size 2 with the 2 32b words of the capture block header

Definition at line 164 of file HGCalRawDataPackingTools.cc.

References hgcal::CAPTUREBLOCK_BC_MASK, hgcal::CAPTUREBLOCK_BC_POS, hgcal::CAPTUREBLOCK_EC_MASK, hgcal::CAPTUREBLOCK_EC_POS, hgcal::CAPTUREBLOCK_OC_MASK, hgcal::CAPTUREBLOCK_OC_POS, RecoTauValidation_cfi::header, mps_fire::i, and testProducerWithPsetDescEmpty_cfi::x1.

Referenced by hgcal::HGCalFrameGenerator::produceCaptureBlockEvent().

168  {
169  if (econd_statuses.size() > 12)
170  throw cms::Exception("HGCalEmulator") << "Invalid size for ECON-D statuses: " << econd_statuses.size() << ".";
171  std::vector<uint32_t> header(2, 0);
172  header[0] =
176  (econd_statuses[11] & 0x7) << 1 | ((econd_statuses[10] >> 2) & 0x1);
177  for (size_t i = 0; i < 11; i++)
178  header[1] |= (econd_statuses[i] & 0x7) << i * 3;
179  return header;
180 }

◆ buildSlinkContentId()

uint32_t hgcal::backend::buildSlinkContentId ( SlinkEmulationFlag  e,
uint8_t  l1a_subtype,
uint16_t  l1a_fragment_cnt 
)

builds the slink rocket event data content ID

Returns
a 32b word

Definition at line 219 of file HGCalRawDataPackingTools.cc.

References MillePedeFileConverter_cfg::e.

Referenced by hgcal::HGCalFrameGenerator::produceSlinkEvent().

219  {
220  return 0x0 | (l1a_fragment_cnt & 0xffff) | (l1a_subtype & 0xff) << 16 | (e & 0x3) << 24;
221 }

◆ buildSlinkHeader()

std::vector< uint32_t > hgcal::backend::buildSlinkHeader ( uint8_t  boe,
uint8_t  v,
uint64_t  global_event_id,
uint32_t  content_id,
uint32_t  fed_id 
)

builds the slink frame header (128 bits header = 4 words)

Returns
a vector with 4 32b words

Definition at line 183 of file HGCalRawDataPackingTools.cc.

References RecoTauValidation_cfi::header, hgcal::SLINK_BOE_MASK, hgcal::SLINK_BOE_POS, hgcal::SLINK_CONTENTID_MASK, hgcal::SLINK_CONTENTID_POS, hgcal::SLINK_GLOBAL_EVENTID_LSB_MASK, hgcal::SLINK_GLOBAL_EVENTID_MSB_MASK, hgcal::SLINK_GLOBAL_EVENTID_MSB_POS, hgcal::SLINK_SOURCEID_MASK, hgcal::SLINK_SOURCEID_POS, hgcal::SLINK_V_MASK, hgcal::SLINK_V_POS, and findQualityFiles::v.

Referenced by hgcal::HGCalFrameGenerator::produceSlinkEvent().

184  {
185  std::vector<uint32_t> header(4, 0);
188  ((global_event_id >> 41) & SLINK_GLOBAL_EVENTID_MSB_MASK)
190  header[1] = (global_event_id & SLINK_GLOBAL_EVENTID_LSB_MASK);
193 
194  return header;
195 }

◆ buildSlinkRocketStatus()

uint16_t hgcal::backend::buildSlinkRocketStatus ( bool  fed_crc_err,
bool  slinkrocket_crc_err,
bool  source_id_err,
bool  sync_lost,
bool  fragment_trunc 
)

builds the SlinkRocket sender core status field

Returns
a 16b word

Definition at line 223 of file HGCalRawDataPackingTools.cc.

References testProducerWithPsetDescEmpty_cfi::x1.

Referenced by hgcal::HGCalFrameGenerator::produceSlinkEvent().

224  {
225  return 0x0 | (fed_crc_err & 0x1) << 0 | (slinkrocket_crc_err & 0x1) << 1 | (source_id_err & 0x1) << 2 |
226  (sync_lost & 0x1) << 3 | (fragment_trunc & 0x1) << 4;
227 }

◆ buildSlinkTrailer()

std::vector< uint32_t > hgcal::backend::buildSlinkTrailer ( uint8_t  eoe,
uint16_t  daqcrc,
uint32_t  event_length,
uint16_t  bxid,
uint32_t  orbit_id,
uint16_t  crc,
uint16_t  status 
)

builds the slink frame trailer (128 bits trailer = 4 words)

Returns
a vector with 4 32b words

Definition at line 198 of file HGCalRawDataPackingTools.cc.

References hgcal::SLINK_BXID_MASK, hgcal::SLINK_BXID_POS, hgcal::SLINK_CRC_MASK, hgcal::SLINK_CRC_POS, hgcal::SLINK_DAQCRC_MASK, hgcal::SLINK_DAQCRC_POS, hgcal::SLINK_EOE_MASK, hgcal::SLINK_EOE_POS, hgcal::SLINK_EVLENGTH_MASK, hgcal::SLINK_EVLENGTH_POS, hgcal::SLINK_ORBID_MASK, hgcal::SLINK_ORBID_POS, hgcal::SLINK_STATUS_MASK, hgcal::SLINK_STATUS_POS, and mps_update::status.

Referenced by hgcal::HGCalFrameGenerator::produceSlinkEvent().

204  {
205  std::vector<uint32_t> trailer(4, 0);
206 
214 
215  return trailer;
216 }