Class to store raw data from CAEN 100MHz DT724 (for raw readout, no-DPP). More...
#include <TDT724RawData.hxx>
Public Member Functions | |
TDT724RawData (int bklen, int bktype, const char *name, void *pdata) | |
Constructor. | |
uint32_t | GetEventCounter () const |
Get Event Counter. | |
uint32_t | GetEventSize () const |
Get Event Counter. | |
uint32_t | GetGeoAddress () const |
Get Geographical Address. | |
uint32_t | GetTriggerTimeTag () const |
Get the extended trigger time tag. | |
uint32_t | GetChMask () |
Get channel mask. | |
void | Print () |
Print the bank contents in a structured way. | |
std::vector < RawChannelMeasurement > & | GetMeasurements () |
Get the Vector of TDC Measurements. | |
const uint16_t * | GetData16 () const |
const uint32_t * | GetData32 () const |
const uint64_t * | GetData64 () const |
int | GetSize () const |
int | GetType () const |
std::string | GetName () const |
void | Dump () |
Dump the bank contents in an unstructured way. | |
Private Attributes | |
std::vector< uint32_t > | fGlobalHeader |
The overall global header. | |
std::vector < RawChannelMeasurement > | fMeasurements |
Vector of DT724 Measurements. |
Class to store raw data from CAEN 100MHz DT724 (for raw readout, no-DPP).
Definition at line 49 of file TDT724RawData.hxx.
TDT724RawData::TDT724RawData | ( | int | bklen, | |
int | bktype, | |||
const char * | name, | |||
void * | pdata | |||
) |
Constructor.
Definition at line 7 of file TDT724RawData.cxx.
References RawChannelMeasurement::AddSamples(), fGlobalHeader, fMeasurements, GetChMask(), TGenericData::GetData32(), and GetEventSize().
00007 : 00008 TGenericData(bklen, bktype, name, pdata) 00009 { 00010 00011 fGlobalHeader.push_back(GetData32()[0]); 00012 fGlobalHeader.push_back(GetData32()[1]); 00013 fGlobalHeader.push_back(GetData32()[2]); 00014 fGlobalHeader.push_back(GetData32()[3]); 00015 00016 // Do some sanity checking. 00017 // Make sure first word has right identifier 00018 if( (GetData32()[0] & 0xf0000000) != 0xa0000000) 00019 std::cerr << "First word has wrong identifier; first word = 0x" 00020 << std::hex << GetData32()[0] << std::dec << std::endl; 00021 00022 int counter = 4; 00023 00024 int number_available_channels = 0; 00025 for(int ch = 0; ch < 16; ch++){ 00026 if((1<<ch) & GetChMask()){ 00027 number_available_channels++; 00028 } 00029 } 00030 00031 int nwords_per_channel = (GetEventSize() - 4)/number_available_channels; 00032 00033 // Loop over channel data (only two channels). 00034 for(int ch = 0; ch < 2; ch++){ 00035 00036 if((1<<ch) & GetChMask()){ 00037 00038 std::vector<uint32_t> Samples; 00039 for(int i = 0; i < nwords_per_channel; i++){ 00040 uint32_t sample = (GetData32()[counter] & 0x3fff); 00041 Samples.push_back(sample); 00042 sample = (GetData32()[counter] & 0x3fff0000) >> 16; 00043 Samples.push_back(sample); 00044 counter++; 00045 } 00046 RawChannelMeasurement meas = RawChannelMeasurement(ch); 00047 meas.AddSamples(Samples); 00048 00049 fMeasurements.push_back(meas); 00050 00051 } 00052 } 00053 00054 }
void TGenericData::Dump | ( | ) | [inline, inherited] |
Dump the bank contents in an unstructured way.
Definition at line 39 of file TGenericData.hxx.
References TGenericData::GetData32(), TGenericData::GetName(), and TGenericData::GetSize().
Referenced by TGenericData::Print().
00039 { 00040 00041 std::cout << "Generic decoder for bank named " << GetName().c_str() << std::endl; 00042 for(int i = 0; i < GetSize(); i++){ 00043 std::cout << std::hex << "0x" << GetData32()[i] << std::dec << std::endl; 00044 } 00045 00046 }
uint32_t TDT724RawData::GetChMask | ( | ) | [inline] |
Get channel mask.
Definition at line 70 of file TDT724RawData.hxx.
References fGlobalHeader.
Referenced by TDT724RawData().
00070 {return (fGlobalHeader[1] & 0xff) + ((fGlobalHeader[2] & 0xff000000) >> 16);};
const uint16_t* TGenericData::GetData16 | ( | ) | const [inline, inherited] |
Definition at line 24 of file TGenericData.hxx.
References TGenericData::fData.
Referenced by TL2249Data::TL2249Data().
00024 { return reinterpret_cast<const uint16_t*>(fData); }
const uint32_t* TGenericData::GetData32 | ( | ) | const [inline, inherited] |
Definition at line 27 of file TGenericData.hxx.
References TGenericData::fData.
Referenced by TGenericData::Dump(), TV1720RawData::HandlUncompressedData(), TV1720RawData::HandlZLECompressedData(), TDT724RawData(), TMesytecData::TMesytecData(), TV1190Data::TV1190Data(), TV1720RawData::TV1720RawData(), TV1730DppData::TV1730DppData(), TV1730RawData::TV1730RawData(), and TV792Data::TV792Data().
00027 { return reinterpret_cast<const uint32_t*>(fData); }
const uint64_t* TGenericData::GetData64 | ( | ) | const [inline, inherited] |
Definition at line 30 of file TGenericData.hxx.
References TGenericData::fData.
Referenced by TAgilentHistograms::UpdateHistograms().
00030 { return reinterpret_cast<const uint64_t*>(fData); }
uint32_t TDT724RawData::GetEventCounter | ( | ) | const [inline] |
Get Event Counter.
Definition at line 58 of file TDT724RawData.hxx.
References fGlobalHeader.
00058 {return (fGlobalHeader[2] & 0xffffff);};
uint32_t TDT724RawData::GetEventSize | ( | ) | const [inline] |
Get Event Counter.
Definition at line 61 of file TDT724RawData.hxx.
References fGlobalHeader.
Referenced by TDT724RawData().
00061 {return (fGlobalHeader[0] & 0xfffffff);};
uint32_t TDT724RawData::GetGeoAddress | ( | ) | const [inline] |
Get Geographical Address.
Definition at line 64 of file TDT724RawData.hxx.
References fGlobalHeader.
00064 {return (fGlobalHeader[1] & 0xf8000000) >> 27 ;};
std::vector<RawChannelMeasurement>& TDT724RawData::GetMeasurements | ( | ) | [inline] |
Get the Vector of TDC Measurements.
Definition at line 75 of file TDT724RawData.hxx.
References fMeasurements.
Referenced by TDT724Waveform::UpdateHistograms().
00075 {return fMeasurements;}
std::string TGenericData::GetName | ( | ) | const [inline, inherited] |
Definition at line 36 of file TGenericData.hxx.
References TGenericData::fBankName.
Referenced by TGenericData::Dump(), TV792Data::Print(), TV1730RawData::Print(), TV1730DppData::Print(), TV1720RawData::Print(), TV1190Data::Print(), TMesytecData::Print(), TL2249Data::Print(), and Print().
00036 {return fBankName;}
int TGenericData::GetSize | ( | ) | const [inline, inherited] |
Definition at line 32 of file TGenericData.hxx.
References TGenericData::fSize.
Referenced by TGenericData::Dump(), TL2249Data::TL2249Data(), TMesytecData::TMesytecData(), TV1190Data::TV1190Data(), and TV792Data::TV792Data().
00032 {return fSize;}
uint32_t TDT724RawData::GetTriggerTimeTag | ( | ) | const [inline] |
Get the extended trigger time tag.
Definition at line 67 of file TDT724RawData.hxx.
References fGlobalHeader.
00067 {return fGlobalHeader[3];};
int TGenericData::GetType | ( | ) | const [inline, inherited] |
Definition at line 34 of file TGenericData.hxx.
References TGenericData::fBankType.
00034 {return fBankType;}
void TDT724RawData::Print | ( | ) | [virtual] |
Print the bank contents in a structured way.
Reimplemented from TGenericData.
Definition at line 56 of file TDT724RawData.cxx.
References TGenericData::GetName().
00056 { 00057 00058 std::cout << "DT724 decoder for bank " << GetName().c_str() << std::endl; 00059 00060 00061 }
std::vector<uint32_t> TDT724RawData::fGlobalHeader [private] |
The overall global header.
Definition at line 85 of file TDT724RawData.hxx.
Referenced by GetChMask(), GetEventCounter(), GetEventSize(), GetGeoAddress(), GetTriggerTimeTag(), and TDT724RawData().
std::vector<RawChannelMeasurement> TDT724RawData::fMeasurements [private] |
Vector of DT724 Measurements.
Definition at line 88 of file TDT724RawData.hxx.
Referenced by GetMeasurements(), and TDT724RawData().