1 #include "artdaq-core-demo/Overlays/ToyFragment.hh"
3 #include "cetlib_except/exception.h"
7 unsigned int pop_count (
unsigned int n) {
9 for (c = 0; n; c++) n &= n - 1;
20 throw cet::exception(
"IllegalADCVal")
21 <<
"Illegal value of ADC word #" << (adcPtr -
dataBeginADCs()) <<
": 0x" << std::hex << *adcPtr <<
".";
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.
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.
adc_t const * dataBeginADCs() const
Start of the ADC values, returned as a const pointer to the ADC type.
uint16_t adc_t
ToyFragment is intended to represent/interpret data that has an inherent size of 16 bits (unsigned)...
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.