NSCL DDAS  1.0
Support for XIA DDAS at the NSCL
 All Classes Namespaces Files Functions Variables Macros Pages
Public Member Functions | Protected Member Functions | List of all members
DAQ::DDAS::DDASHitUnpacker Class Reference

Parse the DDAS Readout event data. More...

#include <DDASHitUnpacker.h>

Inheritance diagram for DAQ::DDAS::DDASHitUnpacker:
DAQ::DDAS::FitHitUnpacker

Public Member Functions

std::tuple< DDASHit, const
uint32_t * > 
unpack (const uint32_t *beg, const uint32_t *sentinel)
 
const uint32_t * unpack (const uint32_t *beg, const uint32_t *sentinel, DDASHit &hit)
 

Protected Member Functions

const uint32_t * parseBodySize (const uint32_t *beg, const uint32_t *sentinel)
 
const uint32_t * parseModuleInfo (DDASHit &hit, const uint32_t *beg)
 
const uint32_t * parseHeaderWord0 (DDASHit &hit, const uint32_t *beg)
 
const uint32_t * parseHeaderWords1And2 (DDASHit &hit, const uint32_t *beg)
 
const uint32_t * parseHeaderWord3 (DDASHit &hit, const uint32_t *beg)
 
const uint32_t * parseTraceData (DDASHit &hit, const uint32_t *beg)
 
std::tuple< double, uint32_t,
uint32_t, uint32_t > 
parseAndComputeCFD (uint32_t ModMSPS, uint32_t data)
 
double parseAndComputeCFD (DDASHit &hit, uint32_t data)
 
void SetTime (DDASHit &hit)
 Compute and store CFD-corrected time in nanoseconds. More...
 
void SetEnergySums (DDASHit &hit, uint32_t data)
 Append energy sum to stored energy sums. More...
 
void SetQDCSums (DDASHit &hit, uint32_t data)
 Append qdc sum to stored qdc sums. More...
 
uint64_t computeCoarseTime (uint32_t adcFrequency, uint32_t timelow, uint32_t timehigh)
 Append trace values to stored trace data. More...
 
const uint32_t * extractEnergySums (const uint32_t *data, DDASHit &hit)
 
const uint32_t * extractQDC (const uint32_t *data, DDASHit &hit)
 
const uint32_t * extractExternalTimestamp (const uint32_t *data, DDASHit &hit)
 

Detailed Description

Parse the DDAS Readout event data.

data pointer to first 32-bit word of an event body

This expects data from the DDAS Readout program. It will parse the entire body of the event in a manner that is consistent with the data present. In other words, it uses the sizes of the event encoded in the data to determine when the parsing is complete.

While it parses, it stores the results into the data members of the object hit. Prior to parsing, all data members are reset to 0 using the Reset() method.

Member Function Documentation

uint64_t DAQ::DDAS::DDASHitUnpacker::computeCoarseTime ( uint32_t  adcFrequency,
uint32_t  timelow,
uint32_t  timehigh 
)
protected

Append trace values to stored trace data.

Parameters
data32-bit word storing two samples to store

The two waveform samples are extraced as the lower and upper 16-bit data words and then appended. The least significant 16-bit word is appended to the stored trace first.

Compute time in nanoseconds from raw data (no CFD correction)

THis method is very similar to the SetTime() method. It differs in that it doesn not apply a correction for the CFD time. It simply forms the timestamp from the low and high bits and then converts it to a time in nanoseconds.

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)

For the 500 MSPS module,

time = 10*(timehigh << 32 + timelow)

void DAQ::DDAS::DDASHitUnpacker::SetEnergySums ( DDASHit hit,
uint32_t  data 
)
protected

Append energy sum to stored energy sums.

Parameters
dataenergy sum to append

This can be called many times and will cause each successive value to be appended to objec.t

void DAQ::DDAS::DDASHitUnpacker::SetQDCSums ( DDASHit hit,
uint32_t  data 
)
protected

Append qdc sum to stored qdc sums.

Parameters
dataenergy sum to store

Like the SetEnergySums() method, this can be called repeatedly to append multiple values to the existing data.

void DAQ::DDAS::DDASHitUnpacker::SetTime ( DDASHit hit)
protected

Compute and store CFD-corrected time in nanoseconds.

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)


The documentation for this class was generated from the following files: