Class to store DPP data from CAEN V1730. More...
#include <TV1730DppData.hxx>
Public Member Functions | |
TV1730DppData (int bklen, int bktype, const char *name, void *pdata) | |
Constructor. | |
uint32_t | GetEventCounter () 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< ChannelMeasurement > & | 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< ChannelMeasurement > | fMeasurements |
Vector of V1730 Measurements. |
Class to store DPP data from CAEN V1730.
Definition at line 63 of file TV1730DppData.hxx.
TV1730DppData::TV1730DppData | ( | int | bklen, | |
int | bktype, | |||
const char * | name, | |||
void * | pdata | |||
) |
Constructor.
Definition at line 7 of file TV1730DppData.cxx.
References ChannelMeasurement::AddSamples(), fGlobalHeader, fMeasurements, GetChMask(), and TGenericData::GetData32().
00007 : 00008 TGenericData(bklen, bktype, name, pdata) 00009 { 00010 00011 // Do decoding. Decoding is complicated by the fact that there can be 00012 // multiple events in the same bank. So need to find and save multiple 00013 // event headers, trailers. 00014 00015 fGlobalHeader.push_back(GetData32()[0]); 00016 fGlobalHeader.push_back(GetData32()[1]); 00017 fGlobalHeader.push_back(GetData32()[2]); 00018 fGlobalHeader.push_back(GetData32()[3]); 00019 00020 // Do some sanity checking. 00021 // Make sure first word has right identifier 00022 if( (GetData32()[0] & 0xf0000000) != 0xa0000000) 00023 std::cerr << "First word has wrong identifier; first word = 0x" 00024 << std::hex << GetData32()[0] << std::dec << std::endl; 00025 00026 int counter = 4; 00027 00028 // Loop over channel data 00029 for(int ch = 0; ch < 16; ch++){ 00030 00031 if((1<<ch) & GetChMask()){ 00032 00033 00034 uint32_t header0 = GetData32()[counter]; 00035 counter++; 00036 uint32_t header1 = GetData32()[counter]; 00037 counter++; 00038 uint32_t size = header0 & 0x7fff; 00039 ChannelMeasurement meas = ChannelMeasurement(ch,header0,header1); 00040 00041 int nsamples = size - 2; // calculate number of samples. 00042 00043 std::vector<uint32_t> Samples; 00044 //std::cout << "nsamples " << nsamples << std::endl; 00045 for(int i = 0; i < nsamples; i++){ 00046 uint32_t sample = (GetData32()[counter] & 0x3fff); 00047 Samples.push_back(sample); 00048 sample = (GetData32()[counter] & 0x3fff0000) >> 16; 00049 Samples.push_back(sample); 00050 counter++; 00051 } 00052 meas.AddSamples(Samples); 00053 00054 fMeasurements.push_back(meas); 00055 00056 } 00057 } 00058 00059 00060 00061 }
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 TV1730DppData::GetChMask | ( | ) | [inline] |
Get channel mask.
Definition at line 81 of file TV1730DppData.hxx.
References fGlobalHeader.
Referenced by TV1730DppData().
00081 {return (fGlobalHeader[1] & 0xff);};
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(), 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 TV1730DppData::GetEventCounter | ( | ) | const [inline] |
Get Event Counter.
Definition at line 72 of file TV1730DppData.hxx.
References fGlobalHeader.
00072 {return (fGlobalHeader[2]);};
uint32_t TV1730DppData::GetGeoAddress | ( | ) | const [inline] |
Get Geographical Address.
Definition at line 75 of file TV1730DppData.hxx.
References fGlobalHeader.
00075 {return (fGlobalHeader[1] & 0xf8000000) >> 27 ;};
std::vector<ChannelMeasurement>& TV1730DppData::GetMeasurements | ( | ) | [inline] |
Get the Vector of TDC Measurements.
Definition at line 86 of file TV1730DppData.hxx.
References fMeasurements.
Referenced by TV1730DppWaveform::UpdateHistograms().
00086 {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(), 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 TV1730DppData::GetTriggerTimeTag | ( | ) | const [inline] |
Get the extended trigger time tag.
Definition at line 78 of file TV1730DppData.hxx.
References fGlobalHeader.
00078 {return fGlobalHeader[3];};
int TGenericData::GetType | ( | ) | const [inline, inherited] |
Definition at line 34 of file TGenericData.hxx.
References TGenericData::fBankType.
00034 {return fBankType;}
void TV1730DppData::Print | ( | ) | [virtual] |
Print the bank contents in a structured way.
Reimplemented from TGenericData.
Definition at line 63 of file TV1730DppData.cxx.
References TGenericData::GetName().
00063 { 00064 00065 std::cout << "V1730Dpp decoder for bank " << GetName().c_str() << std::endl; 00066 00067 00068 }
std::vector<uint32_t> TV1730DppData::fGlobalHeader [private] |
The overall global header.
Definition at line 96 of file TV1730DppData.hxx.
Referenced by GetChMask(), GetEventCounter(), GetGeoAddress(), GetTriggerTimeTag(), and TV1730DppData().
std::vector<ChannelMeasurement> TV1730DppData::fMeasurements [private] |
Vector of V1730 Measurements.
Definition at line 99 of file TV1730DppData.hxx.
Referenced by GetMeasurements(), and TV1730DppData().