1 #ifndef artdaq_demo_Overlays_ToyFragment_hh
2 #define artdaq_demo_Overlays_ToyFragment_hh
4 #include "artdaq-core/Data/Fragment.hh"
12 std::ostream&
operator<<(std::ostream&, ToyFragment
const&);
61 "ToyFragment::Metadata size changed");
68 typedef uint16_t
adc_t;
112 : artdaq_Fragment_(f) {}
211 static size_t adc_range(
int daq_adc_bits) {
return (1ul << daq_adc_bits) - 1; }
234 artdaq::Fragment
const& artdaq_Fragment_;
ToyFragment(artdaq::Fragment const &f)
The ToyFragment constructor.
std::ostream & operator<<(std::ostream &, AsciiFragment const &)
Dumps the AsciiFragment's data (text) to given stream.
Header::trigger_number_t hdr_trigger_number() const
Gets the trigger_number from the ToyFragment::Header.
adc_t const * findBadADC(int daq_adc_bits) const
Look through stored ADC values and determine if any are out-of-range.
bool fastVerify(int daq_adc_bits) const
Do any ADC values in the ToyFragment appear to be out-of-range?
adc_t adc_value(uint32_t index)
Retrieve the given ADC value from the Fragment.
Header const * header_() const
Get a pointer to the ToyFragment::Header object.
An artdaq::Fragment overlay class used for pedagogical purposes.
Header::event_size_t hdr_event_size() const
Gets the event_size from the ToyFragment::Header.
uint8_t hdr_distribution_type() const
Returns the distribution_type field from the ToyFragment::Header.
adc_t const * dataBeginADCs() const
Start of the ADC values, returned as a const pointer to the ADC type.
static size_t adc_range(int daq_adc_bits)
Get the largest ADC value possible for a given number of ADC bits.
static constexpr size_t hdr_size_words()
Gets the size_words variable from the artdaq::Header.
uint16_t adc_t
ToyFragment is intended to represent/interpret data that has an inherent size of 16 bits (unsigned)...
static constexpr size_t adcs_per_word_()
Translates between the size of an ADC and the size in Header::data_t words.
void checkADCData(int daq_adc_bits) const
Throw if any ADC value appears corrupt.
adc_t const * dataEndADCs() const
End of the ADC values, returned as a const pointer to the ADC type.
size_t total_adc_values() const
Get the number of ADC values describing data beyond the header.