A S-link/ECON-D payload generator helper. More...
#include <HGCalFrameGenerator.h>
Classes | |
struct | HeaderBits |
struct | SlinkParameters |
List of S-link operational parameters for emulation. More... | |
Public Member Functions | |
const std::map< unsigned int, econd::EmulatorParameters > & | econdParams () const |
List of ECON-D operational parameters for emulation. More... | |
HGCalFrameGenerator (const edm::ParameterSet &) | |
const econd::ECONDInput & | lastECONDEmulatedInput () const |
Retrieve the last ECON-D event emulated. More... | |
const HGCalSlinkEmulatorInfo & | lastSlinkEmulatedInfo () const |
Retrieve the metadata generated along with the last S-link emulated payload. More... | |
std::vector< uint64_t > | produceCaptureBlockEvent (unsigned int cb_id) const |
std::vector< uint64_t > | produceECONEvent (unsigned int econd_id, unsigned int cb_id=0) const |
std::vector< uint64_t > | produceSlinkEvent (unsigned int fed_id) const |
Produce a S-link event from an emulated event. More... | |
void | setEmulator (econd::Emulator &) |
Set the emulation source for ECON-D frames. More... | |
void | setRandomEngine (CLHEP::HepRandomEngine &rng) |
Set the random number generator engine. More... | |
const SlinkParameters & | slinkParams () const |
List of S-link operational parameters for emulation. More... | |
Static Public Member Functions | |
static edm::ParameterSetDescription | description () |
Private Member Functions | |
uint32_t | computeCRC (const std::vector< uint32_t > &) const |
32bit CRC More... | |
econd::ERxChannelEnable | generateEnabledChannels (unsigned int) const |
std::vector< uint32_t > | generateERxData (unsigned int, const econd::ERxInput &, std::vector< econd::ERxChannelEnable > &) const |
HeaderBits | generateStatusBits (unsigned int) const |
Private Attributes | |
std::map< unsigned int, econd::EmulatorParameters > | econd_params_ |
econd::Emulator * | emul_ {nullptr} |
econd::ECONDInput | last_emul_event_ |
HGCalSlinkEmulatorInfo | last_slink_emul_info_ |
CLHEP::HepRandomEngine * | rng_ {nullptr} |
SlinkParameters | slink_params_ |
Static Private Attributes | |
static constexpr size_t | kMaxNumECONDs = 12 |
A S-link/ECON-D payload generator helper.
Definition at line 32 of file HGCalFrameGenerator.h.
|
explicit |
Definition at line 51 of file HGCalFrameGenerator.cc.
References hgcal::HGCalFrameGenerator::SlinkParameters::active_econds, econd_params_, Exception, edm::ParameterSet::getParameter(), kMaxNumECONDs, and slink_params_.
|
private |
|
static |
Definition at line 81 of file HGCalFrameGenerator.cc.
References edm::ParameterSetDescription::add(), edm::ParameterSetDescription::addVPSet(), submitPVResolutionJobs::desc, hgcal::econd::EmulatorParameters::description(), mps_fire::i, and edm::ParameterDescriptionNode::setComment().
Referenced by HGCalSlinkEmulator::fillDescriptions().
|
inline |
List of ECON-D operational parameters for emulation.
Definition at line 67 of file HGCalFrameGenerator.h.
References econd_params_.
Referenced by HGCalSlinkEmulator::HGCalSlinkEmulator().
|
private |
Definition at line 126 of file HGCalFrameGenerator.cc.
References econd_params_, mps_fire::i, and rng_.
Referenced by generateERxData().
|
private |
Definition at line 135 of file HGCalFrameGenerator.cc.
References econd_params_, hgcal::econd::eRxSubPacketHeader(), generateEnabledChannels(), CrabHelper::log, LogDebug, hgcal::printWords(), and hgcal::econd::produceERxData().
Referenced by produceECONEvent().
|
private |
Definition at line 111 of file HGCalFrameGenerator.cc.
References hgcal::HGCalFrameGenerator::HeaderBits::bitO, econd_params_, Exception, and rng_.
Referenced by produceECONEvent().
|
inline |
Retrieve the last ECON-D event emulated.
Definition at line 54 of file HGCalFrameGenerator.h.
References last_emul_event_.
Referenced by HGCalSlinkEmulator::produce().
|
inline |
Retrieve the metadata generated along with the last S-link emulated payload.
Definition at line 56 of file HGCalFrameGenerator.h.
References last_slink_emul_info_.
Referenced by HGCalSlinkEmulator::produce().
std::vector< uint64_t > hgcal::HGCalFrameGenerator::produceCaptureBlockEvent | ( | unsigned int | cb_id | ) | const |
Produce a capture block from an emulated event [in] cb_id capture block identifier
Definition at line 246 of file HGCalFrameGenerator.cc.
References hgcal::backend::buildCaptureBlockHeader(), econd_params_, runTauDisplay::eid, hgcal::backend::InactiveECOND, kMaxNumECONDs, last_emul_event_, CrabHelper::log, LogDebug, hgcal::backend::Normal, hgcal::printWords(), produceECONEvent(), hgcal::to128bit(), and hgcal::to64bit().
Referenced by produceSlinkEvent().
std::vector< uint64_t > hgcal::HGCalFrameGenerator::produceECONEvent | ( | unsigned int | econd_id, |
unsigned int | cb_id = 0 |
||
) | const |
Produce a ECON-D event from an emulated event
[in] | econd_id | ECON-D identifier |
[in] | cb_id | capture block identifier |
Definition at line 180 of file HGCalFrameGenerator.cc.
References HGCalCaptureBlockEmulatorInfo::addECONDEmulatedInfo(), hgcal::econd::buildIdleWord(), HGCalSlinkEmulatorInfo::captureBlockEmulatedInfo(), computeCRC(), econd_params_, emul_, edmPickEvents::event, hgcal::econd::eventPacketHeader(), Exception, generateERxData(), generateStatusBits(), last_emul_event_, last_slink_emul_info_, CrabHelper::log, LogDebug, hgcal::econd::Emulator::next(), hgcal::printWords(), findQualityFiles::rr, and hgcal::to64bit().
Referenced by produceCaptureBlockEvent().
std::vector< uint64_t > hgcal::HGCalFrameGenerator::produceSlinkEvent | ( | unsigned int | fed_id | ) | const |
Produce a S-link event from an emulated event.
Definition at line 268 of file HGCalFrameGenerator.cc.
References hgcal::HGCalFrameGenerator::SlinkParameters::boe_marker, hgcal::backend::buildSlinkContentId(), hgcal::backend::buildSlinkHeader(), hgcal::backend::buildSlinkRocketStatus(), hgcal::backend::buildSlinkTrailer(), HGCalSlinkEmulatorInfo::clear(), runTauDisplay::eid, hgcal::HGCalFrameGenerator::SlinkParameters::eoe_marker, hgcal::HGCalFrameGenerator::SlinkParameters::format_version, last_emul_event_, last_slink_emul_info_, CrabHelper::log, LogDebug, hgcal::HGCalFrameGenerator::SlinkParameters::num_capture_blocks, hgcal::printWords(), produceCaptureBlockEvent(), slink_params_, mps_update::status, hgcal::HGCalFrameGenerator::SlinkParameters::store_header_trailer, hgcal::backend::Subsystem, hgcal::to128bit(), and hgcal::to64bit().
Referenced by HGCalSlinkEmulator::produce().
void hgcal::HGCalFrameGenerator::setEmulator | ( | econd::Emulator & | emul | ) |
Set the emulation source for ECON-D frames.
Definition at line 105 of file HGCalFrameGenerator.cc.
References L1TdeGEMTPG_cfi::emul, and emul_.
Referenced by HGCalSlinkEmulator::HGCalSlinkEmulator().
void hgcal::HGCalFrameGenerator::setRandomEngine | ( | CLHEP::HepRandomEngine & | rng | ) |
Set the random number generator engine.
Definition at line 103 of file HGCalFrameGenerator.cc.
References rng_.
Referenced by HGCalSlinkEmulator::produce().
|
inline |
List of S-link operational parameters for emulation.
Definition at line 65 of file HGCalFrameGenerator.h.
References slink_params_.
|
private |
Definition at line 85 of file HGCalFrameGenerator.h.
Referenced by econdParams(), generateEnabledChannels(), generateERxData(), generateStatusBits(), HGCalFrameGenerator(), produceCaptureBlockEvent(), and produceECONEvent().
|
mutableprivate |
Definition at line 88 of file HGCalFrameGenerator.h.
Referenced by produceECONEvent(), and setEmulator().
|
staticprivate |
Definition at line 75 of file HGCalFrameGenerator.h.
Referenced by HGCalFrameGenerator(), and produceCaptureBlockEvent().
|
mutableprivate |
Definition at line 91 of file HGCalFrameGenerator.h.
Referenced by lastECONDEmulatedInput(), produceCaptureBlockEvent(), produceECONEvent(), and produceSlinkEvent().
|
mutableprivate |
Definition at line 90 of file HGCalFrameGenerator.h.
Referenced by lastSlinkEmulatedInfo(), produceECONEvent(), and produceSlinkEvent().
|
private |
Definition at line 87 of file HGCalFrameGenerator.h.
Referenced by generateEnabledChannels(), generateStatusBits(), and setRandomEngine().
|
private |
Definition at line 84 of file HGCalFrameGenerator.h.
Referenced by HGCalFrameGenerator(), produceSlinkEvent(), and slinkParams().