TV1730DppData.cxx
Go to the documentation of this file.00001 #include "TV1730DppData.hxx"
00002
00003 #include <iostream>
00004
00005
00006
00007 TV1730DppData::TV1730DppData(int bklen, int bktype, const char* name, void *pdata):
00008 TGenericData(bklen, bktype, name, pdata)
00009 {
00010
00011
00012
00013
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
00021
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
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;
00042
00043 std::vector<uint32_t> Samples;
00044
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 }
00062
00063 void TV1730DppData::Print(){
00064
00065 std::cout << "V1730Dpp decoder for bank " << GetName().c_str() << std::endl;
00066
00067
00068 }