NSCL DDAS
1.0
Support for XIA DDAS at the NSCL
|
Encapsulation of a generic DDAS event. More...
#include <DDASHit.h>
Public Member Functions | |
DDASHit () | |
Default constructor. More... | |
DDASHit (const DDASHit &obj) | |
Copy constructor. | |
DDASHit & | operator= (const DDASHit &obj) |
Assignment operator. | |
virtual | ~DDASHit () |
Destructor. | |
void | Reset () |
Resets the state of all member data to that of initialization. More... | |
uint32_t | GetEnergy () const |
Retrieve the energy. More... | |
uint32_t | GetTimeHigh () const |
Retrieve most significant 16-bits of raw timestamp. | |
uint32_t | GetTimeLow () const |
Retrieve least significant 32-bit of raw timestamp. | |
uint32_t | GetTimeCFD () const |
Retrieve the raw cfd time. | |
double | GetTime () const |
Retrieve computed time. More... | |
uint64_t | GetCoarseTime () const |
Retrieve the 48-bit timestamp in nanoseconds without any CFD correction. | |
uint32_t | GetFinishCode () const |
Retrieve finish code. More... | |
uint32_t | GetChannelLength () const |
Retrieve number of 32-bit words that were in original data packet. More... | |
uint32_t | GetChannelLengthHeader () const |
Retrieve length of header in original data packet. | |
uint32_t | GetOverflowCode () const |
Retrieve the overflow code. | |
uint32_t | GetSlotID () const |
Retrieve the slot that the module resided in. | |
uint32_t | GetCrateID () const |
Retrieve the index of the crate the module resided in. | |
uint32_t | GetChannelID () const |
Retrieve the channel index. | |
uint32_t | GetModMSPS () const |
Retrieve the ADC frequency of the module. | |
int | GetHardwareRevision () const |
Retrieve the hardware revision. | |
int | GetADCResolution () const |
Retrieve the adc resolution. | |
uint32_t | GetCFDTrigSource () const |
uint32_t | GetCFDFailBit () const |
uint32_t | GetTraceLength () const |
std::vector< uint16_t > & | GetTrace () |
const std::vector< uint16_t > & | GetTrace () const |
std::vector< uint32_t > & | GetEnergySums () |
const std::vector< uint32_t > & | GetEnergySums () const |
std::vector< uint32_t > & | GetQDCSums () |
const std::vector< uint32_t > & | GetQDCSums () const |
uint64_t | GetExternalTimestamp () const |
bool | GetADCOverflowUnderflow () const |
Return the adc overflow/underflow status. More... | |
void | setChannel (uint32_t channel) |
void | setSlot (uint32_t slot) |
void | setCrate (uint32_t crate) |
void | setChannelHeaderLength (uint32_t channelHeaderLength) |
void | setChannelLength (uint32_t channelLength) |
void | setOverflowCode (uint32_t overflow) |
void | setFinishCode (bool finishCode) |
void | setCoarseTime (uint64_t time) |
void | setRawCFDTime (uint32_t data) |
void | setCFDTrigSourceBit (uint32_t bit) |
void | setCFDFailBit (uint32_t bit) |
void | setTimeLow (uint32_t datum) |
void | setTimeHigh (uint32_t datum) |
void | setTime (double time) |
void | setEnergy (uint32_t value) |
void | setTraceLength (uint32_t trace) |
void | setADCFrequency (uint32_t value) |
void | setADCResolution (int value) |
void | setHardwareRevision (int value) |
void | appendEnergySum (uint32_t value) |
void | appendQDCSum (uint32_t value) |
void | appendTraceSample (uint16_t value) |
void | setExternalTimestamp (uint64_t tstamp) |
void | setADCOverflowUnderflow (bool state) |
Encapsulation of a generic DDAS event.
The DDASHit class is intended to encapsulate the information that is emitted by the Pixie-16 dgitizer for a single event. It contains information for a single channel only. It is generic because it can store data for the 100 MSPS, 250 MSPS, and 500 MSPS Pixie-16 digitizers used at the lab. In general all of these contain the same set of information, however, the meaning of the CFD data is different for each. The DDASHit class abstracts these differences away from the user.
This class does not provide any parsing capabilities likes its companion class ddasdumper. To fill this with data, you should use the associated DDASHitUnpacker class. Here is how you use it.
DAQ::DDAS::DDASHit::DDASHit | ( | ) |
Default constructor.
All member data are zero initialized.
|
inline |
Return the adc overflow/underflow status.
In the 12 and 14 bit modules, this is value of bit 15 in the 4th header word. In the 16 bit modules, this is the value of bit 31 in the 4th header word.
|
inline |
Retreive failure bit from cfd data
|
inline |
Retrieve trig source from cfd data
|
inline |
Retrieve number of 32-bit words that were in original data packet.
Note that this only really makes sense to be used if the object was filled with data using UnpackChannelData().
|
inline |
Retrieve the energy.
With the advent of Pixie16 modules with 16-bit ADCs, the GetEnergy() method no longer includes the ADC overflow/underflow bit. The overflow/underflow bit can be accessed via the GetADCOverflowUnderflow() method instead.
|
inline |
Access the energy/baseline sum data
|
inline |
|
inline |
Retrieve finish code.
The finish code will be set to 1 if pileup was detected.
|
inline |
Access the qdc data
|
inline |
Retrieve computed time.
This method performs a computation that depends on the type of the digitizer that produced the data. In each case, the coarse timestamp is formed using the timelow and timehigh. This is coarse timestamp is then corrected using any CFD time that exists.
The calculations for the various modules are as follows:
For the 100 MSPS module:
time = 10*((timehigh << 32) + timelow)
For the 250 MSPS module...
time = 8*(timehigh << 32 + timelow) + 4*(timecfd/(2^14) - cfdtrigsourcebit)
For the 500 MSPS module,
time = 10*(timehigh << 32 + timelow) + 2*(timecfd/(2^13) + cfdtrigsourcebit - 1)
timestamp | (units of nanoseconds) |
|
inline |
Access the trace data
|
inline |
Retrieve trace length
void DAQ::DDAS::DDASHit::Reset | ( | ) |
Resets the state of all member data to that of initialization.
For primitive types, this sets the values to 0. For vector data (i.e. trace), the vector is cleared and resized to 0.