NSCL DDAS
1.0
Support for XIA DDAS at the NSCL
|
Encapsulation of a generic DDAS event. More...
#include <ddaschannel.h>
Public Member Functions | |
ddaschannel () | |
Default constructor. More... | |
ddaschannel (const ddaschannel &obj)=default | |
Copy constructor. | |
ddaschannel & | operator= (const ddaschannel &obj)=default |
Assignment operator. | |
ddaschannel & | operator= (DAQ::DDAS::DDASHit &hit) |
Copy DDASHit into ddaschannel. More... | |
~ddaschannel () | |
Destructor. | |
void | UnpackChannelData (const uint32_t *data) |
Parse the DDAS Readout event data. More... | |
void | Reset () |
Resets the state of all member data to that of initialization. More... | |
UInt_t | GetEnergy () const |
Retrieve the energy. | |
UInt_t | GetTimeHigh () const |
Retrieve most significant 16-bits of raw timestamp. | |
UInt_t | GetTimeLow () const |
Retrieve least significant 32-bit of raw timestamp. | |
UInt_t | GetCFDTime () const |
Retrieve the raw cfd time. | |
Double_t | GetTime () const |
Retrieve computed time. More... | |
Double_t | GetCoarseTime () const |
Retrieve the 48-bit timestamp in nanoseconds without any CFD correction. | |
Double_t | GetCFD () const |
UInt_t | GetEnergySums (Int_t i) const |
Retrieve specific energy sum. More... | |
Int_t | GetChannelNum () const |
Retrieve the channel number. | |
Int_t | GetFinishCode () const |
Retrieve finish code. More... | |
Int_t | GetChannelLength () const |
Retrieve number of 32-bit words that were in original data packet. More... | |
Int_t | GetChannelLengthHeader () const |
Retrieve length of header in original data packet. | |
Int_t | GetOverflowCode () const |
Retrieve the overflow code. | |
Int_t | GetSlotID () const |
Retrieve the slot that the module resided in. | |
Int_t | GetCrateID () const |
Retrieve the index of the crate the module resided in. | |
Int_t | GetChannelID () const |
Retrieve the channel index. | |
Int_t | GetID () const |
Int_t | GetModMSPS () const |
Retrieve the ADC frequency of the module. | |
std::vector< UShort_t > | GetTrace () const |
Retrieve a copy of the trace stored. | |
Int_t | GetADCResolution () const |
Int_t | GetHardwareRevision () const |
Bool_t | GetADCOverflowUnderflow () const |
uint32_t | GetCfdTrigSource () const |
Public Attributes | |
Double_t | time |
assembled time including cfd | |
Double_t | coarsetime |
assembled time without cfd | |
Double_t | cfd |
cfd time only More... | |
UInt_t | energy |
energy of event | |
UInt_t | timehigh |
bits 32-47 of timestamp | |
UInt_t | timelow |
bits 0-31 of timestamp | |
UInt_t | timecfd |
raw cfd time | |
Int_t | channelnum |
Int_t | finishcode |
indicates whether pile-up occurred | |
Int_t | channellength |
number of 32-bit words of raw data | |
Int_t | channelheaderlength |
length of header | |
Int_t | overflowcode |
1 = overflow | |
Int_t | chanid |
channel index | |
Int_t | slotid |
slot index | |
Int_t | crateid |
crate index | |
Int_t | id |
Int_t | cfdtrigsourcebit |
value of trigger source bit(s) for 250 MSPS and 500 MSPS | |
Int_t | cfdfailbit |
indicates whether the cfd algo failed | |
Int_t | tracelength |
length of stored trace | |
Int_t | ModMSPS |
Sampling rate of the module (MSPS) | |
Int_t | m_adcResolution |
adc resolution (i.e. bit depth) | |
Int_t | m_hdwrRevision |
hardware revision | |
Bool_t | m_adcOverUnderflow |
whether adc overflowed or underflowed | |
std::vector< UInt_t > | energySums |
Energy sum data. | |
std::vector< UInt_t > | qdcSums |
QDC sum data. | |
std::vector< UShort_t > | trace |
Trace data. | |
Double_t | externalTimestamp |
External clock. | |
Encapsulation of a generic DDAS event.
The ddaschannel 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 ddaschannel class abstracts these differences away from the user.
This class provides a raw data parser (
It should also be noted that the ddaschannel can be persistently stored in a ROOT file. It inherits from TObject and has an appropriate dictionary generated for it that will stream it to and from a file. In fact, the ddasdumper program creates a TTree filled with ddaschannel object.
ddaschannel::ddaschannel | ( | ) |
Default constructor.
All member data are zero initialized.
|
inline |
|
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 specific energy sum.
i | index of energy sum to access |
There is no bound checking here. The caller is responsible for ensuring that the data exists to be retrieved.
|
inline |
Retrieve finish code.
The finish code will be set to 1 if pileup was detected.
|
inline |
|
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) |
ddaschannel & ddaschannel::operator= | ( | DAQ::DDAS::DDASHit & | hit | ) |
Copy DDASHit into ddaschannel.
This copies the contents of an existing DDASHit into the ddaschannel object. For data members that are not identical between the DDASHit and ddaschannel class, this does a best effort at handling them appropriately. These are those values and how they are handled:
ddaschannel data member | handling |
---|---|
cfd | set to zero |
channelnum | set to value of DDASHit::GetChannelID() |
id | set to zero |
hit | the hit to copy |
void ddaschannel::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. traces), the vector is cleared and resized to 0.
void ddaschannel::UnpackChannelData | ( | const uint32_t * | data | ) |
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. Prior to parsing, all data members are reset to 0 using the Reset() method.
Double_t ddaschannel::cfd |
cfd time only
Int_t ddaschannel::channelnum |
Int_t ddaschannel::id |