CMS 3D CMS Logo

TrivialEmulator.cc
Go to the documentation of this file.
3 
4 using namespace hgcal::econd;
5 
7  EventId evt_id{event_id_++, bx_id_++, orbit_id_++};
8  ERxInput evt;
9  for (const auto& erx_id : params_.enabled_erxs) {
10  ERxId_t id{erx_id /*chip*/, 0 /*half*/};
11  ERxData dummy_data{
12  .cm0 = 0x12,
13  .cm1 = 0x34,
14  .tctp = std::vector<ToTStatus>(params_.num_channels_per_erx, static_cast<ToTStatus>(params_.default_totstatus)),
15  .adc = std::vector<uint16_t>(params_.num_channels_per_erx, 0),
16  .adcm = std::vector<uint16_t>(params_.num_channels_per_erx, 0),
17  .toa = std::vector<uint16_t>(params_.num_channels_per_erx, 0),
18  .tot = std::vector<uint16_t>(params_.num_channels_per_erx, 0),
19  .meta = std::vector<uint32_t>{}};
20  evt[id] = dummy_data;
21  }
22  return ECONDInput{evt_id, evt};
23 }
std::pair< uint8_t, uint8_t > ERxId_t
chip/half
Definition: SlinkTypes.h:17
std::map< ERxId_t, ERxData > ERxInput
eRx data maps
Definition: SlinkTypes.h:29
parsed e-rx data
Definition: SlinkTypes.h:20
const std::vector< unsigned int > enabled_erxs
const EmulatorParameters params_
std::pair< EventId, ERxInput > ECONDInput
ECON-D inputs for a given event.
Definition: SlinkTypes.h:32
ECONDInput next() override
Fetch the next ECON-D event.
std::tuple< uint32_t, uint32_t, uint32_t > EventId
Event index (L1A/BX/orbit)
Definition: SlinkTypes.h:14