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   // 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 }
00062 
00063 void TV1730DppData::Print(){
00064 
00065   std::cout << "V1730Dpp decoder for bank " << GetName().c_str() << std::endl;
00066 
00067 
00068 }

Generated on 12 Feb 2016 for ROOT Analyzer by  doxygen 1.6.1