File indexing completed on 2025-01-18 03:42:24
0001 #ifndef SimCalorimetry_HGCalSimAlgos_HGCalRawDataPackingTools_h
0002 #define SimCalorimetry_HGCalSimAlgos_HGCalRawDataPackingTools_h
0003
0004 #include "SimCalorimetry/HGCalSimAlgos/interface/SlinkTypes.h"
0005
0006 namespace hgcal {
0007 namespace econd {
0008 struct ERxData;
0009
0010
0011
0012
0013
0014 std::vector<uint32_t> produceERxData(
0015 const ERxChannelEnable&, const ERxData&, bool passZS, bool passZSm1, bool hasToA, bool char_mode);
0016
0017
0018
0019
0020 std::vector<uint32_t> eRxSubPacketHeader(uint8_t stat,
0021 uint8_t ham,
0022 bool bitE,
0023 uint16_t common_mode0,
0024 uint16_t common_mode1,
0025 const ERxChannelEnable& channel_enable);
0026 std::vector<uint32_t> eRxSubPacketHeader(
0027 uint8_t stat, uint8_t ham, bool bitE, uint16_t common_mode0, uint16_t common_mode1, uint64_t channels_map);
0028
0029
0030
0031
0032 std::vector<uint32_t> eventPacketHeader(uint16_t header,
0033 uint16_t payload,
0034 bool bitP,
0035 bool bitE,
0036 uint8_t ht,
0037 uint8_t ebo,
0038 bool bitM,
0039 bool bitT,
0040 uint8_t hamming,
0041 uint16_t bx,
0042 uint16_t l1a,
0043 uint8_t orb,
0044 bool bitS,
0045 uint8_t RR);
0046
0047
0048
0049 uint32_t buildIdleWord(uint8_t bufStat, uint8_t err, uint8_t rr, uint32_t progPattern);
0050 }
0051
0052 namespace backend {
0053
0054
0055 std::vector<uint32_t> buildCaptureBlockHeader(uint32_t bunch_crossing,
0056 uint32_t event_counter,
0057 uint32_t orbit_counter,
0058 const std::vector<uint8_t>& econd_statuses);
0059
0060
0061
0062 std::vector<uint32_t> buildSlinkHeader(
0063 uint8_t boe, uint8_t v, uint64_t global_event_id, uint32_t content_id, uint32_t fed_id);
0064
0065
0066
0067 std::vector<uint32_t> buildSlinkTrailer(uint8_t eoe,
0068 uint16_t daqcrc,
0069 uint32_t event_length,
0070 uint16_t bxid,
0071 uint32_t orbit_id,
0072 uint16_t crc,
0073 uint16_t status);
0074
0075 enum SlinkEmulationFlag { Subsystem = 0, SlinkRocketSenderCore = 1, DTH = 2 };
0076
0077
0078 uint32_t buildSlinkContentId(SlinkEmulationFlag, uint8_t l1a_subtype, uint16_t l1a_fragment_cnt);
0079
0080
0081
0082 uint16_t buildSlinkRocketStatus(
0083 bool fed_crc_err, bool slinkrocket_crc_err, bool source_id_err, bool sync_lost, bool fragment_trunc);
0084 }
0085 }
0086
0087 #endif