1 #include "DAQDataFormats/RawSummaryDCMDataV0.h" 2 #include "DAQDataFormats/RawSummaryDCMDataPoint.h" 3 #include "DAQDataFormats/RawMilliSliceHeader.h" 4 #include <boost/format.hpp> 15 #include "DAQDataFormats/DataFormatFirst.inc" 16 #define CURRENT_CLASS RawSummaryDCMData 17 #define CURRENT_CLASS_VERSION 0 18 #define CURRENT_FIELDS_SUB_NAMESPACE summarydcmdata 19 #include "DAQDataFormats/DataFormatLast.inc" 48 PRINT_ON_DEBUG(__PRETTY_FUNCTION__ <<
": list.size()=" <<
list.size() <<
", new_sizeofdata=" << new_sizeofdata <<
" 000000000000");
50 if(_shouldBufferBeInternal) {
54 resizeInternalBuffer(new_sizeofdata);
57 checkBufferInternalness();
60 PRINT_ON_DEBUG(__PRETTY_FUNCTION__ <<
": list.size()=" <<
list.size() <<
", new_sizeofdata=" << new_sizeofdata <<
" 1111111111111");
61 std::list<std::pair<uint64_t, uint16_t> >::const_iterator ii =
list.begin(), ee=
list.end();
62 for(; ii != ee; ++ii) {
65 newPoint.setTimeStamp((*ii).first);
66 newPoint.setDCMID((*ii).second);
67 newPoint.setDataType(type);
69 checkBufferInternalness();
71 PRINT_ON_DEBUG(__PRETTY_FUNCTION__ <<
": list.size()=" <<
list.size() <<
", new_sizeofdata=" << new_sizeofdata <<
" 2222222222222");
79 PRINT_ON_DEBUG(__PRETTY_FUNCTION__<<
" initial size of internal buffer"<<_InternalBuffer.size());
81 _Buffer = (
void*)pointer;
83 _shouldBufferBeInternal = isInternalBuffer();
88 return _Header->setBufferSource(pointer);
90 PRINT_ON_DEBUG(__PRETTY_FUNCTION__<<
" step0 size of internal buffer "<<_InternalBuffer.size()<<
" 000000000000000000000000000000000000000000000000000\n");
97 if(_shouldBufferBeInternal){
98 resizeInternalBuffer(_Header->sizeofdata() + 0);
100 checkBufferInternalness();
103 PRINT_ON_DEBUG(__PRETTY_FUNCTION__<<
" step1 size of internal buffer "<<_InternalBuffer.size()<<
" 1111111111111111111111111111111111111111111111111111\n");
107 else std::cout<<
"sizeofdata is not bound\n" 110 _function_sizeofdata = (
sizeofdata_t) &version0::RawSummaryDCMData::sizeofdata;
120 if(_shouldBufferBeInternal){
121 resizeInternalBuffer(
_Header->sizeofdata());
123 checkBufferInternalness();
129 uint32_t RawSummaryDCMData::getVersion()
const {
return _Header->getVersion();}
137 os<<
boost::format(
"\n---SummaryDCMData---------------------------------------------(size=%u, version=%u)\n")
142 for(uint32_t
i = 0;
i < size_of_data; ++
i){
144 printWord(
i,
false, os);
149 printBinary(_Buffer,
_Header->sizeofdata(), os);
161 if(
_Header->getNumEntries() - 1 <
idx)
return NULL;
#define EXECUTE_FUNCTION(FULLFUNCTIONNAME)
Execute and return the delegate.
#define VERSION_NAMESPACE
#define EXECUTE_ON_DEBUG(x)
Debugging macros.
std::string format(const int32_t &value, const int &ndigits=8)
#define PRINT_ON_DEBUG(x)