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