1 #ifndef dune_artdaq_Overlays_PennMilliSlice_hh 2 #define dune_artdaq_Overlays_PennMilliSlice_hh 5 #include "artdaq-core/Data/Fragment.hh" 7 #include <boost/crc.hpp> 20 #ifdef PENN_OLD_STRUCTS 21 struct TriggerPayload {
24 typedef uint32_t trigger_type_t;
25 typedef uint32_t trigger_pattern_t;
26 typedef uint16_t trigger_bits_t;
27 trigger_pattern_t trigger_pattern: 27;
28 trigger_type_t trigger_type : 5;
30 static trigger_bits_t
const num_bits_trigger_pattern = 27;
31 static trigger_bits_t
const num_bits_trigger_type = 5;
33 struct TriggerPatternBits {
34 static trigger_bits_t
const bsu_rm_cl = 26;
35 static trigger_bits_t
const tsu_nu_sl = 25;
36 static trigger_bits_t
const tsu_sl_nu = 24;
37 static trigger_bits_t
const tsu_el_wu = 23;
38 static std::string getName(trigger_bits_t trigger_bit){
61 static trigger_type_t
const calibration = 0x00;
63 static trigger_type_t
const rce_a = 0x01;
64 static trigger_type_t
const rce_b = 0x02;
65 static trigger_type_t
const rce_c = 0x03;
66 static trigger_type_t
const rce_d = 0x04;
67 static trigger_type_t
const rce_e = 0x05;
68 static trigger_type_t
const rce_f = 0x06;
69 static trigger_type_t
const rce_g = 0x07;
70 static trigger_type_t
const ssp = 0x08;
71 static trigger_type_t
const muon = 0x10;
72 static std::string getName(trigger_type_t trigger_type){
114 struct TimestampPayload {
116 typedef uint16_t data_size_t;
117 timestamp_t nova_timestamp : 64;
119 static data_size_t
const num_bits_timestamp = 64;
120 static size_t const size_words =
sizeof(uint64_t);
122 static size_t const ptb_offset =
sizeof(uint32_t);
126 struct CounterPayload {
129 typedef uint64_t counter_set_t;
130 typedef uint16_t trigger_bits_t;
131 counter_set_t tsu_wu : 10;
132 counter_set_t tsu_el : 10;
133 counter_set_t tsu_extra : 4;
134 counter_set_t tsu_nu : 6;
135 counter_set_t tsu_sl : 6;
136 counter_set_t tsu_nl : 6;
137 counter_set_t tsu_su : 6;
138 counter_set_t bsu_rm : 16;
139 counter_set_t bsu_cu : 10;
140 counter_set_t bsu_cl : 13;
141 counter_set_t bsu_rl : 10;
142 counter_set_t ts_rollover: 28;
143 counter_set_t header : 3;
144 static trigger_bits_t
const num_bits_tsu_wu = 10;
145 static trigger_bits_t
const num_bits_tsu_el = 10;
146 static trigger_bits_t
const num_bits_tsu_extra = 4;
147 static trigger_bits_t
const num_bits_tsu_nu = 6;
148 static trigger_bits_t
const num_bits_tsu_sl = 6;
149 static trigger_bits_t
const num_bits_tsu_nl = 6;
150 static trigger_bits_t
const num_bits_tsu_su = 6;
151 static trigger_bits_t
const num_bits_bsu_rm = 16;
152 static trigger_bits_t
const num_bits_bsu_cu = 10;
153 static trigger_bits_t
const num_bits_bsu_cl = 13;
154 static trigger_bits_t
const num_bits_bsu_rl = 10;
155 static trigger_bits_t
const num_bits_ts_rollover= 28;
156 static trigger_bits_t
const num_bits_header = 3;
169 #ifdef PENN_DONT_REBLOCK_USLICES 170 typedef uint32_t microslice_count_t;
175 data_t sequence_id : 16;
177 data_t millislice_size : 32;
178 #ifdef PENN_DONT_REBLOCK_USLICES 179 data_t microslice_count : 32;
182 data_t payload_count : 16;
183 data_t payload_count_counter : 16;
184 data_t payload_count_trigger : 16;
185 data_t payload_count_timestamp : 16;
188 data_t payload_count_warning : 16;
190 data_t end_timestamp : 64;
191 data_t width_in_ticks : 32;
192 data_t overlap_in_ticks : 32;
226 #ifdef PENN_DONT_REBLOCK_USLICES 228 Header::microslice_count_t microSliceCount()
const;
232 std::unique_ptr<PennMicroSlice> microSlice(uint32_t
index)
const;
239 size_t& payload_size)
const;
258 size_t& payload_size);
269 #ifdef ENABLE_PENNMILLISLICE_CHECKSUM 270 typedef uint32_t checksum_t;
273 checksum_t calculateChecksum()
const;
276 checksum_t checksum()
const;
Header const * header_() const
uint8_t * payload(uint32_t index, dune::PennMicroSlice::Payload_Header::data_packet_type_t &data_packet_type, dune::PennMicroSlice::Payload_Header::short_nova_timestamp_t &short_nova_timestamp, size_t &payload_size) const
uint8_t * get_next_payload(uint32_t &index, dune::PennMicroSlice::Payload_Header::data_packet_type_t &data_packet_type, dune::PennMicroSlice::Payload_Header::short_nova_timestamp_t &short_nova_timestamp, size_t &payload_size)
Header::millislice_size_t size() const
uint32_t current_word_id_
uint8_t * data_(int index) const
Header::timestamp_t endTimestamp() const
uint8_t * current_payload_
Header::ticks_t overlapTicks() const
Header::version_t version() const
uint8_t * get_next_timestamp(dune::PennMicroSlice::Payload_Header *&data_header)
struct ptb::content::word::timestamp_t timestamp_t
PennMilliSlice(uint8_t *address)
Header::ticks_t widthTicks() const
Header::sequence_id_t sequenceID() const
Header::payload_count_t payloadCount() const