artdaq_core_demo
v1_07_01
|
An artdaq::Fragment overlay class used for pedagogical purposes. More...
#include <artdaq-core-demo/Overlays/ToyFragment.hh>
Classes | |
struct | Header |
The "Header" struct is used to interpret the header information that is created by the hardware and is part of the data blob that is read from the hardware for each event. Not to be confused with the Fragment::Header or the ToyFragment::Metadata objects. More... | |
struct | Metadata |
The ToyFragment::Metadata struct holds data about the readout that may not be present in the primary data stream. More... | |
Public Types | |
typedef uint16_t | adc_t |
ToyFragment is intended to represent/interpret data that has an inherent size of 16 bits (unsigned). This is represented by the adc_t type that is declared here. | |
Public Member Functions | |
ToyFragment (artdaq::Fragment const &f) | |
The ToyFragment constructor. More... | |
Header::event_size_t | hdr_event_size () const |
Gets the event_size from the ToyFragment::Header. More... | |
Header::trigger_number_t | hdr_trigger_number () const |
Gets the trigger_number from the ToyFragment::Header. More... | |
uint8_t | hdr_distribution_type () const |
Returns the distribution_type field from the ToyFragment::Header. More... | |
size_t | total_adc_values () const |
Get the number of ADC values describing data beyond the header. More... | |
adc_t | adc_value (uint32_t index) |
Retrieve the given ADC value from the Fragment. More... | |
adc_t const * | dataBeginADCs () const |
Start of the ADC values, returned as a const pointer to the ADC type. More... | |
adc_t const * | dataEndADCs () const |
End of the ADC values, returned as a const pointer to the ADC type. More... | |
adc_t const * | findBadADC (int daq_adc_bits) const |
Look through stored ADC values and determine if any are out-of-range. More... | |
bool | fastVerify (int daq_adc_bits) const |
Do any ADC values in the ToyFragment appear to be out-of-range? More... | |
void | checkADCData (int daq_adc_bits) const |
Throw if any ADC value appears corrupt. More... | |
Static Public Member Functions | |
static constexpr size_t | hdr_size_words () |
Gets the size_words variable from the artdaq::Header. More... | |
static size_t | adc_range (int daq_adc_bits) |
Get the largest ADC value possible for a given number of ADC bits. More... | |
Protected Member Functions | |
Header const * | header_ () const |
Get a pointer to the ToyFragment::Header object. More... | |
Static Protected Member Functions | |
static constexpr size_t | adcs_per_word_ () |
Translates between the size of an ADC and the size in Header::data_t words. More... | |
An artdaq::Fragment overlay class used for pedagogical purposes.
The intention of this class is to provide an example of how an Overlay can be constructed for a hypothetical 16-bit ADC module. In this example, the ADC data can have either 12 or 14 bits of meaningful information per 16-bit word. (This is just a characteristic of this example. Separate classes could certainly be used to overlay the two types of ADC data.)
Definition at line 25 of file ToyFragment.hh.
|
inlineexplicit |
The ToyFragment constructor.
f | The raw artdaq::Fragment object to overlay |
The constructor simply sets its const private member "artdaq_Fragment_" to refer to the artdaq::Fragment object
Definition at line 111 of file ToyFragment.hh.
|
inlinestatic |
Get the largest ADC value possible for a given number of ADC bits.
daq_adc_bits | Number of bits in the ADC field |
Definition at line 211 of file ToyFragment.hh.
|
inline |
Retrieve the given ADC value from the Fragment.
index | Index of the ADC value |
Definition at line 148 of file ToyFragment.hh.
|
inlinestaticprotected |
Translates between the size of an ADC and the size in Header::data_t words.
Definition at line 218 of file ToyFragment.hh.
void demo::ToyFragment::checkADCData | ( | int | daq_adc_bits | ) | const |
Throw if any ADC value appears corrupt.
daq_adc_bits | Number of bits for ADC values |
cet::exception | if any ADC value is out-of-range |
Definition at line 15 of file ToyFragment.cc.
|
inline |
Start of the ADC values, returned as a const pointer to the ADC type.
Definition at line 162 of file ToyFragment.hh.
|
inline |
End of the ADC values, returned as a const pointer to the ADC type.
Definition at line 171 of file ToyFragment.hh.
|
inline |
Do any ADC values in the ToyFragment appear to be out-of-range?
daq_adc_bits | Number of bits for ADC values |
Definition at line 197 of file ToyFragment.hh.
|
inline |
Look through stored ADC values and determine if any are out-of-range.
daq_adc_bits | Number of bits for ADC values |
findBadADC() checks to make sure that the ADC type (adc_t) variable holding the ADC value doesn't contain bits beyond the expected range, i.e., can't be evaluated to a larger value than the max permitted ADC value
Definition at line 187 of file ToyFragment.hh.
|
inline |
Returns the distribution_type field from the ToyFragment::Header.
Definition at line 129 of file ToyFragment.hh.
|
inline |
Gets the event_size from the ToyFragment::Header.
Definition at line 118 of file ToyFragment.hh.
|
inlinestatic |
Gets the size_words variable from the artdaq::Header.
Definition at line 135 of file ToyFragment.hh.
|
inline |
Gets the trigger_number from the ToyFragment::Header.
Definition at line 123 of file ToyFragment.hh.
|
inlineprotected |
Get a pointer to the ToyFragment::Header object.
header_() simply takes the address of the start of this overlay's data (i.e., where the ToyFragment::Header object begins) and casts it as a const pointer to ToyFragment::Header
Definition at line 228 of file ToyFragment.hh.
|
inline |
Get the number of ADC values describing data beyond the header.
Definition at line 141 of file ToyFragment.hh.