DRAGON Analyzer
|
#include <Vme.hxx>
Public Member Functions | |
V792 () | |
Calls reset(),. | |
bool | unpack (const midas::Event &event, const char *bankName, bool reportMissing=false) |
Unpack ADC data from a midas event. More... | |
void | reset () |
Reset data fields to default values. | |
int32_t | get_data (int16_t ch) const |
Get a data value, with bounds checking. More... | |
Public Attributes | |
int16_t | n_ch |
Number of channels present in an event. | |
int32_t | count |
Event counter. | |
bool | overflow |
Is any channel an overflow? | |
bool | underflow |
Is any channel under threshold? | |
int16_t | data [MAX_CHANNELS] |
Array of event data. | |
Static Public Attributes | |
static const uint16_t | DATA_BITS = 0x0 |
Code to specify a data buffer. | |
static const uint16_t | HEADER_BITS = 0x2 |
Code to specify a header buffer. | |
static const uint16_t | FOOTER_BITS = 0x4 |
Code to specify a footer buffer. | |
static const uint16_t | INVALID_BITS = 0x6 |
Code to specify an invalid buffer. | |
static const uint16_t | MAX_CHANNELS = 32 |
Number of data channels availible in the ADC. | |
Private Member Functions | |
bool | unpack_data_buffer (const uint32_t *const pbuffer) |
Unpack event data from a caen 32 channel adc. More... | |
bool | unpack_buffer (const uint32_t *const pbuffer, const char *bankName) |
Unpack a Midas data buffer from a CAEN ADC. More... | |
int32_t vme::V792::get_data | ( | int16_t | ch | ) | const |
Get a data value, with bounds checking.
ch | Channel number to get data from Returns the data value stored at ch. If ch is out of bounds of the internal array, prints a warning message and returns dragon::DR_NO_DATA. |
Definition at line 383 of file Vme.cxx.
References dragon::NoData< T >::value().
bool vme::V792::unpack | ( | const midas::Event & | event, |
const char * | bankName, | ||
bool | reportMissing = false |
||
) |
Unpack ADC data from a midas event.
Searches for a bank tagged by bankName and then proceeds to loop over the data contained in the bank and extract into the appropriate class data fields.
[in] | event | The midas event to unpack |
[in] | bankName | Name of the bank to unpack |
[in] | reportMissing | False specifies to silently return if bankName isn't found in the event. True specifies to print a warning message if this is the case. |
Definition at line 459 of file Vme.cxx.
|
private |
Unpack a Midas data buffer from a CAEN ADC.
[in] | pbuffer | Pointer to the buffer word |
[in] | bank | Name of the midas bank being unpacked |
V792 buffers are 32 bit words. Bits 24-26 specify the type of data contained in the buffer. In this function, we read the buffer type and then handle appropriately.
case DATA_BITS : See unpack_data_buffer()
case HEADER_BITS: read number of channels (n_ch) in the event from bits 6 - 13
case FOOTER_BITS: read event counter (count) from bits 0 - 23
case INVALID_BITS: bail out
Bail out if we read an unknown buffer code
Definition at line 420 of file Vme.cxx.
|
private |
Unpack event data from a caen 32 channel adc.
[in] | pbuffer | Pointer to the data buffer word. |
A data buffer encodes the conversion value (i.e. integrated charge or peak pulse height) for a single ADC channel. See below for bitpacking instructions.
Bit 12 is an overflow tag
Bit 13 is an underflow tag
Bits 16-20 tell the channel number of the conversion
Bits 0 - 11 encode the converted value
Definition at line 399 of file Vme.cxx.