81.3. Event structure

This section describes events written by the Readout program. These hits are encapsulated in NSCLDAQ ringitems. When the event builder is in use, additional event builder encapsulation will occur.

Ring items are described in the NSCLDAQ documentation. This is in the form of an annotated header for DataFormat.h. See e.g. https://docs.nscl.msu.edu/daq/newsite/nscldaq-11.3/r22906.html. In order to support event building, the ring items that encapslate hits include a body header. The body header includes the hit timestamp and sourceid as well as a zero valued barrier type.

The additional event builder encapsulation is described in the NSCLDAQ section on the event builder e.g. https://docs.nscl.msu.edu/daq/newsite/nscldaq-11.3/x4509.html

This leaves to us documenting the format of the body of a hit:

Table 81-1. Format of event body

Data TypeContents
uint32_tNumber of uint16_t's in the event
Variable.Null terminated string that identifies the module
uint16_tChannel within the module the hit came from
uint64_tHit timestamp in nanoseconds
uint64_traw timestamp only meaningful if selected
uint16_tfine timestamp only meaningful if selected
uint16_tPeak height (energy)
uint16_tLow priority flags. Only meaningful if selected.
uint16_tHigh priority flags. Only meaningful if selected.
uint16_tDown sample selection code. Only meaningful if selected
uint16_t Fail flags. Only meaningful if selected
uint16_tAnalog probe type 1 - only meaningful if analog probe 1 is selected for readout
uint32_t Number of samples of analog probe 1 data. This is zero if analog probe 1 is not selecte.
variable number of uint32_t valuesAnalog probe 1 values.
uint16_tAnalog probe type 2 - only meaningful if analog probe 2 is selected for readout
uint32_t Number of samples of analog probe 1 data. This is zero if analog probe 2 is not selected.
variable number of uint32_t valuesAnalog probe 1 values.
uint16_tDigital probe type 1 - only meaningful if digital probe 1 is selected
uint32_tNumber of samples in digital probe 1
variable number of uint8_tsDigital probe sample.
uint16_tDigital probe type 2 - only meaningful if digital probe 2 is selected
uint32_tNumber of samples in digital probe 2
variable number of uint8_tsDigital probe sample.
uint16_tDigital probe type 3 - only meaningful if digital probe 3 is selected
uint32_tNumber of samples in digital probe 3
variable number of uint8_tsDigital probe sample.
uint16_tDigital probe type 4 - only meaningful if digital probe 4 is selected
uint32_tNumber of samples in digital probe 4
variable number of uint8_tsDigital probe sample.

Note that if needed an additional byte will pad out the end of the event to bring it to an even number of uint16_t. However, since there are an even number of digital probes, all with the same length, I don't think this padding ever happens.